extends {
+ thisArg: infer OrigThis;
+ params: infer P extends readonly unknown[];
+ returnType: infer R;
+}
+ ? ReceiverBound extends true
+ ? (...args: RemoveFromTuple>) => R extends [OrigThis, ...infer Rest]
+ ? [TThis, ...Rest] // Replace `this` with `thisArg`
+ : R
+ : >>(
+ thisArg: U,
+ ...args: RemainingArgs
+ ) => R extends [OrigThis, ...infer Rest]
+ ? [U, ...ConcatTuples] // Preserve bound args in return type
+ : R
+ : never;
+
+declare function callBind<
+ const T extends (this: any, ...args: any[]) => any,
+ Extracted extends ExtractFunctionParams,
+ const TBoundArgs extends Partial & readonly unknown[],
+ const TThis extends Extracted["thisArg"]
+>(
+ args: [fn: T, thisArg: TThis, ...boundArgs: TBoundArgs]
+): BindFunction;
+
+declare function callBind<
+ const T extends (this: any, ...args: any[]) => any,
+ Extracted extends ExtractFunctionParams,
+ const TBoundArgs extends Partial & readonly unknown[]
+>(
+ args: [fn: T, ...boundArgs: TBoundArgs]
+): BindFunction;
+
+declare function callBind(
+ args: [fn: Exclude, ...rest: TArgs]
+): never;
+
+// export as namespace callBind;
+export = callBind;
diff --git a/node_modules/call-bind-apply-helpers/index.js b/node_modules/call-bind-apply-helpers/index.js
new file mode 100644
index 00000000000..2f6dab4c104
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/index.js
@@ -0,0 +1,15 @@
+'use strict';
+
+var bind = require('function-bind');
+var $TypeError = require('es-errors/type');
+
+var $call = require('./functionCall');
+var $actualApply = require('./actualApply');
+
+/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
+module.exports = function callBindBasic(args) {
+ if (args.length < 1 || typeof args[0] !== 'function') {
+ throw new $TypeError('a function is required');
+ }
+ return $actualApply(bind, $call, args);
+};
diff --git a/node_modules/call-bind-apply-helpers/package.json b/node_modules/call-bind-apply-helpers/package.json
new file mode 100644
index 00000000000..923b8be2f14
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/package.json
@@ -0,0 +1,85 @@
+{
+ "name": "call-bind-apply-helpers",
+ "version": "1.0.2",
+ "description": "Helper functions around Function call/apply/bind, for use in `call-bind`",
+ "main": "index.js",
+ "exports": {
+ ".": "./index.js",
+ "./actualApply": "./actualApply.js",
+ "./applyBind": "./applyBind.js",
+ "./functionApply": "./functionApply.js",
+ "./functionCall": "./functionCall.js",
+ "./reflectApply": "./reflectApply.js",
+ "./package.json": "./package.json"
+ },
+ "scripts": {
+ "prepack": "npmignore --auto --commentLines=auto",
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "prepublishOnly": "safe-publish-latest",
+ "prelint": "evalmd README.md",
+ "lint": "eslint --ext=.js,.mjs .",
+ "postlint": "tsc -p . && attw -P",
+ "pretest": "npm run lint",
+ "tests-only": "nyc tape 'test/**/*.js'",
+ "test": "npm run tests-only",
+ "posttest": "npx npm@'>=10.2' audit --production",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/ljharb/call-bind-apply-helpers.git"
+ },
+ "author": "Jordan Harband ",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/ljharb/call-bind-apply-helpers/issues"
+ },
+ "homepage": "https://github.com/ljharb/call-bind-apply-helpers#readme",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2"
+ },
+ "devDependencies": {
+ "@arethetypeswrong/cli": "^0.17.3",
+ "@ljharb/eslint-config": "^21.1.1",
+ "@ljharb/tsconfig": "^0.2.3",
+ "@types/for-each": "^0.3.3",
+ "@types/function-bind": "^1.1.10",
+ "@types/object-inspect": "^1.13.0",
+ "@types/tape": "^5.8.1",
+ "auto-changelog": "^2.5.0",
+ "encoding": "^0.1.13",
+ "es-value-fixtures": "^1.7.1",
+ "eslint": "=8.8.0",
+ "evalmd": "^0.0.19",
+ "for-each": "^0.3.5",
+ "has-strict-mode": "^1.1.0",
+ "in-publish": "^2.0.1",
+ "npmignore": "^0.3.1",
+ "nyc": "^10.3.2",
+ "object-inspect": "^1.13.4",
+ "safe-publish-latest": "^2.0.0",
+ "tape": "^5.9.0",
+ "typescript": "next"
+ },
+ "testling": {
+ "files": "test/index.js"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ },
+ "publishConfig": {
+ "ignore": [
+ ".github/workflows"
+ ]
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+}
diff --git a/node_modules/call-bind-apply-helpers/reflectApply.d.ts b/node_modules/call-bind-apply-helpers/reflectApply.d.ts
new file mode 100644
index 00000000000..6b2ae764c54
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/reflectApply.d.ts
@@ -0,0 +1,3 @@
+declare const reflectApply: false | typeof Reflect.apply;
+
+export = reflectApply;
diff --git a/node_modules/call-bind-apply-helpers/reflectApply.js b/node_modules/call-bind-apply-helpers/reflectApply.js
new file mode 100644
index 00000000000..3d03caa695a
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/reflectApply.js
@@ -0,0 +1,4 @@
+'use strict';
+
+/** @type {import('./reflectApply')} */
+module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
diff --git a/node_modules/call-bind-apply-helpers/test/index.js b/node_modules/call-bind-apply-helpers/test/index.js
new file mode 100644
index 00000000000..1cdc89ed492
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/test/index.js
@@ -0,0 +1,63 @@
+'use strict';
+
+var callBind = require('../');
+var hasStrictMode = require('has-strict-mode')();
+var forEach = require('for-each');
+var inspect = require('object-inspect');
+var v = require('es-value-fixtures');
+
+var test = require('tape');
+
+test('callBindBasic', function (t) {
+ forEach(v.nonFunctions, function (nonFunction) {
+ t['throws'](
+ // @ts-expect-error
+ function () { callBind([nonFunction]); },
+ TypeError,
+ inspect(nonFunction) + ' is not a function'
+ );
+ });
+
+ var sentinel = { sentinel: true };
+ /** @type {(this: T, a: A, b: B) => [T | undefined, A, B]} */
+ var func = function (a, b) {
+ // eslint-disable-next-line no-invalid-this
+ return [!hasStrictMode && this === global ? undefined : this, a, b];
+ };
+ t.equal(func.length, 2, 'original function length is 2');
+
+ /** type {(thisArg: unknown, a: number, b: number) => [unknown, number, number]} */
+ var bound = callBind([func]);
+ /** type {((a: number, b: number) => [typeof sentinel, typeof a, typeof b])} */
+ var boundR = callBind([func, sentinel]);
+ /** type {((b: number) => [typeof sentinel, number, typeof b])} */
+ var boundArg = callBind([func, sentinel, /** @type {const} */ (1)]);
+
+ // @ts-expect-error
+ t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with no args');
+
+ // @ts-expect-error
+ t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args');
+ // @ts-expect-error
+ t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func too few args');
+ // @ts-expect-error
+ t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args');
+ // @ts-expect-error
+ t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args');
+
+ t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args');
+ t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with right args');
+ t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args');
+ t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg');
+
+ // @ts-expect-error
+ t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args');
+ // @ts-expect-error
+ t.deepEqual(bound(1, 2, 3, 4), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args');
+ // @ts-expect-error
+ t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args');
+ // @ts-expect-error
+ t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args');
+
+ t.end();
+});
diff --git a/node_modules/call-bind-apply-helpers/tsconfig.json b/node_modules/call-bind-apply-helpers/tsconfig.json
new file mode 100644
index 00000000000..aef9993084c
--- /dev/null
+++ b/node_modules/call-bind-apply-helpers/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "@ljharb/tsconfig",
+ "compilerOptions": {
+ "target": "es2021",
+ },
+ "exclude": [
+ "coverage",
+ ],
+}
\ No newline at end of file
diff --git a/node_modules/call-bound/.eslintrc b/node_modules/call-bound/.eslintrc
new file mode 100644
index 00000000000..2612ed8fefa
--- /dev/null
+++ b/node_modules/call-bound/.eslintrc
@@ -0,0 +1,13 @@
+{
+ "root": true,
+
+ "extends": "@ljharb",
+
+ "rules": {
+ "new-cap": [2, {
+ "capIsNewExceptions": [
+ "GetIntrinsic",
+ ],
+ }],
+ },
+}
diff --git a/node_modules/call-bound/.github/FUNDING.yml b/node_modules/call-bound/.github/FUNDING.yml
new file mode 100644
index 00000000000..2a2a1357137
--- /dev/null
+++ b/node_modules/call-bound/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: [ljharb]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/call-bound
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/node_modules/call-bound/.nycrc b/node_modules/call-bound/.nycrc
new file mode 100644
index 00000000000..bdd626ce914
--- /dev/null
+++ b/node_modules/call-bound/.nycrc
@@ -0,0 +1,9 @@
+{
+ "all": true,
+ "check-coverage": false,
+ "reporter": ["text-summary", "text", "html", "json"],
+ "exclude": [
+ "coverage",
+ "test"
+ ]
+}
diff --git a/node_modules/call-bound/CHANGELOG.md b/node_modules/call-bound/CHANGELOG.md
new file mode 100644
index 00000000000..8bde4e9a563
--- /dev/null
+++ b/node_modules/call-bound/CHANGELOG.md
@@ -0,0 +1,42 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v1.0.4](https://github.com/ljharb/call-bound/compare/v1.0.3...v1.0.4) - 2025-03-03
+
+### Commits
+
+- [types] improve types [`e648922`](https://github.com/ljharb/call-bound/commit/e6489222a9e54f350fbf952ceabe51fd8b6027ff)
+- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `es-value-fixtures`, `for-each`, `has-strict-mode`, `object-inspect` [`a42a5eb`](https://github.com/ljharb/call-bound/commit/a42a5ebe6c1b54fcdc7997c7dc64fdca9e936719)
+- [Deps] update `call-bind-apply-helpers`, `get-intrinsic` [`f529eac`](https://github.com/ljharb/call-bound/commit/f529eac132404c17156bbc23ab2297a25d0f20b8)
+
+## [v1.0.3](https://github.com/ljharb/call-bound/compare/v1.0.2...v1.0.3) - 2024-12-15
+
+### Commits
+
+- [Refactor] use `call-bind-apply-helpers` instead of `call-bind` [`5e0b134`](https://github.com/ljharb/call-bound/commit/5e0b13496df14fb7d05dae9412f088da8d3f75be)
+- [Deps] update `get-intrinsic` [`41fc967`](https://github.com/ljharb/call-bound/commit/41fc96732a22c7b7e8f381f93ccc54bb6293be2e)
+- [readme] fix example [`79a0137`](https://github.com/ljharb/call-bound/commit/79a0137723f7c6d09c9c05452bbf8d5efb5d6e49)
+- [meta] add `sideEffects` flag [`08b07be`](https://github.com/ljharb/call-bound/commit/08b07be7f1c03f67dc6f3cdaf0906259771859f7)
+
+## [v1.0.2](https://github.com/ljharb/call-bound/compare/v1.0.1...v1.0.2) - 2024-12-10
+
+### Commits
+
+- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `gopd` [`e6a5ffe`](https://github.com/ljharb/call-bound/commit/e6a5ffe849368fe4f74dfd6cdeca1b9baa39e8d5)
+- [Deps] update `call-bind`, `get-intrinsic` [`2aeb5b5`](https://github.com/ljharb/call-bound/commit/2aeb5b521dc2b2683d1345c753ea1161de2d1c14)
+- [types] improve return type [`1a0c9fe`](https://github.com/ljharb/call-bound/commit/1a0c9fe3114471e7ca1f57d104e2efe713bb4871)
+
+## v1.0.1 - 2024-12-05
+
+### Commits
+
+- Initial implementation, tests, readme, types [`6d94121`](https://github.com/ljharb/call-bound/commit/6d94121a9243602e506334069f7a03189fe3363d)
+- Initial commit [`0eae867`](https://github.com/ljharb/call-bound/commit/0eae867334ea025c33e6e91cdecfc9df96680cf9)
+- npm init [`71b2479`](https://github.com/ljharb/call-bound/commit/71b2479c6723e0b7d91a6b663613067e98b7b275)
+- Only apps should have lockfiles [`c3754a9`](https://github.com/ljharb/call-bound/commit/c3754a949b7f9132b47e2d18c1729889736741eb)
+- [actions] skip `npm ls` in node < 10 [`74275a5`](https://github.com/ljharb/call-bound/commit/74275a5186b8caf6309b6b97472bdcb0df4683a8)
+- [Dev Deps] add missing peer dep [`1354de8`](https://github.com/ljharb/call-bound/commit/1354de8679413e4ae9c523d85f76fa7a5e032d97)
diff --git a/node_modules/call-bound/LICENSE b/node_modules/call-bound/LICENSE
new file mode 100644
index 00000000000..f82f38963b0
--- /dev/null
+++ b/node_modules/call-bound/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 Jordan Harband
+
+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/call-bound/README.md b/node_modules/call-bound/README.md
new file mode 100644
index 00000000000..a44e43e56e0
--- /dev/null
+++ b/node_modules/call-bound/README.md
@@ -0,0 +1,53 @@
+# call-bound [![Version Badge][npm-version-svg]][package-url]
+
+[![github actions][actions-image]][actions-url]
+[![coverage][codecov-image]][codecov-url]
+[![dependency status][deps-svg]][deps-url]
+[![dev dependency status][dev-deps-svg]][dev-deps-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][npm-badge-png]][package-url]
+
+Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.
+
+## Getting started
+
+```sh
+npm install --save call-bound
+```
+
+## Usage/Examples
+
+```js
+const assert = require('assert');
+const callBound = require('call-bound');
+
+const slice = callBound('Array.prototype.slice');
+
+delete Function.prototype.call;
+delete Function.prototype.bind;
+delete Array.prototype.slice;
+
+assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]);
+```
+
+## Tests
+
+Clone the repo, `npm install`, and run `npm test`
+
+[package-url]: https://npmjs.org/package/call-bound
+[npm-version-svg]: https://versionbadg.es/ljharb/call-bound.svg
+[deps-svg]: https://david-dm.org/ljharb/call-bound.svg
+[deps-url]: https://david-dm.org/ljharb/call-bound
+[dev-deps-svg]: https://david-dm.org/ljharb/call-bound/dev-status.svg
+[dev-deps-url]: https://david-dm.org/ljharb/call-bound#info=devDependencies
+[npm-badge-png]: https://nodei.co/npm/call-bound.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/call-bound.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/call-bound.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=call-bound
+[codecov-image]: https://codecov.io/gh/ljharb/call-bound/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/ljharb/call-bound/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bound
+[actions-url]: https://github.com/ljharb/call-bound/actions
diff --git a/node_modules/call-bound/index.d.ts b/node_modules/call-bound/index.d.ts
new file mode 100644
index 00000000000..5562f00ed88
--- /dev/null
+++ b/node_modules/call-bound/index.d.ts
@@ -0,0 +1,94 @@
+type Intrinsic = typeof globalThis;
+
+type IntrinsicName = keyof Intrinsic | `%${keyof Intrinsic}%`;
+
+type IntrinsicPath = IntrinsicName | `${StripPercents}.${string}` | `%${StripPercents}.${string}%`;
+
+type AllowMissing = boolean;
+
+type StripPercents = T extends `%${infer U}%` ? U : T;
+
+type BindMethodPrecise =
+ F extends (this: infer This, ...args: infer Args) => infer R
+ ? (obj: This, ...args: Args) => R
+ : F extends {
+ (this: infer This1, ...args: infer Args1): infer R1;
+ (this: infer This2, ...args: infer Args2): infer R2
+ }
+ ? {
+ (obj: This1, ...args: Args1): R1;
+ (obj: This2, ...args: Args2): R2
+ }
+ : never
+
+// Extract method type from a prototype
+type GetPrototypeMethod =
+ (typeof globalThis)[T] extends { prototype: any }
+ ? M extends keyof (typeof globalThis)[T]['prototype']
+ ? (typeof globalThis)[T]['prototype'][M]
+ : never
+ : never
+
+// Get static property/method
+type GetStaticMember =
+ P extends keyof (typeof globalThis)[T] ? (typeof globalThis)[T][P] : never
+
+// Type that maps string path to actual bound function or value with better precision
+type BoundIntrinsic =
+ S extends `${infer Obj}.prototype.${infer Method}`
+ ? Obj extends keyof typeof globalThis
+ ? BindMethodPrecise>
+ : unknown
+ : S extends `${infer Obj}.${infer Prop}`
+ ? Obj extends keyof typeof globalThis
+ ? GetStaticMember
+ : unknown
+ : unknown
+
+declare function arraySlice(array: readonly T[], start?: number, end?: number): T[];
+declare function arraySlice(array: ArrayLike, start?: number, end?: number): T[];
+declare function arraySlice(array: IArguments, start?: number, end?: number): T[];
+
+// Special cases for methods that need explicit typing
+interface SpecialCases {
+ '%Object.prototype.isPrototypeOf%': (thisArg: {}, obj: unknown) => boolean;
+ '%String.prototype.replace%': {
+ (str: string, searchValue: string | RegExp, replaceValue: string): string;
+ (str: string, searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string
+ };
+ '%Object.prototype.toString%': (obj: {}) => string;
+ '%Object.prototype.hasOwnProperty%': (obj: {}, v: PropertyKey) => boolean;
+ '%Array.prototype.slice%': typeof arraySlice;
+ '%Array.prototype.map%': (array: readonly T[], callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any) => U[];
+ '%Array.prototype.filter%': (array: readonly T[], predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any) => T[];
+ '%Array.prototype.indexOf%': (array: readonly T[], searchElement: T, fromIndex?: number) => number;
+ '%Function.prototype.apply%': (fn: (...args: A) => R, thisArg: any, args: A) => R;
+ '%Function.prototype.call%': (fn: (...args: A) => R, thisArg: any, ...args: A) => R;
+ '%Function.prototype.bind%': (fn: (...args: A) => R, thisArg: any, ...args: A) => (...remainingArgs: A) => R;
+ '%Promise.prototype.then%': {
+ (promise: Promise, onfulfilled: (value: T) => R | PromiseLike