From ccb202821ec9bcf5d99aaad45bcd026d9d38bb55 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Mon, 10 Jul 2023 23:42:58 -0400 Subject: [PATCH 0001/1086] Begin modifying pmjs for event loop integration --- pmjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmjs b/pmjs index 52c6730e..6f94e6ab 100755 --- a/pmjs +++ b/pmjs @@ -3,7 +3,7 @@ # @author Wes Garland, wes@distributive.network # @date June 2023 -import sys, os, readline, signal, getopt +import sys, os, readline, signal, getopt, asyncio import pythonmonkey as pm globalThis = pm.eval("globalThis") evalOptions = { 'strict': False } @@ -290,7 +290,7 @@ def initGlobalThis(): argvBuilder(arg); # list=>Array not working yet return globalInitModule -def main(): +async def main(): """ Main program entry point """ @@ -339,4 +339,4 @@ def main(): repl() if __name__ == "__main__": - main() + asyncio.run(main()) From 67ca9e043585e7c2f479fb319d11a937bb15d6a2 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Sat, 15 Jul 2023 17:26:57 -0400 Subject: [PATCH 0002/1086] pmjs - implement event-loop, works with timers.js setTimeout --- pmjs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pmjs b/pmjs index 2ebda028..c4d5a396 100755 --- a/pmjs +++ b/pmjs @@ -296,7 +296,7 @@ def initGlobalThis(): argvBuilder(arg); # list=>Array not working yet return globalInitModule -async def main(): +def main(): """ Main program entry point """ @@ -338,11 +338,16 @@ async def main(): assert False, "unhandled option" if (len(args) > 0): - globalInitModule.patchGlobalRequire() - pm.runProgramModule(args[0], args, requirePath) + loop = asyncio.new_event_loop() + async def runJS(): + globalInitModule.patchGlobalRequire() + pm.runProgramModule(args[0], args, requirePath) + loop.create_task(runJS()) + loop.run_forever() + loop.close() elif (enterRepl or forceRepl): globalInitModule.initReplLibs() repl() if __name__ == "__main__": - asyncio.run(main()) + main(); From 887a33799b69da79adbd4cabd2aa8166ab0c39a7 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Sat, 15 Jul 2023 20:29:07 -0400 Subject: [PATCH 0003/1086] pmjs - implement event loop via pmjs-lib/event-loop* modules --- pmjs | 8 ++- pmjs-lib/event-loop-asyncio.py | 83 +++++++++++++++++++++++++ pmjs-lib/event-loop.js | 109 +++++++++++++++++++++++++++++++++ 3 files changed, 198 insertions(+), 2 deletions(-) create mode 100644 pmjs-lib/event-loop-asyncio.py create mode 100644 pmjs-lib/event-loop.js diff --git a/pmjs b/pmjs index c4d5a396..ae5d2bf4 100755 --- a/pmjs +++ b/pmjs @@ -338,13 +338,17 @@ def main(): assert False, "unhandled option" if (len(args) > 0): - loop = asyncio.new_event_loop() + ela = pm.require('./pmjs-lib/event-loop-asyncio') + loop = ela['makeLoop']() + globalThis.setTimeout = pm.require('./pmjs-lib/event-loop')['setTimeout']; + async def runJS(): globalInitModule.patchGlobalRequire() pm.runProgramModule(args[0], args, requirePath) + loop.create_task(runJS()) loop.run_forever() - loop.close() + elif (enterRepl or forceRepl): globalInitModule.initReplLibs() repl() diff --git a/pmjs-lib/event-loop-asyncio.py b/pmjs-lib/event-loop-asyncio.py new file mode 100644 index 00000000..7dca4044 --- /dev/null +++ b/pmjs-lib/event-loop-asyncio.py @@ -0,0 +1,83 @@ +# @file event-loop-asyncio.py +# Interface to the asyncio module for the event-loop library. We can't use JavaScript for +# some of this code, because PythonMonkey can't transport things like asyncio.TimerHandler +# and event loops as of version 0.2.0. +# @author Wes Garland, wes@distributive.network +# @date July 2023 +# +import asyncio + +loop = False + +def enqueueWithDelay(callback, delay): + """ + Schedule a callback to run after a certain amount of time. Delay is in seconds. + """ + return { 'timer': loop.call_later(delay, callback) } + +def enqueue(callback): + """ + Schedule a callback to run as soon as possible. + """ + global loop + acb = loop.run_in_executor(None, callback) + loop.call_soon(acb) + return acb + +def cancelTimer(pyHnd): + """ + Cancel a timer that was previously enqueued. The pyHnd argument is the return value from one of the + enqueue functions. + """ + loop.pyHnd['timer'].cancel() + +def getLoop(): + """ + Get the current Python event loop used by this code. If no loop has been specified and this is the + first time this function is run, we start using the event loop that invoked this call. + """ + global loop + if (loop == False): + loop = asyncio.get_running_loop() + return loop + +def setLoop(newLoop): + """ + Set the event loop this code will use. Replacing a running loop is not allowed. + """ + global loop + if (loop != False and loop != newLoop): + raise Except("can't set loop - event loop already exists") + loop = newLoop + +def makeLoop(): + """ + Make a new event loop. + """ + global loop + if (loop != False): + raise Except("can't make loop - event loop already exists") + loop = asyncio.new_event_loop() + return loop + +def endLoop(): + """ + End the event loop. This will throw if there are pending events. + """ + global loop + if (loop != False): + loop.stop() + loop = False + +def uptime(): + """ + Return the number of seconds this event loop has been running. + """ + return loop.time() + +exports['enqueueWithDelay'] = enqueueWithDelay +exports['enqueue'] = enqueue +exports['getLoop'] = getLoop +exports['setLoop'] = setLoop +exports['makeLoop'] = makeLoop +exports['endLoop'] = endLoop diff --git a/pmjs-lib/event-loop.js b/pmjs-lib/event-loop.js new file mode 100644 index 00000000..f0dc6475 --- /dev/null +++ b/pmjs-lib/event-loop.js @@ -0,0 +1,109 @@ +/** + * @file event-loops.js + * Code for creating and manipulating a NodeJS-style reference-centric event loop for use + * within pmjs. The code currently in builtin_modules/timers.js implements WHATWG-spec- + * compliant timers, but this code needs different functionality and access to the Python + * awaitables implementing the timers because of that. + * + * @author Wes Garland, wes@distributive.network + * @date July 2023 + */ +'use strict'; + +const { enqueue, enqueueWithDelay, cancelTimer, endLoop } = require('./event-loop-asyncio'); + +const references = new Set(); +var seq = 0; + +/** + * Timeout constructor. This is the handle returned from setTimeout, setInterval, and setImmediate in an + * environment with a node-style event-loop. We implement the following methods, modelled on Node.js: + * - ref() + * - unref() + * - toString() + * + * Also like Node.js, there is a repeat property on this handle which controls if it is re-scheduled + * every time it fires. This is the main difference between intervals and timeouts. + * + * @param {Dict} pyHnd a dict with a timer attribute which can be used for cancelling the timeout + */ +function Timeout(pyHnd) +{ + this.id = ++seq; + this.pyHnd = pyHnd; + this.repeat = false; + this.ref(); +} + +Timeout.prototype.toString = function eventLoop$$Timeout$toString() +{ + return `${this.id}` +} + +Timeout.prototype.unref = function eventLoop$$Timeout$unref() +{ + references.delete(this); + this._refed = false; +} + +Timeout.prototype.ref = function eventLoop$$Timeout$unref() +{ + console.log('add reference') + references.add(this); + this._refed = true; +} + +/** + * setTimeout method. setImmediate and setInterval are implemented in terms of setTimeout. + */ +function eventLoop$$setTimeout(callback, delayMs, ...args) +{ + var pyHnd, timer; + + if (delayMs) + pyHnd = enqueueWithDelay(timerCallbackWrapper, Math.max(4, delayMs) / 1000); + else + pyHnd = enqueue(timerCallbackWrapper); + + timer = new Timeout(pyHnd); + + function timerCallbackWrapper() + { + if (timer._destroyed === true) + return; + callback.apply(this, ...args); + if (timer._repeat && typeof timer._repeat === 'number') + enqueueWithDelay(callbackWrapper, Math.max(4, delayMs) / 1000, timer._repeat); + else + timer.unref(); + + if (references.size === 0) + endLoop(); + } +} + +function eventLoop$$setInterval(callback, delayMs, ...args) +{ + const timer = eventLoop$$setTimeout(callback, delayMs, ...args) + timer._repeat = delayMs; + return timer; +} + +function eventLoop$$setImmediate(callback, ...args) +{ + return setTimeout(callback, false, ...args) +} + +function eventLoop$$clearTimeout(timer) +{ + timer.unref(); + timer._repeat = false; + timer._destroyed = true; +} + +exports.setInterval = eventLoop$$setImmediate; +exports.setTimeout = eventLoop$$setTimeout; +exports.setInterval = eventLoop$$setInterval; +exports.clearTimeout = eventLoop$$clearTimeout; +exports.clearInterval = eventLoop$$clearTimeout; +exports.clearImmediate = eventLoop$$clearTimeout; From 116e7774e2c13bbc0a18c0c305bda3255a8430a5 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Sat, 15 Jul 2023 20:58:02 -0400 Subject: [PATCH 0004/1086] pmjs - plumb in all event loop methods, make programs without events exit properly --- pmjs | 3 ++- pmjs-lib/event-loop-asyncio.py | 5 +---- pmjs-lib/event-loop.js | 5 ++--- pmjs-lib/global-init.js | 4 ++++ 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pmjs b/pmjs index ae5d2bf4..58daa4f8 100755 --- a/pmjs +++ b/pmjs @@ -339,12 +339,13 @@ def main(): if (len(args) > 0): ela = pm.require('./pmjs-lib/event-loop-asyncio') + eljs = pm.require('./pmjs-lib/event-loop') loop = ela['makeLoop']() - globalThis.setTimeout = pm.require('./pmjs-lib/event-loop')['setTimeout']; async def runJS(): globalInitModule.patchGlobalRequire() pm.runProgramModule(args[0], args, requirePath) + pm.eval("setImmediate(()=>1)") # seed the loop.stop() code loop.create_task(runJS()) loop.run_forever() diff --git a/pmjs-lib/event-loop-asyncio.py b/pmjs-lib/event-loop-asyncio.py index 7dca4044..abd15767 100644 --- a/pmjs-lib/event-loop-asyncio.py +++ b/pmjs-lib/event-loop-asyncio.py @@ -19,10 +19,7 @@ def enqueue(callback): """ Schedule a callback to run as soon as possible. """ - global loop - acb = loop.run_in_executor(None, callback) - loop.call_soon(acb) - return acb + return { 'timer': loop.call_soon(callback) } def cancelTimer(pyHnd): """ diff --git a/pmjs-lib/event-loop.js b/pmjs-lib/event-loop.js index f0dc6475..21166ae6 100644 --- a/pmjs-lib/event-loop.js +++ b/pmjs-lib/event-loop.js @@ -48,7 +48,6 @@ Timeout.prototype.unref = function eventLoop$$Timeout$unref() Timeout.prototype.ref = function eventLoop$$Timeout$unref() { - console.log('add reference') references.add(this); this._refed = true; } @@ -60,7 +59,7 @@ function eventLoop$$setTimeout(callback, delayMs, ...args) { var pyHnd, timer; - if (delayMs) + if (delayMs >= 0) pyHnd = enqueueWithDelay(timerCallbackWrapper, Math.max(4, delayMs) / 1000); else pyHnd = enqueue(timerCallbackWrapper); @@ -101,7 +100,7 @@ function eventLoop$$clearTimeout(timer) timer._destroyed = true; } -exports.setInterval = eventLoop$$setImmediate; +exports.setImmediate = eventLoop$$setImmediate; exports.setTimeout = eventLoop$$setTimeout; exports.setInterval = eventLoop$$setInterval; exports.clearTimeout = eventLoop$$clearTimeout; diff --git a/pmjs-lib/global-init.js b/pmjs-lib/global-init.js index db78892c..10c08544 100644 --- a/pmjs-lib/global-init.js +++ b/pmjs-lib/global-init.js @@ -49,3 +49,7 @@ exports.initReplLibs = function pmjs$$initReplLibs() { globalThis.util = require('util'); } + +const eventLoopMethods = require('./event-loop'); +for (let name in eventLoopMethods) + globalThis[name] = eventLoopMethods[name]; From 6ec009bfb393d223d67e8bdf683cbcbd1e20b85e Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Sun, 16 Jul 2023 14:42:01 -0400 Subject: [PATCH 0005/1086] pmjs - unreference events during exit, improve uncaught handling --- pmjs | 24 ++++++++--- pmjs-lib/event-loop-asyncio.py | 3 +- pmjs-lib/event-loop.js | 76 +++++++++++++++++++++++++++++++--- pmjs-lib/global-init.js | 16 +++++-- 4 files changed, 104 insertions(+), 15 deletions(-) diff --git a/pmjs b/pmjs index 58daa4f8..996cf4e7 100755 --- a/pmjs +++ b/pmjs @@ -343,11 +343,25 @@ def main(): loop = ela['makeLoop']() async def runJS(): - globalInitModule.patchGlobalRequire() - pm.runProgramModule(args[0], args, requirePath) - pm.eval("setImmediate(()=>1)") # seed the loop.stop() code - - loop.create_task(runJS()) + try: + pm.eval("setImmediate(()=>1)") # seed the loop.stop() code + globalInitModule.patchGlobalRequire() + pm.runProgramModule(args[0], args, requirePath) + except pm.SpiderMonkeyError as error: + globalInitModule.uncaughtExceptionHandler(error) + except Exception as error: + print(error) + + def cleanupExit(code): + eljs['unrefEverything']() + dummyReference = programTask + realExit(code); + + realExit = globalThis.python.exit; + globalThis.python.exit = cleanupExit; + + programTask = loop.create_task(runJS()) + programTask.set_name('pmjs-program') loop.run_forever() elif (enterRepl or forceRepl): diff --git a/pmjs-lib/event-loop-asyncio.py b/pmjs-lib/event-loop-asyncio.py index abd15767..857b522a 100644 --- a/pmjs-lib/event-loop-asyncio.py +++ b/pmjs-lib/event-loop-asyncio.py @@ -26,7 +26,7 @@ def cancelTimer(pyHnd): Cancel a timer that was previously enqueued. The pyHnd argument is the return value from one of the enqueue functions. """ - loop.pyHnd['timer'].cancel() + pyHnd['timer'].cancel() def getLoop(): """ @@ -74,6 +74,7 @@ def uptime(): exports['enqueueWithDelay'] = enqueueWithDelay exports['enqueue'] = enqueue +exports['cancelTimer'] = cancelTimer exports['getLoop'] = getLoop exports['setLoop'] = setLoop exports['makeLoop'] = makeLoop diff --git a/pmjs-lib/event-loop.js b/pmjs-lib/event-loop.js index 21166ae6..2222b34e 100644 --- a/pmjs-lib/event-loop.js +++ b/pmjs-lib/event-loop.js @@ -12,7 +12,7 @@ const { enqueue, enqueueWithDelay, cancelTimer, endLoop } = require('./event-loop-asyncio'); -const references = new Set(); +const pendingTimers = new Set(); var seq = 0; /** @@ -33,6 +33,8 @@ function Timeout(pyHnd) this.pyHnd = pyHnd; this.repeat = false; this.ref(); + + pendingTimers.add(this); } Timeout.prototype.toString = function eventLoop$$Timeout$toString() @@ -40,20 +42,29 @@ Timeout.prototype.toString = function eventLoop$$Timeout$toString() return `${this.id}` } +/** + * Remove a reference from a timer. Program will not naturally exit until all references are removed. + */ Timeout.prototype.unref = function eventLoop$$Timeout$unref() { - references.delete(this); this._refed = false; } +/** + * Add a reference to a timer. Program will not naturally exit until all references are removed. Timers + * are referenced by default. References are binary, on/off, not counted. + */ Timeout.prototype.ref = function eventLoop$$Timeout$unref() { - references.add(this); this._refed = true; } /** * setTimeout method. setImmediate and setInterval are implemented in terms of setTimeout. + * @param {function} callback Function to run after delay + * @param {number} delayMs minimum number of ms to delay; false to run immediately + * @param {...} ...args arguments passed to callback + * @returns instance of Timer */ function eventLoop$$setTimeout(callback, delayMs, ...args) { @@ -68,17 +79,31 @@ function eventLoop$$setTimeout(callback, delayMs, ...args) function timerCallbackWrapper() { + const globalInit = require('./global-init'); + if (timer._destroyed === true) return; - callback.apply(this, ...args); + + try + { + const p = callback.apply(this, ...args); + if (p instanceof Promise) + p.catch(globalInit.unhandledRejection) + } + catch (error) + { + globalInit.unhandledException(error); + } + if (timer._repeat && typeof timer._repeat === 'number') enqueueWithDelay(callbackWrapper, Math.max(4, delayMs) / 1000, timer._repeat); else timer.unref(); - if (references.size === 0) - endLoop(); + maybeEndLoop(); } + + return timer; } function eventLoop$$setInterval(callback, delayMs, ...args) @@ -93,16 +118,55 @@ function eventLoop$$setImmediate(callback, ...args) return setTimeout(callback, false, ...args) } +/** + * Remove a timeout/interval/immediate by cleaning up JS object and removing Timer from Python's event loop. + */ function eventLoop$$clearTimeout(timer) { + if (timer._destroyed) + return; timer.unref(); timer._repeat = false; timer._destroyed = true; + cancelTimer(timer.pyHnd); +} + +/* Scan the pendingTimers for any event loop references. If there are none, clear all the pending timers + * and end the event loop. + */ +function maybeEndLoop() +{ + for (let pendingTimer of pendingTimers) + if (pendingTimer._refed === true) + return; + + for (let pendingTimer of pendingTimers) + eventLoop$$clearTimeout(pendingTimer); + + endLoop(); } +/** + * Remove all references - part of a clean shutdown. + */ +function eventLoop$$unrefEverything() +{ + for (let pendingTimer of pendingTimers) + pendingTimer.unref(); +} + +/* Enumerable exports are intended to replace global methods of the same name when running this style + * of event loop. + */ exports.setImmediate = eventLoop$$setImmediate; exports.setTimeout = eventLoop$$setTimeout; exports.setInterval = eventLoop$$setInterval; exports.clearTimeout = eventLoop$$clearTimeout; exports.clearInterval = eventLoop$$clearTimeout; exports.clearImmediate = eventLoop$$clearTimeout; + +/* Not enumerable -> not part of official/public API */ +Object.defineProperty(exports, 'unrefEverything', { + value: eventLoop$$unrefEverything, + enumerable: false +}); diff --git a/pmjs-lib/global-init.js b/pmjs-lib/global-init.js index 10c08544..c3a75162 100644 --- a/pmjs-lib/global-init.js +++ b/pmjs-lib/global-init.js @@ -15,6 +15,11 @@ for (let mid in require.cache) delete require.cache[mid]; +/* Patch the global object so that our event loop methods are the kind that understand references */ +const eventLoopMethods = require('./event-loop'); +for (let name in eventLoopMethods) + globalThis[name] = eventLoopMethods[name]; + /** * Set the global arguments array, which is just the program's argv. We use an argvBuilder function to * get around PythonMonkey's missing list->Array coercion. /wg june 2023 @@ -50,6 +55,11 @@ exports.initReplLibs = function pmjs$$initReplLibs() globalThis.util = require('util'); } -const eventLoopMethods = require('./event-loop'); -for (let name in eventLoopMethods) - globalThis[name] = eventLoopMethods[name]; +/** + * Temporary API until we get EventEmitters working. Replace this export for a custom handler. + */ +exports.uncaughtExceptionHandler = function globalInit$$uncaughtExceptionHandler(error) +{ + console.error(error); +} + From faf6f505855d07ece1b1153131b75b41fd1ae032 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Sun, 16 Jul 2023 16:00:43 -0400 Subject: [PATCH 0006/1086] pmjs - exit with code 1 when uncaught exception --- pmjs | 2 ++ tests/js/program-throw.bash | 29 +++++++++++++++++++++++++++++ tests/js/program-throw.js | 9 +++++++++ 3 files changed, 40 insertions(+) create mode 100755 tests/js/program-throw.bash create mode 100644 tests/js/program-throw.js diff --git a/pmjs b/pmjs index 996cf4e7..3cccf616 100755 --- a/pmjs +++ b/pmjs @@ -349,8 +349,10 @@ def main(): pm.runProgramModule(args[0], args, requirePath) except pm.SpiderMonkeyError as error: globalInitModule.uncaughtExceptionHandler(error) + cleanupExit(1) except Exception as error: print(error) + cleanupExit(1) def cleanupExit(code): eljs['unrefEverything']() diff --git a/tests/js/program-throw.bash b/tests/js/program-throw.bash new file mode 100755 index 00000000..ef94b774 --- /dev/null +++ b/tests/js/program-throw.bash @@ -0,0 +1,29 @@ +#! /bin/bash +# +# @file program-throw.bash +# A peter-jr test which shows that uncaught exceptions in the program throw, get shown +# on stderr, cause a non-zero exit code, and aren't delayed because of pending events. +# +# @author Wes Garland, wes@distributive.network +# @date July 2023 +# +# timeout: 5 + +set -u + +panic() +{ + echo "FAIL: $*" >&2 + exit 2 +} + +cd `dirname "$0"` || panic "could not change to test directory" + +"${PMJS:-../../pmjs}" ./program-throw.js 2>&1 1>/dev/null \ +| egrep 'hello|goodbye' \ +| while read line + do + [[ "$line" =~ goodbye ]] && panic "found goodbye - timer fired when it shouldn't have!" + [[ "$line" =~ hello ]] && echo "found expected '$line'" && exit 0 + echo wtf $line + done diff --git a/tests/js/program-throw.js b/tests/js/program-throw.js new file mode 100644 index 00000000..dd842f3e --- /dev/null +++ b/tests/js/program-throw.js @@ -0,0 +1,9 @@ +/** + * @file program-throw.js + * Support code program-throw.bash + * @author Wes Garland, wes@distributive.network + * @date July 2023 + */ + +setTimeout(() => console.error('goodbye'), 6000) +throw new Error('hello') From eda4c93b62325106ef0e41cc77a758bf0966d5b9 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Sun, 16 Jul 2023 16:11:43 -0400 Subject: [PATCH 0007/1086] fix unhandled exceptions from timers --- tests/js/timer-throw.bash | 38 ++++++++++++++++++++++++++++++++++++++ tests/js/timer-throw.js | 9 +++++++++ 2 files changed, 47 insertions(+) create mode 100755 tests/js/timer-throw.bash create mode 100644 tests/js/timer-throw.js diff --git a/tests/js/timer-throw.bash b/tests/js/timer-throw.bash new file mode 100755 index 00000000..a3d87804 --- /dev/null +++ b/tests/js/timer-throw.bash @@ -0,0 +1,38 @@ +#! /bin/bash +# +# @file program-throw.bash +# A peter-jr test which shows that uncaught exceptions in the program throw, get shown +# on stderr, cause a non-zero exit code, and aren't delayed because of pending events. +# +# @author Wes Garland, wes@distributive.network +# @date July 2023 +# +# timeout: 5 + +set -u + +panic() +{ + echo "FAIL: $*" >&2 + exit 2 +} + +cd `dirname "$0"` || panic "could not change to test directory" + +"${PMJS:-../../pmjs}" ./timer-throw.js 2>&1 1>/dev/null \ +| egrep 'hello|goodbye' \ +| ( + read line + if [[ "$line" =~ hello ]]; then + echo "found expected '$line'" + else + panic "expected hello, found '${line}'" + fi + + read line + if [[ "$line" =~ Error:.goodbye ]]; then + echo "found expected '$line'" + else + panic "expected Error: goodbye, found '${line}'" + fi + ) diff --git a/tests/js/timer-throw.js b/tests/js/timer-throw.js new file mode 100644 index 00000000..c9901890 --- /dev/null +++ b/tests/js/timer-throw.js @@ -0,0 +1,9 @@ +/** + * @file timer-throw.js + * Support code timer-throw.bash + * @author Wes Garland, wes@distributive.network + * @date July 2023 + */ + +setTimeout(() => { throw new Error('goodbye') }, 600); +console.error('hello'); From 688a1a12d2bd2ded859a7ee7ce47c9a2e992f2bd Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Sun, 16 Jul 2023 17:05:27 -0400 Subject: [PATCH 0008/1086] peter-jr - improve timeout display, fix dynamic timeouts --- peter-jr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/peter-jr b/peter-jr index d931a507..3d487c8e 100755 --- a/peter-jr +++ b/peter-jr @@ -21,6 +21,7 @@ cd "$runDir" set -u set -o pipefail peter_exit_code=2 +defaultTimeout="${defaultTimeout:-15}" if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then cat < Date: Sun, 16 Jul 2023 17:08:24 -0400 Subject: [PATCH 0009/1086] pmjs - support unhandled rejections in event handlers --- pmjs-lib/event-loop.js | 4 ++-- pmjs-lib/global-init.js | 10 ++++++++ tests/js/timer-reject.bash | 47 ++++++++++++++++++++++++++++++++++++++ tests/js/timer-reject.js | 10 ++++++++ 4 files changed, 69 insertions(+), 2 deletions(-) create mode 100755 tests/js/timer-reject.bash create mode 100644 tests/js/timer-reject.js diff --git a/pmjs-lib/event-loop.js b/pmjs-lib/event-loop.js index 2222b34e..f45d4909 100644 --- a/pmjs-lib/event-loop.js +++ b/pmjs-lib/event-loop.js @@ -88,11 +88,11 @@ function eventLoop$$setTimeout(callback, delayMs, ...args) { const p = callback.apply(this, ...args); if (p instanceof Promise) - p.catch(globalInit.unhandledRejection) + p.catch(globalInit.unhandledRejectionHandler) } catch (error) { - globalInit.unhandledException(error); + globalInit.uncaughtExceptionHandler(error); } if (timer._repeat && typeof timer._repeat === 'number') diff --git a/pmjs-lib/global-init.js b/pmjs-lib/global-init.js index c3a75162..13f274cb 100644 --- a/pmjs-lib/global-init.js +++ b/pmjs-lib/global-init.js @@ -61,5 +61,15 @@ exports.initReplLibs = function pmjs$$initReplLibs() exports.uncaughtExceptionHandler = function globalInit$$uncaughtExceptionHandler(error) { console.error(error); + python.exit(1); +} + +/** + * Temporary API until we get EventEmitters working. Replace this export for a custom handler. + */ +exports.unhandledRejectionHandler = function globalInit$$unhandledRejectionHandler(error) +{ + console.error(error); + python.exit(1); } diff --git a/tests/js/timer-reject.bash b/tests/js/timer-reject.bash new file mode 100755 index 00000000..6cc3c89e --- /dev/null +++ b/tests/js/timer-reject.bash @@ -0,0 +1,47 @@ +#! /bin/bash +# +# @file timer-reject.bash +# A peter-jr test which shows that unhandled rejections in timers get shown on stderr, +# exit with status 1, and aren't delayed because of pending events. +# +# @author Wes Garland, wes@distributive.network +# @date July 2023 +# +# timeout: 10 + +set -u +set -o pipefail + +panic() +{ + echo "FAIL: $*" >&2 + exit 2 +} + +cd `dirname "$0"` || panic "could not change to test directory" + +"${PMJS:-../../pmjs}" ./timer-reject.js 2>&1 1>/dev/null \ +| egrep 'hello|goodbye|fire' \ +| ( + read line + if [[ "$line" =~ hello ]]; then + echo "found expected '$line'" + else + panic "expected hello, found '${line}'" + fi + + read line + if [[ "$line" =~ Error:.goodbye ]]; then + echo "found expected '$line'" + else + panic "expected Error: goodbye, found '${line}'" + fi + ) +exitCode="$?" + +if [ "${exitCode}" = "1" ]; then + echo pass + exit 0 +fi + +[ "$exitCode" = 2 ] || panic "Exit code was $exitCode" diff --git a/tests/js/timer-reject.js b/tests/js/timer-reject.js new file mode 100644 index 00000000..b756cd34 --- /dev/null +++ b/tests/js/timer-reject.js @@ -0,0 +1,10 @@ +/** + * @file timer-reject.js + * Support code timer-reject.bash + * @author Wes Garland, wes@distributive.network + * @date July 2023 + */ + +setTimeout(async () => { throw new Error('goodbye') }, 600); +setTimeout(async () => { console.warn('this should not fire') }, 2000); +console.error('hello'); From 343192c228cbb3bd3dd4293b9fe8078f194c8aa0 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Sun, 16 Jul 2023 17:18:31 -0400 Subject: [PATCH 0010/1086] pmjs - improve test coverage for timers, exit --- tests/js/program-exit.bash | 35 +++++++++++++++++++++++++++++++ tests/js/program-exit.js | 8 +++++++ tests/js/program-throw.bash | 1 - tests/js/timers-force-exit.simple | 13 ++++++++++++ tests/js/timers-natural-exit.bash | 27 ++++++++++++++++++++++++ tests/js/timers-natural-exit.js | 9 ++++++++ 6 files changed, 92 insertions(+), 1 deletion(-) create mode 100755 tests/js/program-exit.bash create mode 100644 tests/js/program-exit.js create mode 100644 tests/js/timers-force-exit.simple create mode 100755 tests/js/timers-natural-exit.bash create mode 100644 tests/js/timers-natural-exit.js diff --git a/tests/js/program-exit.bash b/tests/js/program-exit.bash new file mode 100755 index 00000000..70eb4987 --- /dev/null +++ b/tests/js/program-exit.bash @@ -0,0 +1,35 @@ +#! /bin/bash +# +# @file program-exit.bash +# A peter-jr test which shows that python.exit can cause a program to exit without +# reporting errors, even if there are pending timers. +# +# @author Wes Garland, wes@distributive.network +# @date July 2023 +# +# timeout: 5 + +set -u + +panic() +{ + echo "FAIL: $*" >&2 + exit 2 +} + +cd `dirname "$0"` || panic "could not change to test directory" + +"${PMJS:-../../pmjs}" ./program-exit.js 2>&1 \ +| while read line + do + panic "Unexpected output '$line'" + done +exitCode="$?" +[ "$exitCode" = 0 ] || exit "$exitCode" + +"${PMJS:-../../pmjs}" ./program-exit.js +exitCode="$?" + +[ "$exitCode" = "99" ] || panic "exit code should have been 99 but was $exitCode" + +exit 0 diff --git a/tests/js/program-exit.js b/tests/js/program-exit.js new file mode 100644 index 00000000..b88b0ed2 --- /dev/null +++ b/tests/js/program-exit.js @@ -0,0 +1,8 @@ +/** + * @file program-exit.js + * Support code program-exit.bash + * @author Wes Garland, wes@distributive.network + * @date July 2023 + */ +setTimeout(()=>console.log('hey'), 10400) +python.exit(99) diff --git a/tests/js/program-throw.bash b/tests/js/program-throw.bash index ef94b774..2f4d848c 100755 --- a/tests/js/program-throw.bash +++ b/tests/js/program-throw.bash @@ -25,5 +25,4 @@ cd `dirname "$0"` || panic "could not change to test directory" do [[ "$line" =~ goodbye ]] && panic "found goodbye - timer fired when it shouldn't have!" [[ "$line" =~ hello ]] && echo "found expected '$line'" && exit 0 - echo wtf $line done diff --git a/tests/js/timers-force-exit.simple b/tests/js/timers-force-exit.simple new file mode 100644 index 00000000..93e2eb79 --- /dev/null +++ b/tests/js/timers-force-exit.simple @@ -0,0 +1,13 @@ +/** + * @file timers-force-exit.simple + * ensure we can use python.exit() even though there are timers pending + * @author Wes Garland, wes@distributive.network + * @date July 2023 + * + * timeout: 2 + */ + +setTimeout(()=>console.log('fired timer'), 500000); +setTimeout(()=>console.error('should not have fired timer!'), 0); +console.log('about to exit even though timers are pending') +python.exit(0) diff --git a/tests/js/timers-natural-exit.bash b/tests/js/timers-natural-exit.bash new file mode 100755 index 00000000..00c5532b --- /dev/null +++ b/tests/js/timers-natural-exit.bash @@ -0,0 +1,27 @@ +#! /bin/bash +# +# @file timers-natural-exit.bash +# A peter-jr test which show that programs exit when the event loop becomes empty. +# +# @author Wes Garland, wes@distributive.network +# @date July 2023 + +set -u +set -o pipefail + +panic() +{ + echo "FAIL: $*" >&2 + exit 2 +} + +cd `dirname "$0"` || panic "could not change to test directory" + +"${PMJS:-../../pmjs}" ./timers-natural-exit.js \ +| egrep 'end of program|fired timer' \ +| ( + read line + [ "$line" = "end of program" ] || panic "first line read was '$line', not 'end of program'" + read line + [ "$line" = "fired timer" ] || panic "second line read was '$line', not 'fired timer'" + ) diff --git a/tests/js/timers-natural-exit.js b/tests/js/timers-natural-exit.js new file mode 100644 index 00000000..178e3cae --- /dev/null +++ b/tests/js/timers-natural-exit.js @@ -0,0 +1,9 @@ +/** + * @file timers-natural-exit.js + * Support code timers-natural-exit.bash + * @author Wes Garland, wes@distributive.network + * @date July 2023 + */ + +setTimeout(()=>console.log('fired timer'), 500); +console.log('end of program') From 6297147f76c06b2a1d903d25e9f76297abeeacb4 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Sun, 16 Jul 2023 17:35:02 -0400 Subject: [PATCH 0011/1086] pmjs - fix setInterval --- pmjs-lib/event-loop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmjs-lib/event-loop.js b/pmjs-lib/event-loop.js index f45d4909..9c9fa71f 100644 --- a/pmjs-lib/event-loop.js +++ b/pmjs-lib/event-loop.js @@ -96,7 +96,7 @@ function eventLoop$$setTimeout(callback, delayMs, ...args) } if (timer._repeat && typeof timer._repeat === 'number') - enqueueWithDelay(callbackWrapper, Math.max(4, delayMs) / 1000, timer._repeat); + enqueueWithDelay(timerCallbackWrapper, Math.max(4, timer._repeat) / 1000); else timer.unref(); From 68dca850cb135636a6b9430022879b20ad24692d Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Sun, 16 Jul 2023 17:36:08 -0400 Subject: [PATCH 0012/1086] Add timers-segfaults.simple.failing for issue 112 --- tests/js/timers-segfault.simple.failing | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/js/timers-segfault.simple.failing diff --git a/tests/js/timers-segfault.simple.failing b/tests/js/timers-segfault.simple.failing new file mode 100644 index 00000000..a902ecf2 --- /dev/null +++ b/tests/js/timers-segfault.simple.failing @@ -0,0 +1,12 @@ +/** + * @file timers-segfault.simlpe + * MRTC for a segfault when using the pmjs-lib/event-timers.js module. + * @author Wes Garland, wes@distributive.network + * @date July 2023 + * + * timeout: 10 + */ + +setTimeout(() => { /* a.push(1) */ 1 }); +const interval = setInterval(() => { 1 }, 500); +setTimeout(() => { 2 }, 1000); From ac645cfb2cba146af4fc012477cdb5f0e212ced2 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Mon, 17 Jul 2023 14:23:26 -0400 Subject: [PATCH 0013/1086] util.js - improve display of jsapi stacks w/ .code props --- python/pythonmonkey/builtin_modules/util.js | 23 +++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/util.js b/python/pythonmonkey/builtin_modules/util.js index 4131cf98..dbe2fccb 100644 --- a/python/pythonmonkey/builtin_modules/util.js +++ b/python/pythonmonkey/builtin_modules/util.js @@ -1,5 +1,8 @@ /** * @file util.js + * Node.js-style util.inspect implementation, largely based on + * https://github.com/nodejs/node/blob/v8.17.0/lib/util.js. + * * @author Tom Tang * @date June 2023 */ @@ -532,7 +535,8 @@ function formatValue(ctx, value, recurseTimes, ln) { // Make error with message first say the error if (keyLength === 0) return formatError(ctx, value); - base = ` ${formatError(ctx, value)}`; + base = ` ${formatError(ctx, value)}\n`; + braces.length=0; } else if (isAnyArrayBuffer(value)) { // Fast path for ArrayBuffer and SharedArrayBuffer. // Can't do the same for DataView because it has a non-primitive @@ -647,10 +651,11 @@ function formatError(ctx, error) .split('\n') .filter(a => a.length > 0) .map(a => ` ${a}`); - return (`${error.name}: ${error.message}\n` - + stackEls[0] + '\n' - + style(stackEls.slice(1).join('\n')) - ); + const retstr = + `${error.name}: ${error.message}\n` + + stackEls[0] + '\n' + + style(stackEls.slice(1).join('\n')); + return retstr; } function formatObject(ctx, value, recurseTimes, keys) { @@ -871,7 +876,12 @@ function reduceToSingleString(ctx, output, base, braces, addLn) { } } if (length <= breakLength) - return `${braces[0]}${base} ${join(output, ', ')} ${braces[1]}`; + { + if (braces.length) + return `${braces[0]}${base} ${join(output, ', ')} ${braces[1]}`; + else + return `${base} ${join(output, ', ')}`; + } } // If the opening "brace" is too large, like in the case of "Set {", // we need to force the first item to be on the next line or the @@ -881,6 +891,7 @@ function reduceToSingleString(ctx, output, base, braces, addLn) { const ln = base === '' && braces[0].length === 1 ? ' ' : `${base}\n${indentation} `; const str = join(output, `,\n${indentation} `); + return `${extraLn}${braces[0]}${ln}${str} ${braces[1]}`; } From 95cb7fe2555f92c5b0a2b4fa8e6379d86d8fe81e Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Mon, 17 Jul 2023 14:24:07 -0400 Subject: [PATCH 0014/1086] pmjs ropt, popt tests - fix error in failure-handling --- tests/js/pmjs-popt.bash | 2 +- tests/js/pmjs-ropt.bash | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/js/pmjs-popt.bash b/tests/js/pmjs-popt.bash index d5b19a89..9252bab7 100755 --- a/tests/js/pmjs-popt.bash +++ b/tests/js/pmjs-popt.bash @@ -27,7 +27,7 @@ do exit 111 ;; *) - echo "Ignored: ${keyword} ${rest} (${loaded})" + echo "Ignored: ${keyword} ${rest}" ;; esac done diff --git a/tests/js/pmjs-ropt.bash b/tests/js/pmjs-ropt.bash index 7c4e96f5..969b4bf2 100755 --- a/tests/js/pmjs-ropt.bash +++ b/tests/js/pmjs-ropt.bash @@ -27,7 +27,7 @@ do exit 111 ;; *) - echo "Ignored: ${keyword} ${rest} (${loaded})" + echo "Ignored: ${keyword} ${rest}" ;; esac done From 8b2d7179dce50ca03ae5cb09567e8ecb9a9204b6 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Mon, 17 Jul 2023 14:28:02 -0400 Subject: [PATCH 0015/1086] pmjs-lib/event-loop - throw if callback is not a function --- pmjs-lib/event-loop.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pmjs-lib/event-loop.js b/pmjs-lib/event-loop.js index 9c9fa71f..edd3a29f 100644 --- a/pmjs-lib/event-loop.js +++ b/pmjs-lib/event-loop.js @@ -10,6 +10,7 @@ */ 'use strict'; +const util = require('util'); const { enqueue, enqueueWithDelay, cancelTimer, endLoop } = require('./event-loop-asyncio'); const pendingTimers = new Set(); @@ -70,6 +71,13 @@ function eventLoop$$setTimeout(callback, delayMs, ...args) { var pyHnd, timer; + if (typeof callback !== 'function') + { + const error = new Error('Callback must be a function. Received ' + util.inspect(callback, { depth: 1, colors: false })); + error.code = 'ERR_INVALID_CALLBACK'; + throw error; + } + if (delayMs >= 0) pyHnd = enqueueWithDelay(timerCallbackWrapper, Math.max(4, delayMs) / 1000); else From 31f6b000bcc78f170c4c5fec970a62fc028d89e7 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Mon, 17 Jul 2023 14:51:13 -0400 Subject: [PATCH 0016/1086] createRequire - return existing require from module cache when exact filename match; add pminit node_modules to require.path --- python/pythonmonkey/require.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/pythonmonkey/require.py b/python/pythonmonkey/require.py index 4774cc0e..69942bb8 100644 --- a/python/pythonmonkey/require.py +++ b/python/pythonmonkey/require.py @@ -48,7 +48,8 @@ globalThis.python.pythonMonkey.dir = os.path.dirname(__file__) #globalThis.python.pythonMonkey.version = pm.__version__ #globalThis.python.pythonMonkey.module = pm -globalThis.python.pythonMonkey.isCompilableUnit = pm.isCompilableUnit; +globalThis.python.pythonMonkey.isCompilableUnit = pm.isCompilableUnit +globalThis.python.pythonMonkey.nodeModules = node_modules globalThis.python.print = print globalThis.python.stdout.write = sys.stdout.write globalThis.python.stderr.write = sys.stderr.write @@ -272,10 +273,15 @@ def _createRequireInner(*args): module.exports = python.load(filename); } + if (moduleCache[filename]) + return moduleCache[filename].require; + const module = new CtxModule(globalThis, filename, moduleCache); + moduleCache[filename] = module; for (let path of python.paths) module.paths.push(path + '/node_modules'); module.require.path.push(python.pythonMonkey.dir + '/builtin_modules'); + module.require.path.push(python.pythonMonkey.nodeModules); module.require.extensions['.py'] = loadPythonModule; if (isMain) From e790de3ec5fd0b91ddc5bb8d06b9313893e41250 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Tue, 27 Jun 2023 05:38:04 +0000 Subject: [PATCH 0017/1086] chore: update package-lock.json to use lockfileVersion 2 --- python/pminit/pythonmonkey/package-lock.json | 500 ++++++++++++++++++- 1 file changed, 499 insertions(+), 1 deletion(-) diff --git a/python/pminit/pythonmonkey/package-lock.json b/python/pminit/pythonmonkey/package-lock.json index 58f8278c..36fc56fe 100644 --- a/python/pminit/pythonmonkey/package-lock.json +++ b/python/pminit/pythonmonkey/package-lock.json @@ -1,8 +1,506 @@ { "name": "pythonmonkey", "version": "0.0.1", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "pythonmonkey", + "version": "0.0.1", + "license": "MIT", + "dependencies": { + "ctx-module": "^1.0.12" + } + }, + "node_modules/asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dependencies": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "node_modules/browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dependencies": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dependencies": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ctx-module": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/ctx-module/-/ctx-module-1.0.12.tgz", + "integrity": "sha512-iaple0ZSdEOq5Wdx7/eh6VvVZ5Rm4IICzvEulDiXXER+eGMgUlaPBBPZsV3aPhyy5LJNVwA4pKSqc0hIBvP0sA==", + "dependencies": { + "buffer": "^6.0.3", + "crypto-browserify": "^3.12.0" + } + }, + "node_modules/des.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + }, + "node_modules/parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "dependencies": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "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==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + } + }, "dependencies": { "asn1.js": { "version": "5.4.1", From d5cab0bd9c3a9935931bc9ea66cfac234819c802 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Tue, 18 Jul 2023 08:34:40 -0400 Subject: [PATCH 0018/1086] pmjs - don't plumb in setTimeout for repl, pass around {loop} to avoid NYI pm type errors --- pmjs | 5 ++--- pmjs-lib/event-loop-asyncio.py | 5 +++-- pmjs-lib/global-init.js | 15 ++++++++++----- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/pmjs b/pmjs index 3cccf616..b0244b88 100755 --- a/pmjs +++ b/pmjs @@ -223,7 +223,7 @@ def repl(): if (statement == ""): statement = input('> ')[readline_skip_chars:] readline_skip_chars = 0 - + if (len(statement) == 0): continue if (statement[0] == '.'): @@ -338,9 +338,8 @@ def main(): assert False, "unhandled option" if (len(args) > 0): - ela = pm.require('./pmjs-lib/event-loop-asyncio') + loop = globalInitModule.prepareEventLoop()['loop'] eljs = pm.require('./pmjs-lib/event-loop') - loop = ela['makeLoop']() async def runJS(): try: diff --git a/pmjs-lib/event-loop-asyncio.py b/pmjs-lib/event-loop-asyncio.py index 857b522a..910a2caf 100644 --- a/pmjs-lib/event-loop-asyncio.py +++ b/pmjs-lib/event-loop-asyncio.py @@ -36,7 +36,7 @@ def getLoop(): global loop if (loop == False): loop = asyncio.get_running_loop() - return loop + return { loop } def setLoop(newLoop): """ @@ -55,7 +55,8 @@ def makeLoop(): if (loop != False): raise Except("can't make loop - event loop already exists") loop = asyncio.new_event_loop() - return loop + + return { 'loop': loop } def endLoop(): """ diff --git a/pmjs-lib/global-init.js b/pmjs-lib/global-init.js index 13f274cb..d5992597 100644 --- a/pmjs-lib/global-init.js +++ b/pmjs-lib/global-init.js @@ -15,16 +15,21 @@ for (let mid in require.cache) delete require.cache[mid]; -/* Patch the global object so that our event loop methods are the kind that understand references */ -const eventLoopMethods = require('./event-loop'); -for (let name in eventLoopMethods) - globalThis[name] = eventLoopMethods[name]; +exports.prepareEventLoop = function globalInit$$prepareEventLoops() +{ + /* Patch the global object so that our event loop methods are the kind that understand references */ + const loopHnd = require('./event-loop-asyncio').makeLoop(); + const eventLoopMethods = require('./event-loop'); + for (let name in eventLoopMethods) + globalThis[name] = eventLoopMethods[name]; + return loopHnd; +} /** * Set the global arguments array, which is just the program's argv. We use an argvBuilder function to * get around PythonMonkey's missing list->Array coercion. /wg june 2023 */ -exports.makeArgvBuilder = function pmjsRequire$$makeArgvBuilder() +exports.makeArgvBuilder = function globalInit$$makeArgvBuilder() { const argv = []; globalThis.arguments = argv; From b9b8507c7c9027b3cd06ad75c0389db88a3b0233 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Wed, 19 Jul 2023 00:02:01 +0000 Subject: [PATCH 0019/1086] feat(pmpm): write our own minimum copy of npm in Python to remove the requirement for Node.js npm --- README.md | 1 - python/pminit/pmpm.py | 72 ++++++++++++++++++++++++++++++ python/pminit/post-install-hook.py | 17 +------ 3 files changed, 74 insertions(+), 16 deletions(-) create mode 100644 python/pminit/pmpm.py diff --git a/README.md b/README.md index 450a38da..784ae4ba 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,6 @@ Read this if you want to build a local version. - rust - python3.8 or later with header files (python3-dev) - spidermonkey 102.2.0 or later - - npm (nodejs) - [Poetry](https://python-poetry.org/docs/#installation) - [poetry-dynamic-versioning](https://github.com/mtkennerly/poetry-dynamic-versioning) diff --git a/python/pminit/pmpm.py b/python/pminit/pmpm.py new file mode 100644 index 00000000..d9986b7f --- /dev/null +++ b/python/pminit/pmpm.py @@ -0,0 +1,72 @@ +# @file pmpm.py +# A minimum copy of npm written in pure Python. +# Currently, this can only install dependencies specified by package-lock.json into node_modules. +# @author Tom Tang +# @date July 2023 + +import json +import io +import os, shutil +import tempfile +import tarfile +from dataclasses import dataclass +import urllib.request +from typing import List, Union + +WORK_DIR = os.path.join( + os.path.realpath(os.path.dirname(__file__)), + "pythonmonkey" +) + +@dataclass +class PackageItem: + installation_path: str + tarball_url: str + has_install_script: bool + +def parse_package_lock_json(json_data: Union[str, bytes]) -> List[PackageItem]: + # See https://docs.npmjs.com/cli/v9/configuring-npm/package-lock-json#packages + packages: dict = json.loads(json_data)["packages"] + items: List[PackageItem] = [] + for key, entry in packages.items(): + if key == "": + # Skip the root project (listed with a key of "") + continue + items.append( + PackageItem( + installation_path=key, # relative path from the root project folder + # The path is flattened for nested node_modules, e.g., "node_modules/create-ecdh/node_modules/bn.js" + tarball_url=entry["resolved"], # TODO: handle git dependencies + has_install_script=entry.get("hasInstallScript", False) # the package has a preinstall, install, or postinstall script + ) + ) + return items + +def download_package(tarball_url: str) -> bytes: + with urllib.request.urlopen(tarball_url) as response: + tarball_data: bytes = response.read() + return tarball_data + +def unpack_package(installation_path: str, tarball_data: bytes): + installation_path = os.path.join(WORK_DIR, installation_path) + shutil.rmtree(installation_path, ignore_errors=True) + + with tempfile.TemporaryDirectory(prefix="pmpm_cache-") as tmpdir: + with io.BytesIO(tarball_data) as tar_file: + with tarfile.open(fileobj=tar_file) as tar: + tar.extractall(tmpdir) + shutil.move( + os.path.join(tmpdir, "package"), # Strip the root folder + installation_path + ) + +def main(): + with open(os.path.join(WORK_DIR, "package-lock.json"), encoding="utf-8") as f: + items = parse_package_lock_json(f.read()) + for i in items: + print("Installing " + i.installation_path) + tarball_data = download_package(i.tarball_url) + unpack_package(i.installation_path, tarball_data) + +if __name__ == "__main__": + main() diff --git a/python/pminit/post-install-hook.py b/python/pminit/post-install-hook.py index 52f1e423..390f81c4 100644 --- a/python/pminit/post-install-hook.py +++ b/python/pminit/post-install-hook.py @@ -1,20 +1,7 @@ -import subprocess -import sys - -def execute(cmd: str): - popen = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, - shell = True, text = True ) - for stdout_line in iter(popen.stdout.readline, ""): - sys.stdout.write(stdout_line) - sys.stdout.flush() - - popen.stdout.close() - return_code = popen.wait() - if return_code: - raise subprocess.CalledProcessError(return_code, cmd) +import pmpm def main(): - execute("cd pythonmonkey && npm i --no-package-lock") # do not update package-lock.json + pmpm.main() # cd pythonmonkey && npm i if __name__ == "__main__": main() From 0e0d15d40a1f8163dcaf20ca105bdfd7afac974e Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Wed, 19 Jul 2023 00:08:06 +0000 Subject: [PATCH 0020/1086] fix(pmpm): import path for post-install-hook --- python/pminit/post-install-hook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pminit/post-install-hook.py b/python/pminit/post-install-hook.py index 390f81c4..58deb01e 100644 --- a/python/pminit/post-install-hook.py +++ b/python/pminit/post-install-hook.py @@ -1,4 +1,4 @@ -import pmpm +from . import pmpm def main(): pmpm.main() # cd pythonmonkey && npm i From 5757ac2ead1af778fcd89300562a057be4415b60 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Wed, 19 Jul 2023 07:57:57 -0400 Subject: [PATCH 0021/1086] Move pmjs libs to python/pythonmonkey/lib/pmjs --- {pmjs-lib => python/pythonmonkey/lib/pmjs}/event-loop-asyncio.py | 0 {pmjs-lib => python/pythonmonkey/lib/pmjs}/event-loop.js | 0 {pmjs-lib => python/pythonmonkey/lib/pmjs}/global-init.js | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {pmjs-lib => python/pythonmonkey/lib/pmjs}/event-loop-asyncio.py (100%) rename {pmjs-lib => python/pythonmonkey/lib/pmjs}/event-loop.js (100%) rename {pmjs-lib => python/pythonmonkey/lib/pmjs}/global-init.js (100%) diff --git a/pmjs-lib/event-loop-asyncio.py b/python/pythonmonkey/lib/pmjs/event-loop-asyncio.py similarity index 100% rename from pmjs-lib/event-loop-asyncio.py rename to python/pythonmonkey/lib/pmjs/event-loop-asyncio.py diff --git a/pmjs-lib/event-loop.js b/python/pythonmonkey/lib/pmjs/event-loop.js similarity index 100% rename from pmjs-lib/event-loop.js rename to python/pythonmonkey/lib/pmjs/event-loop.js diff --git a/pmjs-lib/global-init.js b/python/pythonmonkey/lib/pmjs/global-init.js similarity index 100% rename from pmjs-lib/global-init.js rename to python/pythonmonkey/lib/pmjs/global-init.js From 69193ac912e9b895b3ee10d3cd2a6f287b6fcbac Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Wed, 19 Jul 2023 08:01:00 -0400 Subject: [PATCH 0022/1086] Update pmjs to load event-loop libs from lib/pmjs --- python/pythonmonkey/cli/pmjs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pythonmonkey/cli/pmjs.py b/python/pythonmonkey/cli/pmjs.py index 6ec4ecf4..775dde46 100755 --- a/python/pythonmonkey/cli/pmjs.py +++ b/python/pythonmonkey/cli/pmjs.py @@ -339,7 +339,7 @@ def main(): if (len(args) > 0): loop = globalInitModule.prepareEventLoop()['loop'] - eljs = pm.require('./pmjs-lib/event-loop') + eljs = pm.require('../lib/pmjs/event-loop') async def runJS(): try: From 6c774fbea9cc25ab99da5b3dfaaf4fbf4c5a88f1 Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Wed, 19 Jul 2023 11:36:47 -0400 Subject: [PATCH 0023/1086] Implement python.on('uncaughtException') and python.on('unhandledRejection') --- python/pminit/pythonmonkey/package-lock.json | 5 +++ python/pminit/pythonmonkey/package.json | 3 +- python/pythonmonkey/lib/pmjs/global-init.js | 35 +++++++++++++++++--- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/python/pminit/pythonmonkey/package-lock.json b/python/pminit/pythonmonkey/package-lock.json index 58f8278c..73425c54 100644 --- a/python/pminit/pythonmonkey/package-lock.json +++ b/python/pminit/pythonmonkey/package-lock.json @@ -234,6 +234,11 @@ } } }, + "events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" + }, "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", diff --git a/python/pminit/pythonmonkey/package.json b/python/pminit/pythonmonkey/package.json index 9a5cce4b..af06ddb8 100644 --- a/python/pminit/pythonmonkey/package.json +++ b/python/pminit/pythonmonkey/package.json @@ -21,6 +21,7 @@ }, "homepage": "https://github.com/Distributive-Network/PythonMonkey#readme", "dependencies": { - "ctx-module": "^1.0.13" + "ctx-module": "^1.0.13", + "events": "^3.3.0" } } diff --git a/python/pythonmonkey/lib/pmjs/global-init.js b/python/pythonmonkey/lib/pmjs/global-init.js index d5992597..99c2bd5b 100644 --- a/python/pythonmonkey/lib/pmjs/global-init.js +++ b/python/pythonmonkey/lib/pmjs/global-init.js @@ -15,6 +15,20 @@ for (let mid in require.cache) delete require.cache[mid]; +/* Recreate the python object as an EventEmitter */ +const { EventEmitter } = require('events'); +const originalPython = globalThis.python; +const python = globalThis.python = new EventEmitter('python'); +Object.assign(python, originalPython); + +/* Emulate node's process.on('error') behaviour with python.on('error'). */ +python.on('error', function unhandledError() { + if (python.listenerCount('error') > 1) + return; + if (python.listenerCount('error') === 0 || python.listeners('error')[0] === unhandledErrror) + python.emit('unhandledException', error); +}); + exports.prepareEventLoop = function globalInit$$prepareEventLoops() { /* Patch the global object so that our event loop methods are the kind that understand references */ @@ -58,6 +72,7 @@ exports.patchGlobalRequire = function pmjs$$patchGlobalRequire() exports.initReplLibs = function pmjs$$initReplLibs() { globalThis.util = require('util'); + globalThis.events = require('events'); } /** @@ -65,8 +80,14 @@ exports.initReplLibs = function pmjs$$initReplLibs() */ exports.uncaughtExceptionHandler = function globalInit$$uncaughtExceptionHandler(error) { - console.error(error); - python.exit(1); + error.name = 'Uncaught ' + error.name; + if (python._events && python._events['uncaughtException']) + python.emit('uncaughtException', error); + else + { + console.error(error); + python.exit(1); + } } /** @@ -74,7 +95,11 @@ exports.uncaughtExceptionHandler = function globalInit$$uncaughtExceptionHandler */ exports.unhandledRejectionHandler = function globalInit$$unhandledRejectionHandler(error) { - console.error(error); - python.exit(1); + if (python._events && python._events['uncaughtRejection']) + python.emit('unhandledRejection', error); + else + { + console.error(error); + python.exit(1); + } } - From 3646564bfbb60ad6c4f412247287887fa639eda5 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Wed, 2 Aug 2023 06:47:13 +0000 Subject: [PATCH 0024/1086] cleanup --- python/pythonmonkey/cli/pmjs.py | 4 +- .../lib/pmjs/event-loop-asyncio.py | 82 -------- python/pythonmonkey/lib/pmjs/event-loop.js | 180 ------------------ python/pythonmonkey/lib/pmjs/global-init.js | 14 +- 4 files changed, 3 insertions(+), 277 deletions(-) delete mode 100644 python/pythonmonkey/lib/pmjs/event-loop-asyncio.py delete mode 100644 python/pythonmonkey/lib/pmjs/event-loop.js diff --git a/python/pythonmonkey/cli/pmjs.py b/python/pythonmonkey/cli/pmjs.py index fca4a973..7b70d43a 100755 --- a/python/pythonmonkey/cli/pmjs.py +++ b/python/pythonmonkey/cli/pmjs.py @@ -368,12 +368,10 @@ async def runJS(): except Exception as error: print(error, file=sys.stderr) sys.exit(1) - asyncio.run(runJS()) - elif (enterRepl or forceRepl): globalInitModule.initReplLibs() repl() if __name__ == "__main__": - main(); + main() diff --git a/python/pythonmonkey/lib/pmjs/event-loop-asyncio.py b/python/pythonmonkey/lib/pmjs/event-loop-asyncio.py deleted file mode 100644 index 910a2caf..00000000 --- a/python/pythonmonkey/lib/pmjs/event-loop-asyncio.py +++ /dev/null @@ -1,82 +0,0 @@ -# @file event-loop-asyncio.py -# Interface to the asyncio module for the event-loop library. We can't use JavaScript for -# some of this code, because PythonMonkey can't transport things like asyncio.TimerHandler -# and event loops as of version 0.2.0. -# @author Wes Garland, wes@distributive.network -# @date July 2023 -# -import asyncio - -loop = False - -def enqueueWithDelay(callback, delay): - """ - Schedule a callback to run after a certain amount of time. Delay is in seconds. - """ - return { 'timer': loop.call_later(delay, callback) } - -def enqueue(callback): - """ - Schedule a callback to run as soon as possible. - """ - return { 'timer': loop.call_soon(callback) } - -def cancelTimer(pyHnd): - """ - Cancel a timer that was previously enqueued. The pyHnd argument is the return value from one of the - enqueue functions. - """ - pyHnd['timer'].cancel() - -def getLoop(): - """ - Get the current Python event loop used by this code. If no loop has been specified and this is the - first time this function is run, we start using the event loop that invoked this call. - """ - global loop - if (loop == False): - loop = asyncio.get_running_loop() - return { loop } - -def setLoop(newLoop): - """ - Set the event loop this code will use. Replacing a running loop is not allowed. - """ - global loop - if (loop != False and loop != newLoop): - raise Except("can't set loop - event loop already exists") - loop = newLoop - -def makeLoop(): - """ - Make a new event loop. - """ - global loop - if (loop != False): - raise Except("can't make loop - event loop already exists") - loop = asyncio.new_event_loop() - - return { 'loop': loop } - -def endLoop(): - """ - End the event loop. This will throw if there are pending events. - """ - global loop - if (loop != False): - loop.stop() - loop = False - -def uptime(): - """ - Return the number of seconds this event loop has been running. - """ - return loop.time() - -exports['enqueueWithDelay'] = enqueueWithDelay -exports['enqueue'] = enqueue -exports['cancelTimer'] = cancelTimer -exports['getLoop'] = getLoop -exports['setLoop'] = setLoop -exports['makeLoop'] = makeLoop -exports['endLoop'] = endLoop diff --git a/python/pythonmonkey/lib/pmjs/event-loop.js b/python/pythonmonkey/lib/pmjs/event-loop.js deleted file mode 100644 index edd3a29f..00000000 --- a/python/pythonmonkey/lib/pmjs/event-loop.js +++ /dev/null @@ -1,180 +0,0 @@ -/** - * @file event-loops.js - * Code for creating and manipulating a NodeJS-style reference-centric event loop for use - * within pmjs. The code currently in builtin_modules/timers.js implements WHATWG-spec- - * compliant timers, but this code needs different functionality and access to the Python - * awaitables implementing the timers because of that. - * - * @author Wes Garland, wes@distributive.network - * @date July 2023 - */ -'use strict'; - -const util = require('util'); -const { enqueue, enqueueWithDelay, cancelTimer, endLoop } = require('./event-loop-asyncio'); - -const pendingTimers = new Set(); -var seq = 0; - -/** - * Timeout constructor. This is the handle returned from setTimeout, setInterval, and setImmediate in an - * environment with a node-style event-loop. We implement the following methods, modelled on Node.js: - * - ref() - * - unref() - * - toString() - * - * Also like Node.js, there is a repeat property on this handle which controls if it is re-scheduled - * every time it fires. This is the main difference between intervals and timeouts. - * - * @param {Dict} pyHnd a dict with a timer attribute which can be used for cancelling the timeout - */ -function Timeout(pyHnd) -{ - this.id = ++seq; - this.pyHnd = pyHnd; - this.repeat = false; - this.ref(); - - pendingTimers.add(this); -} - -Timeout.prototype.toString = function eventLoop$$Timeout$toString() -{ - return `${this.id}` -} - -/** - * Remove a reference from a timer. Program will not naturally exit until all references are removed. - */ -Timeout.prototype.unref = function eventLoop$$Timeout$unref() -{ - this._refed = false; -} - -/** - * Add a reference to a timer. Program will not naturally exit until all references are removed. Timers - * are referenced by default. References are binary, on/off, not counted. - */ -Timeout.prototype.ref = function eventLoop$$Timeout$unref() -{ - this._refed = true; -} - -/** - * setTimeout method. setImmediate and setInterval are implemented in terms of setTimeout. - * @param {function} callback Function to run after delay - * @param {number} delayMs minimum number of ms to delay; false to run immediately - * @param {...} ...args arguments passed to callback - * @returns instance of Timer - */ -function eventLoop$$setTimeout(callback, delayMs, ...args) -{ - var pyHnd, timer; - - if (typeof callback !== 'function') - { - const error = new Error('Callback must be a function. Received ' + util.inspect(callback, { depth: 1, colors: false })); - error.code = 'ERR_INVALID_CALLBACK'; - throw error; - } - - if (delayMs >= 0) - pyHnd = enqueueWithDelay(timerCallbackWrapper, Math.max(4, delayMs) / 1000); - else - pyHnd = enqueue(timerCallbackWrapper); - - timer = new Timeout(pyHnd); - - function timerCallbackWrapper() - { - const globalInit = require('./global-init'); - - if (timer._destroyed === true) - return; - - try - { - const p = callback.apply(this, ...args); - if (p instanceof Promise) - p.catch(globalInit.unhandledRejectionHandler) - } - catch (error) - { - globalInit.uncaughtExceptionHandler(error); - } - - if (timer._repeat && typeof timer._repeat === 'number') - enqueueWithDelay(timerCallbackWrapper, Math.max(4, timer._repeat) / 1000); - else - timer.unref(); - - maybeEndLoop(); - } - - return timer; -} - -function eventLoop$$setInterval(callback, delayMs, ...args) -{ - const timer = eventLoop$$setTimeout(callback, delayMs, ...args) - timer._repeat = delayMs; - return timer; -} - -function eventLoop$$setImmediate(callback, ...args) -{ - return setTimeout(callback, false, ...args) -} - -/** - * Remove a timeout/interval/immediate by cleaning up JS object and removing Timer from Python's event loop. - */ -function eventLoop$$clearTimeout(timer) -{ - if (timer._destroyed) - return; - timer.unref(); - timer._repeat = false; - timer._destroyed = true; - cancelTimer(timer.pyHnd); -} - -/* Scan the pendingTimers for any event loop references. If there are none, clear all the pending timers - * and end the event loop. - */ -function maybeEndLoop() -{ - for (let pendingTimer of pendingTimers) - if (pendingTimer._refed === true) - return; - - for (let pendingTimer of pendingTimers) - eventLoop$$clearTimeout(pendingTimer); - - endLoop(); -} - -/** - * Remove all references - part of a clean shutdown. - */ -function eventLoop$$unrefEverything() -{ - for (let pendingTimer of pendingTimers) - pendingTimer.unref(); -} - -/* Enumerable exports are intended to replace global methods of the same name when running this style - * of event loop. - */ -exports.setImmediate = eventLoop$$setImmediate; -exports.setTimeout = eventLoop$$setTimeout; -exports.setInterval = eventLoop$$setInterval; -exports.clearTimeout = eventLoop$$clearTimeout; -exports.clearInterval = eventLoop$$clearTimeout; -exports.clearImmediate = eventLoop$$clearTimeout; - -/* Not enumerable -> not part of official/public API */ -Object.defineProperty(exports, 'unrefEverything', { - value: eventLoop$$unrefEverything, - enumerable: false -}); diff --git a/python/pythonmonkey/lib/pmjs/global-init.js b/python/pythonmonkey/lib/pmjs/global-init.js index 99c2bd5b..fa60b757 100644 --- a/python/pythonmonkey/lib/pmjs/global-init.js +++ b/python/pythonmonkey/lib/pmjs/global-init.js @@ -22,22 +22,12 @@ const python = globalThis.python = new EventEmitter('python'); Object.assign(python, originalPython); /* Emulate node's process.on('error') behaviour with python.on('error'). */ -python.on('error', function unhandledError() { +python.on('error', function unhandledError(error) { if (python.listenerCount('error') > 1) return; - if (python.listenerCount('error') === 0 || python.listeners('error')[0] === unhandledErrror) + if (python.listenerCount('error') === 0 || python.listeners('error')[0] === unhandledError) python.emit('unhandledException', error); }); - -exports.prepareEventLoop = function globalInit$$prepareEventLoops() -{ - /* Patch the global object so that our event loop methods are the kind that understand references */ - const loopHnd = require('./event-loop-asyncio').makeLoop(); - const eventLoopMethods = require('./event-loop'); - for (let name in eventLoopMethods) - globalThis[name] = eventLoopMethods[name]; - return loopHnd; -} /** * Set the global arguments array, which is just the program's argv. We use an argvBuilder function to From 92d454fef504ad31ed3c1ef07c5963dff4881e89 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Wed, 2 Aug 2023 07:26:24 +0000 Subject: [PATCH 0025/1086] fix(pmjs): exception catching in event-loop --- python/pythonmonkey/cli/pmjs.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/python/pythonmonkey/cli/pmjs.py b/python/pythonmonkey/cli/pmjs.py index 7b70d43a..fd29a27c 100755 --- a/python/pythonmonkey/cli/pmjs.py +++ b/python/pythonmonkey/cli/pmjs.py @@ -358,13 +358,24 @@ def main(): if (len(args) > 0): async def runJS(): + loop = asyncio.get_running_loop() + # See https://docs.python.org/3.11/library/asyncio-eventloop.html#error-handling-api + def exceptionHandler(loop, context): + error = context["exception"] + try: + globalInitModule.uncaughtExceptionHandler(error) + except: + pass + finally: + os._exit(1) + loop.set_exception_handler(exceptionHandler) + + globalThis.python.exit = lambda status: os._exit(int(status)) + try: globalInitModule.patchGlobalRequire() pm.runProgramModule(args[0], args, requirePath) await pm.wait() # blocks until all asynchronous calls finish - except pm.SpiderMonkeyError as error: - globalInitModule.uncaughtExceptionHandler(error) - sys.exit(1) except Exception as error: print(error, file=sys.stderr) sys.exit(1) From aa8f8e81c3b666b2341cbdaef8d6a62c270b1eb2 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 4 Aug 2023 09:26:21 +0000 Subject: [PATCH 0026/1086] feat(event-loop): `pm.stop()` to stop all pending asynchronous jobs --- include/PyEventLoop.hh | 6 ++++++ python/pythonmonkey/cli/pmjs.py | 15 ++++++++++++--- python/pythonmonkey/pythonmonkey.pyi | 5 +++++ src/PyEventLoop.cc | 8 ++++++++ src/modules/pythonmonkey/pythonmonkey.cc | 6 ++++++ 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/include/PyEventLoop.hh b/include/PyEventLoop.hh index 36fdb03c..5c07e30d 100644 --- a/include/PyEventLoop.hh +++ b/include/PyEventLoop.hh @@ -65,6 +65,12 @@ public: } } + /** + * @brief Cancel all pending event-loop jobs. + * @return success + */ + static bool cancelAll(); + /** * @brief Get the underlying `asyncio.Handle` Python object */ diff --git a/python/pythonmonkey/cli/pmjs.py b/python/pythonmonkey/cli/pmjs.py index fd29a27c..55bc7419 100755 --- a/python/pythonmonkey/cli/pmjs.py +++ b/python/pythonmonkey/cli/pmjs.py @@ -358,24 +358,33 @@ def main(): if (len(args) > 0): async def runJS(): + hasUncaughtException = False loop = asyncio.get_running_loop() # See https://docs.python.org/3.11/library/asyncio-eventloop.html#error-handling-api def exceptionHandler(loop, context): error = context["exception"] try: globalInitModule.uncaughtExceptionHandler(error) - except: + except SystemExit: # the "exception" raised by `sys.exit()` call pass finally: - os._exit(1) + pm.stop() # unblock `await pm.wait()` to gracefully exit the program + nonlocal hasUncaughtException + hasUncaughtException = True loop.set_exception_handler(exceptionHandler) - globalThis.python.exit = lambda status: os._exit(int(status)) + def cleanupExit(code): + pm.stop() + realExit(code) + realExit = globalThis.python.exit + globalThis.python.exit = cleanupExit try: globalInitModule.patchGlobalRequire() pm.runProgramModule(args[0], args, requirePath) await pm.wait() # blocks until all asynchronous calls finish + if hasUncaughtException: + sys.exit(1) except Exception as error: print(error, file=sys.stderr) sys.exit(1) diff --git a/python/pythonmonkey/pythonmonkey.pyi b/python/pythonmonkey/pythonmonkey.pyi index 15bed09d..8318a562 100644 --- a/python/pythonmonkey/pythonmonkey.pyi +++ b/python/pythonmonkey/pythonmonkey.pyi @@ -33,6 +33,11 @@ def wait() -> _typing.Awaitable[None]: This is the event-loop shield that protects the loop from being prematurely terminated. """ +def stop() -> None: + """ + Stop all pending asynchronous jobs, and unblock `await pm.wait()` + """ + def isCompilableUnit(code: str) -> bool: """ Hint if a string might be compilable Javascript without actual evaluation diff --git a/src/PyEventLoop.cc b/src/PyEventLoop.cc index d5b7f0a9..4b98980c 100644 --- a/src/PyEventLoop.cc +++ b/src/PyEventLoop.cc @@ -154,6 +154,14 @@ void PyEventLoop::AsyncHandle::cancel() { Py_XDECREF(ret); } +/* static */ +bool PyEventLoop::AsyncHandle::cancelAll() { + for (AsyncHandle &handle: _timeoutIdMap) { + handle.cancel(); + } + return true; +} + void PyEventLoop::Future::setResult(PyObject *result) { // https://docs.python.org/3/library/asyncio-future.html#asyncio.Future.set_result PyObject *ret = PyObject_CallMethod(_future, "set_result", "O", result); // returns None diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 21b92ec7..f35c395b 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -279,6 +279,11 @@ static PyObject *waitForEventLoop(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED return PyObject_CallMethod(waiter, "wait", NULL); } +static PyObject *closeAllPending(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(_)) { + if (!PyEventLoop::AsyncHandle::cancelAll()) return NULL; + Py_RETURN_NONE; +} + static PyObject *isCompilableUnit(PyObject *self, PyObject *args) { StrType *buffer = new StrType(PyTuple_GetItem(args, 0)); const char *bufferUtf8; @@ -301,6 +306,7 @@ static PyObject *isCompilableUnit(PyObject *self, PyObject *args) { PyMethodDef PythonMonkeyMethods[] = { {"eval", eval, METH_VARARGS, "Javascript evaluator in Python"}, {"wait", waitForEventLoop, METH_NOARGS, "The event-loop shield. Blocks until all asynchronous jobs finish."}, + {"stop", closeAllPending, METH_NOARGS, "Cancel all pending event-loop jobs."}, {"isCompilableUnit", isCompilableUnit, METH_VARARGS, "Hint if a string might be compilable Javascript"}, {"collect", collect, METH_VARARGS, "Calls the spidermonkey garbage collector"}, {NULL, NULL, 0, NULL} From 4da2838c0754f2c802be820fd1a10196dab74823 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 4 Aug 2023 09:33:40 +0000 Subject: [PATCH 0027/1086] fix(event-loop): `decCounter()` fails if python error indicator is set --- src/PyEventLoop.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PyEventLoop.cc b/src/PyEventLoop.cc index 4b98980c..ca597a5b 100644 --- a/src/PyEventLoop.cc +++ b/src/PyEventLoop.cc @@ -8,7 +8,12 @@ static PyObject *eventLoopJobWrapper(PyObject *jobFn, PyObject *Py_UNUSED(_)) { PyObject *ret = PyObject_CallObject(jobFn, NULL); // jobFn() Py_XDECREF(ret); // don't care about its return value + + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); // Protects `decCounter()`. If the error indicator is set, Python cannot make further function calls. PyEventLoop::_locker->decCounter(); + PyErr_Restore(type, value, traceback); + if (PyErr_Occurred()) { return NULL; } else { From 2cd6564d1163dedc958c7f3751d0479531ac4a7a Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 11 Aug 2023 07:39:14 +0000 Subject: [PATCH 0028/1086] feat: use `URL`/`URLSearchParams` API implementations from core-js --- python/pminit/pythonmonkey/package-lock.json | 5 +++++ python/pminit/pythonmonkey/package.json | 1 + python/pythonmonkey/__init__.py | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/python/pminit/pythonmonkey/package-lock.json b/python/pminit/pythonmonkey/package-lock.json index 5aa5ddaf..faa8b2ab 100644 --- a/python/pminit/pythonmonkey/package-lock.json +++ b/python/pminit/pythonmonkey/package-lock.json @@ -119,6 +119,11 @@ "safe-buffer": "^5.0.1" } }, + "core-js": { + "version": "3.32.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.32.0.tgz", + "integrity": "sha512-rd4rYZNlF3WuoYuRIDEmbR/ga9CeuWX9U05umAvgrrZoHY4Z++cp/xwPQMvUpBB4Ag6J8KfD80G0zwCyaSxDww==" + }, "create-ecdh": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", diff --git a/python/pminit/pythonmonkey/package.json b/python/pminit/pythonmonkey/package.json index 2e5f0241..44d5e884 100644 --- a/python/pminit/pythonmonkey/package.json +++ b/python/pminit/pythonmonkey/package.json @@ -21,6 +21,7 @@ }, "homepage": "https://github.com/Distributive-Network/PythonMonkey#readme", "dependencies": { + "core-js": "^3.32.0", "ctx-module": "^1.0.14" } } diff --git a/python/pythonmonkey/__init__.py b/python/pythonmonkey/__init__.py index c779f0a7..1cee251d 100644 --- a/python/pythonmonkey/__init__.py +++ b/python/pythonmonkey/__init__.py @@ -9,9 +9,14 @@ del importlib # Load the module by default to expose global APIs +## builtin_modules require("console") require("base64") require("timers") +## npm packages +require("core-js/actual/dom-exception") +require("core-js/actual/url") +require("core-js/actual/url-search-params") # Add the `.keys()` method on `Object.prototype` to get JSObjectProxy dict() conversion working # Conversion from a dict-subclass to a strict dict by `dict(subclass)` internally calls the .keys() method to read the dictionary keys, From 3ea52a7b5a58a3da6814b433702a73263a313af9 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 11 Aug 2023 07:42:24 +0000 Subject: [PATCH 0029/1086] chore: specify `pminit` version because it'll install extra packages --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cf888b17..62fabb1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ include = [ [tool.poetry.dependencies] python = "^3.8" pyreadline3 = { version = "^3.4.1", platform = "win32" } -pminit = { version = "*", allow-prereleases = true } +pminit = { version = ">=0.3.0", allow-prereleases = true } [tool.poetry-dynamic-versioning] From 542894e08f381efd02e3508319c8bd9cf5ac448c Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Thu, 17 Aug 2023 23:44:32 +0000 Subject: [PATCH 0030/1086] Revert "chore: specify `pminit` version because it'll install extra packages" This reverts commit 3ea52a7b5a58a3da6814b433702a73263a313af9. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 62fabb1d..cf888b17 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ include = [ [tool.poetry.dependencies] python = "^3.8" pyreadline3 = { version = "^3.4.1", platform = "win32" } -pminit = { version = ">=0.3.0", allow-prereleases = true } +pminit = { version = "*", allow-prereleases = true } [tool.poetry-dynamic-versioning] From 0481eec484b64e1316930a31b28d30bcfeecf564 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Tue, 22 Aug 2023 19:54:04 +0000 Subject: [PATCH 0031/1086] test(URL): write tests for the URL interface and URLSearchParams --- tests/js/quint.js | 72 +++ tests/js/url-search-params.simple | 921 ++++++++++++++++++++++++++++++ tests/js/url.simple | 651 +++++++++++++++++++++ 3 files changed, 1644 insertions(+) create mode 100644 tests/js/quint.js create mode 100644 tests/js/url-search-params.simple create mode 100644 tests/js/url.simple diff --git a/tests/js/quint.js b/tests/js/quint.js new file mode 100644 index 00000000..0d3e1c99 --- /dev/null +++ b/tests/js/quint.js @@ -0,0 +1,72 @@ +/** + * @file quint.js + * A minimum testing framework with QUnit-like (https://qunitjs.com/) APIs + * @author Tom Tang + * @date Aug 2023 + */ + +const QUnitAssert = { + arity(fn, length) + { + if (fn.length !== length) throw new Error(`'${fn}' does not have arity of ${length}`); + }, + isFunction(x) + { + if (typeof x !== 'function') throw new Error(`'${x}' is not a function`); + }, + name(x, name) + { + if (x.name !== name) throw new Error(`'${x}' does not have a name of ${name}`); + }, + true(x) + { + if (x !== true) throw new Error(`'${x}' is not true`); + }, + false(x) + { + if (x !== false) throw new Error(`'${x}' is not false`); + }, + same(a, b) + { + if (a !== b) throw new Error(`'${a}' does not equal to '${b}'`); + }, + arrayEqual(a, b) + { + if (JSON.stringify(a) !== JSON.stringify(b)) throw new Error(`'${a}' does not equal to '${b}'`); + }, + throws(fn, error) + { + try + { + fn(); + } + catch (err) + { + if (!err.toString().includes(error)) throw new Error(`'${fn}' throws '${err}' but expects '${error}'`); + return; + } + throw new Error(`'${fn}' does not throw`); + }, + looksNative(fn) + { + if (!fn.toString().includes('[native code]')) throw new Error(`'${fn}' does not look native`); + }, + enumerable(obj, propertyName) + { + const descriptor = Object.getOwnPropertyDescriptor(obj, propertyName); + if (!descriptor.enumerable) throw new Error(`'${obj[Symbol.toStringTag]}.${propertyName}' is not enumerable`); + }, +}; + +const QUnit = { + test(name, callback) + { + callback(QUnitAssert); + }, + skip(name, callback) + { + // no op + } +}; + +module.exports = QUnit; diff --git a/tests/js/url-search-params.simple b/tests/js/url-search-params.simple new file mode 100644 index 00000000..76569d0c --- /dev/null +++ b/tests/js/url-search-params.simple @@ -0,0 +1,921 @@ +/** + * @file url-search-params.simple + * Simple test for URLSearchParams + * @author Tom Tang + * @date Aug 2023 + */ + +const QUnit = require('./quint'); + +/* ! + * Modified from https://github.com/zloirock/core-js/blob/d99baeff/tests/unit-global/web.url-search-params.js + * core-js + * MIT License + */ + +const DESCRIPTORS = true; +const NODE = false; + +const { getPrototypeOf, getOwnPropertyDescriptor } = Object; + +QUnit.test('URLSearchParams', assert => { + assert.isFunction(URLSearchParams); + assert.arity(URLSearchParams, 0); + assert.name(URLSearchParams, 'URLSearchParams'); + if (!NODE) assert.looksNative(URLSearchParams); + + assert.same(String(new URLSearchParams()), ''); + assert.same(String(new URLSearchParams('')), ''); + assert.same(String(new URLSearchParams('a=b')), 'a=b'); + assert.same(String(new URLSearchParams(new URLSearchParams('a=b'))), 'a=b'); + assert.same(String(new URLSearchParams([])), ''); + assert.same(String(new URLSearchParams([[1, 2], ['a', 'b']])), '1=2&a=b'); + // assert.same(String(new URLSearchParams(createIterable([createIterable(['a', 'b']), createIterable(['c', 'd'])]))), 'a=b&c=d'); + assert.same(String(new URLSearchParams({})), ''); + assert.same(String(new URLSearchParams({ 1: 2, a: 'b' })), '1=2&a=b'); + + assert.same(String(new URLSearchParams('?a=b')), 'a=b', 'leading ? should be ignored'); + assert.same(String(new URLSearchParams('??a=b')), '%3Fa=b'); + assert.same(String(new URLSearchParams('?')), ''); + assert.same(String(new URLSearchParams('??')), '%3F='); + + assert.same(String(new URLSearchParams('a=b c')), 'a=b+c'); + assert.same(String(new URLSearchParams('a=b&b=c&a=d')), 'a=b&b=c&a=d'); + + assert.same(String(new URLSearchParams('a==')), 'a=%3D'); + assert.same(String(new URLSearchParams('a=b=')), 'a=b%3D'); + assert.same(String(new URLSearchParams('a=b=c')), 'a=b%3Dc'); + assert.same(String(new URLSearchParams('a==b')), 'a=%3Db'); + + let params = new URLSearchParams('a=b'); + assert.true(params.has('a'), 'search params object has name "a"'); + assert.false(params.has('b'), 'search params object has not got name "b"'); + + params = new URLSearchParams('a=b&c'); + assert.true(params.has('a'), 'search params object has name "a"'); + assert.true(params.has('c'), 'search params object has name "c"'); + + params = new URLSearchParams('&a&&& &&&&&a+b=& c&m%c3%b8%c3%b8'); + assert.true(params.has('a'), 'search params object has name "a"'); + assert.true(params.has('a b'), 'search params object has name "a b"'); + assert.true(params.has(' '), 'search params object has name " "'); + assert.false(params.has('c'), 'search params object did not have the name "c"'); + assert.true(params.has(' c'), 'search params object has name " c"'); + assert.true(params.has('møø'), 'search params object has name "møø"'); + + params = new URLSearchParams('a=b+c'); + assert.same(params.get('a'), 'b c', 'parse +'); + params = new URLSearchParams('a+b=c'); + assert.same(params.get('a b'), 'c', 'parse +'); + + params = new URLSearchParams('a=b c'); + assert.same(params.get('a'), 'b c', 'parse " "'); + params = new URLSearchParams('a b=c'); + assert.same(params.get('a b'), 'c', 'parse " "'); + + params = new URLSearchParams('a=b%20c'); + assert.same(params.get('a'), 'b c', 'parse %20'); + params = new URLSearchParams('a%20b=c'); + assert.same(params.get('a b'), 'c', 'parse %20'); + + params = new URLSearchParams('a=b\0c'); + assert.same(params.get('a'), 'b\0c', 'parse \\0'); + params = new URLSearchParams('a\0b=c'); + assert.same(params.get('a\0b'), 'c', 'parse \\0'); + + params = new URLSearchParams('a=b%00c'); + assert.same(params.get('a'), 'b\0c', 'parse %00'); + params = new URLSearchParams('a%00b=c'); + assert.same(params.get('a\0b'), 'c', 'parse %00'); + + params = new URLSearchParams('a=b\u2384'); + assert.same(params.get('a'), 'b\u2384', 'parse \u2384'); + params = new URLSearchParams('a\u2384b=c'); + assert.same(params.get('a\u2384b'), 'c', 'parse \u2384'); + + params = new URLSearchParams('a=b%e2%8e%84'); + assert.same(params.get('a'), 'b\u2384', 'parse %e2%8e%84'); + params = new URLSearchParams('a%e2%8e%84b=c'); + assert.same(params.get('a\u2384b'), 'c', 'parse %e2%8e%84'); + + params = new URLSearchParams('a=b\uD83D\uDCA9c'); + assert.same(params.get('a'), 'b\uD83D\uDCA9c', 'parse \uD83D\uDCA9'); + params = new URLSearchParams('a\uD83D\uDCA9b=c'); + assert.same(params.get('a\uD83D\uDCA9b'), 'c', 'parse \uD83D\uDCA9'); + + params = new URLSearchParams('a=b%f0%9f%92%a9c'); + assert.same(params.get('a'), 'b\uD83D\uDCA9c', 'parse %f0%9f%92%a9'); + params = new URLSearchParams('a%f0%9f%92%a9b=c'); + assert.same(params.get('a\uD83D\uDCA9b'), 'c', 'parse %f0%9f%92%a9'); + + params = new URLSearchParams(); + params.set('query', '+15555555555'); + assert.same(params.toString(), 'query=%2B15555555555'); + assert.same(params.get('query'), '+15555555555', 'parse encoded +'); + params = new URLSearchParams(params.toString()); + assert.same(params.get('query'), '+15555555555', 'parse encoded +'); + + const testData = [ + { input: '?a=%', output: [['a', '%']], name: 'handling %' }, + { input: { '+': '%C2' }, output: [['+', '%C2']], name: 'object with +' }, + { input: { c: 'x', a: '?' }, output: [['c', 'x'], ['a', '?']], name: 'object with two keys' }, + { input: [['c', 'x'], ['a', '?']], output: [['c', 'x'], ['a', '?']], name: 'array with two keys' }, + // eslint-disable-next-line max-len -- ignore + // !!! { input: { 'a\0b': '42', 'c\uD83D': '23', dሴ: 'foo' }, output: [['a\0b', '42'], ['c\uFFFD', '23'], ['d\u1234', 'foo']], name: 'object with NULL, non-ASCII, and surrogate keys' }, + ]; + + for (const { input, output, name } of testData) { + params = new URLSearchParams(input); + let i = 0; + params.forEach((value, key) => { + const [reqKey, reqValue] = output[i++]; + assert.same(key, reqKey, `construct with ${ name }`); + assert.same(value, reqValue, `construct with ${ name }`); + }); + } + + assert.throws(() => { + URLSearchParams(''); + }, 'TypeError: Incorrect invocation'); // throws w/o `new` + + assert.throws(() => { + new URLSearchParams([[1, 2, 3]]); + }, 'TypeError: Expected sequence with length 2'); + + // assert.throws(() => { + // new URLSearchParams([createIterable([createIterable([1, 2, 3])])]); + // }, 'sequence elements must be pairs #2'); + + assert.throws(() => { + new URLSearchParams([[1]]); + }, 'TypeError: Expected sequence with length 2'); + + // assert.throws(() => { + // new URLSearchParams([createIterable([createIterable([1])])]); + // }, 'sequence elements must be pairs #4'); +}); + +QUnit.test('URLSearchParams#append', assert => { + const { append } = URLSearchParams.prototype; + assert.isFunction(append); + assert.arity(append, 2); + assert.name(append, 'append'); + assert.enumerable(URLSearchParams.prototype, 'append'); + if (!NODE) assert.looksNative(append); + + assert.same(new URLSearchParams().append('a', 'b'), undefined, 'void'); + + let params = new URLSearchParams(); + params.append('a', 'b'); + assert.same(String(params), 'a=b'); + params.append('a', 'b'); + assert.same(String(params), 'a=b&a=b'); + params.append('a', 'c'); + assert.same(String(params), 'a=b&a=b&a=c'); + + params = new URLSearchParams(); + params.append('', ''); + assert.same(String(params), '='); + params.append('', ''); + assert.same(String(params), '=&='); + + params = new URLSearchParams(); + params.append(undefined, undefined); + assert.same(String(params), 'undefined=undefined'); + params.append(undefined, undefined); + assert.same(String(params), 'undefined=undefined&undefined=undefined'); + + params = new URLSearchParams(); + params.append(null, null); + assert.same(String(params), 'null=null'); + params.append(null, null); + assert.same(String(params), 'null=null&null=null'); + + params = new URLSearchParams(); + params.append('first', 1); + params.append('second', 2); + params.append('third', ''); + params.append('first', 10); + assert.true(params.has('first'), 'search params object has name "first"'); + assert.same(params.get('first'), '1', 'search params object has name "first" with value "1"'); + assert.same(params.get('second'), '2', 'search params object has name "second" with value "2"'); + assert.same(params.get('third'), '', 'search params object has name "third" with value ""'); + params.append('first', 10); + assert.same(params.get('first'), '1', 'search params object has name "first" with value "1"'); + + assert.throws(() => { + return new URLSearchParams('').append(); + }, 'TypeError: Not enough arguments'); // throws w/o arguments +}); + +QUnit.test('URLSearchParams#delete', assert => { + const $delete = URLSearchParams.prototype.delete; + assert.isFunction($delete); + assert.arity($delete, 1); + assert.enumerable(URLSearchParams.prototype, 'delete'); + if (!NODE) assert.looksNative($delete); + + let params = new URLSearchParams('a=b&c=d'); + params.delete('a'); + assert.same(String(params), 'c=d'); + + params = new URLSearchParams('a=a&b=b&a=a&c=c'); + params.delete('a'); + assert.same(String(params), 'b=b&c=c'); + + params = new URLSearchParams('a=a&=&b=b&c=c'); + params.delete(''); + assert.same(String(params), 'a=a&b=b&c=c'); + + params = new URLSearchParams('a=a&null=null&b=b'); + params.delete(null); + assert.same(String(params), 'a=a&b=b'); + + params = new URLSearchParams('a=a&undefined=undefined&b=b'); + params.delete(undefined); + assert.same(String(params), 'a=a&b=b'); + + params = new URLSearchParams(); + params.append('first', 1); + assert.true(params.has('first'), 'search params object has name "first"'); + assert.same(params.get('first'), '1', 'search params object has name "first" with value "1"'); + params.delete('first'); + assert.false(params.has('first'), 'search params object has no "first" name'); + params.append('first', 1); + params.append('first', 10); + params.delete('first'); + assert.false(params.has('first'), 'search params object has no "first" name'); + + params = new URLSearchParams('a=1&a=2&a=null&a=3&b=4'); + params.delete('a', 2); + assert.same(String(params), 'a=1&a=null&a=3&b=4'); + + params = new URLSearchParams('a=1&a=2&a=null&a=3&b=4'); + params.delete('a', null); + assert.same(String(params), 'a=1&a=2&a=3&b=4'); + + params = new URLSearchParams('a=1&a=2&a=null&a=3&b=4'); + params.delete('a', undefined); + assert.same(String(params), 'b=4'); + + if (DESCRIPTORS) { + let url = new URL('http://example.com/?param1¶m2'); + url.searchParams.delete('param1'); + url.searchParams.delete('param2'); + assert.same(String(url), 'http://example.com/', 'url.href does not have ?'); + assert.same(url.search, '', 'url.search does not have ?'); + + url = new URL('http://example.com/?'); + url.searchParams.delete('param1'); + // assert.same(String(url), 'http://example.com/', 'url.href does not have ?'); // Safari bug + assert.same(url.search, '', 'url.search does not have ?'); + } + + assert.throws(() => { + return new URLSearchParams('').delete(); + }, 'TypeError: Not enough arguments'); +}); + +QUnit.test('URLSearchParams#get', assert => { + const { get } = URLSearchParams.prototype; + assert.isFunction(get); + assert.arity(get, 1); + assert.name(get, 'get'); + assert.enumerable(URLSearchParams.prototype, 'get'); + if (!NODE) assert.looksNative(get); + + let params = new URLSearchParams('a=b&c=d'); + assert.same(params.get('a'), 'b'); + assert.same(params.get('c'), 'd'); + assert.same(params.get('e'), null); + + params = new URLSearchParams('a=b&c=d&a=e'); + assert.same(params.get('a'), 'b'); + + params = new URLSearchParams('=b&c=d'); + assert.same(params.get(''), 'b'); + + params = new URLSearchParams('a=&c=d&a=e'); + assert.same(params.get('a'), ''); + + params = new URLSearchParams('first=second&third&&'); + assert.true(params.has('first'), 'Search params object has name "first"'); + assert.same(params.get('first'), 'second', 'Search params object has name "first" with value "second"'); + assert.same(params.get('third'), '', 'Search params object has name "third" with the empty value.'); + assert.same(params.get('fourth'), null, 'Search params object has no "fourth" name and value.'); + + assert.same(new URLSearchParams('a=b c').get('a'), 'b c'); + assert.same(new URLSearchParams('a b=c').get('a b'), 'c'); + + assert.same(new URLSearchParams('a=b%20c').get('a'), 'b c', 'parse %20'); + assert.same(new URLSearchParams('a%20b=c').get('a b'), 'c', 'parse %20'); + + assert.same(new URLSearchParams('a=b\0c').get('a'), 'b\0c', 'parse \\0'); + assert.same(new URLSearchParams('a\0b=c').get('a\0b'), 'c', 'parse \\0'); + + assert.same(new URLSearchParams('a=b%2Bc').get('a'), 'b+c', 'parse %2B'); + assert.same(new URLSearchParams('a%2Bb=c').get('a+b'), 'c', 'parse %2B'); + + assert.same(new URLSearchParams('a=b%00c').get('a'), 'b\0c', 'parse %00'); + assert.same(new URLSearchParams('a%00b=c').get('a\0b'), 'c', 'parse %00'); + + assert.same(new URLSearchParams('a==').get('a'), '=', 'parse ='); + assert.same(new URLSearchParams('a=b=').get('a'), 'b=', 'parse ='); + assert.same(new URLSearchParams('a=b=c').get('a'), 'b=c', 'parse ='); + assert.same(new URLSearchParams('a==b').get('a'), '=b', 'parse ='); + + assert.same(new URLSearchParams('a=b\u2384').get('a'), 'b\u2384', 'parse \\u2384'); + assert.same(new URLSearchParams('a\u2384b=c').get('a\u2384b'), 'c', 'parse \\u2384'); + + assert.same(new URLSearchParams('a=b%e2%8e%84').get('a'), 'b\u2384', 'parse %e2%8e%84'); + assert.same(new URLSearchParams('a%e2%8e%84b=c').get('a\u2384b'), 'c', 'parse %e2%8e%84'); + + assert.same(new URLSearchParams('a=b\uD83D\uDCA9c').get('a'), 'b\uD83D\uDCA9c', 'parse \\uD83D\\uDCA9'); + assert.same(new URLSearchParams('a\uD83D\uDCA9b=c').get('a\uD83D\uDCA9b'), 'c', 'parse \\uD83D\\uDCA9'); + + assert.same(new URLSearchParams('a=b%f0%9f%92%a9c').get('a'), 'b\uD83D\uDCA9c', 'parse %f0%9f%92%a9'); + assert.same(new URLSearchParams('a%f0%9f%92%a9b=c').get('a\uD83D\uDCA9b'), 'c', 'parse %f0%9f%92%a9'); + + assert.same(new URLSearchParams('=').get(''), '', 'parse ='); + + assert.throws(() => { + return new URLSearchParams('').get(); + }, 'TypeError: Not enough arguments'); +}); + +QUnit.test('URLSearchParams#getAll', assert => { + const { getAll } = URLSearchParams.prototype; + assert.isFunction(getAll); + assert.arity(getAll, 1); + assert.name(getAll, 'getAll'); + assert.enumerable(URLSearchParams.prototype, 'getAll'); + if (!NODE) assert.looksNative(getAll); + + let params = new URLSearchParams('a=b&c=d'); + assert.arrayEqual(params.getAll('a'), ['b']); + assert.arrayEqual(params.getAll('c'), ['d']); + assert.arrayEqual(params.getAll('e'), []); + + params = new URLSearchParams('a=b&c=d&a=e'); + assert.arrayEqual(params.getAll('a'), ['b', 'e']); + + params = new URLSearchParams('=b&c=d'); + assert.arrayEqual(params.getAll(''), ['b']); + + params = new URLSearchParams('a=&c=d&a=e'); + assert.arrayEqual(params.getAll('a'), ['', 'e']); + + params = new URLSearchParams('a=1&a=2&a=3&a'); + assert.arrayEqual(params.getAll('a'), ['1', '2', '3', ''], 'search params object has expected name "a" values'); + params.set('a', 'one'); + assert.arrayEqual(params.getAll('a'), ['one'], 'search params object has expected name "a" values'); + + assert.throws(() => { + return new URLSearchParams('').getAll(); + }, 'TypeError: Not enough arguments'); +}); + +QUnit.test('URLSearchParams#has', assert => { + const { has } = URLSearchParams.prototype; + assert.isFunction(has); + assert.arity(has, 1); + assert.name(has, 'has'); + assert.enumerable(URLSearchParams.prototype, 'has'); + if (!NODE) assert.looksNative(has); + + let params = new URLSearchParams('a=b&c=d'); + assert.true(params.has('a')); + assert.true(params.has('c')); + assert.false(params.has('e')); + + params = new URLSearchParams('a=b&c=d&a=e'); + assert.true(params.has('a')); + + params = new URLSearchParams('=b&c=d'); + assert.true(params.has('')); + + params = new URLSearchParams('null=a'); + assert.true(params.has(null)); + + params = new URLSearchParams('a=b&c=d&&'); + params.append('first', 1); + params.append('first', 2); + assert.true(params.has('a'), 'search params object has name "a"'); + assert.true(params.has('c'), 'search params object has name "c"'); + assert.true(params.has('first'), 'search params object has name "first"'); + assert.false(params.has('d'), 'search params object has no name "d"'); + params.delete('first'); + assert.false(params.has('first'), 'search params object has no name "first"'); + + params = new URLSearchParams('a=1&a=2&a=null&a=3&b=4'); + assert.true(params.has('a', 2)); + assert.true(params.has('a', null)); + assert.false(params.has('a', 4)); + assert.true(params.has('b', 4)); + assert.false(params.has('b', null)); + assert.true(params.has('b', undefined)); + assert.false(params.has('c', undefined)); + + assert.throws(() => { + return new URLSearchParams('').has(); + }, 'TypeError: Not enough arguments'); +}); + +QUnit.test('URLSearchParams#set', assert => { + const { set } = URLSearchParams.prototype; + assert.isFunction(set); + assert.arity(set, 2); + assert.name(set, 'set'); + assert.enumerable(URLSearchParams.prototype, 'set'); + if (!NODE) assert.looksNative(set); + + let params = new URLSearchParams('a=b&c=d'); + params.set('a', 'B'); + assert.same(String(params), 'a=B&c=d'); + + params = new URLSearchParams('a=b&c=d&a=e'); + params.set('a', 'B'); + assert.same(String(params), 'a=B&c=d'); + params.set('e', 'f'); + assert.same(String(params), 'a=B&c=d&e=f'); + + params = new URLSearchParams('a=1&a=2&a=3'); + assert.true(params.has('a'), 'search params object has name "a"'); + assert.same(params.get('a'), '1', 'search params object has name "a" with value "1"'); + params.set('first', 4); + assert.true(params.has('a'), 'search params object has name "a"'); + assert.same(params.get('a'), '1', 'search params object has name "a" with value "1"'); + assert.same(String(params), 'a=1&a=2&a=3&first=4'); + params.set('a', 4); + assert.true(params.has('a'), 'search params object has name "a"'); + assert.same(params.get('a'), '4', 'search params object has name "a" with value "4"'); + assert.same(String(params), 'a=4&first=4'); + + assert.throws(() => { + return new URLSearchParams('').set(); + }, 'TypeError: Not enough arguments'); +}); + +QUnit.test('URLSearchParams#sort', assert => { + const { sort } = URLSearchParams.prototype; + assert.isFunction(sort); + assert.arity(sort, 0); + assert.name(sort, 'sort'); + assert.enumerable(URLSearchParams.prototype, 'sort'); + if (!NODE) assert.looksNative(sort); + + let params = new URLSearchParams('a=1&b=4&a=3&b=2'); + params.sort(); + assert.same(String(params), 'a=1&a=3&b=4&b=2'); + params.delete('a'); + params.append('a', '0'); + params.append('b', '0'); + params.sort(); + assert.same(String(params), 'a=0&b=4&b=2&b=0'); + + const testData = [ + { + input: 'z=b&a=b&z=a&a=a', + output: [['a', 'b'], ['a', 'a'], ['z', 'b'], ['z', 'a']], + }, + { + input: '\uFFFD=x&\uFFFC&\uFFFD=a', + output: [['\uFFFC', ''], ['\uFFFD', 'x'], ['\uFFFD', 'a']], + }, + { + input: 'ffi&🌈', // 🌈 > code point, but < code unit because two code units + output: [['🌈', ''], ['ffi', '']], + }, + { + input: 'é&e\uFFFD&e\u0301', + output: [['e\u0301', ''], ['e\uFFFD', ''], ['é', '']], + }, + { + input: 'z=z&a=a&z=y&a=b&z=x&a=c&z=w&a=d&z=v&a=e&z=u&a=f&z=t&a=g', + output: [ + ['a', 'a'], + ['a', 'b'], + ['a', 'c'], + ['a', 'd'], + ['a', 'e'], + ['a', 'f'], + ['a', 'g'], + ['z', 'z'], + ['z', 'y'], + ['z', 'x'], + ['z', 'w'], + ['z', 'v'], + ['z', 'u'], + ['z', 't'], + ], + }, + { + input: 'bbb&bb&aaa&aa=x&aa=y', + output: [['aa', 'x'], ['aa', 'y'], ['aaa', ''], ['bb', ''], ['bbb', '']], + }, + { + input: 'z=z&=f&=t&=x', + output: [['', 'f'], ['', 't'], ['', 'x'], ['z', 'z']], + }, + { + input: 'a🌈&a💩', + output: [['a🌈', ''], ['a💩', '']], + }, + ]; + + for (const { input, output } of testData) { + let i = 0; + params = new URLSearchParams(input); + params.sort(); + params.forEach((value, key) => { + const [reqKey, reqValue] = output[i++]; + assert.same(key, reqKey); + assert.same(value, reqValue); + }); + + i = 0; + const url = new URL(`?${ input }`, 'https://example/'); + params = url.searchParams; + params.sort(); + params.forEach((value, key) => { + const [reqKey, reqValue] = output[i++]; + assert.same(key, reqKey); + assert.same(value, reqValue); + }); + } + + if (DESCRIPTORS) { + const url = new URL('http://example.com/?'); + url.searchParams.sort(); + assert.same(url.href, 'http://example.com/', 'Sorting non-existent params removes ? from URL'); + assert.same(url.search, '', 'Sorting non-existent params removes ? from URL'); + } +}); + +QUnit.test('URLSearchParams#toString', assert => { + const { toString } = URLSearchParams.prototype; + assert.isFunction(toString); + assert.arity(toString, 0); + assert.name(toString, 'toString'); + if (!NODE) assert.looksNative(toString); + + let params = new URLSearchParams(); + params.append('a', 'b c'); + assert.same(String(params), 'a=b+c'); + params.delete('a'); + params.append('a b', 'c'); + assert.same(String(params), 'a+b=c'); + + params = new URLSearchParams(); + params.append('a', ''); + assert.same(String(params), 'a='); + params.append('a', ''); + assert.same(String(params), 'a=&a='); + params.append('', 'b'); + assert.same(String(params), 'a=&a=&=b'); + params.append('', ''); + assert.same(String(params), 'a=&a=&=b&='); + params.append('', ''); + assert.same(String(params), 'a=&a=&=b&=&='); + + params = new URLSearchParams(); + params.append('', 'b'); + assert.same(String(params), '=b'); + params.append('', 'b'); + assert.same(String(params), '=b&=b'); + + params = new URLSearchParams(); + params.append('', ''); + assert.same(String(params), '='); + params.append('', ''); + assert.same(String(params), '=&='); + + params = new URLSearchParams(); + params.append('a', 'b+c'); + assert.same(String(params), 'a=b%2Bc'); + params.delete('a'); + params.append('a+b', 'c'); + assert.same(String(params), 'a%2Bb=c'); + + params = new URLSearchParams(); + params.append('=', 'a'); + assert.same(String(params), '%3D=a'); + params.append('b', '='); + assert.same(String(params), '%3D=a&b=%3D'); + + params = new URLSearchParams(); + params.append('&', 'a'); + assert.same(String(params), '%26=a'); + params.append('b', '&'); + assert.same(String(params), '%26=a&b=%26'); + + params = new URLSearchParams(); + params.append('a', '\r'); + assert.same(String(params), 'a=%0D'); + + params = new URLSearchParams(); + params.append('a', '\n'); + assert.same(String(params), 'a=%0A'); + + params = new URLSearchParams(); + params.append('a', '\r\n'); + assert.same(String(params), 'a=%0D%0A'); + + params = new URLSearchParams(); + params.append('a', 'b%c'); + assert.same(String(params), 'a=b%25c'); + params.delete('a'); + params.append('a%b', 'c'); + assert.same(String(params), 'a%25b=c'); + + params = new URLSearchParams(); + params.append('a', 'b\0c'); + assert.same(String(params), 'a=b%00c'); + params.delete('a'); + params.append('a\0b', 'c'); + assert.same(String(params), 'a%00b=c'); + + params = new URLSearchParams(); + params.append('a', 'b\uD83D\uDCA9c'); + assert.same(String(params), 'a=b%F0%9F%92%A9c'); + params.delete('a'); + params.append('a\uD83D\uDCA9b', 'c'); + assert.same(String(params), 'a%F0%9F%92%A9b=c'); + + params = new URLSearchParams('a=b&c=d&&e&&'); + assert.same(String(params), 'a=b&c=d&e='); + params = new URLSearchParams('a = b &a=b&c=d%20'); + assert.same(String(params), 'a+=+b+&a=b&c=d+'); + params = new URLSearchParams('a=&a=b'); + assert.same(String(params), 'a=&a=b'); +}); + +QUnit.test('URLSearchParams#forEach', assert => { + const { forEach } = URLSearchParams.prototype; + assert.isFunction(forEach); + assert.arity(forEach, 1); + assert.name(forEach, 'forEach'); + assert.enumerable(URLSearchParams.prototype, 'forEach'); + if (!NODE) assert.looksNative(forEach); + + const expectedValues = { a: '1', b: '2', c: '3' }; + let params = new URLSearchParams('a=1&b=2&c=3'); + let result = ''; + params.forEach((value, key, that) => { + assert.same(params.get(key), expectedValues[key]); + assert.same(value, expectedValues[key]); + assert.same(that, params); + result += key; + }); + assert.same(result, 'abc'); + + new URL('http://a.b/c').searchParams.forEach(() => { + assert.avoid(); + }); + + // fails in Chrome 66- + if (DESCRIPTORS) { + const url = new URL('http://a.b/c?a=1&b=2&c=3&d=4'); + params = url.searchParams; + result = ''; + params.forEach((val, key) => { + url.search = 'x=1&y=2&z=3'; + result += key + val; + }); + assert.same(result, 'a1y2z3'); + } + + // fails in Chrome 66- + params = new URLSearchParams('a=1&b=2&c=3'); + result = ''; + params.forEach((value, key) => { + params.delete('b'); + result += key + value; + }); + assert.same(result, 'a1c3'); +}); + +QUnit.test('URLSearchParams#entries', assert => { + const { entries } = URLSearchParams.prototype; + assert.isFunction(entries); + assert.arity(entries, 0); + assert.name(entries, 'entries'); + assert.enumerable(URLSearchParams.prototype, 'entries'); + if (!NODE) assert.looksNative(entries); + + const expectedValues = { a: '1', b: '2', c: '3' }; + let params = new URLSearchParams('a=1&b=2&c=3'); + let iterator = params.entries(); + let result = ''; + let entry; + while (!(entry = iterator.next()).done) { + const [key, value] = entry.value; + assert.same(params.get(key), expectedValues[key]); + assert.same(value, expectedValues[key]); + result += key; + } + assert.same(result, 'abc'); + + assert.true(new URL('http://a.b/c').searchParams.entries().next().done, 'should be finished'); + + // fails in Chrome 66- + if (DESCRIPTORS) { + const url = new URL('http://a.b/c?a=1&b=2&c=3&d=4'); + iterator = url.searchParams.entries(); + result = ''; + while (!(entry = iterator.next()).done) { + const [key, value] = entry.value; + url.search = 'x=1&y=2&z=3'; + result += key + value; + } + assert.same(result, 'a1y2z3'); + } + + // fails in Chrome 66- + params = new URLSearchParams('a=1&b=2&c=3'); + iterator = params.entries(); + result = ''; + while (!(entry = iterator.next()).done) { + params.delete('b'); + const [key, value] = entry.value; + result += key + value; + } + assert.same(result, 'a1c3'); + + if (DESCRIPTORS) assert.true(getOwnPropertyDescriptor(getPrototypeOf(new URLSearchParams().entries()), 'next').enumerable, 'enumerable .next'); +}); + +QUnit.test('URLSearchParams#keys', assert => { + const { keys } = URLSearchParams.prototype; + assert.isFunction(keys); + assert.arity(keys, 0); + assert.name(keys, 'keys'); + assert.enumerable(URLSearchParams.prototype, 'keys'); + if (!NODE) assert.looksNative(keys); + + let iterator = new URLSearchParams('a=1&b=2&c=3').keys(); + let result = ''; + let entry; + while (!(entry = iterator.next()).done) { + result += entry.value; + } + assert.same(result, 'abc'); + + assert.true(new URL('http://a.b/c').searchParams.keys().next().done, 'should be finished'); + + // fails in Chrome 66- + if (DESCRIPTORS) { + const url = new URL('http://a.b/c?a=1&b=2&c=3&d=4'); + iterator = url.searchParams.keys(); + result = ''; + while (!(entry = iterator.next()).done) { + const key = entry.value; + url.search = 'x=1&y=2&z=3'; + result += key; + } + assert.same(result, 'ayz'); + } + + // fails in Chrome 66- + const params = new URLSearchParams('a=1&b=2&c=3'); + iterator = params.keys(); + result = ''; + while (!(entry = iterator.next()).done) { + params.delete('b'); + const key = entry.value; + result += key; + } + assert.same(result, 'ac'); + + if (DESCRIPTORS) assert.true(getOwnPropertyDescriptor(getPrototypeOf(new URLSearchParams().keys()), 'next').enumerable, 'enumerable .next'); +}); + +QUnit.test('URLSearchParams#values', assert => { + const { values } = URLSearchParams.prototype; + assert.isFunction(values); + assert.arity(values, 0); + assert.name(values, 'values'); + assert.enumerable(URLSearchParams.prototype, 'values'); + if (!NODE) assert.looksNative(values); + + let iterator = new URLSearchParams('a=1&b=2&c=3').values(); + let result = ''; + let entry; + while (!(entry = iterator.next()).done) { + result += entry.value; + } + assert.same(result, '123'); + + assert.true(new URL('http://a.b/c').searchParams.values().next().done, 'should be finished'); + + // fails in Chrome 66- + if (DESCRIPTORS) { + const url = new URL('http://a.b/c?a=a&b=b&c=c&d=d'); + iterator = url.searchParams.keys(); + result = ''; + while (!(entry = iterator.next()).done) { + const { value } = entry; + url.search = 'x=x&y=y&z=z'; + result += value; + } + assert.same(result, 'ayz'); + } + + // fails in Chrome 66- + const params = new URLSearchParams('a=1&b=2&c=3'); + iterator = params.values(); + result = ''; + while (!(entry = iterator.next()).done) { + params.delete('b'); + const key = entry.value; + result += key; + } + assert.same(result, '13'); + + if (DESCRIPTORS) assert.true(getOwnPropertyDescriptor(getPrototypeOf(new URLSearchParams().values()), 'next').enumerable, 'enumerable .next'); +}); + +QUnit.test('URLSearchParams#@@iterator', assert => { + const entries = URLSearchParams.prototype[Symbol.iterator]; + assert.isFunction(entries); + assert.arity(entries, 0); + assert.name(entries, 'entries'); + if (!NODE) assert.looksNative(entries); + + assert.same(entries, URLSearchParams.prototype.entries); + + const expectedValues = { a: '1', b: '2', c: '3' }; + let params = new URLSearchParams('a=1&b=2&c=3'); + let iterator = params[Symbol.iterator](); + let result = ''; + let entry; + while (!(entry = iterator.next()).done) { + const [key, value] = entry.value; + assert.same(params.get(key), expectedValues[key]); + assert.same(value, expectedValues[key]); + result += key; + } + assert.same(result, 'abc'); + + assert.true(new URL('http://a.b/c').searchParams[Symbol.iterator]().next().done, 'should be finished'); + + // fails in Chrome 66- + if (DESCRIPTORS) { + const url = new URL('http://a.b/c?a=1&b=2&c=3&d=4'); + iterator = url.searchParams[Symbol.iterator](); + result = ''; + while (!(entry = iterator.next()).done) { + const [key, value] = entry.value; + url.search = 'x=1&y=2&z=3'; + result += key + value; + } + assert.same(result, 'a1y2z3'); + } + + // fails in Chrome 66- + params = new URLSearchParams('a=1&b=2&c=3'); + iterator = params[Symbol.iterator](); + result = ''; + while (!(entry = iterator.next()).done) { + params.delete('b'); + const [key, value] = entry.value; + result += key + value; + } + assert.same(result, 'a1c3'); + + if (DESCRIPTORS) assert.true(getOwnPropertyDescriptor(getPrototypeOf(new URLSearchParams()[Symbol.iterator]()), 'next').enumerable, 'enumerable .next'); +}); + +QUnit.test('URLSearchParams#size', assert => { + const params = new URLSearchParams('a=1&b=2&b=3'); + assert.true('size' in params); + assert.same(params.size, 3); + + if (DESCRIPTORS) { + assert.true('size' in URLSearchParams.prototype); + + const { enumerable, configurable, get } = getOwnPropertyDescriptor(URLSearchParams.prototype, 'size'); + + assert.true(enumerable, 'enumerable'); + assert.true(configurable, 'configurable'); + + if (!NODE) assert.looksNative(get); + + assert.throws(() => get.call([]), 'TypeError: Incompatible receiver, URLSearchParams required'); + } +}); + +QUnit.test('URLSearchParams#@@toStringTag', assert => { + const params = new URLSearchParams('a=b'); + assert.same(({}).toString.call(params), '[object URLSearchParams]'); +}); + +if (typeof Request == 'function') { + QUnit.test('URLSearchParams with Request', assert => { + const async = assert.async(); + new Request('http://zloirock.ru', { body: new URLSearchParams({ foo: 'baz' }), method: 'POST' }).text().then(text => { + assert.same(text, 'foo=baz'); + async(); + }); + }); +} diff --git a/tests/js/url.simple b/tests/js/url.simple new file mode 100644 index 00000000..5aada95b --- /dev/null +++ b/tests/js/url.simple @@ -0,0 +1,651 @@ +/** + * @file url.simple + * Simple test for the URL interface + * @author Tom Tang + * @date Aug 2023 + */ + +const QUnit = require('./quint'); + +/* ! + * Modified from https://github.com/zloirock/core-js/blob/d99baeff/tests/unit-global/web.url.js + * core-js + * MIT License + */ + +const DESCRIPTORS = true; +const NODE = false; + +const { hasOwnProperty } = Object.prototype; + +QUnit.test('URL constructor', assert => { + assert.isFunction(URL); + if (!NODE) assert.arity(URL, 1); + assert.name(URL, 'URL'); + if (!NODE) assert.looksNative(URL); + + assert.same(String(new URL('http://www.domain.com/a/b')), 'http://www.domain.com/a/b'); + assert.same(String(new URL('/c/d', 'http://www.domain.com/a/b')), 'http://www.domain.com/c/d'); + assert.same(String(new URL('b/c', 'http://www.domain.com/a/b')), 'http://www.domain.com/a/b/c'); + assert.same(String(new URL('b/c', new URL('http://www.domain.com/a/b'))), 'http://www.domain.com/a/b/c'); + assert.same(String(new URL({ toString: () => 'https://example.org/' })), 'https://example.org/'); + + assert.same(String(new URL('nonspecial://example.com/')), 'nonspecial://example.com/'); + + assert.same(String(new URL('https://測試')), 'https://xn--g6w251d/', 'unicode parsing'); + assert.same(String(new URL('https://xxпривет.тест')), 'https://xn--xx-flcmn5bht.xn--e1aybc/', 'unicode parsing'); + assert.same(String(new URL('https://xxПРИВЕТ.тест')), 'https://xn--xx-flcmn5bht.xn--e1aybc/', 'unicode parsing'); + assert.same(String(new URL('http://Example.com/', 'https://example.org/')), 'http://example.com/'); + assert.same(String(new URL('https://Example.com/', 'https://example.org/')), 'https://example.com/'); + assert.same(String(new URL('nonspecial://Example.com/', 'https://example.org/')), 'nonspecial://Example.com/'); + assert.same(String(new URL('http:Example.com/', 'https://example.org/')), 'http://example.com/'); + assert.same(String(new URL('https:Example.com/', 'https://example.org/')), 'https://example.org/Example.com/'); + assert.same(String(new URL('nonspecial:Example.com/', 'https://example.org/')), 'nonspecial:Example.com/'); + + assert.same(String(new URL('http://0300.168.0xF0')), 'http://192.168.0.240/'); + assert.same(String(new URL('http://[20:0:0:1:0:0:0:ff]')), 'http://[20:0:0:1::ff]/'); + // assert.same(String(new URL('http://257.168.0xF0')), 'http://257.168.0xf0/', 'incorrect IPv4 parsed as host'); // TypeError in Chrome and Safari + assert.same(String(new URL('http://0300.168.0xG0')), 'http://0300.168.0xg0/', 'incorrect IPv4 parsed as host'); + + assert.same(String(new URL('file:///var/log/system.log')), 'file:///var/log/system.log', 'file scheme'); + // assert.same(String(new URL('file://nnsc.nsf.net/bar/baz')), 'file://nnsc.nsf.net/bar/baz', 'file scheme'); // 'file:///bar/baz' in FF + // assert.same(String(new URL('file://localhost/bar/baz')), 'file:///bar/baz', 'file scheme'); // 'file://localhost/bar/baz' in Chrome + + assert.throws(() => new URL(), 'TypeError: Not enough arguments'); + assert.throws(() => new URL(''), 'TypeError: Invalid scheme'); + // Node 19.7 + // https://github.com/nodejs/node/issues/46755 + // assert.throws(() => new URL('', 'about:blank'), 'TypeError: Failed to construct URL: Invalid URL'); + assert.throws(() => new URL('abc'), 'TypeError: Invalid scheme'); + assert.throws(() => new URL('//abc'), 'TypeError: Invalid scheme'); + assert.throws(() => new URL('http:///www.domain.com/', 'abc'), 'TypeError: Invalid scheme'); + assert.throws(() => new URL('http:///www.domain.com/', null), 'TypeError: Invalid scheme'); + assert.throws(() => new URL('//abc', null), 'TypeError: Invalid scheme'); + assert.throws(() => new URL('http://[20:0:0:1:0:0:0:ff'), 'TypeError: Invalid host'); + assert.throws(() => new URL('http://[20:0:0:1:0:0:0:fg]'), 'TypeError: Invalid host'); + // assert.throws(() => new URL('http://a%b'), 'forbidden host code point'); // no error in FF + assert.throws(() => new URL('1http://zloirock.ru'), 'TypeError: Invalid scheme'); +}); + +QUnit.test('URL#href', assert => { + let url = new URL('http://zloirock.ru/'); + + if (DESCRIPTORS) { + assert.false(hasOwnProperty.call(url, 'href')); + const descriptor = Object.getOwnPropertyDescriptor(URL.prototype, 'href'); + assert.true(descriptor.enumerable); + assert.true(descriptor.configurable); + assert.same(typeof descriptor.get, 'function'); + assert.same(typeof descriptor.set, 'function'); + } + + assert.same(url.href, 'http://zloirock.ru/'); + + if (DESCRIPTORS) { + url.searchParams.append('foo', 'bar'); + assert.same(url.href, 'http://zloirock.ru/?foo=bar'); + + url = new URL('http://zloirock.ru/foo'); + url.href = 'https://測試'; + assert.same(url.href, 'https://xn--g6w251d/', 'unicode parsing'); + assert.same(String(url), 'https://xn--g6w251d/', 'unicode parsing'); + + url = new URL('http://zloirock.ru/foo'); + url.href = 'https://xxпривет.тест'; + assert.same(url.href, 'https://xn--xx-flcmn5bht.xn--e1aybc/', 'unicode parsing'); + assert.same(String(url), 'https://xn--xx-flcmn5bht.xn--e1aybc/', 'unicode parsing'); + + url = new URL('http://zloirock.ru/foo'); + url.href = 'https://xxПРИВЕТ.тест'; + assert.same(url.href, 'https://xn--xx-flcmn5bht.xn--e1aybc/', 'unicode parsing'); + assert.same(String(url), 'https://xn--xx-flcmn5bht.xn--e1aybc/', 'unicode parsing'); + + url = new URL('http://zloirock.ru/'); + url.href = 'http://0300.168.0xF0'; + assert.same(url.href, 'http://192.168.0.240/'); + assert.same(String(url), 'http://192.168.0.240/'); + + url = new URL('http://zloirock.ru/'); + url.href = 'http://[20:0:0:1:0:0:0:ff]'; + assert.same(url.href, 'http://[20:0:0:1::ff]/'); + assert.same(String(url), 'http://[20:0:0:1::ff]/'); + + // url = new URL('http://zloirock.ru/'); + // url.href = 'http://257.168.0xF0'; // TypeError and Safari + // assert.same(url.href, 'http://257.168.0xf0/', 'incorrect IPv4 parsed as host'); // `F` instead of `f` in Chrome + // assert.same(String(url), 'http://257.168.0xf0/', 'incorrect IPv4 parsed as host'); // `F` instead of `f` in Chrome + + url = new URL('http://zloirock.ru/'); + url.href = 'http://0300.168.0xG0'; + assert.same(url.href, 'http://0300.168.0xg0/', 'incorrect IPv4 parsed as host'); + assert.same(String(url), 'http://0300.168.0xg0/', 'incorrect IPv4 parsed as host'); + + url = new URL('http://192.168.0.240/'); + url.href = 'file:///var/log/system.log'; + assert.same(url.href, 'file:///var/log/system.log', 'file -> ip'); + assert.same(String(url), 'file:///var/log/system.log', 'file -> ip'); + + url = new URL('file:///var/log/system.log'); + url.href = 'http://0300.168.0xF0'; + // Node 19.7 + // https://github.com/nodejs/node/issues/46755 + // assert.same(url.href, 'http://192.168.0.240/', 'file -> http'); + // assert.same(String(url), 'http://192.168.0.240/', 'file -> http'); + + // assert.throws(() => new URL('http://zloirock.ru/').href = undefined, 'incorrect URL'); // no error in Chrome + // assert.throws(() => new URL('http://zloirock.ru/').href = '', 'incorrect URL'); // no error in Chrome + // assert.throws(() => new URL('http://zloirock.ru/').href = 'abc', 'incorrect URL'); // no error in Chrome + // assert.throws(() => new URL('http://zloirock.ru/').href = '//abc', 'incorrect URL'); // no error in Chrome + // assert.throws(() => new URL('http://zloirock.ru/').href = 'http://[20:0:0:1:0:0:0:ff', 'incorrect IPv6'); // no error in Chrome + // assert.throws(() => new URL('http://zloirock.ru/').href = 'http://[20:0:0:1:0:0:0:fg]', 'incorrect IPv6'); // no error in Chrome + // assert.throws(() => new URL('http://zloirock.ru/').href = 'http://a%b', 'forbidden host code point'); // no error in Chrome and FF + // assert.throws(() => new URL('http://zloirock.ru/').href = '1http://zloirock.ru', 'incorrect scheme'); // no error in Chrome + } +}); + +QUnit.test('URL#origin', assert => { + const url = new URL('http://es6.zloirock.ru/tests.html'); + + if (DESCRIPTORS) { + assert.false(hasOwnProperty.call(url, 'origin')); + const descriptor = Object.getOwnPropertyDescriptor(URL.prototype, 'origin'); + assert.true(descriptor.enumerable); + assert.true(descriptor.configurable); + assert.same(typeof descriptor.get, 'function'); + } + + assert.same(url.origin, 'http://es6.zloirock.ru'); + + assert.same(new URL('https://測試/tests').origin, 'https://xn--g6w251d'); +}); + +QUnit.test('URL#protocol', assert => { + let url = new URL('http://zloirock.ru/'); + + if (DESCRIPTORS) { + assert.false(hasOwnProperty.call(url, 'protocol')); + const descriptor = Object.getOwnPropertyDescriptor(URL.prototype, 'protocol'); + assert.true(descriptor.enumerable); + assert.true(descriptor.configurable); + assert.same(typeof descriptor.get, 'function'); + assert.same(typeof descriptor.set, 'function'); + } + + assert.same(url.protocol, 'http:'); + + if (DESCRIPTORS) { + url = new URL('http://zloirock.ru/'); + url.protocol = 'https'; + assert.same(url.protocol, 'https:'); + assert.same(String(url), 'https://zloirock.ru/'); + + // https://nodejs.org/api/url.html#url_special_schemes + // url = new URL('http://zloirock.ru/'); + // url.protocol = 'fish'; + // assert.same(url.protocol, 'http:'); + // assert.same(url.href, 'http://zloirock.ru/'); + // assert.same(String(url), 'http://zloirock.ru/'); + + url = new URL('http://zloirock.ru/'); + url.protocol = '1http'; + assert.same(url.protocol, 'http:'); + assert.same(url.href, 'http://zloirock.ru/', 'incorrect scheme'); + assert.same(String(url), 'http://zloirock.ru/', 'incorrect scheme'); + } +}); + +QUnit.test('URL#username', assert => { + let url = new URL('http://zloirock.ru/'); + + if (DESCRIPTORS) { + assert.false(hasOwnProperty.call(url, 'username')); + const descriptor = Object.getOwnPropertyDescriptor(URL.prototype, 'username'); + assert.true(descriptor.enumerable); + assert.true(descriptor.configurable); + assert.same(typeof descriptor.get, 'function'); + assert.same(typeof descriptor.set, 'function'); + } + + assert.same(url.username, ''); + + url = new URL('http://username@zloirock.ru/'); + assert.same(url.username, 'username'); + + if (DESCRIPTORS) { + url = new URL('http://zloirock.ru/'); + url.username = 'username'; + assert.same(url.username, 'username'); + assert.same(String(url), 'http://username@zloirock.ru/'); + } +}); + +QUnit.test('URL#password', assert => { + let url = new URL('http://zloirock.ru/'); + + if (DESCRIPTORS) { + assert.false(hasOwnProperty.call(url, 'password')); + const descriptor = Object.getOwnPropertyDescriptor(URL.prototype, 'password'); + assert.true(descriptor.enumerable); + assert.true(descriptor.configurable); + assert.same(typeof descriptor.get, 'function'); + assert.same(typeof descriptor.set, 'function'); + } + + assert.same(url.password, ''); + + url = new URL('http://username:password@zloirock.ru/'); + assert.same(url.password, 'password'); + + // url = new URL('http://:password@zloirock.ru/'); // TypeError in FF + // assert.same(url.password, 'password'); + + if (DESCRIPTORS) { + url = new URL('http://zloirock.ru/'); + url.username = 'username'; + url.password = 'password'; + assert.same(url.password, 'password'); + assert.same(String(url), 'http://username:password@zloirock.ru/'); + + // url = new URL('http://zloirock.ru/'); + // url.password = 'password'; + // assert.same(url.password, 'password'); // '' in FF + // assert.same(String(url), 'http://:password@zloirock.ru/'); // 'http://zloirock.ru/' in FF + } +}); + +QUnit.test('URL#host', assert => { + let url = new URL('http://zloirock.ru:81/path'); + + if (DESCRIPTORS) { + assert.false(hasOwnProperty.call(url, 'host')); + const descriptor = Object.getOwnPropertyDescriptor(URL.prototype, 'host'); + assert.true(descriptor.enumerable); + assert.true(descriptor.configurable); + assert.same(typeof descriptor.get, 'function'); + assert.same(typeof descriptor.set, 'function'); + } + + assert.same(url.host, 'zloirock.ru:81'); + + if (DESCRIPTORS) { + url = new URL('http://zloirock.ru:81/path'); + url.host = 'example.com:82'; + assert.same(url.host, 'example.com:82'); + assert.same(String(url), 'http://example.com:82/path'); + + // url = new URL('http://zloirock.ru:81/path'); + // url.host = 'other?domain.com'; + // assert.same(String(url), 'http://other:81/path'); // 'http://other/?domain.com/path' in Safari + + url = new URL('https://www.mydomain.com:8080/path/'); + url.host = 'www.otherdomain.com:80'; + assert.same(url.href, 'https://www.otherdomain.com:80/path/', 'set default port for another protocol'); + + // url = new URL('https://www.mydomain.com:8080/path/'); + // url.host = 'www.otherdomain.com:443'; + // assert.same(url.href, 'https://www.otherdomain.com/path/', 'set default port'); + + url = new URL('http://zloirock.ru/foo'); + url.host = '測試'; + assert.same(url.host, 'xn--g6w251d', 'unicode parsing'); + assert.same(String(url), 'http://xn--g6w251d/foo', 'unicode parsing'); + + url = new URL('http://zloirock.ru/foo'); + url.host = 'xxпривет.тест'; + assert.same(url.host, 'xn--xx-flcmn5bht.xn--e1aybc', 'unicode parsing'); + assert.same(String(url), 'http://xn--xx-flcmn5bht.xn--e1aybc/foo', 'unicode parsing'); + + url = new URL('http://zloirock.ru/foo'); + url.host = 'xxПРИВЕТ.тест'; + assert.same(url.host, 'xn--xx-flcmn5bht.xn--e1aybc', 'unicode parsing'); + assert.same(String(url), 'http://xn--xx-flcmn5bht.xn--e1aybc/foo', 'unicode parsing'); + + url = new URL('http://zloirock.ru/foo'); + url.host = '0300.168.0xF0'; + assert.same(url.host, '192.168.0.240'); + assert.same(String(url), 'http://192.168.0.240/foo'); + + // url = new URL('http://zloirock.ru/foo'); + // url.host = '[20:0:0:1:0:0:0:ff]'; + // assert.same(url.host, '[20:0:0:1::ff]'); // ':0' in Chrome, 'zloirock.ru' in Safari + // assert.same(String(url), 'http://[20:0:0:1::ff]/foo'); // 'http://[20:0/foo' in Chrome, 'http://zloirock.ru/foo' in Safari + + // url = new URL('file:///var/log/system.log'); + // url.host = 'nnsc.nsf.net'; // does not work in FF + // assert.same(url.hostname, 'nnsc.nsf.net', 'file'); + // assert.same(String(url), 'file://nnsc.nsf.net/var/log/system.log', 'file'); + + // url = new URL('http://zloirock.ru/'); + // url.host = '[20:0:0:1:0:0:0:ff'; + // assert.same(url.host, 'zloirock.ru', 'incorrect IPv6'); // ':0' in Chrome + // assert.same(String(url), 'http://zloirock.ru/', 'incorrect IPv6'); // 'http://[20:0/' in Chrome + + // url = new URL('http://zloirock.ru/'); + // url.host = '[20:0:0:1:0:0:0:fg]'; + // assert.same(url.host, 'zloirock.ru', 'incorrect IPv6'); // ':0' in Chrome + // assert.same(String(url), 'http://zloirock.ru/', 'incorrect IPv6'); // 'http://[20:0/' in Chrome + + // url = new URL('http://zloirock.ru/'); + // url.host = 'a%b'; + // assert.same(url.host, 'zloirock.ru', 'forbidden host code point'); // '' in Chrome, 'a%b' in FF + // assert.same(String(url), 'http://zloirock.ru/', 'forbidden host code point'); // 'http://a%25b/' in Chrome, 'http://a%b/' in FF + } +}); + +QUnit.test('URL#hostname', assert => { + let url = new URL('http://zloirock.ru:81/'); + + if (DESCRIPTORS) { + assert.false(hasOwnProperty.call(url, 'hostname')); + const descriptor = Object.getOwnPropertyDescriptor(URL.prototype, 'hostname'); + assert.true(descriptor.enumerable); + assert.true(descriptor.configurable); + assert.same(typeof descriptor.get, 'function'); + assert.same(typeof descriptor.set, 'function'); + } + + assert.same(url.hostname, 'zloirock.ru'); + + if (DESCRIPTORS) { + url = new URL('http://zloirock.ru:81/'); + url.hostname = 'example.com'; + assert.same(url.hostname, 'example.com'); + assert.same(String(url), 'http://example.com:81/'); + + // url = new URL('http://zloirock.ru:81/'); + // url.hostname = 'example.com:82'; + // assert.same(url.hostname, 'example.com'); // '' in Chrome + // assert.same(String(url), 'http://example.com:81/'); // 'http://example.com:82:81/' in Chrome + + url = new URL('http://zloirock.ru/foo'); + url.hostname = '測試'; + assert.same(url.hostname, 'xn--g6w251d', 'unicode parsing'); + assert.same(String(url), 'http://xn--g6w251d/foo', 'unicode parsing'); + + url = new URL('http://zloirock.ru/foo'); + url.hostname = 'xxпривет.тест'; + assert.same(url.hostname, 'xn--xx-flcmn5bht.xn--e1aybc', 'unicode parsing'); + assert.same(String(url), 'http://xn--xx-flcmn5bht.xn--e1aybc/foo', 'unicode parsing'); + + url = new URL('http://zloirock.ru/foo'); + url.hostname = 'xxПРИВЕТ.тест'; + assert.same(url.hostname, 'xn--xx-flcmn5bht.xn--e1aybc', 'unicode parsing'); + assert.same(String(url), 'http://xn--xx-flcmn5bht.xn--e1aybc/foo', 'unicode parsing'); + + url = new URL('http://zloirock.ru/foo'); + url.hostname = '0300.168.0xF0'; + assert.same(url.hostname, '192.168.0.240'); + assert.same(String(url), 'http://192.168.0.240/foo'); + + // url = new URL('http://zloirock.ru/foo'); + // url.hostname = '[20:0:0:1:0:0:0:ff]'; + // assert.same(url.hostname, '[20:0:0:1::ff]'); // 'zloirock.ru' in Safari + // assert.same(String(url), 'http://[20:0:0:1::ff]/foo'); // 'http://zloirock.ru/foo' in Safari + + // url = new URL('file:///var/log/system.log'); + // url.hostname = 'nnsc.nsf.net'; // does not work in FF + // assert.same(url.hostname, 'nnsc.nsf.net', 'file'); + // assert.same(String(url), 'file://nnsc.nsf.net/var/log/system.log', 'file'); + + // url = new URL('http://zloirock.ru/'); + // url.hostname = '[20:0:0:1:0:0:0:ff'; + // assert.same(url.hostname, 'zloirock.ru', 'incorrect IPv6'); // '' in Chrome + // assert.same(String(url), 'http://zloirock.ru/', 'incorrect IPv6'); // 'http://[20:0:0:1:0:0:0:ff' in Chrome + + // url = new URL('http://zloirock.ru/'); + // url.hostname = '[20:0:0:1:0:0:0:fg]'; + // assert.same(url.hostname, 'zloirock.ru', 'incorrect IPv6'); // '' in Chrome + // assert.same(String(url), 'http://zloirock.ru/', 'incorrect IPv6'); // 'http://[20:0:0:1:0:0:0:ff/' in Chrome + + // url = new URL('http://zloirock.ru/'); + // url.hostname = 'a%b'; + // assert.same(url.hostname, 'zloirock.ru', 'forbidden host code point'); // '' in Chrome, 'a%b' in FF + // assert.same(String(url), 'http://zloirock.ru/', 'forbidden host code point'); // 'http://a%25b/' in Chrome, 'http://a%b/' in FF + } +}); + +QUnit.test('URL#port', assert => { + let url = new URL('http://zloirock.ru:1337/'); + + if (DESCRIPTORS) { + assert.false(hasOwnProperty.call(url, 'port')); + const descriptor = Object.getOwnPropertyDescriptor(URL.prototype, 'port'); + assert.true(descriptor.enumerable); + assert.true(descriptor.configurable); + assert.same(typeof descriptor.get, 'function'); + assert.same(typeof descriptor.set, 'function'); + } + + assert.same(url.port, '1337'); + + if (DESCRIPTORS) { + url = new URL('http://zloirock.ru/'); + url.port = 80; + assert.same(url.port, ''); + assert.same(String(url), 'http://zloirock.ru/'); + url.port = 1337; + assert.same(url.port, '1337'); + assert.same(String(url), 'http://zloirock.ru:1337/'); + // url.port = 'abcd'; + // assert.same(url.port, '1337'); // '0' in Chrome + // assert.same(String(url), 'http://zloirock.ru:1337/'); // 'http://zloirock.ru:0/' in Chrome + // url.port = '5678abcd'; + // assert.same(url.port, '5678'); // '1337' in FF + // assert.same(String(url), 'http://zloirock.ru:5678/'); // 'http://zloirock.ru:1337/"' in FF + url.port = 1234.5678; + assert.same(url.port, '1234'); + assert.same(String(url), 'http://zloirock.ru:1234/'); + // url.port = 1e10; + // assert.same(url.port, '1234'); // '0' in Chrome + // assert.same(String(url), 'http://zloirock.ru:1234/'); // 'http://zloirock.ru:0/' in Chrome + } +}); + +QUnit.test('URL#pathname', assert => { + let url = new URL('http://zloirock.ru/foo/bar'); + + if (DESCRIPTORS) { + assert.false(hasOwnProperty.call(url, 'pathname')); + const descriptor = Object.getOwnPropertyDescriptor(URL.prototype, 'pathname'); + assert.true(descriptor.enumerable); + assert.true(descriptor.configurable); + assert.same(typeof descriptor.get, 'function'); + assert.same(typeof descriptor.set, 'function'); + } + + assert.same(url.pathname, '/foo/bar'); + + if (DESCRIPTORS) { + url = new URL('http://zloirock.ru/'); + url.pathname = 'bar/baz'; + assert.same(url.pathname, '/bar/baz'); + assert.same(String(url), 'http://zloirock.ru/bar/baz'); + } +}); + +QUnit.test('URL#search', assert => { + let url = new URL('http://zloirock.ru/'); + + if (DESCRIPTORS) { + assert.false(hasOwnProperty.call(url, 'search')); + const descriptor = Object.getOwnPropertyDescriptor(URL.prototype, 'search'); + assert.true(descriptor.enumerable); + assert.true(descriptor.configurable); + assert.same(typeof descriptor.get, 'function'); + assert.same(typeof descriptor.set, 'function'); + } + + assert.same(url.search, ''); + + url = new URL('http://zloirock.ru/?foo=bar'); + assert.same(url.search, '?foo=bar'); + + if (DESCRIPTORS) { + url = new URL('http://zloirock.ru/?'); + assert.same(url.search, ''); + assert.same(String(url), 'http://zloirock.ru/?'); + url.search = 'foo=bar'; + assert.same(url.search, '?foo=bar'); + assert.same(String(url), 'http://zloirock.ru/?foo=bar'); + url.search = '?bar=baz'; + assert.same(url.search, '?bar=baz'); + assert.same(String(url), 'http://zloirock.ru/?bar=baz'); + url.search = ''; + assert.same(url.search, ''); + assert.same(String(url), 'http://zloirock.ru/'); + } +}); + +QUnit.test('URL#searchParams', assert => { + let url = new URL('http://zloirock.ru/?foo=bar&bar=baz'); + + if (DESCRIPTORS) { + assert.false(hasOwnProperty.call(url, 'searchParams')); + const descriptor = Object.getOwnPropertyDescriptor(URL.prototype, 'searchParams'); + assert.true(descriptor.enumerable); + assert.true(descriptor.configurable); + assert.same(typeof descriptor.get, 'function'); + } + + assert.true(url.searchParams instanceof URLSearchParams); + assert.same(url.searchParams.get('foo'), 'bar'); + assert.same(url.searchParams.get('bar'), 'baz'); + + if (DESCRIPTORS) { + url = new URL('http://zloirock.ru/'); + url.searchParams.append('foo', 'bar'); + assert.same(String(url), 'http://zloirock.ru/?foo=bar'); + + url = new URL('http://zloirock.ru/'); + url.search = 'foo=bar'; + assert.same(url.searchParams.get('foo'), 'bar'); + + url = new URL('http://zloirock.ru/?foo=bar&bar=baz'); + url.search = ''; + assert.false(url.searchParams.has('foo')); + } +}); + +QUnit.test('URL#hash', assert => { + let url = new URL('http://zloirock.ru/'); + + if (DESCRIPTORS) { + assert.false(hasOwnProperty.call(url, 'hash')); + const descriptor = Object.getOwnPropertyDescriptor(URL.prototype, 'hash'); + assert.true(descriptor.enumerable); + assert.true(descriptor.configurable); + assert.same(typeof descriptor.get, 'function'); + assert.same(typeof descriptor.set, 'function'); + } + + assert.same(url.hash, ''); + + url = new URL('http://zloirock.ru/#foo'); + assert.same(url.hash, '#foo'); + + url = new URL('http://zloirock.ru/#'); + assert.same(url.hash, ''); + assert.same(String(url), 'http://zloirock.ru/#'); + + if (DESCRIPTORS) { + url = new URL('http://zloirock.ru/#'); + url.hash = 'foo'; + assert.same(url.hash, '#foo'); + assert.same(String(url), 'http://zloirock.ru/#foo'); + url.hash = ''; + assert.same(url.hash, ''); + assert.same(String(url), 'http://zloirock.ru/'); + // url.hash = '#'; + // assert.same(url.hash, ''); + // assert.same(String(url), 'http://zloirock.ru/'); // 'http://zloirock.ru/#' in FF + url.hash = '#foo'; + assert.same(url.hash, '#foo'); + assert.same(String(url), 'http://zloirock.ru/#foo'); + url.hash = '#foo#bar'; + assert.same(url.hash, '#foo#bar'); + assert.same(String(url), 'http://zloirock.ru/#foo#bar'); + + url = new URL('http://zloirock.ru/'); + url.hash = 'абa'; + assert.same(url.hash, '#%D0%B0%D0%B1a'); + + // url = new URL('http://zloirock.ru/'); + // url.hash = '\udc01\ud802a'; + // assert.same(url.hash, '#%EF%BF%BD%EF%BF%BDa', 'unmatched surrogates'); + } +}); + +QUnit.test('URL#toJSON', assert => { + const { toJSON } = URL.prototype; + assert.isFunction(toJSON); + assert.arity(toJSON, 0); + assert.name(toJSON, 'toJSON'); + assert.enumerable(URL.prototype, 'toJSON'); + if (!NODE) assert.looksNative(toJSON); + + const url = new URL('http://zloirock.ru/'); + assert.same(url.toJSON(), 'http://zloirock.ru/'); + + if (DESCRIPTORS) { + url.searchParams.append('foo', 'bar'); + assert.same(url.toJSON(), 'http://zloirock.ru/?foo=bar'); + } +}); + +QUnit.test('URL#toString', assert => { + const { toString } = URL.prototype; + assert.isFunction(toString); + assert.arity(toString, 0); + assert.name(toString, 'toString'); + assert.enumerable(URL.prototype, 'toString'); + if (!NODE) assert.looksNative(toString); + + const url = new URL('http://zloirock.ru/'); + assert.same(url.toString(), 'http://zloirock.ru/'); + + if (DESCRIPTORS) { + url.searchParams.append('foo', 'bar'); + assert.same(url.toString(), 'http://zloirock.ru/?foo=bar'); + } +}); + +QUnit.test('URL#@@toStringTag', assert => { + const url = new URL('http://zloirock.ru/'); + assert.same(({}).toString.call(url), '[object URL]'); +}); + +QUnit.test('URL.sham', assert => { + assert.same(URL.sham, DESCRIPTORS ? undefined : true); +}); + +/* ! + * Modified from https://github.com/zloirock/core-js/blob/d99baeff/tests/unit-global/web.url.can-parse.js + * core-js + * MIT License + */ + +QUnit.test('URL.canParse', assert => { + const { canParse } = URL; + + assert.isFunction(canParse); + assert.arity(canParse, 1); + assert.name(canParse, 'canParse'); + if (!NODE) assert.looksNative(canParse); + + assert.false(canParse(undefined), 'undefined'); + assert.false(canParse(undefined, undefined), 'undefined, undefined'); + assert.true(canParse('q:w'), 'q:w'); + assert.true(canParse('q:w', undefined), 'q:w, undefined'); + // assert.false(canParse(undefined, 'q:w'), 'undefined, q:w'); // fails in Chromium on Windows + assert.true(canParse('q:/w'), 'q:/w'); + assert.true(canParse('q:/w', undefined), 'q:/w, undefined'); + assert.true(canParse(undefined, 'q:/w'), 'undefined, q:/w'); + assert.false(canParse('https://login:password@examp:le.com:8080/?a=1&b=2&a=3&c=4#fragment'), 'https://login:password@examp:le.com:8080/?a=1&b=2&a=3&c=4#fragment'); + assert.true(canParse('https://login:password@example.com:8080/?a=1&b=2&a=3&c=4#fragment'), 'https://login:password@example.com:8080/?a=1&b=2&a=3&c=4#fragment'); + assert.true(canParse('https://login:password@example.com:8080/?a=1&b=2&a=3&c=4#fragment', undefined), 'https://login:password@example.com:8080/?a=1&b=2&a=3&c=4#fragment, undefined'); + assert.true(canParse('x', 'https://login:password@example.com:8080/?a=1&b=2&a=3&c=4#fragment'), 'x, https://login:password@example.com:8080/?a=1&b=2&a=3&c=4#fragment'); + + assert.throws(() => canParse(), 'TypeError: Not enough arguments'); + assert.throws(() => canParse({ toString() { throw Error('conversion thrower #1'); } }), 'conversion thrower #1'); + assert.throws(() => canParse('q:w', { toString() { throw Error('conversion thrower #2'); } }), 'conversion thrower #2'); +}); From 63f3aedd166e0f95f8b8dd259df0d04df718636e Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 25 Aug 2023 01:05:13 +0000 Subject: [PATCH 0032/1086] refactor: move URL/URLSearchParams APIs into the `url` builtin_modules --- python/pythonmonkey/__init__.py | 5 +- python/pythonmonkey/builtin_modules/url.d.ts | 111 +++++++++++++++++++ python/pythonmonkey/builtin_modules/url.js | 15 +++ python/pythonmonkey/global.d.ts | 4 + 4 files changed, 131 insertions(+), 4 deletions(-) create mode 100644 python/pythonmonkey/builtin_modules/url.d.ts create mode 100644 python/pythonmonkey/builtin_modules/url.js diff --git a/python/pythonmonkey/__init__.py b/python/pythonmonkey/__init__.py index 1cee251d..1f95e64e 100644 --- a/python/pythonmonkey/__init__.py +++ b/python/pythonmonkey/__init__.py @@ -13,10 +13,7 @@ require("console") require("base64") require("timers") -## npm packages -require("core-js/actual/dom-exception") -require("core-js/actual/url") -require("core-js/actual/url-search-params") +require("url") # Add the `.keys()` method on `Object.prototype` to get JSObjectProxy dict() conversion working # Conversion from a dict-subclass to a strict dict by `dict(subclass)` internally calls the .keys() method to read the dictionary keys, diff --git a/python/pythonmonkey/builtin_modules/url.d.ts b/python/pythonmonkey/builtin_modules/url.d.ts new file mode 100644 index 00000000..8e4baa62 --- /dev/null +++ b/python/pythonmonkey/builtin_modules/url.d.ts @@ -0,0 +1,111 @@ +/** + * @file url.d.ts + * Type definitions for URL/URLSearchParams + * + * @author Tom Tang + * @date August 2023 + */ + +/*! + * Modified from https://www.npmjs.com/package/@types/web + * Apache License 2.0 + */ + +/** + * The URL interface represents an object providing static methods used for creating object URLs. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL) + */ +export interface URL { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash) */ + hash: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host) */ + host: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname) */ + hostname: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href) */ + href: string; + toString(): string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin) */ + readonly origin: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password) */ + password: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname) */ + pathname: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port) */ + port: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol) */ + protocol: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search) */ + search: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams) */ + readonly searchParams: URLSearchParams; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username) */ + username: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON) */ + toJSON(): string; +} + +export declare var URL: { + prototype: URL; + new(url: string | URL, base?: string | URL): URL; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static) */ + canParse(url: string | URL, base?: string): boolean; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static) @deprecated not implemented by polyfill */ + // @ts-expect-error types not defined + createObjectURL(obj: Blob | MediaSource): string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static) @deprecated not implemented by polyfill */ + revokeObjectURL(url: string): void; +}; + +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams) */ +export interface URLSearchParams { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size) */ + readonly size: number; + /** + * Appends a specified key/value pair as a new search parameter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append) + */ + append(name: string, value: string): void; + /** + * Deletes the given search parameter, and its associated value, from the list of all search parameters. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete) + */ + delete(name: string, value?: string): void; + /** + * Returns the first value associated to the given search parameter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get) + */ + get(name: string): string | null; + /** + * Returns all the values association with a given search parameter. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll) + */ + getAll(name: string): string[]; + /** + * Returns a Boolean indicating if such a search parameter exists. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has) + */ + has(name: string, value?: string): boolean; + /** + * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set) + */ + set(name: string, value: string): void; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort) */ + sort(): void; + /** Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */ + toString(): string; + forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void; +} + +export declare var URLSearchParams: { + prototype: URLSearchParams; + new(init?: string[][] | Record | string | URLSearchParams): URLSearchParams; +}; diff --git a/python/pythonmonkey/builtin_modules/url.js b/python/pythonmonkey/builtin_modules/url.js new file mode 100644 index 00000000..5692d4f6 --- /dev/null +++ b/python/pythonmonkey/builtin_modules/url.js @@ -0,0 +1,15 @@ +/** + * @file url.js + * Polyfill the URL and URLSearchParams interfaces + * + * @author Tom Tang + * @date August 2023 + */ + +// Apply polyfills from core-js +require("core-js/actual/dom-exception") +require("core-js/actual/url") +require("core-js/actual/url-search-params") + +exports.URL = globalThis.URL; +exports.URLSearchParams = globalThis.URLSearchParams; diff --git a/python/pythonmonkey/global.d.ts b/python/pythonmonkey/global.d.ts index 6b9371e5..c814db98 100644 --- a/python/pythonmonkey/global.d.ts +++ b/python/pythonmonkey/global.d.ts @@ -55,6 +55,10 @@ declare var btoa: typeof import("base64").btoa; declare var setTimeout: typeof import("timers").setTimeout; declare var clearTimeout: typeof import("timers").clearTimeout; +// Expose `URL`/`URLSearchParams` APIs +declare var URL: typeof import("url").URL; +declare var URLSearchParams: typeof import("url").URLSearchParams; + // Keep this in sync with both https://hg.mozilla.org/releases/mozilla-esr102/file/a03fde6/js/public/Promise.h#l331 // and https://github.com/nodejs/node/blob/v20.2.0/deps/v8/include/v8-promise.h#L30 declare enum PromiseState { Pending = 0, Fulfilled = 1, Rejected = 2 } From eb0523c480869eee97f1d7f6bda12389e24b8884 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 25 Aug 2023 02:57:24 +0000 Subject: [PATCH 0033/1086] feat: implement browser-style EventTarget --- .../builtin_modules/event-target.js | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 python/pythonmonkey/builtin_modules/event-target.js diff --git a/python/pythonmonkey/builtin_modules/event-target.js b/python/pythonmonkey/builtin_modules/event-target.js new file mode 100644 index 00000000..a81370f6 --- /dev/null +++ b/python/pythonmonkey/builtin_modules/event-target.js @@ -0,0 +1,111 @@ +/** + * @file event-target.js + * Implement browser-style EventTarget + * @see https://dom.spec.whatwg.org/#eventtarget + * @author Tom Tang + * @date August 2023 + */ + +/** + * The Event interface represents an event which takes place in the DOM. + * @see https://developer.mozilla.org/en-US/docs/Web/API/Event + */ +class Event +{ + /** + * The name identifying the type of the event. + */ + type = ''; + + /** + * @type {EventTarget} + */ + target = null; + + /** + * @param {string} type A string with the name of the event. + */ + constructor(type) + { + this.type = type; + } + + // TODO: to be implemented +} + +/** + * @typedef {(ev: Event) => void} EventListenerFn + * @typedef {{handleEvent(ev: Event): void}} EventListenerObj + * @typedef {EventListenerFn | EventListenerObj} EventListener + */ + +class EventTarget +{ + /** + * @readonly + * @type {{ [type: string]: Set }} + */ + #listeners = Object.create(null); + + /** + * Add an event listener that will be called whenever the specified event is delivered to the target + * @param {string} type A case-sensitive string representing the event type to listen for + * @param {EventListener | null} listener The object that receives a notification when an event of the specified type occurs + */ + addEventListener(type, listener) + { + if (!listener) + return; + + if (!Object.hasOwn(this.#listeners, type)) + this.#listeners[type] = new Set(); + + this.#listeners[type].add(listener); + } + + /** + * Remove an event listener previously registered with EventTarget.addEventListener() from the target. + * @param {string} type A string which specifies the type of event for which to remove an event listener. + * @param {EventListener} listener The event listener function of the event handler to remove from the event target. + */ + removeEventListener(type, listener) + { + if (Object.hasOwn(this.#listeners, type)) + this.#listeners[type].delete(listener); + } + + /** + * Send an Event to the target, (synchronously) invoking the affected event listeners in the appropriate order. + * @param {Event} event The Event object to dispatch + */ + dispatchEvent(event) + { + // Set the Event.target property to the current EventTarget + event.target = this; + + const type = event.type; + if (!type) + return; + + // Call "on" methods + if (typeof this['on' + type] === 'function') + this['on' + type](); + + // Call listeners registered with addEventListener() + if (!Object.hasOwn(this.#listeners, type)) + return; + for (const listener of this.#listeners[type].values()) + if (typeof listener === 'function') + listener(event); + else + listener.handleEvent(event); + } +} + +if (!globalThis.Event) + globalThis.Event = Event; +if (!globalThis.EventTarget) + globalThis.EventTarget = EventTarget; + +exports.Event = Event; +exports.EventTarget = EventTarget; From a32bb80ae211807b99674a34369441cccc28c7f8 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 25 Aug 2023 03:43:49 +0000 Subject: [PATCH 0034/1086] refactor: move DOMException into the `dom-exception` builtin_module --- .../builtin_modules/dom-exception.d.ts | 85 +++++++++++++++++++ .../builtin_modules/dom-exception.js | 12 +++ python/pythonmonkey/builtin_modules/url.js | 6 +- python/pythonmonkey/global.d.ts | 2 + 4 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 python/pythonmonkey/builtin_modules/dom-exception.d.ts create mode 100644 python/pythonmonkey/builtin_modules/dom-exception.js diff --git a/python/pythonmonkey/builtin_modules/dom-exception.d.ts b/python/pythonmonkey/builtin_modules/dom-exception.d.ts new file mode 100644 index 00000000..849c1882 --- /dev/null +++ b/python/pythonmonkey/builtin_modules/dom-exception.d.ts @@ -0,0 +1,85 @@ +/** + * @file dom-exception.d.ts + * Type definitions for DOMException + * + * @author Tom Tang + * @date August 2023 + */ + +/*! + * Copied from https://www.npmjs.com/package/@types/web + * Apache License 2.0 + */ + +/** + * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException) + */ +export interface DOMException extends Error { + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code) + */ + readonly code: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */ + readonly message: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */ + readonly name: string; + readonly INDEX_SIZE_ERR: 1; + readonly DOMSTRING_SIZE_ERR: 2; + readonly HIERARCHY_REQUEST_ERR: 3; + readonly WRONG_DOCUMENT_ERR: 4; + readonly INVALID_CHARACTER_ERR: 5; + readonly NO_DATA_ALLOWED_ERR: 6; + readonly NO_MODIFICATION_ALLOWED_ERR: 7; + readonly NOT_FOUND_ERR: 8; + readonly NOT_SUPPORTED_ERR: 9; + readonly INUSE_ATTRIBUTE_ERR: 10; + readonly INVALID_STATE_ERR: 11; + readonly SYNTAX_ERR: 12; + readonly INVALID_MODIFICATION_ERR: 13; + readonly NAMESPACE_ERR: 14; + readonly INVALID_ACCESS_ERR: 15; + readonly VALIDATION_ERR: 16; + readonly TYPE_MISMATCH_ERR: 17; + readonly SECURITY_ERR: 18; + readonly NETWORK_ERR: 19; + readonly ABORT_ERR: 20; + readonly URL_MISMATCH_ERR: 21; + readonly QUOTA_EXCEEDED_ERR: 22; + readonly TIMEOUT_ERR: 23; + readonly INVALID_NODE_TYPE_ERR: 24; + readonly DATA_CLONE_ERR: 25; +} + +export declare var DOMException: { + prototype: DOMException; + new(message?: string, name?: string): DOMException; + readonly INDEX_SIZE_ERR: 1; + readonly DOMSTRING_SIZE_ERR: 2; + readonly HIERARCHY_REQUEST_ERR: 3; + readonly WRONG_DOCUMENT_ERR: 4; + readonly INVALID_CHARACTER_ERR: 5; + readonly NO_DATA_ALLOWED_ERR: 6; + readonly NO_MODIFICATION_ALLOWED_ERR: 7; + readonly NOT_FOUND_ERR: 8; + readonly NOT_SUPPORTED_ERR: 9; + readonly INUSE_ATTRIBUTE_ERR: 10; + readonly INVALID_STATE_ERR: 11; + readonly SYNTAX_ERR: 12; + readonly INVALID_MODIFICATION_ERR: 13; + readonly NAMESPACE_ERR: 14; + readonly INVALID_ACCESS_ERR: 15; + readonly VALIDATION_ERR: 16; + readonly TYPE_MISMATCH_ERR: 17; + readonly SECURITY_ERR: 18; + readonly NETWORK_ERR: 19; + readonly ABORT_ERR: 20; + readonly URL_MISMATCH_ERR: 21; + readonly QUOTA_EXCEEDED_ERR: 22; + readonly TIMEOUT_ERR: 23; + readonly INVALID_NODE_TYPE_ERR: 24; + readonly DATA_CLONE_ERR: 25; +}; diff --git a/python/pythonmonkey/builtin_modules/dom-exception.js b/python/pythonmonkey/builtin_modules/dom-exception.js new file mode 100644 index 00000000..d6cc2971 --- /dev/null +++ b/python/pythonmonkey/builtin_modules/dom-exception.js @@ -0,0 +1,12 @@ +/** + * @file dom-exception.js + * Polyfill the DOMException interface + * + * @author Tom Tang + * @date August 2023 + */ + +// Apply polyfill from core-js +require('core-js/actual/dom-exception'); + +exports.DOMException = globalThis.DOMException; diff --git a/python/pythonmonkey/builtin_modules/url.js b/python/pythonmonkey/builtin_modules/url.js index 5692d4f6..8d13806f 100644 --- a/python/pythonmonkey/builtin_modules/url.js +++ b/python/pythonmonkey/builtin_modules/url.js @@ -7,9 +7,9 @@ */ // Apply polyfills from core-js -require("core-js/actual/dom-exception") -require("core-js/actual/url") -require("core-js/actual/url-search-params") +require('./dom-exception'); +require('core-js/actual/url'); +require('core-js/actual/url-search-params'); exports.URL = globalThis.URL; exports.URLSearchParams = globalThis.URLSearchParams; diff --git a/python/pythonmonkey/global.d.ts b/python/pythonmonkey/global.d.ts index c814db98..5e13faf9 100644 --- a/python/pythonmonkey/global.d.ts +++ b/python/pythonmonkey/global.d.ts @@ -47,6 +47,8 @@ declare function pmEval(code: string): any; // XXX: ↓↓↓ we must use "var" here declare var console: import("console").Console; +declare var DOMException: typeof import("dom-exception").DOMException; + // Expose `atob`/`btoa` as properties of the global object declare var atob: typeof import("base64").atob; declare var btoa: typeof import("base64").btoa; From 15048e078c2ba0740ff7b9a94dddc9ef8b59aa25 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 25 Aug 2023 08:21:58 +0000 Subject: [PATCH 0035/1086] feat(XHR): initial implementation of the XMLHttpRequest (XHR) API --- poetry.lock | 788 +++++++++++++++++- pyproject.toml | 1 + .../builtin_modules/XMLHttpRequest.js | 441 ++++++++++ .../builtin_modules/event-target.js | 17 + 4 files changed, 1246 insertions(+), 1 deletion(-) create mode 100644 python/pythonmonkey/builtin_modules/XMLHttpRequest.js diff --git a/poetry.lock b/poetry.lock index 62d1a77f..af352f75 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,5 +1,462 @@ # This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. +[[package]] +name = "aiodns" +version = "3.0.0" +description = "Simple DNS resolver for asyncio" +optional = false +python-versions = "*" +files = [ + {file = "aiodns-3.0.0-py3-none-any.whl", hash = "sha256:2b19bc5f97e5c936638d28e665923c093d8af2bf3aa88d35c43417fa25d136a2"}, + {file = "aiodns-3.0.0.tar.gz", hash = "sha256:946bdfabe743fceeeb093c8a010f5d1645f708a241be849e17edfb0e49e08cd6"}, +] + +[package.dependencies] +pycares = ">=4.0.0" + +[[package]] +name = "aiohttp" +version = "3.8.5" +description = "Async http client/server framework (asyncio)" +optional = false +python-versions = ">=3.6" +files = [ + {file = "aiohttp-3.8.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a94159871304770da4dd371f4291b20cac04e8c94f11bdea1c3478e557fbe0d8"}, + {file = "aiohttp-3.8.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:13bf85afc99ce6f9ee3567b04501f18f9f8dbbb2ea11ed1a2e079670403a7c84"}, + {file = "aiohttp-3.8.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2ce2ac5708501afc4847221a521f7e4b245abf5178cf5ddae9d5b3856ddb2f3a"}, + {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:96943e5dcc37a6529d18766597c491798b7eb7a61d48878611298afc1fca946c"}, + {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2ad5c3c4590bb3cc28b4382f031f3783f25ec223557124c68754a2231d989e2b"}, + {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0c413c633d0512df4dc7fd2373ec06cc6a815b7b6d6c2f208ada7e9e93a5061d"}, + {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:df72ac063b97837a80d80dec8d54c241af059cc9bb42c4de68bd5b61ceb37caa"}, + {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c48c5c0271149cfe467c0ff8eb941279fd6e3f65c9a388c984e0e6cf57538e14"}, + {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:368a42363c4d70ab52c2c6420a57f190ed3dfaca6a1b19afda8165ee16416a82"}, + {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:7607ec3ce4993464368505888af5beb446845a014bc676d349efec0e05085905"}, + {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:0d21c684808288a98914e5aaf2a7c6a3179d4df11d249799c32d1808e79503b5"}, + {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:312fcfbacc7880a8da0ae8b6abc6cc7d752e9caa0051a53d217a650b25e9a691"}, + {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ad093e823df03bb3fd37e7dec9d4670c34f9e24aeace76808fc20a507cace825"}, + {file = "aiohttp-3.8.5-cp310-cp310-win32.whl", hash = "sha256:33279701c04351a2914e1100b62b2a7fdb9a25995c4a104259f9a5ead7ed4802"}, + {file = "aiohttp-3.8.5-cp310-cp310-win_amd64.whl", hash = "sha256:6e4a280e4b975a2e7745573e3fc9c9ba0d1194a3738ce1cbaa80626cc9b4f4df"}, + {file = "aiohttp-3.8.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ae871a964e1987a943d83d6709d20ec6103ca1eaf52f7e0d36ee1b5bebb8b9b9"}, + {file = "aiohttp-3.8.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:461908b2578955045efde733719d62f2b649c404189a09a632d245b445c9c975"}, + {file = "aiohttp-3.8.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:72a860c215e26192379f57cae5ab12b168b75db8271f111019509a1196dfc780"}, + {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc14be025665dba6202b6a71cfcdb53210cc498e50068bc088076624471f8bb9"}, + {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8af740fc2711ad85f1a5c034a435782fbd5b5f8314c9a3ef071424a8158d7f6b"}, + {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:841cd8233cbd2111a0ef0a522ce016357c5e3aff8a8ce92bcfa14cef890d698f"}, + {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ed1c46fb119f1b59304b5ec89f834f07124cd23ae5b74288e364477641060ff"}, + {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84f8ae3e09a34f35c18fa57f015cc394bd1389bce02503fb30c394d04ee6b938"}, + {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:62360cb771707cb70a6fd114b9871d20d7dd2163a0feafe43fd115cfe4fe845e"}, + {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:23fb25a9f0a1ca1f24c0a371523546366bb642397c94ab45ad3aedf2941cec6a"}, + {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:b0ba0d15164eae3d878260d4c4df859bbdc6466e9e6689c344a13334f988bb53"}, + {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:5d20003b635fc6ae3f96d7260281dfaf1894fc3aa24d1888a9b2628e97c241e5"}, + {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0175d745d9e85c40dcc51c8f88c74bfbaef9e7afeeeb9d03c37977270303064c"}, + {file = "aiohttp-3.8.5-cp311-cp311-win32.whl", hash = "sha256:2e1b1e51b0774408f091d268648e3d57f7260c1682e7d3a63cb00d22d71bb945"}, + {file = "aiohttp-3.8.5-cp311-cp311-win_amd64.whl", hash = "sha256:043d2299f6dfdc92f0ac5e995dfc56668e1587cea7f9aa9d8a78a1b6554e5755"}, + {file = "aiohttp-3.8.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cae533195e8122584ec87531d6df000ad07737eaa3c81209e85c928854d2195c"}, + {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f21e83f355643c345177a5d1d8079f9f28b5133bcd154193b799d380331d5d3"}, + {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a7a75ef35f2df54ad55dbf4b73fe1da96f370e51b10c91f08b19603c64004acc"}, + {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2e2e9839e14dd5308ee773c97115f1e0a1cb1d75cbeeee9f33824fa5144c7634"}, + {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c44e65da1de4403d0576473e2344828ef9c4c6244d65cf4b75549bb46d40b8dd"}, + {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78d847e4cde6ecc19125ccbc9bfac4a7ab37c234dd88fbb3c5c524e8e14da543"}, + {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:c7a815258e5895d8900aec4454f38dca9aed71085f227537208057853f9d13f2"}, + {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:8b929b9bd7cd7c3939f8bcfffa92fae7480bd1aa425279d51a89327d600c704d"}, + {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:5db3a5b833764280ed7618393832e0853e40f3d3e9aa128ac0ba0f8278d08649"}, + {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:a0215ce6041d501f3155dc219712bc41252d0ab76474615b9700d63d4d9292af"}, + {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:fd1ed388ea7fbed22c4968dd64bab0198de60750a25fe8c0c9d4bef5abe13824"}, + {file = "aiohttp-3.8.5-cp36-cp36m-win32.whl", hash = "sha256:6e6783bcc45f397fdebc118d772103d751b54cddf5b60fbcc958382d7dd64f3e"}, + {file = "aiohttp-3.8.5-cp36-cp36m-win_amd64.whl", hash = "sha256:b5411d82cddd212644cf9360879eb5080f0d5f7d809d03262c50dad02f01421a"}, + {file = "aiohttp-3.8.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:01d4c0c874aa4ddfb8098e85d10b5e875a70adc63db91f1ae65a4b04d3344cda"}, + {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5980a746d547a6ba173fd5ee85ce9077e72d118758db05d229044b469d9029a"}, + {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2a482e6da906d5e6e653be079b29bc173a48e381600161c9932d89dfae5942ef"}, + {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80bd372b8d0715c66c974cf57fe363621a02f359f1ec81cba97366948c7fc873"}, + {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1161b345c0a444ebcf46bf0a740ba5dcf50612fd3d0528883fdc0eff578006a"}, + {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cd56db019015b6acfaaf92e1ac40eb8434847d9bf88b4be4efe5bfd260aee692"}, + {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:153c2549f6c004d2754cc60603d4668899c9895b8a89397444a9c4efa282aaf4"}, + {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4a01951fabc4ce26ab791da5f3f24dca6d9a6f24121746eb19756416ff2d881b"}, + {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bfb9162dcf01f615462b995a516ba03e769de0789de1cadc0f916265c257e5d8"}, + {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:7dde0009408969a43b04c16cbbe252c4f5ef4574ac226bc8815cd7342d2028b6"}, + {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:4149d34c32f9638f38f544b3977a4c24052042affa895352d3636fa8bffd030a"}, + {file = "aiohttp-3.8.5-cp37-cp37m-win32.whl", hash = "sha256:68c5a82c8779bdfc6367c967a4a1b2aa52cd3595388bf5961a62158ee8a59e22"}, + {file = "aiohttp-3.8.5-cp37-cp37m-win_amd64.whl", hash = "sha256:2cf57fb50be5f52bda004b8893e63b48530ed9f0d6c96c84620dc92fe3cd9b9d"}, + {file = "aiohttp-3.8.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:eca4bf3734c541dc4f374ad6010a68ff6c6748f00451707f39857f429ca36ced"}, + {file = "aiohttp-3.8.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1274477e4c71ce8cfe6c1ec2f806d57c015ebf84d83373676036e256bc55d690"}, + {file = "aiohttp-3.8.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:28c543e54710d6158fc6f439296c7865b29e0b616629767e685a7185fab4a6b9"}, + {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:910bec0c49637d213f5d9877105d26e0c4a4de2f8b1b29405ff37e9fc0ad52b8"}, + {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5443910d662db951b2e58eb70b0fbe6b6e2ae613477129a5805d0b66c54b6cb7"}, + {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2e460be6978fc24e3df83193dc0cc4de46c9909ed92dd47d349a452ef49325b7"}, + {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb1558def481d84f03b45888473fc5a1f35747b5f334ef4e7a571bc0dfcb11f8"}, + {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:34dd0c107799dcbbf7d48b53be761a013c0adf5571bf50c4ecad5643fe9cfcd0"}, + {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:aa1990247f02a54185dc0dff92a6904521172a22664c863a03ff64c42f9b5410"}, + {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:0e584a10f204a617d71d359fe383406305a4b595b333721fa50b867b4a0a1548"}, + {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:a3cf433f127efa43fee6b90ea4c6edf6c4a17109d1d037d1a52abec84d8f2e42"}, + {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:c11f5b099adafb18e65c2c997d57108b5bbeaa9eeee64a84302c0978b1ec948b"}, + {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:84de26ddf621d7ac4c975dbea4c945860e08cccde492269db4e1538a6a6f3c35"}, + {file = "aiohttp-3.8.5-cp38-cp38-win32.whl", hash = "sha256:ab88bafedc57dd0aab55fa728ea10c1911f7e4d8b43e1d838a1739f33712921c"}, + {file = "aiohttp-3.8.5-cp38-cp38-win_amd64.whl", hash = "sha256:5798a9aad1879f626589f3df0f8b79b3608a92e9beab10e5fda02c8a2c60db2e"}, + {file = "aiohttp-3.8.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a6ce61195c6a19c785df04e71a4537e29eaa2c50fe745b732aa937c0c77169f3"}, + {file = "aiohttp-3.8.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:773dd01706d4db536335fcfae6ea2440a70ceb03dd3e7378f3e815b03c97ab51"}, + {file = "aiohttp-3.8.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f83a552443a526ea38d064588613aca983d0ee0038801bc93c0c916428310c28"}, + {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f7372f7341fcc16f57b2caded43e81ddd18df53320b6f9f042acad41f8e049a"}, + {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ea353162f249c8097ea63c2169dd1aa55de1e8fecbe63412a9bc50816e87b761"}, + {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e5d47ae48db0b2dcf70bc8a3bc72b3de86e2a590fc299fdbbb15af320d2659de"}, + {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d827176898a2b0b09694fbd1088c7a31836d1a505c243811c87ae53a3f6273c1"}, + {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3562b06567c06439d8b447037bb655ef69786c590b1de86c7ab81efe1c9c15d8"}, + {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4e874cbf8caf8959d2adf572a78bba17cb0e9d7e51bb83d86a3697b686a0ab4d"}, + {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6809a00deaf3810e38c628e9a33271892f815b853605a936e2e9e5129762356c"}, + {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:33776e945d89b29251b33a7e7d006ce86447b2cfd66db5e5ded4e5cd0340585c"}, + {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:eaeed7abfb5d64c539e2db173f63631455f1196c37d9d8d873fc316470dfbacd"}, + {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:e91d635961bec2d8f19dfeb41a539eb94bd073f075ca6dae6c8dc0ee89ad6f91"}, + {file = "aiohttp-3.8.5-cp39-cp39-win32.whl", hash = "sha256:00ad4b6f185ec67f3e6562e8a1d2b69660be43070bd0ef6fcec5211154c7df67"}, + {file = "aiohttp-3.8.5-cp39-cp39-win_amd64.whl", hash = "sha256:c0a9034379a37ae42dea7ac1e048352d96286626251862e448933c0f59cbd79c"}, + {file = "aiohttp-3.8.5.tar.gz", hash = "sha256:b9552ec52cc147dbf1944ac7ac98af7602e51ea2dcd076ed194ca3c0d1c7d0bc"}, +] + +[package.dependencies] +aiodns = {version = "*", optional = true, markers = "extra == \"speedups\""} +aiosignal = ">=1.1.2" +async-timeout = ">=4.0.0a3,<5.0" +attrs = ">=17.3.0" +Brotli = {version = "*", optional = true, markers = "extra == \"speedups\""} +cchardet = {version = "*", optional = true, markers = "python_version < \"3.10\" and extra == \"speedups\""} +charset-normalizer = ">=2.0,<4.0" +frozenlist = ">=1.1.1" +multidict = ">=4.5,<7.0" +yarl = ">=1.0,<2.0" + +[package.extras] +speedups = ["Brotli", "aiodns", "cchardet"] + +[[package]] +name = "aiosignal" +version = "1.3.1" +description = "aiosignal: a list of registered asynchronous callbacks" +optional = false +python-versions = ">=3.7" +files = [ + {file = "aiosignal-1.3.1-py3-none-any.whl", hash = "sha256:f8376fb07dd1e86a584e4fcdec80b36b7f81aac666ebc724e2c090300dd83b17"}, + {file = "aiosignal-1.3.1.tar.gz", hash = "sha256:54cd96e15e1649b75d6c87526a6ff0b6c1b0dd3459f43d9ca11d48c339b68cfc"}, +] + +[package.dependencies] +frozenlist = ">=1.1.0" + +[[package]] +name = "async-timeout" +version = "4.0.3" +description = "Timeout context manager for asyncio programs" +optional = false +python-versions = ">=3.7" +files = [ + {file = "async-timeout-4.0.3.tar.gz", hash = "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f"}, + {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, +] + +[[package]] +name = "attrs" +version = "23.1.0" +description = "Classes Without Boilerplate" +optional = false +python-versions = ">=3.7" +files = [ + {file = "attrs-23.1.0-py3-none-any.whl", hash = "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04"}, + {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, +] + +[package.extras] +cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] +dev = ["attrs[docs,tests]", "pre-commit"] +docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] +tests = ["attrs[tests-no-zope]", "zope-interface"] +tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] + +[[package]] +name = "brotli" +version = "1.0.9" +description = "Python bindings for the Brotli compression library" +optional = false +python-versions = "*" +files = [ + {file = "Brotli-1.0.9-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:268fe94547ba25b58ebc724680609c8ee3e5a843202e9a381f6f9c5e8bdb5c70"}, + {file = "Brotli-1.0.9-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:c2415d9d082152460f2bd4e382a1e85aed233abc92db5a3880da2257dc7daf7b"}, + {file = "Brotli-1.0.9-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:5913a1177fc36e30fcf6dc868ce23b0453952c78c04c266d3149b3d39e1410d6"}, + {file = "Brotli-1.0.9-cp27-cp27m-win32.whl", hash = "sha256:afde17ae04d90fbe53afb628f7f2d4ca022797aa093e809de5c3cf276f61bbfa"}, + {file = "Brotli-1.0.9-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:7cb81373984cc0e4682f31bc3d6be9026006d96eecd07ea49aafb06897746452"}, + {file = "Brotli-1.0.9-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:db844eb158a87ccab83e868a762ea8024ae27337fc7ddcbfcddd157f841fdfe7"}, + {file = "Brotli-1.0.9-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:9744a863b489c79a73aba014df554b0e7a0fc44ef3f8a0ef2a52919c7d155031"}, + {file = "Brotli-1.0.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a72661af47119a80d82fa583b554095308d6a4c356b2a554fdc2799bc19f2a43"}, + {file = "Brotli-1.0.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ee83d3e3a024a9618e5be64648d6d11c37047ac48adff25f12fa4226cf23d1c"}, + {file = "Brotli-1.0.9-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:19598ecddd8a212aedb1ffa15763dd52a388518c4550e615aed88dc3753c0f0c"}, + {file = "Brotli-1.0.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:44bb8ff420c1d19d91d79d8c3574b8954288bdff0273bf788954064d260d7ab0"}, + {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e23281b9a08ec338469268f98f194658abfb13658ee98e2b7f85ee9dd06caa91"}, + {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:3496fc835370da351d37cada4cf744039616a6db7d13c430035e901443a34daa"}, + {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b83bb06a0192cccf1eb8d0a28672a1b79c74c3a8a5f2619625aeb6f28b3a82bb"}, + {file = "Brotli-1.0.9-cp310-cp310-win32.whl", hash = "sha256:26d168aac4aaec9a4394221240e8a5436b5634adc3cd1cdf637f6645cecbf181"}, + {file = "Brotli-1.0.9-cp310-cp310-win_amd64.whl", hash = "sha256:622a231b08899c864eb87e85f81c75e7b9ce05b001e59bbfbf43d4a71f5f32b2"}, + {file = "Brotli-1.0.9-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:cc0283a406774f465fb45ec7efb66857c09ffefbe49ec20b7882eff6d3c86d3a"}, + {file = "Brotli-1.0.9-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:11d3283d89af7033236fa4e73ec2cbe743d4f6a81d41bd234f24bf63dde979df"}, + {file = "Brotli-1.0.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c1306004d49b84bd0c4f90457c6f57ad109f5cc6067a9664e12b7b79a9948ad"}, + {file = "Brotli-1.0.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1375b5d17d6145c798661b67e4ae9d5496920d9265e2f00f1c2c0b5ae91fbde"}, + {file = "Brotli-1.0.9-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cab1b5964b39607a66adbba01f1c12df2e55ac36c81ec6ed44f2fca44178bf1a"}, + {file = "Brotli-1.0.9-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:8ed6a5b3d23ecc00ea02e1ed8e0ff9a08f4fc87a1f58a2530e71c0f48adf882f"}, + {file = "Brotli-1.0.9-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:cb02ed34557afde2d2da68194d12f5719ee96cfb2eacc886352cb73e3808fc5d"}, + {file = "Brotli-1.0.9-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:b3523f51818e8f16599613edddb1ff924eeb4b53ab7e7197f85cbc321cdca32f"}, + {file = "Brotli-1.0.9-cp311-cp311-win32.whl", hash = "sha256:ba72d37e2a924717990f4d7482e8ac88e2ef43fb95491eb6e0d124d77d2a150d"}, + {file = "Brotli-1.0.9-cp311-cp311-win_amd64.whl", hash = "sha256:3ffaadcaeafe9d30a7e4e1e97ad727e4f5610b9fa2f7551998471e3736738679"}, + {file = "Brotli-1.0.9-cp35-cp35m-macosx_10_6_intel.whl", hash = "sha256:c83aa123d56f2e060644427a882a36b3c12db93727ad7a7b9efd7d7f3e9cc2c4"}, + {file = "Brotli-1.0.9-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:6b2ae9f5f67f89aade1fab0f7fd8f2832501311c363a21579d02defa844d9296"}, + {file = "Brotli-1.0.9-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:68715970f16b6e92c574c30747c95cf8cf62804569647386ff032195dc89a430"}, + {file = "Brotli-1.0.9-cp35-cp35m-win32.whl", hash = "sha256:defed7ea5f218a9f2336301e6fd379f55c655bea65ba2476346340a0ce6f74a1"}, + {file = "Brotli-1.0.9-cp35-cp35m-win_amd64.whl", hash = "sha256:88c63a1b55f352b02c6ffd24b15ead9fc0e8bf781dbe070213039324922a2eea"}, + {file = "Brotli-1.0.9-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:503fa6af7da9f4b5780bb7e4cbe0c639b010f12be85d02c99452825dd0feef3f"}, + {file = "Brotli-1.0.9-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:40d15c79f42e0a2c72892bf407979febd9cf91f36f495ffb333d1d04cebb34e4"}, + {file = "Brotli-1.0.9-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:93130612b837103e15ac3f9cbacb4613f9e348b58b3aad53721d92e57f96d46a"}, + {file = "Brotli-1.0.9-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87fdccbb6bb589095f413b1e05734ba492c962b4a45a13ff3408fa44ffe6479b"}, + {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:6d847b14f7ea89f6ad3c9e3901d1bc4835f6b390a9c71df999b0162d9bb1e20f"}, + {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:495ba7e49c2db22b046a53b469bbecea802efce200dffb69b93dd47397edc9b6"}, + {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:4688c1e42968ba52e57d8670ad2306fe92e0169c6f3af0089be75bbac0c64a3b"}, + {file = "Brotli-1.0.9-cp36-cp36m-win32.whl", hash = "sha256:61a7ee1f13ab913897dac7da44a73c6d44d48a4adff42a5701e3239791c96e14"}, + {file = "Brotli-1.0.9-cp36-cp36m-win_amd64.whl", hash = "sha256:1c48472a6ba3b113452355b9af0a60da5c2ae60477f8feda8346f8fd48e3e87c"}, + {file = "Brotli-1.0.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:3b78a24b5fd13c03ee2b7b86290ed20efdc95da75a3557cc06811764d5ad1126"}, + {file = "Brotli-1.0.9-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:9d12cf2851759b8de8ca5fde36a59c08210a97ffca0eb94c532ce7b17c6a3d1d"}, + {file = "Brotli-1.0.9-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:6c772d6c0a79ac0f414a9f8947cc407e119b8598de7621f39cacadae3cf57d12"}, + {file = "Brotli-1.0.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29d1d350178e5225397e28ea1b7aca3648fcbab546d20e7475805437bfb0a130"}, + {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7bbff90b63328013e1e8cb50650ae0b9bac54ffb4be6104378490193cd60f85a"}, + {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:ec1947eabbaf8e0531e8e899fc1d9876c179fc518989461f5d24e2223395a9e3"}, + {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:12effe280b8ebfd389022aa65114e30407540ccb89b177d3fbc9a4f177c4bd5d"}, + {file = "Brotli-1.0.9-cp37-cp37m-win32.whl", hash = "sha256:f909bbbc433048b499cb9db9e713b5d8d949e8c109a2a548502fb9aa8630f0b1"}, + {file = "Brotli-1.0.9-cp37-cp37m-win_amd64.whl", hash = "sha256:97f715cf371b16ac88b8c19da00029804e20e25f30d80203417255d239f228b5"}, + {file = "Brotli-1.0.9-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e16eb9541f3dd1a3e92b89005e37b1257b157b7256df0e36bd7b33b50be73bcb"}, + {file = "Brotli-1.0.9-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:160c78292e98d21e73a4cc7f76a234390e516afcd982fa17e1422f7c6a9ce9c8"}, + {file = "Brotli-1.0.9-cp38-cp38-manylinux1_i686.whl", hash = "sha256:b663f1e02de5d0573610756398e44c130add0eb9a3fc912a09665332942a2efb"}, + {file = "Brotli-1.0.9-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:5b6ef7d9f9c38292df3690fe3e302b5b530999fa90014853dcd0d6902fb59f26"}, + {file = "Brotli-1.0.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8a674ac10e0a87b683f4fa2b6fa41090edfd686a6524bd8dedbd6138b309175c"}, + {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e2d9e1cbc1b25e22000328702b014227737756f4b5bf5c485ac1d8091ada078b"}, + {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:b336c5e9cf03c7be40c47b5fd694c43c9f1358a80ba384a21969e0b4e66a9b17"}, + {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:85f7912459c67eaab2fb854ed2bc1cc25772b300545fe7ed2dc03954da638649"}, + {file = "Brotli-1.0.9-cp38-cp38-win32.whl", hash = "sha256:35a3edbe18e876e596553c4007a087f8bcfd538f19bc116917b3c7522fca0429"}, + {file = "Brotli-1.0.9-cp38-cp38-win_amd64.whl", hash = "sha256:269a5743a393c65db46a7bb982644c67ecba4b8d91b392403ad8a861ba6f495f"}, + {file = "Brotli-1.0.9-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2aad0e0baa04517741c9bb5b07586c642302e5fb3e75319cb62087bd0995ab19"}, + {file = "Brotli-1.0.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5cb1e18167792d7d21e21365d7650b72d5081ed476123ff7b8cac7f45189c0c7"}, + {file = "Brotli-1.0.9-cp39-cp39-manylinux1_i686.whl", hash = "sha256:16d528a45c2e1909c2798f27f7bf0a3feec1dc9e50948e738b961618e38b6a7b"}, + {file = "Brotli-1.0.9-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:56d027eace784738457437df7331965473f2c0da2c70e1a1f6fdbae5402e0389"}, + {file = "Brotli-1.0.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9bf919756d25e4114ace16a8ce91eb340eb57a08e2c6950c3cebcbe3dff2a5e7"}, + {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e4c4e92c14a57c9bd4cb4be678c25369bf7a092d55fd0866f759e425b9660806"}, + {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:e48f4234f2469ed012a98f4b7874e7f7e173c167bed4934912a29e03167cf6b1"}, + {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9ed4c92a0665002ff8ea852353aeb60d9141eb04109e88928026d3c8a9e5433c"}, + {file = "Brotli-1.0.9-cp39-cp39-win32.whl", hash = "sha256:cfc391f4429ee0a9370aa93d812a52e1fee0f37a81861f4fdd1f4fb28e8547c3"}, + {file = "Brotli-1.0.9-cp39-cp39-win_amd64.whl", hash = "sha256:854c33dad5ba0fbd6ab69185fec8dab89e13cda6b7d191ba111987df74f38761"}, + {file = "Brotli-1.0.9-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9749a124280a0ada4187a6cfd1ffd35c350fb3af79c706589d98e088c5044267"}, + {file = "Brotli-1.0.9-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:73fd30d4ce0ea48010564ccee1a26bfe39323fde05cb34b5863455629db61dc7"}, + {file = "Brotli-1.0.9-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:02177603aaca36e1fd21b091cb742bb3b305a569e2402f1ca38af471777fb019"}, + {file = "Brotli-1.0.9-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:76ffebb907bec09ff511bb3acc077695e2c32bc2142819491579a695f77ffd4d"}, + {file = "Brotli-1.0.9-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:b43775532a5904bc938f9c15b77c613cb6ad6fb30990f3b0afaea82797a402d8"}, + {file = "Brotli-1.0.9-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:5bf37a08493232fbb0f8229f1824b366c2fc1d02d64e7e918af40acd15f3e337"}, + {file = "Brotli-1.0.9-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:330e3f10cd01da535c70d09c4283ba2df5fb78e915bea0a28becad6e2ac010be"}, + {file = "Brotli-1.0.9-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:e1abbeef02962596548382e393f56e4c94acd286bd0c5afba756cffc33670e8a"}, + {file = "Brotli-1.0.9-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:3148362937217b7072cf80a2dcc007f09bb5ecb96dae4617316638194113d5be"}, + {file = "Brotli-1.0.9-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:336b40348269f9b91268378de5ff44dc6fbaa2268194f85177b53463d313842a"}, + {file = "Brotli-1.0.9-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3b8b09a16a1950b9ef495a0f8b9d0a87599a9d1f179e2d4ac014b2ec831f87e7"}, + {file = "Brotli-1.0.9-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:c8e521a0ce7cf690ca84b8cc2272ddaf9d8a50294fd086da67e517439614c755"}, + {file = "Brotli-1.0.9.zip", hash = "sha256:4d1b810aa0ed773f81dceda2cc7b403d01057458730e309856356d4ef4188438"}, +] + +[[package]] +name = "cchardet" +version = "2.1.7" +description = "cChardet is high speed universal character encoding detector." +optional = false +python-versions = "*" +files = [ + {file = "cchardet-2.1.7-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:c6f70139aaf47ffb94d89db603af849b82efdf756f187cdd3e566e30976c519f"}, + {file = "cchardet-2.1.7-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:5a25f9577e9bebe1a085eec2d6fdd72b7a9dd680811bba652ea6090fb2ff472f"}, + {file = "cchardet-2.1.7-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:6b6397d8a32b976a333bdae060febd39ad5479817fabf489e5596a588ad05133"}, + {file = "cchardet-2.1.7-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:228d2533987c450f39acf7548f474dd6814c446e9d6bd228e8f1d9a2d210f10b"}, + {file = "cchardet-2.1.7-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:54341e7e1ba9dc0add4c9d23b48d3a94e2733065c13920e85895f944596f6150"}, + {file = "cchardet-2.1.7-cp36-cp36m-win32.whl", hash = "sha256:eee4f5403dc3a37a1ca9ab87db32b48dc7e190ef84601068f45397144427cc5e"}, + {file = "cchardet-2.1.7-cp36-cp36m-win_amd64.whl", hash = "sha256:f86e0566cb61dc4397297696a4a1b30f6391b50bc52b4f073507a48466b6255a"}, + {file = "cchardet-2.1.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:302aa443ae2526755d412c9631136bdcd1374acd08e34f527447f06f3c2ddb98"}, + {file = "cchardet-2.1.7-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:70eeae8aaf61192e9b247cf28969faef00578becd2602526ecd8ae7600d25e0e"}, + {file = "cchardet-2.1.7-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:a39526c1c526843965cec589a6f6b7c2ab07e3e56dc09a7f77a2be6a6afa4636"}, + {file = "cchardet-2.1.7-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:b154effa12886e9c18555dfc41a110f601f08d69a71809c8d908be4b1ab7314f"}, + {file = "cchardet-2.1.7-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:ec3eb5a9c475208cf52423524dcaf713c394393e18902e861f983c38eeb77f18"}, + {file = "cchardet-2.1.7-cp37-cp37m-win32.whl", hash = "sha256:50ad671e8d6c886496db62c3bd68b8d55060688c655873aa4ce25ca6105409a1"}, + {file = "cchardet-2.1.7-cp37-cp37m-win_amd64.whl", hash = "sha256:54d0b26fd0cd4099f08fb9c167600f3e83619abefeaa68ad823cc8ac1f7bcc0c"}, + {file = "cchardet-2.1.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b59ddc615883835e03c26f81d5fc3671fab2d32035c87f50862de0da7d7db535"}, + {file = "cchardet-2.1.7-cp38-cp38-manylinux1_i686.whl", hash = "sha256:27a9ba87c9f99e0618e1d3081189b1217a7d110e5c5597b0b7b7c3fedd1c340a"}, + {file = "cchardet-2.1.7-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:90086e5645f8a1801350f4cc6cb5d5bf12d3fa943811bb08667744ec1ecc9ccd"}, + {file = "cchardet-2.1.7-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:45456c59ec349b29628a3c6bfb86d818ec3a6fbb7eb72de4ff3bd4713681c0e3"}, + {file = "cchardet-2.1.7-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:f16517f3697569822c6d09671217fdeab61dfebc7acb5068634d6b0728b86c0b"}, + {file = "cchardet-2.1.7-cp38-cp38-win32.whl", hash = "sha256:0b859069bbb9d27c78a2c9eb997e6f4b738db2d7039a03f8792b4058d61d1109"}, + {file = "cchardet-2.1.7-cp38-cp38-win_amd64.whl", hash = "sha256:273699c4e5cd75377776501b72a7b291a988c6eec259c29505094553ee505597"}, + {file = "cchardet-2.1.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:48ba829badef61441e08805cfa474ccd2774be2ff44b34898f5854168c596d4d"}, + {file = "cchardet-2.1.7-cp39-cp39-manylinux1_i686.whl", hash = "sha256:bd7f262f41fd9caf5a5f09207a55861a67af6ad5c66612043ed0f81c58cdf376"}, + {file = "cchardet-2.1.7-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:fdac1e4366d0579fff056d1280b8dc6348be964fda8ebb627c0269e097ab37fa"}, + {file = "cchardet-2.1.7-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:80e6faae75ecb9be04a7b258dc4750d459529debb6b8dee024745b7b5a949a34"}, + {file = "cchardet-2.1.7-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:c96aee9ebd1147400e608a3eff97c44f49811f8904e5a43069d55603ac4d8c97"}, + {file = "cchardet-2.1.7-cp39-cp39-win32.whl", hash = "sha256:2309ff8fc652b0fc3c0cff5dbb172530c7abb92fe9ba2417c9c0bcf688463c1c"}, + {file = "cchardet-2.1.7-cp39-cp39-win_amd64.whl", hash = "sha256:24974b3e40fee9e7557bb352be625c39ec6f50bc2053f44a3d1191db70b51675"}, + {file = "cchardet-2.1.7.tar.gz", hash = "sha256:c428b6336545053c2589f6caf24ea32276c6664cb86db817e03a94c60afa0eaf"}, +] + +[[package]] +name = "cffi" +version = "1.15.1" +description = "Foreign Function Interface for Python calling C code." +optional = false +python-versions = "*" +files = [ + {file = "cffi-1.15.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2"}, + {file = "cffi-1.15.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2"}, + {file = "cffi-1.15.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914"}, + {file = "cffi-1.15.1-cp27-cp27m-win32.whl", hash = "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3"}, + {file = "cffi-1.15.1-cp27-cp27m-win_amd64.whl", hash = "sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e"}, + {file = "cffi-1.15.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162"}, + {file = "cffi-1.15.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b"}, + {file = "cffi-1.15.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21"}, + {file = "cffi-1.15.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4"}, + {file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01"}, + {file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e"}, + {file = "cffi-1.15.1-cp310-cp310-win32.whl", hash = "sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2"}, + {file = "cffi-1.15.1-cp310-cp310-win_amd64.whl", hash = "sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d"}, + {file = "cffi-1.15.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac"}, + {file = "cffi-1.15.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83"}, + {file = "cffi-1.15.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9"}, + {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c"}, + {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325"}, + {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c"}, + {file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef"}, + {file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8"}, + {file = "cffi-1.15.1-cp311-cp311-win32.whl", hash = "sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d"}, + {file = "cffi-1.15.1-cp311-cp311-win_amd64.whl", hash = "sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104"}, + {file = "cffi-1.15.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e"}, + {file = "cffi-1.15.1-cp36-cp36m-win32.whl", hash = "sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf"}, + {file = "cffi-1.15.1-cp36-cp36m-win_amd64.whl", hash = "sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497"}, + {file = "cffi-1.15.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426"}, + {file = "cffi-1.15.1-cp37-cp37m-win32.whl", hash = "sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9"}, + {file = "cffi-1.15.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045"}, + {file = "cffi-1.15.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192"}, + {file = "cffi-1.15.1-cp38-cp38-win32.whl", hash = "sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314"}, + {file = "cffi-1.15.1-cp38-cp38-win_amd64.whl", hash = "sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5"}, + {file = "cffi-1.15.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585"}, + {file = "cffi-1.15.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27"}, + {file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76"}, + {file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3"}, + {file = "cffi-1.15.1-cp39-cp39-win32.whl", hash = "sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee"}, + {file = "cffi-1.15.1-cp39-cp39-win_amd64.whl", hash = "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c"}, + {file = "cffi-1.15.1.tar.gz", hash = "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9"}, +] + +[package.dependencies] +pycparser = "*" + +[[package]] +name = "charset-normalizer" +version = "3.2.0" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +optional = false +python-versions = ">=3.7.0" +files = [ + {file = "charset-normalizer-3.2.0.tar.gz", hash = "sha256:3bb3d25a8e6c0aedd251753a79ae98a093c7e7b471faa3aa9a93a81431987ace"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0b87549028f680ca955556e3bd57013ab47474c3124dc069faa0b6545b6c9710"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7c70087bfee18a42b4040bb9ec1ca15a08242cf5867c58726530bdf3945672ed"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a103b3a7069b62f5d4890ae1b8f0597618f628b286b03d4bc9195230b154bfa9"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94aea8eff76ee6d1cdacb07dd2123a68283cb5569e0250feab1240058f53b623"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:db901e2ac34c931d73054d9797383d0f8009991e723dab15109740a63e7f902a"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b0dac0ff919ba34d4df1b6131f59ce95b08b9065233446be7e459f95554c0dc8"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:193cbc708ea3aca45e7221ae58f0fd63f933753a9bfb498a3b474878f12caaad"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09393e1b2a9461950b1c9a45d5fd251dc7c6f228acab64da1c9c0165d9c7765c"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:baacc6aee0b2ef6f3d308e197b5d7a81c0e70b06beae1f1fcacffdbd124fe0e3"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:bf420121d4c8dce6b889f0e8e4ec0ca34b7f40186203f06a946fa0276ba54029"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:c04a46716adde8d927adb9457bbe39cf473e1e2c2f5d0a16ceb837e5d841ad4f"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:aaf63899c94de41fe3cf934601b0f7ccb6b428c6e4eeb80da72c58eab077b19a"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d62e51710986674142526ab9f78663ca2b0726066ae26b78b22e0f5e571238dd"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-win32.whl", hash = "sha256:04e57ab9fbf9607b77f7d057974694b4f6b142da9ed4a199859d9d4d5c63fe96"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:48021783bdf96e3d6de03a6e39a1171ed5bd7e8bb93fc84cc649d11490f87cea"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4957669ef390f0e6719db3613ab3a7631e68424604a7b448f079bee145da6e09"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:46fb8c61d794b78ec7134a715a3e564aafc8f6b5e338417cb19fe9f57a5a9bf2"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f779d3ad205f108d14e99bb3859aa7dd8e9c68874617c72354d7ecaec2a054ac"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f25c229a6ba38a35ae6e25ca1264621cc25d4d38dca2942a7fce0b67a4efe918"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2efb1bd13885392adfda4614c33d3b68dee4921fd0ac1d3988f8cbb7d589e72a"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f30b48dd7fa1474554b0b0f3fdfdd4c13b5c737a3c6284d3cdc424ec0ffff3a"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:246de67b99b6851627d945db38147d1b209a899311b1305dd84916f2b88526c6"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9bd9b3b31adcb054116447ea22caa61a285d92e94d710aa5ec97992ff5eb7cf3"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:8c2f5e83493748286002f9369f3e6607c565a6a90425a3a1fef5ae32a36d749d"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3170c9399da12c9dc66366e9d14da8bf7147e1e9d9ea566067bbce7bb74bd9c2"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:7a4826ad2bd6b07ca615c74ab91f32f6c96d08f6fcc3902ceeedaec8cdc3bcd6"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:3b1613dd5aee995ec6d4c69f00378bbd07614702a315a2cf6c1d21461fe17c23"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9e608aafdb55eb9f255034709e20d5a83b6d60c054df0802fa9c9883d0a937aa"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-win32.whl", hash = "sha256:f2a1d0fd4242bd8643ce6f98927cf9c04540af6efa92323e9d3124f57727bfc1"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:681eb3d7e02e3c3655d1b16059fbfb605ac464c834a0c629048a30fad2b27489"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c57921cda3a80d0f2b8aec7e25c8aa14479ea92b5b51b6876d975d925a2ea346"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41b25eaa7d15909cf3ac4c96088c1f266a9a93ec44f87f1d13d4a0e86c81b982"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f058f6963fd82eb143c692cecdc89e075fa0828db2e5b291070485390b2f1c9c"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a7647ebdfb9682b7bb97e2a5e7cb6ae735b1c25008a70b906aecca294ee96cf4"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eef9df1eefada2c09a5e7a40991b9fc6ac6ef20b1372abd48d2794a316dc0449"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e03b8895a6990c9ab2cdcd0f2fe44088ca1c65ae592b8f795c3294af00a461c3"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:ee4006268ed33370957f55bf2e6f4d263eaf4dc3cfc473d1d90baff6ed36ce4a"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c4983bf937209c57240cff65906b18bb35e64ae872da6a0db937d7b4af845dd7"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:3bb7fda7260735efe66d5107fb7e6af6a7c04c7fce9b2514e04b7a74b06bf5dd"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:72814c01533f51d68702802d74f77ea026b5ec52793c791e2da806a3844a46c3"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:70c610f6cbe4b9fce272c407dd9d07e33e6bf7b4aa1b7ffb6f6ded8e634e3592"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-win32.whl", hash = "sha256:a401b4598e5d3f4a9a811f3daf42ee2291790c7f9d74b18d75d6e21dda98a1a1"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-win_amd64.whl", hash = "sha256:c0b21078a4b56965e2b12f247467b234734491897e99c1d51cee628da9786959"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:95eb302ff792e12aba9a8b8f8474ab229a83c103d74a750ec0bd1c1eea32e669"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1a100c6d595a7f316f1b6f01d20815d916e75ff98c27a01ae817439ea7726329"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6339d047dab2780cc6220f46306628e04d9750f02f983ddb37439ca47ced7149"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4b749b9cc6ee664a3300bb3a273c1ca8068c46be705b6c31cf5d276f8628a94"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a38856a971c602f98472050165cea2cdc97709240373041b69030be15047691f"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f87f746ee241d30d6ed93969de31e5ffd09a2961a051e60ae6bddde9ec3583aa"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89f1b185a01fe560bc8ae5f619e924407efca2191b56ce749ec84982fc59a32a"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1c8a2f4c69e08e89632defbfabec2feb8a8d99edc9f89ce33c4b9e36ab63037"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2f4ac36d8e2b4cc1aa71df3dd84ff8efbe3bfb97ac41242fbcfc053c67434f46"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a386ebe437176aab38c041de1260cd3ea459c6ce5263594399880bbc398225b2"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:ccd16eb18a849fd8dcb23e23380e2f0a354e8daa0c984b8a732d9cfaba3a776d"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:e6a5bf2cba5ae1bb80b154ed68a3cfa2fa00fde979a7f50d6598d3e17d9ac20c"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:45de3f87179c1823e6d9e32156fb14c1927fcc9aba21433f088fdfb555b77c10"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-win32.whl", hash = "sha256:1000fba1057b92a65daec275aec30586c3de2401ccdcd41f8a5c1e2c87078706"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:8b2c760cfc7042b27ebdb4a43a4453bd829a5742503599144d54a032c5dc7e9e"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:855eafa5d5a2034b4621c74925d89c5efef61418570e5ef9b37717d9c796419c"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:203f0c8871d5a7987be20c72442488a0b8cfd0f43b7973771640fc593f56321f"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e857a2232ba53ae940d3456f7533ce6ca98b81917d47adc3c7fd55dad8fab858"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e86d77b090dbddbe78867a0275cb4df08ea195e660f1f7f13435a4649e954e5"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c4fb39a81950ec280984b3a44f5bd12819953dc5fa3a7e6fa7a80db5ee853952"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2dee8e57f052ef5353cf608e0b4c871aee320dd1b87d351c28764fc0ca55f9f4"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8700f06d0ce6f128de3ccdbc1acaea1ee264d2caa9ca05daaf492fde7c2a7200"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1920d4ff15ce893210c1f0c0e9d19bfbecb7983c76b33f046c13a8ffbd570252"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c1c76a1743432b4b60ab3358c937a3fe1341c828ae6194108a94c69028247f22"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f7560358a6811e52e9c4d142d497f1a6e10103d3a6881f18d04dbce3729c0e2c"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:c8063cf17b19661471ecbdb3df1c84f24ad2e389e326ccaf89e3fb2484d8dd7e"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:cd6dbe0238f7743d0efe563ab46294f54f9bc8f4b9bcf57c3c666cc5bc9d1299"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1249cbbf3d3b04902ff081ffbb33ce3377fa6e4c7356f759f3cd076cc138d020"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-win32.whl", hash = "sha256:6c409c0deba34f147f77efaa67b8e4bb83d2f11c8806405f76397ae5b8c0d1c9"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:7095f6fbfaa55defb6b733cfeb14efaae7a29f0b59d8cf213be4e7ca0b857b80"}, + {file = "charset_normalizer-3.2.0-py3-none-any.whl", hash = "sha256:8e098148dd37b4ce3baca71fb394c81dc5d9c7728c95df695d2dca218edf40e6"}, +] + [[package]] name = "colorama" version = "0.4.6" @@ -25,6 +482,87 @@ files = [ [package.extras] test = ["pytest (>=6)"] +[[package]] +name = "frozenlist" +version = "1.4.0" +description = "A list-like structure which implements collections.abc.MutableSequence" +optional = false +python-versions = ">=3.8" +files = [ + {file = "frozenlist-1.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:764226ceef3125e53ea2cb275000e309c0aa5464d43bd72abd661e27fffc26ab"}, + {file = "frozenlist-1.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d6484756b12f40003c6128bfcc3fa9f0d49a687e171186c2d85ec82e3758c559"}, + {file = "frozenlist-1.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9ac08e601308e41eb533f232dbf6b7e4cea762f9f84f6357136eed926c15d12c"}, + {file = "frozenlist-1.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d081f13b095d74b67d550de04df1c756831f3b83dc9881c38985834387487f1b"}, + {file = "frozenlist-1.4.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:71932b597f9895f011f47f17d6428252fc728ba2ae6024e13c3398a087c2cdea"}, + {file = "frozenlist-1.4.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:981b9ab5a0a3178ff413bca62526bb784249421c24ad7381e39d67981be2c326"}, + {file = "frozenlist-1.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e41f3de4df3e80de75845d3e743b3f1c4c8613c3997a912dbf0229fc61a8b963"}, + {file = "frozenlist-1.4.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6918d49b1f90821e93069682c06ffde41829c346c66b721e65a5c62b4bab0300"}, + {file = "frozenlist-1.4.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0e5c8764c7829343d919cc2dfc587a8db01c4f70a4ebbc49abde5d4b158b007b"}, + {file = "frozenlist-1.4.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:8d0edd6b1c7fb94922bf569c9b092ee187a83f03fb1a63076e7774b60f9481a8"}, + {file = "frozenlist-1.4.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:e29cda763f752553fa14c68fb2195150bfab22b352572cb36c43c47bedba70eb"}, + {file = "frozenlist-1.4.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:0c7c1b47859ee2cac3846fde1c1dc0f15da6cec5a0e5c72d101e0f83dcb67ff9"}, + {file = "frozenlist-1.4.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:901289d524fdd571be1c7be054f48b1f88ce8dddcbdf1ec698b27d4b8b9e5d62"}, + {file = "frozenlist-1.4.0-cp310-cp310-win32.whl", hash = "sha256:1a0848b52815006ea6596c395f87449f693dc419061cc21e970f139d466dc0a0"}, + {file = "frozenlist-1.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:b206646d176a007466358aa21d85cd8600a415c67c9bd15403336c331a10d956"}, + {file = "frozenlist-1.4.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:de343e75f40e972bae1ef6090267f8260c1446a1695e77096db6cfa25e759a95"}, + {file = "frozenlist-1.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ad2a9eb6d9839ae241701d0918f54c51365a51407fd80f6b8289e2dfca977cc3"}, + {file = "frozenlist-1.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bd7bd3b3830247580de99c99ea2a01416dfc3c34471ca1298bccabf86d0ff4dc"}, + {file = "frozenlist-1.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bdf1847068c362f16b353163391210269e4f0569a3c166bc6a9f74ccbfc7e839"}, + {file = "frozenlist-1.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:38461d02d66de17455072c9ba981d35f1d2a73024bee7790ac2f9e361ef1cd0c"}, + {file = "frozenlist-1.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d5a32087d720c608f42caed0ef36d2b3ea61a9d09ee59a5142d6070da9041b8f"}, + {file = "frozenlist-1.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dd65632acaf0d47608190a71bfe46b209719bf2beb59507db08ccdbe712f969b"}, + {file = "frozenlist-1.4.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:261b9f5d17cac914531331ff1b1d452125bf5daa05faf73b71d935485b0c510b"}, + {file = "frozenlist-1.4.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:b89ac9768b82205936771f8d2eb3ce88503b1556324c9f903e7156669f521472"}, + {file = "frozenlist-1.4.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:008eb8b31b3ea6896da16c38c1b136cb9fec9e249e77f6211d479db79a4eaf01"}, + {file = "frozenlist-1.4.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:e74b0506fa5aa5598ac6a975a12aa8928cbb58e1f5ac8360792ef15de1aa848f"}, + {file = "frozenlist-1.4.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:490132667476f6781b4c9458298b0c1cddf237488abd228b0b3650e5ecba7467"}, + {file = "frozenlist-1.4.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:76d4711f6f6d08551a7e9ef28c722f4a50dd0fc204c56b4bcd95c6cc05ce6fbb"}, + {file = "frozenlist-1.4.0-cp311-cp311-win32.whl", hash = "sha256:a02eb8ab2b8f200179b5f62b59757685ae9987996ae549ccf30f983f40602431"}, + {file = "frozenlist-1.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:515e1abc578dd3b275d6a5114030b1330ba044ffba03f94091842852f806f1c1"}, + {file = "frozenlist-1.4.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:f0ed05f5079c708fe74bf9027e95125334b6978bf07fd5ab923e9e55e5fbb9d3"}, + {file = "frozenlist-1.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ca265542ca427bf97aed183c1676e2a9c66942e822b14dc6e5f42e038f92a503"}, + {file = "frozenlist-1.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:491e014f5c43656da08958808588cc6c016847b4360e327a62cb308c791bd2d9"}, + {file = "frozenlist-1.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:17ae5cd0f333f94f2e03aaf140bb762c64783935cc764ff9c82dff626089bebf"}, + {file = "frozenlist-1.4.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1e78fb68cf9c1a6aa4a9a12e960a5c9dfbdb89b3695197aa7064705662515de2"}, + {file = "frozenlist-1.4.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d5655a942f5f5d2c9ed93d72148226d75369b4f6952680211972a33e59b1dfdc"}, + {file = "frozenlist-1.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c11b0746f5d946fecf750428a95f3e9ebe792c1ee3b1e96eeba145dc631a9672"}, + {file = "frozenlist-1.4.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e66d2a64d44d50d2543405fb183a21f76b3b5fd16f130f5c99187c3fb4e64919"}, + {file = "frozenlist-1.4.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:88f7bc0fcca81f985f78dd0fa68d2c75abf8272b1f5c323ea4a01a4d7a614efc"}, + {file = "frozenlist-1.4.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:5833593c25ac59ede40ed4de6d67eb42928cca97f26feea219f21d0ed0959b79"}, + {file = "frozenlist-1.4.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:fec520865f42e5c7f050c2a79038897b1c7d1595e907a9e08e3353293ffc948e"}, + {file = "frozenlist-1.4.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:b826d97e4276750beca7c8f0f1a4938892697a6bcd8ec8217b3312dad6982781"}, + {file = "frozenlist-1.4.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ceb6ec0a10c65540421e20ebd29083c50e6d1143278746a4ef6bcf6153171eb8"}, + {file = "frozenlist-1.4.0-cp38-cp38-win32.whl", hash = "sha256:2b8bcf994563466db019fab287ff390fffbfdb4f905fc77bc1c1d604b1c689cc"}, + {file = "frozenlist-1.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:a6c8097e01886188e5be3e6b14e94ab365f384736aa1fca6a0b9e35bd4a30bc7"}, + {file = "frozenlist-1.4.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:6c38721585f285203e4b4132a352eb3daa19121a035f3182e08e437cface44bf"}, + {file = "frozenlist-1.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a0c6da9aee33ff0b1a451e867da0c1f47408112b3391dd43133838339e410963"}, + {file = "frozenlist-1.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:93ea75c050c5bb3d98016b4ba2497851eadf0ac154d88a67d7a6816206f6fa7f"}, + {file = "frozenlist-1.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f61e2dc5ad442c52b4887f1fdc112f97caeff4d9e6ebe78879364ac59f1663e1"}, + {file = "frozenlist-1.4.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aa384489fefeb62321b238e64c07ef48398fe80f9e1e6afeff22e140e0850eef"}, + {file = "frozenlist-1.4.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:10ff5faaa22786315ef57097a279b833ecab1a0bfb07d604c9cbb1c4cdc2ed87"}, + {file = "frozenlist-1.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:007df07a6e3eb3e33e9a1fe6a9db7af152bbd8a185f9aaa6ece10a3529e3e1c6"}, + {file = "frozenlist-1.4.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f4f399d28478d1f604c2ff9119907af9726aed73680e5ed1ca634d377abb087"}, + {file = "frozenlist-1.4.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c5374b80521d3d3f2ec5572e05adc94601985cc526fb276d0c8574a6d749f1b3"}, + {file = "frozenlist-1.4.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:ce31ae3e19f3c902de379cf1323d90c649425b86de7bbdf82871b8a2a0615f3d"}, + {file = "frozenlist-1.4.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7211ef110a9194b6042449431e08c4d80c0481e5891e58d429df5899690511c2"}, + {file = "frozenlist-1.4.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:556de4430ce324c836789fa4560ca62d1591d2538b8ceb0b4f68fb7b2384a27a"}, + {file = "frozenlist-1.4.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:7645a8e814a3ee34a89c4a372011dcd817964ce8cb273c8ed6119d706e9613e3"}, + {file = "frozenlist-1.4.0-cp39-cp39-win32.whl", hash = "sha256:19488c57c12d4e8095a922f328df3f179c820c212940a498623ed39160bc3c2f"}, + {file = "frozenlist-1.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:6221d84d463fb110bdd7619b69cb43878a11d51cbb9394ae3105d082d5199167"}, + {file = "frozenlist-1.4.0.tar.gz", hash = "sha256:09163bdf0b2907454042edb19f887c6d33806adc71fbd54afc14908bfdc22251"}, +] + +[[package]] +name = "idna" +version = "3.4" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.5" +files = [ + {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, + {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, +] + [[package]] name = "iniconfig" version = "2.0.0" @@ -36,6 +574,89 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] +[[package]] +name = "multidict" +version = "6.0.4" +description = "multidict implementation" +optional = false +python-versions = ">=3.7" +files = [ + {file = "multidict-6.0.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0b1a97283e0c85772d613878028fec909f003993e1007eafa715b24b377cb9b8"}, + {file = "multidict-6.0.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:eeb6dcc05e911516ae3d1f207d4b0520d07f54484c49dfc294d6e7d63b734171"}, + {file = "multidict-6.0.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d6d635d5209b82a3492508cf5b365f3446afb65ae7ebd755e70e18f287b0adf7"}, + {file = "multidict-6.0.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c048099e4c9e9d615545e2001d3d8a4380bd403e1a0578734e0d31703d1b0c0b"}, + {file = "multidict-6.0.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ea20853c6dbbb53ed34cb4d080382169b6f4554d394015f1bef35e881bf83547"}, + {file = "multidict-6.0.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:16d232d4e5396c2efbbf4f6d4df89bfa905eb0d4dc5b3549d872ab898451f569"}, + {file = "multidict-6.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:36c63aaa167f6c6b04ef2c85704e93af16c11d20de1d133e39de6a0e84582a93"}, + {file = "multidict-6.0.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:64bdf1086b6043bf519869678f5f2757f473dee970d7abf6da91ec00acb9cb98"}, + {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:43644e38f42e3af682690876cff722d301ac585c5b9e1eacc013b7a3f7b696a0"}, + {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:7582a1d1030e15422262de9f58711774e02fa80df0d1578995c76214f6954988"}, + {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:ddff9c4e225a63a5afab9dd15590432c22e8057e1a9a13d28ed128ecf047bbdc"}, + {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:ee2a1ece51b9b9e7752e742cfb661d2a29e7bcdba2d27e66e28a99f1890e4fa0"}, + {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a2e4369eb3d47d2034032a26c7a80fcb21a2cb22e1173d761a162f11e562caa5"}, + {file = "multidict-6.0.4-cp310-cp310-win32.whl", hash = "sha256:574b7eae1ab267e5f8285f0fe881f17efe4b98c39a40858247720935b893bba8"}, + {file = "multidict-6.0.4-cp310-cp310-win_amd64.whl", hash = "sha256:4dcbb0906e38440fa3e325df2359ac6cb043df8e58c965bb45f4e406ecb162cc"}, + {file = "multidict-6.0.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0dfad7a5a1e39c53ed00d2dd0c2e36aed4650936dc18fd9a1826a5ae1cad6f03"}, + {file = "multidict-6.0.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:64da238a09d6039e3bd39bb3aee9c21a5e34f28bfa5aa22518581f910ff94af3"}, + {file = "multidict-6.0.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ff959bee35038c4624250473988b24f846cbeb2c6639de3602c073f10410ceba"}, + {file = "multidict-6.0.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:01a3a55bd90018c9c080fbb0b9f4891db37d148a0a18722b42f94694f8b6d4c9"}, + {file = "multidict-6.0.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c5cb09abb18c1ea940fb99360ea0396f34d46566f157122c92dfa069d3e0e982"}, + {file = "multidict-6.0.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:666daae833559deb2d609afa4490b85830ab0dfca811a98b70a205621a6109fe"}, + {file = "multidict-6.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:11bdf3f5e1518b24530b8241529d2050014c884cf18b6fc69c0c2b30ca248710"}, + {file = "multidict-6.0.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7d18748f2d30f94f498e852c67d61261c643b349b9d2a581131725595c45ec6c"}, + {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:458f37be2d9e4c95e2d8866a851663cbc76e865b78395090786f6cd9b3bbf4f4"}, + {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:b1a2eeedcead3a41694130495593a559a668f382eee0727352b9a41e1c45759a"}, + {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:7d6ae9d593ef8641544d6263c7fa6408cc90370c8cb2bbb65f8d43e5b0351d9c"}, + {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:5979b5632c3e3534e42ca6ff856bb24b2e3071b37861c2c727ce220d80eee9ed"}, + {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:dcfe792765fab89c365123c81046ad4103fcabbc4f56d1c1997e6715e8015461"}, + {file = "multidict-6.0.4-cp311-cp311-win32.whl", hash = "sha256:3601a3cece3819534b11d4efc1eb76047488fddd0c85a3948099d5da4d504636"}, + {file = "multidict-6.0.4-cp311-cp311-win_amd64.whl", hash = "sha256:81a4f0b34bd92df3da93315c6a59034df95866014ac08535fc819f043bfd51f0"}, + {file = "multidict-6.0.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:67040058f37a2a51ed8ea8f6b0e6ee5bd78ca67f169ce6122f3e2ec80dfe9b78"}, + {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:853888594621e6604c978ce2a0444a1e6e70c8d253ab65ba11657659dcc9100f"}, + {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:39ff62e7d0f26c248b15e364517a72932a611a9b75f35b45be078d81bdb86603"}, + {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:af048912e045a2dc732847d33821a9d84ba553f5c5f028adbd364dd4765092ac"}, + {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1e8b901e607795ec06c9e42530788c45ac21ef3aaa11dbd0c69de543bfb79a9"}, + {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62501642008a8b9871ddfccbf83e4222cf8ac0d5aeedf73da36153ef2ec222d2"}, + {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:99b76c052e9f1bc0721f7541e5e8c05db3941eb9ebe7b8553c625ef88d6eefde"}, + {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:509eac6cf09c794aa27bcacfd4d62c885cce62bef7b2c3e8b2e49d365b5003fe"}, + {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:21a12c4eb6ddc9952c415f24eef97e3e55ba3af61f67c7bc388dcdec1404a067"}, + {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:5cad9430ab3e2e4fa4a2ef4450f548768400a2ac635841bc2a56a2052cdbeb87"}, + {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ab55edc2e84460694295f401215f4a58597f8f7c9466faec545093045476327d"}, + {file = "multidict-6.0.4-cp37-cp37m-win32.whl", hash = "sha256:5a4dcf02b908c3b8b17a45fb0f15b695bf117a67b76b7ad18b73cf8e92608775"}, + {file = "multidict-6.0.4-cp37-cp37m-win_amd64.whl", hash = "sha256:6ed5f161328b7df384d71b07317f4d8656434e34591f20552c7bcef27b0ab88e"}, + {file = "multidict-6.0.4-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5fc1b16f586f049820c5c5b17bb4ee7583092fa0d1c4e28b5239181ff9532e0c"}, + {file = "multidict-6.0.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1502e24330eb681bdaa3eb70d6358e818e8e8f908a22a1851dfd4e15bc2f8161"}, + {file = "multidict-6.0.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b692f419760c0e65d060959df05f2a531945af31fda0c8a3b3195d4efd06de11"}, + {file = "multidict-6.0.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45e1ecb0379bfaab5eef059f50115b54571acfbe422a14f668fc8c27ba410e7e"}, + {file = "multidict-6.0.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ddd3915998d93fbcd2566ddf9cf62cdb35c9e093075f862935573d265cf8f65d"}, + {file = "multidict-6.0.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:59d43b61c59d82f2effb39a93c48b845efe23a3852d201ed2d24ba830d0b4cf2"}, + {file = "multidict-6.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cc8e1d0c705233c5dd0c5e6460fbad7827d5d36f310a0fadfd45cc3029762258"}, + {file = "multidict-6.0.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d6aa0418fcc838522256761b3415822626f866758ee0bc6632c9486b179d0b52"}, + {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6748717bb10339c4760c1e63da040f5f29f5ed6e59d76daee30305894069a660"}, + {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:4d1a3d7ef5e96b1c9e92f973e43aa5e5b96c659c9bc3124acbbd81b0b9c8a951"}, + {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4372381634485bec7e46718edc71528024fcdc6f835baefe517b34a33c731d60"}, + {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:fc35cb4676846ef752816d5be2193a1e8367b4c1397b74a565a9d0389c433a1d"}, + {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:4b9d9e4e2b37daddb5c23ea33a3417901fa7c7b3dee2d855f63ee67a0b21e5b1"}, + {file = "multidict-6.0.4-cp38-cp38-win32.whl", hash = "sha256:e41b7e2b59679edfa309e8db64fdf22399eec4b0b24694e1b2104fb789207779"}, + {file = "multidict-6.0.4-cp38-cp38-win_amd64.whl", hash = "sha256:d6c254ba6e45d8e72739281ebc46ea5eb5f101234f3ce171f0e9f5cc86991480"}, + {file = "multidict-6.0.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:16ab77bbeb596e14212e7bab8429f24c1579234a3a462105cda4a66904998664"}, + {file = "multidict-6.0.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:bc779e9e6f7fda81b3f9aa58e3a6091d49ad528b11ed19f6621408806204ad35"}, + {file = "multidict-6.0.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4ceef517eca3e03c1cceb22030a3e39cb399ac86bff4e426d4fc6ae49052cc60"}, + {file = "multidict-6.0.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:281af09f488903fde97923c7744bb001a9b23b039a909460d0f14edc7bf59706"}, + {file = "multidict-6.0.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:52f2dffc8acaba9a2f27174c41c9e57f60b907bb9f096b36b1a1f3be71c6284d"}, + {file = "multidict-6.0.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b41156839806aecb3641f3208c0dafd3ac7775b9c4c422d82ee2a45c34ba81ca"}, + {file = "multidict-6.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d5e3fc56f88cc98ef8139255cf8cd63eb2c586531e43310ff859d6bb3a6b51f1"}, + {file = "multidict-6.0.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8316a77808c501004802f9beebde51c9f857054a0c871bd6da8280e718444449"}, + {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f70b98cd94886b49d91170ef23ec5c0e8ebb6f242d734ed7ed677b24d50c82cf"}, + {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:bf6774e60d67a9efe02b3616fee22441d86fab4c6d335f9d2051d19d90a40063"}, + {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:e69924bfcdda39b722ef4d9aa762b2dd38e4632b3641b1d9a57ca9cd18f2f83a"}, + {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:6b181d8c23da913d4ff585afd1155a0e1194c0b50c54fcfe286f70cdaf2b7176"}, + {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:52509b5be062d9eafc8170e53026fbc54cf3b32759a23d07fd935fb04fc22d95"}, + {file = "multidict-6.0.4-cp39-cp39-win32.whl", hash = "sha256:27c523fbfbdfd19c6867af7346332b62b586eed663887392cff78d614f9ec313"}, + {file = "multidict-6.0.4-cp39-cp39-win_amd64.whl", hash = "sha256:33029f5734336aa0d4c0384525da0387ef89148dc7191aae00ca5fb23d7aafc2"}, + {file = "multidict-6.0.4.tar.gz", hash = "sha256:3666906492efb76453c0e7b97f2cf459b0682e7402c0489a95484965dbc1da49"}, +] + [[package]] name = "numpy" version = "1.24.4" @@ -148,6 +769,84 @@ files = [ dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] +[[package]] +name = "pycares" +version = "4.3.0" +description = "Python interface for c-ares" +optional = false +python-versions = "*" +files = [ + {file = "pycares-4.3.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:19c9cdd3322d422931982939773e453e491dfc5c0b2e23d7266959315c7a0824"}, + {file = "pycares-4.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9e56e9cdf46a092970dc4b75bbabddea9f480be5eeadc3fcae3eb5c6807c4136"}, + {file = "pycares-4.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c75a6241c79b935048272cb77df498da64b8defc8c4b29fdf9870e43ba4cbb4"}, + {file = "pycares-4.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24d8654fac3742791b8bef59d1fbb3e19ae6a5c48876a6d98659f7c66ee546c4"}, + {file = "pycares-4.3.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ebf50b049a245880f1aa16a6f72c4408e0a65b49ea1d3bf13383a44a2cabd2bf"}, + {file = "pycares-4.3.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:84daf560962763c0359fd79c750ef480f0fda40c08b57765088dbe362e8dc452"}, + {file = "pycares-4.3.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:978d10da7ee74b9979c494afa8b646411119ad0186a29c7f13c72bb4295630c6"}, + {file = "pycares-4.3.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c5b9d7fe52eb3d243f5ead58d5c0011884226d961df8360a34618c38c7515"}, + {file = "pycares-4.3.0-cp310-cp310-win32.whl", hash = "sha256:da7c7089ae617317d2cbe38baefd3821387b3bfef7b3ee5b797b871cb1257974"}, + {file = "pycares-4.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:7106dc683db30e1d851283b7b9df7a5ea4964d6bdd000d918d91d4b1f9bed329"}, + {file = "pycares-4.3.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4e7a24ecef0b1933f2a3fdbf328d1b529a76cda113f8364fa0742e5b3bd76566"}, + {file = "pycares-4.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e7abccc2aa4771c06994e4d9ed596453061e2b8846f887d9c98a64ccdaf4790a"}, + {file = "pycares-4.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:531fed46c5ed798a914c3207be4ae7b297c4d09e4183d3cf8fd9ee59a55d5080"}, + {file = "pycares-4.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2c9335175af0c64a1e0ba67bdd349eb62d4eea0ad02c235ccdf0d535fd20f323"}, + {file = "pycares-4.3.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c5f0e95535027d2dcd51e780410632b0d3ed7e9e5ceb25dc0fe937f2c2960079"}, + {file = "pycares-4.3.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:3692179ce5fb96908ba342e1e5303608d0c976f0d5d4619fa9d3d6d9d5a9a1b4"}, + {file = "pycares-4.3.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:5c4cb6cc7fe8e0606d30b60367f59fe26d1472e88555d61e202db70dea5c8edb"}, + {file = "pycares-4.3.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3215445396c74103e2054e6b349d9e85883ceda2006d0039fc2d58c9b11818a2"}, + {file = "pycares-4.3.0-cp311-cp311-win32.whl", hash = "sha256:6a0c0c3a0adf490bba9dbb37dbd07ec81e4a6584f095036ac34f06a633710ffe"}, + {file = "pycares-4.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:995cb37cc39bd40ca87bb16555a0f7724f3be30d9f9059a4caab2fde45b1b903"}, + {file = "pycares-4.3.0-cp36-cp36m-win32.whl", hash = "sha256:4c9187be72449c975c11daa1d94d7ddcc494f8a4c37a6c18f977cd7024a531d9"}, + {file = "pycares-4.3.0-cp36-cp36m-win_amd64.whl", hash = "sha256:d7405ba10a2903a58b8b0faedcb54994c9ee002ad01963587fabf93e7e479783"}, + {file = "pycares-4.3.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:40aaa12081495f879f11f4cfc95edfec1ea14711188563102f9e33fe98728fac"}, + {file = "pycares-4.3.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4972cac24b66c5997f3a3e2cb608e408066d80103d443e36d626a88a287b9ae7"}, + {file = "pycares-4.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:35886dba7aa5b73affca8729aeb5a1f5e94d3d9a764adb1b7e75bafca44eeca5"}, + {file = "pycares-4.3.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5cea6e1f3be016f155d60f27f16c1074d58b4d6e123228fdbc3326d076016af8"}, + {file = "pycares-4.3.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:3a9fd2665b053afb39226ac6f8137a60910ca7729358456df2fb94866f4297de"}, + {file = "pycares-4.3.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:e8e9195f869120e44e0aa0a6098bb5c19947f4753054365891f592e6f9eab3ef"}, + {file = "pycares-4.3.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:674486ecf2afb25ee219171b07cdaba481a1aaa2dabb155779c7be9ded03eaa9"}, + {file = "pycares-4.3.0-cp37-cp37m-win32.whl", hash = "sha256:1b6cd3161851499b6894d1e23bfd633e7b775472f5af35ae35409c4a47a2d45e"}, + {file = "pycares-4.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:710120c97b9afdba443564350c3f5f72fd9aae74d95b73dc062ca8ac3d7f36d7"}, + {file = "pycares-4.3.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:9103649bd29d84bc6bcfaf09def9c0592bbc766018fad19d76d09989608b915d"}, + {file = "pycares-4.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c072dbaf73cb5434279578dc35322867d8d5df053e14fdcdcc589994ba4804ae"}, + {file = "pycares-4.3.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:008531733f9c7a976b59c7760a3672b191159fd69ae76c01ca051f20b5e44164"}, + {file = "pycares-4.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2aae02d97d77dcff840ab55f86cb8b99bf644acbca17e1edb7048408b9782088"}, + {file = "pycares-4.3.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:257953ae6d400a934fd9193aeb20990ac84a78648bdf5978e998bd007a4045cd"}, + {file = "pycares-4.3.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:c28d481efae26936ec08cb6beea305f4b145503b152cf2c4dc68cc4ad9644f0e"}, + {file = "pycares-4.3.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:976249b39037dbfb709ccf7e1c40d2785905a0065536385d501b94570cfed96d"}, + {file = "pycares-4.3.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:98568c30cfab6b327d94ae1acdf85bbba4cffd415980804985d34ca07e6f4791"}, + {file = "pycares-4.3.0-cp38-cp38-win32.whl", hash = "sha256:a2f3c4f49f43162f7e684419d9834c2c8ec165e54cb8dc47aa9dc0c2132701c0"}, + {file = "pycares-4.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:1730ef93e33e4682fbbf0e7fb19df2ed9822779d17de8ea6e20d5b0d71c1d2be"}, + {file = "pycares-4.3.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5a26b3f1684557025da26ce65d076619890c82b95e38cc7284ce51c3539a1ce8"}, + {file = "pycares-4.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:86112cce01655b9f63c5e53b74722084e88e784a7a8ad138d373440337c591c9"}, + {file = "pycares-4.3.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c01465a191dc78e923884bb45cd63c7e012623e520cf7ed67e542413ee334804"}, + {file = "pycares-4.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9fd5d6012f3ee8c8038cbfe16e988bbd17b2f21eea86650874bf63757ee6161"}, + {file = "pycares-4.3.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aa36b8ea91eae20b5c7205f3e6654423f066af24a1df02b274770a96cbcafaa7"}, + {file = "pycares-4.3.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:61019151130557c1788cae52e4f2f388a7520c9d92574f3a0d61c974c6740db0"}, + {file = "pycares-4.3.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:231962bb46274c52632469a1e686fab065dbd106dbef586de4f7fb101e297587"}, + {file = "pycares-4.3.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:6c979512fa51c7ccef5204fe10ed4e5c44c2bce5f335fe98a3e423f1672bd7d4"}, + {file = "pycares-4.3.0-cp39-cp39-win32.whl", hash = "sha256:655cf0df862ce3847a60e1a106dafa2ba2c14e6636bac49e874347acdc7312dc"}, + {file = "pycares-4.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:36f2251ad0f99a5ce13df45c94c3161d9734c9e9fa2b9b4cc163b853ca170dc5"}, + {file = "pycares-4.3.0.tar.gz", hash = "sha256:c542696f6dac978e9d99192384745a65f80a7d9450501151e4a7563e06010d45"}, +] + +[package.dependencies] +cffi = ">=1.5.0" + +[package.extras] +idna = ["idna (>=2.1)"] + +[[package]] +name = "pycparser" +version = "2.21" +description = "C parser in Python" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "pycparser-2.21-py2.py3-none-any.whl", hash = "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9"}, + {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, +] + [[package]] name = "pyreadline3" version = "3.4.1" @@ -192,7 +891,94 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] +[[package]] +name = "yarl" +version = "1.9.2" +description = "Yet another URL library" +optional = false +python-versions = ">=3.7" +files = [ + {file = "yarl-1.9.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:8c2ad583743d16ddbdf6bb14b5cd76bf43b0d0006e918809d5d4ddf7bde8dd82"}, + {file = "yarl-1.9.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:82aa6264b36c50acfb2424ad5ca537a2060ab6de158a5bd2a72a032cc75b9eb8"}, + {file = "yarl-1.9.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c0c77533b5ed4bcc38e943178ccae29b9bcf48ffd1063f5821192f23a1bd27b9"}, + {file = "yarl-1.9.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ee4afac41415d52d53a9833ebae7e32b344be72835bbb589018c9e938045a560"}, + {file = "yarl-1.9.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9bf345c3a4f5ba7f766430f97f9cc1320786f19584acc7086491f45524a551ac"}, + {file = "yarl-1.9.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2a96c19c52ff442a808c105901d0bdfd2e28575b3d5f82e2f5fd67e20dc5f4ea"}, + {file = "yarl-1.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:891c0e3ec5ec881541f6c5113d8df0315ce5440e244a716b95f2525b7b9f3608"}, + {file = "yarl-1.9.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c3a53ba34a636a256d767c086ceb111358876e1fb6b50dfc4d3f4951d40133d5"}, + {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:566185e8ebc0898b11f8026447eacd02e46226716229cea8db37496c8cdd26e0"}, + {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:2b0738fb871812722a0ac2154be1f049c6223b9f6f22eec352996b69775b36d4"}, + {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:32f1d071b3f362c80f1a7d322bfd7b2d11e33d2adf395cc1dd4df36c9c243095"}, + {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:e9fdc7ac0d42bc3ea78818557fab03af6181e076a2944f43c38684b4b6bed8e3"}, + {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:56ff08ab5df8429901ebdc5d15941b59f6253393cb5da07b4170beefcf1b2528"}, + {file = "yarl-1.9.2-cp310-cp310-win32.whl", hash = "sha256:8ea48e0a2f931064469bdabca50c2f578b565fc446f302a79ba6cc0ee7f384d3"}, + {file = "yarl-1.9.2-cp310-cp310-win_amd64.whl", hash = "sha256:50f33040f3836e912ed16d212f6cc1efb3231a8a60526a407aeb66c1c1956dde"}, + {file = "yarl-1.9.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:646d663eb2232d7909e6601f1a9107e66f9791f290a1b3dc7057818fe44fc2b6"}, + {file = "yarl-1.9.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:aff634b15beff8902d1f918012fc2a42e0dbae6f469fce134c8a0dc51ca423bb"}, + {file = "yarl-1.9.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a83503934c6273806aed765035716216cc9ab4e0364f7f066227e1aaea90b8d0"}, + {file = "yarl-1.9.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b25322201585c69abc7b0e89e72790469f7dad90d26754717f3310bfe30331c2"}, + {file = "yarl-1.9.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:22a94666751778629f1ec4280b08eb11815783c63f52092a5953faf73be24191"}, + {file = "yarl-1.9.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ec53a0ea2a80c5cd1ab397925f94bff59222aa3cf9c6da938ce05c9ec20428d"}, + {file = "yarl-1.9.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:159d81f22d7a43e6eabc36d7194cb53f2f15f498dbbfa8edc8a3239350f59fe7"}, + {file = "yarl-1.9.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:832b7e711027c114d79dffb92576acd1bd2decc467dec60e1cac96912602d0e6"}, + {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:95d2ecefbcf4e744ea952d073c6922e72ee650ffc79028eb1e320e732898d7e8"}, + {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:d4e2c6d555e77b37288eaf45b8f60f0737c9efa3452c6c44626a5455aeb250b9"}, + {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:783185c75c12a017cc345015ea359cc801c3b29a2966c2655cd12b233bf5a2be"}, + {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:b8cc1863402472f16c600e3e93d542b7e7542a540f95c30afd472e8e549fc3f7"}, + {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:822b30a0f22e588b32d3120f6d41e4ed021806418b4c9f0bc3048b8c8cb3f92a"}, + {file = "yarl-1.9.2-cp311-cp311-win32.whl", hash = "sha256:a60347f234c2212a9f0361955007fcf4033a75bf600a33c88a0a8e91af77c0e8"}, + {file = "yarl-1.9.2-cp311-cp311-win_amd64.whl", hash = "sha256:be6b3fdec5c62f2a67cb3f8c6dbf56bbf3f61c0f046f84645cd1ca73532ea051"}, + {file = "yarl-1.9.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:38a3928ae37558bc1b559f67410df446d1fbfa87318b124bf5032c31e3447b74"}, + {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac9bb4c5ce3975aeac288cfcb5061ce60e0d14d92209e780c93954076c7c4367"}, + {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3da8a678ca8b96c8606bbb8bfacd99a12ad5dd288bc6f7979baddd62f71c63ef"}, + {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:13414591ff516e04fcdee8dc051c13fd3db13b673c7a4cb1350e6b2ad9639ad3"}, + {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf74d08542c3a9ea97bb8f343d4fcbd4d8f91bba5ec9d5d7f792dbe727f88938"}, + {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6e7221580dc1db478464cfeef9b03b95c5852cc22894e418562997df0d074ccc"}, + {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:494053246b119b041960ddcd20fd76224149cfea8ed8777b687358727911dd33"}, + {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:52a25809fcbecfc63ac9ba0c0fb586f90837f5425edfd1ec9f3372b119585e45"}, + {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:e65610c5792870d45d7b68c677681376fcf9cc1c289f23e8e8b39c1485384185"}, + {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:1b1bba902cba32cdec51fca038fd53f8beee88b77efc373968d1ed021024cc04"}, + {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:662e6016409828ee910f5d9602a2729a8a57d74b163c89a837de3fea050c7582"}, + {file = "yarl-1.9.2-cp37-cp37m-win32.whl", hash = "sha256:f364d3480bffd3aa566e886587eaca7c8c04d74f6e8933f3f2c996b7f09bee1b"}, + {file = "yarl-1.9.2-cp37-cp37m-win_amd64.whl", hash = "sha256:6a5883464143ab3ae9ba68daae8e7c5c95b969462bbe42e2464d60e7e2698368"}, + {file = "yarl-1.9.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5610f80cf43b6202e2c33ba3ec2ee0a2884f8f423c8f4f62906731d876ef4fac"}, + {file = "yarl-1.9.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b9a4e67ad7b646cd6f0938c7ebfd60e481b7410f574c560e455e938d2da8e0f4"}, + {file = "yarl-1.9.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:83fcc480d7549ccebe9415d96d9263e2d4226798c37ebd18c930fce43dfb9574"}, + {file = "yarl-1.9.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5fcd436ea16fee7d4207c045b1e340020e58a2597301cfbcfdbe5abd2356c2fb"}, + {file = "yarl-1.9.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:84e0b1599334b1e1478db01b756e55937d4614f8654311eb26012091be109d59"}, + {file = "yarl-1.9.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3458a24e4ea3fd8930e934c129b676c27452e4ebda80fbe47b56d8c6c7a63a9e"}, + {file = "yarl-1.9.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:838162460b3a08987546e881a2bfa573960bb559dfa739e7800ceeec92e64417"}, + {file = "yarl-1.9.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f4e2d08f07a3d7d3e12549052eb5ad3eab1c349c53ac51c209a0e5991bbada78"}, + {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:de119f56f3c5f0e2fb4dee508531a32b069a5f2c6e827b272d1e0ff5ac040333"}, + {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:149ddea5abf329752ea5051b61bd6c1d979e13fbf122d3a1f9f0c8be6cb6f63c"}, + {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:674ca19cbee4a82c9f54e0d1eee28116e63bc6fd1e96c43031d11cbab8b2afd5"}, + {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:9b3152f2f5677b997ae6c804b73da05a39daa6a9e85a512e0e6823d81cdad7cc"}, + {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5415d5a4b080dc9612b1b63cba008db84e908b95848369aa1da3686ae27b6d2b"}, + {file = "yarl-1.9.2-cp38-cp38-win32.whl", hash = "sha256:f7a3d8146575e08c29ed1cd287068e6d02f1c7bdff8970db96683b9591b86ee7"}, + {file = "yarl-1.9.2-cp38-cp38-win_amd64.whl", hash = "sha256:63c48f6cef34e6319a74c727376e95626f84ea091f92c0250a98e53e62c77c72"}, + {file = "yarl-1.9.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:75df5ef94c3fdc393c6b19d80e6ef1ecc9ae2f4263c09cacb178d871c02a5ba9"}, + {file = "yarl-1.9.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c027a6e96ef77d401d8d5a5c8d6bc478e8042f1e448272e8d9752cb0aff8b5c8"}, + {file = "yarl-1.9.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f3b078dbe227f79be488ffcfc7a9edb3409d018e0952cf13f15fd6512847f3f7"}, + {file = "yarl-1.9.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:59723a029760079b7d991a401386390c4be5bfec1e7dd83e25a6a0881859e716"}, + {file = "yarl-1.9.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b03917871bf859a81ccb180c9a2e6c1e04d2f6a51d953e6a5cdd70c93d4e5a2a"}, + {file = "yarl-1.9.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c1012fa63eb6c032f3ce5d2171c267992ae0c00b9e164efe4d73db818465fac3"}, + {file = "yarl-1.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a74dcbfe780e62f4b5a062714576f16c2f3493a0394e555ab141bf0d746bb955"}, + {file = "yarl-1.9.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8c56986609b057b4839968ba901944af91b8e92f1725d1a2d77cbac6972b9ed1"}, + {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:2c315df3293cd521033533d242d15eab26583360b58f7ee5d9565f15fee1bef4"}, + {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:b7232f8dfbd225d57340e441d8caf8652a6acd06b389ea2d3222b8bc89cbfca6"}, + {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:53338749febd28935d55b41bf0bcc79d634881195a39f6b2f767870b72514caf"}, + {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:066c163aec9d3d073dc9ffe5dd3ad05069bcb03fcaab8d221290ba99f9f69ee3"}, + {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8288d7cd28f8119b07dd49b7230d6b4562f9b61ee9a4ab02221060d21136be80"}, + {file = "yarl-1.9.2-cp39-cp39-win32.whl", hash = "sha256:b124e2a6d223b65ba8768d5706d103280914d61f5cae3afbc50fc3dfcc016623"}, + {file = "yarl-1.9.2-cp39-cp39-win_amd64.whl", hash = "sha256:61016e7d582bc46a5378ffdd02cd0314fb8ba52f40f9cf4d9a5e7dbef88dee18"}, + {file = "yarl-1.9.2.tar.gz", hash = "sha256:04ab9d4b9f587c06d801c2abfe9317b77cdf996c65a90d5e84ecc45010823571"}, +] + +[package.dependencies] +idna = ">=2.0" +multidict = ">=4.0" + [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "f4de4ae4242c925c62044ba107e732a45941c0568a3c434e3daa446da24956de" +content-hash = "3cd492eff2ec24fd2ee9ed5d667fbb8ebf2c4643e007aac3c5997c01839efdf2" diff --git a/pyproject.toml b/pyproject.toml index cf888b17..91e78e90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,7 @@ include = [ [tool.poetry.dependencies] python = "^3.8" pyreadline3 = { version = "^3.4.1", platform = "win32" } +aiohttp = { version = "^3.8.5", extras = ["speedups"] } pminit = { version = "*", allow-prereleases = true } diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js new file mode 100644 index 00000000..3b893a1f --- /dev/null +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -0,0 +1,441 @@ +/** + * @file XMLHttpRequest.js + * Implement the XMLHttpRequest (XHR) API + * + * @author Tom Tang + * @date August 2023 + */ + +const { EventTarget, Event } = require('event-target'); +const { DOMException } = require('dom-exception'); +const { URL, URLSearchParams } = require('url'); + +// exposed +/** + * Events using the ProgressEvent interface indicate some kind of progression. + */ +class ProgressEvent extends Event +{ + /** + * @param {string} type + * @param {{ lengthComputable?: boolean; loaded?: number; total?: number; }} eventInitDict + */ + constructor (type, eventInitDict = {}) + { + super(type); + this.lengthComputable = eventInitDict.lengthComputable ?? false; + this.loaded = eventInitDict.loaded ?? 0; + this.total = eventInitDict.total ?? 0; + } +} + +// exposed +class XMLHttpRequestEventTarget extends EventTarget +{ + // event handlers + /** @typedef {import('event-target').EventListenerFn} EventListenerFn */ + /** @type {EventListenerFn} */ + onloadstart; + /** @type {EventListenerFn} */ + onprogress; + /** @type {EventListenerFn} */ + onabort; + /** @type {EventListenerFn} */ + onerror; + /** @type {EventListenerFn} */ + onload; + /** @type {EventListenerFn} */ + ontimeout; + /** @type {EventListenerFn} */ + onloadend; +} + +// exposed +class XMLHttpRequestUpload extends XMLHttpRequestEventTarget +{} + +const FORBIDDEN_REQUEST_METHODS = [ + 'TRACE', + 'TRACK', + 'CONNECT' +]; + +// exposed +class XMLHttpRequest extends XMLHttpRequestEventTarget +{ + // event handler + /** @type {EventListenerFn} */ + onreadystatechange = null; + + // + // states + // + static UNSENT = 0; + static OPENED = 1; + static HEADERS_RECEIVED = 2; + static LOADING = 3; + static DONE = 4; + /** + * Returns client's state. + */ + get readyState() + { + return this.#state; + } + + // + // request + // + /** + * Sets the request method, request URL, and synchronous flag. + * @typedef {'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'POST' | 'PUT'} Method + * @param {Method} method + * @param {string | URL} url + * @param {boolean} async + * @param {string} username + * @param {string} password + * @see https://xhr.spec.whatwg.org/#the-open()-method + */ + open(method, url, async = true, username = null, password = null) + { + // Reset + this.abort(); + + // Normalize the method. + // @ts-expect-error + method = method.toString().toUpperCase(); + + // Check for valid request method + if (!method || FORBIDDEN_REQUEST_METHODS.includes(method)) + throw new DOMException('Request method not allowed', 'SecurityError'); + + const parsedURL = new URL(url); + if (username) + parsedURL.username = username; + if (password) + parsedURL.password = password; + + // step 11 + this.#sendFlag = false; + this.#uploadListenerFlag = false; + this.#requestMethod = method; + this.#requestURL = parsedURL; + if (async === false) + this.#synchronousFlag = true; + this.#requestHeaders = {}; // clear + this.#response = null; + this.#responseObject = null; + + // step 12 + if (this.#state !== XMLHttpRequest.OPENED) + { + this.#state = XMLHttpRequest.OPENED; + this.dispatchEvent(new Event('readystatechange')); + } + } + + /** + * Combines a header in author request headers. + * @param {string} name + * @param {string} value + */ + setRequestHeader(name, value) + { + if (this.#state !== XMLHttpRequest.OPENED) + throw new DOMException('setRequestHeader can only be called when state is OPEN', 'InvalidStateError'); + if (this.#sendFlag) + throw new DOMException('send flag is true', 'InvalidStateError'); + + // Normalize value + value = value.toString().trim(); + name = name.toString().trim().toLowerCase(); + + // TODO: do we need to throw for forbidden request-headers here? + // see https://fetch.spec.whatwg.org/#forbidden-request-header + + // Combine header values + if (this.#requestHeaders[name]) + this.#requestHeaders[name] += ', ' + value; + else + this.#requestHeaders[name] = value; + } + + /** + * Returns the associated XMLHttpRequestUpload object. + * It can be used to gather transmission information when data is transferred to a server. + */ + get upload() + { + return this.#uploadObject; + } + + /** + * Initiates the request. + * @typedef {TypedArray | DataView | ArrayBuffer | URLSearchParams | string} XMLHttpRequestBodyInit + * @param {XMLHttpRequestBodyInit | null} body + * @see https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send + */ + send(body = null) + { + if (this.#state !== XMLHttpRequest.OPENED) // step 1 + throw new DOMException('connection must be opened before send() is called', 'InvalidStateError'); + if (this.#sendFlag) // step 2 + throw new DOMException('send has already been called', 'InvalidStateError'); + + if (['GET', 'HEAD'].includes(this.#requestMethod)) // step 3 + body = null; + + // step 4 + this.#requestBody = null; + if (body !== null) + { + let extractedContentType = null; + if (body instanceof URLSearchParams) + { + this.#requestBody = body.toString(); + extractedContentType = 'application/x-www-form-urlencoded;charset=UTF-8'; + } + else if (typeof body === 'string') + { + this.#requestBody = body; + extractedContentType = 'text/plain;charset=UTF-8'; + } + else // BufferSource + { + this.#requestBody = body instanceof ArrayBuffer ? new Uint8Array(body) : new Uint8Array(body.buffer); // make a copy + } + + const originalAuthorContentType = this.#requestHeaders['content-type']; + if (!originalAuthorContentType && extractedContentType) + { + this.#requestHeaders['content-type'] = extractedContentType; + } + } + + // step 5 + if (this.#uploadObject._hasAnyListeners()) + this.#uploadListenerFlag = true; + + // step 6 + // TODO: Let req be a new request, initialized as follows: + + this.#uploadCompleteFlag = false; // step 7 + this.#timedOutFlag = false; // step 8 + if (this.#requestBody === null) // step 9 + this.#uploadCompleteFlag = true; + this.#sendFlag = true; // step 10 + + if (!this.#synchronousFlag) // step 11 + this.#sendAsync(); + else // step 12 + this.#sendSync(); + } + + /** + * @see https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send step 11 + */ + #sendAsync() + { + this.dispatchEvent(new ProgressEvent('loadstart', { loaded:0, total:0 })); // step 11.1 + + let requestBodyTransmitted = 0; // step 11.2 + let requestBodyLength = this.#requestBody ? this.#requestBody.length : 0; // step 11.3 + if (!this.#uploadCompleteFlag && this.#uploadListenerFlag) // step 11.5 + this.#uploadObject.dispatchEvent(new ProgressEvent('loadstart', { loaded:requestBodyTransmitted, total:requestBodyLength })); + + if (this.#state !== XMLHttpRequest.OPENED || !this.#sendFlag) // step 11.6 + return; + + // step 11.7 + const processRequestBodyChunkLength = (/** @type {number} */ bytesLength) => + { + requestBodyTransmitted += bytesLength; + if (this.#uploadListenerFlag) + this.#uploadObject.dispatchEvent(new ProgressEvent('progress', { loaded:requestBodyTransmitted, total:requestBodyLength })); + }; + + // step 11.8 + const processRequestEndOfBody = () => + { + this.#uploadCompleteFlag = true; + if (!this.#uploadListenerFlag) + return; + for (const eventType of ['progress', 'load', 'loadend']) + this.#uploadObject.dispatchEvent(new ProgressEvent(eventType, { loaded:requestBodyTransmitted, total:requestBodyLength })); + }; + + // step 11.9 + const processResponse = (response) => + { + this.#response = response; // step 11.9.1 + this.#state = XMLHttpRequest.HEADERS_RECEIVED; // step 11.9.4 + this.dispatchEvent(new Event('readystatechange')); // step 11.9.5 + if (this.#state !== XMLHttpRequest.HEADERS_RECEIVED) // step 11.9.6 + return; + // TODO + }; + // TODO: + } + + /** + * @see https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send step 12 + */ + #sendSync() + { + throw new DOMException('synchronous XHR is not supported', 'NotSupportedError'); + // TODO: handle synchronous request + } + + abort() + { + // TODO + } + + // + // response + // + /** + * @return {string} + */ + get responseURL() + { + // TODO + } + + /** + * @return {number} HTTP status code + */ + get status() + { + // TODO + } + + /** + * @return {string} HTTP status message + */ + get statusText() + { + // TODO + } + + /** + * @param {string} name + * @return {string} the text of a particular header's value + */ + getResponseHeader(name) + { + // TODO + } + + /** + * @return {string} all the response headers, separated by CRLF, as a string, or returns null if no response has been received. + */ + getAllResponseHeaders() + { + // TODO + } + + /** + * Acts as if the `Content-Type` header value for a response is mime. + * (It does not change the header.) + * @param {string} mime + */ + overrideMimeType(mime) + { + // TODO + } + + /** + * @typedef {"" | "arraybuffer" | "blob" | "document" | "json" | "text"} ResponseType + */ + get responseType() + { + return this.#responseType; + } + set responseType(t) + { + if (this.#state === XMLHttpRequest.LOADING || this.#state === XMLHttpRequest.DONE) + throw new DOMException('responseType can only be set before send()', 'InvalidStateError'); + if (!['', 'text', 'arraybuffer', 'json'].includes(t)) + throw new DOMException('only responseType "text", "arraybuffer", or "json" is supported', 'NotSupportedError'); + this.#responseType = t; + } + + /** + * @see https://xhr.spec.whatwg.org/#text-response + * @return {string} + */ + #getTextResponse() + { + // TODO + } + + /** + * Returns the response body. + * @see https://xhr.spec.whatwg.org/#the-response-attribute + */ + get response() + { + if (this.#responseType === '' || this.#responseType === 'text') // step 1 + return this.responseText; + if (this.#state !== XMLHttpRequest.DONE) // step 2 + return null; + // TODO + } + + /** + * Returns response as text. + */ + get responseText() + { + if (!['text', ''].includes(this.#responseType)) + throw new DOMException('responseType must be "text" or an empty string', 'InvalidStateError'); + if (![XMLHttpRequest.LOADING, XMLHttpRequest.DONE].includes(this.#state)) + return ''; + else + return this.#getTextResponse(); + } + + /** + * Returns the response as document. + */ + get responseXML() + { + throw new DOMException('responseXML is not supported', 'NotSupportedError'); + } + + // internal properties + #uploadObject = new XMLHttpRequestUpload(); + #state = XMLHttpRequest.UNSENT; // One of unsent, opened, headers received, loading, and done; initially unsent. + #sendFlag = false; // A flag, initially unset. + #timeout = 0; // An unsigned integer, initially 0. + /** @type {Method} */ + #requestMethod = null; + /** @type {URL} */ + #requestURL = null; + #requestHeaders = {}; + /** @type {string | Uint8Array | null} */ + #requestBody = null; + #synchronousFlag = false; // A flag, initially unset. + #uploadCompleteFlag = false; // A flag, initially unset. + #uploadListenerFlag = false; // A flag, initially unset. + #timedOutFlag = false; // A flag, initially unset. + #response = null; + /** @type {ResponseType} */ + #responseType = ''; + #responseObject = null; +} + +if (!globalThis.XMLHttpRequestEventTarget) + globalThis.XMLHttpRequestEventTarget = XMLHttpRequestEventTarget; +if (!globalThis.XMLHttpRequestUpload) + globalThis.XMLHttpRequestUpload = XMLHttpRequestUpload; +if (!globalThis.XMLHttpRequest) + globalThis.XMLHttpRequest = XMLHttpRequest; +if (!globalThis.ProgressEvent) + globalThis.ProgressEvent = ProgressEvent; + +exports.XMLHttpRequestEventTarget = XMLHttpRequestEventTarget; +exports.XMLHttpRequestUpload = XMLHttpRequestUpload; +exports.XMLHttpRequest = XMLHttpRequest; +exports.ProgressEvent = ProgressEvent; diff --git a/python/pythonmonkey/builtin_modules/event-target.js b/python/pythonmonkey/builtin_modules/event-target.js index a81370f6..a0a3ac39 100644 --- a/python/pythonmonkey/builtin_modules/event-target.js +++ b/python/pythonmonkey/builtin_modules/event-target.js @@ -100,6 +100,23 @@ class EventTarget else listener.handleEvent(event); } + + /** + * Determine whether the target has any kind of event listeners + */ + _hasAnyListeners() + { + return Object.values(this.#listeners).some(t => t.size > 0); + } + + /** + * Determine whether the target has listeners of the given event type + * @param {string} [type] + */ + _hasListeners(type) + { + return this.#listeners[type] && this.#listeners[type].size > 0; + } } if (!globalThis.Event) From c12de3aa79a3bb5b491fea4e9ba79f14b54f77de Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 25 Aug 2023 09:04:53 +0000 Subject: [PATCH 0036/1086] fix(EventTarget): `this` in listener function should be the event target --- python/pythonmonkey/builtin_modules/event-target.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/event-target.js b/python/pythonmonkey/builtin_modules/event-target.js index a0a3ac39..088d9b19 100644 --- a/python/pythonmonkey/builtin_modules/event-target.js +++ b/python/pythonmonkey/builtin_modules/event-target.js @@ -89,16 +89,16 @@ class EventTarget // Call "on" methods if (typeof this['on' + type] === 'function') - this['on' + type](); + this['on' + type].call(this, event); // Call listeners registered with addEventListener() if (!Object.hasOwn(this.#listeners, type)) return; for (const listener of this.#listeners[type].values()) if (typeof listener === 'function') - listener(event); + listener.call(this, event); else - listener.handleEvent(event); + listener.handleEvent.call(this, event); } /** From df73b366d12b2754bfb633b306e7210aed3b74c9 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 25 Aug 2023 09:28:17 +0000 Subject: [PATCH 0037/1086] feat(XHR): status, statusText, getResponseHeader, getAllResponseHeaders --- .../builtin_modules/XMLHttpRequest.js | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index 3b893a1f..2d01d8ba 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -299,7 +299,10 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget */ get responseURL() { - // TODO + if (!this.#response) + return ''; + else + return this.#response.url; } /** @@ -307,7 +310,10 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget */ get status() { - // TODO + if (!this.#response) + return 0; + else + return this.#response.status; } /** @@ -315,7 +321,10 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget */ get statusText() { - // TODO + if (!this.#response) + return ''; + else + return this.#response.statusText; } /** @@ -324,7 +333,10 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget */ getResponseHeader(name) { - // TODO + if (!this.#response) + return null; + else + return this.#response.getResponseHeader(name) ?? null; } /** @@ -332,7 +344,10 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget */ getAllResponseHeaders() { - // TODO + if (!this.#response) + return ''; + else + return this.#response.getAllResponseHeaders(); } /** From fcd197e966908bcf505dff6ef76bc5a2cf4dd672 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 25 Aug 2023 11:13:56 +0000 Subject: [PATCH 0038/1086] feat(XHR): get `XMLHttpRequest` working We are close to the spec! --- .../XMLHttpRequest-internal.d.ts | 19 +++++ .../XMLHttpRequest-internal.py | 58 +++++++++++++ .../builtin_modules/XMLHttpRequest.js | 82 +++++++++++++++++-- 3 files changed, 152 insertions(+), 7 deletions(-) create mode 100644 python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts create mode 100644 python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts new file mode 100644 index 00000000..de804ffe --- /dev/null +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts @@ -0,0 +1,19 @@ +/** + * @file XMLHttpRequest-internal.d.ts + * @brief TypeScript type declarations for the internal XMLHttpRequest helpers + * @author Tom Tang + * @date August 2023 + */ + +/** + * Send request + */ +export declare function request( + method: string, + url: string, + headers: Record, + body: string | Uint8Array, + processResponse: (response: any) => void, + processBodyChunk: (bytes: Uint8Array) => void, + processEndOfBody: () => void, +): string; diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py new file mode 100644 index 00000000..7729ae25 --- /dev/null +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py @@ -0,0 +1,58 @@ +# @file XMLHttpRequest-internal.py +# @brief internal helper functions for XMLHttpRequest +# @author Tom Tang +# @date August 2023 + +import aiohttp +import yarl +from typing import Union, Sequence, Callable, Any + +async def request( + method: str, + url: str, + headers: dict, + body: Union[str, Sequence[int]], + processResponse: Callable[[Any], None], + processBodyChunk: Callable[[bytearray], None], + processEndOfBody: Callable[[], None], + / +): + if isinstance(body, str): + body = bytes(body, "utf-8") + + async with aiohttp.request(method=method, + url=yarl.URL(url, encoded=True), + headers=dict(headers), + data=bytes(body) + ) as res: + def getResponseHeader(name: str): + return res.headers.get(name) + def getAllResponseHeaders(): + headers = [] + for name, value in res.headers.items(): + headers.append(f"{name.lower()}: {value}") + headers.sort() + return "\r\n".join(headers) + + # readyState HEADERS_RECEIVED + responseData = { # FIXME: PythonMonkey bug: the dict will be GCed if directly as an argument + 'url': str(res.real_url), + 'status': res.status, + 'statusText': res.reason, + + 'getResponseHeader': getResponseHeader, + 'getAllResponseHeaders': getAllResponseHeaders, + + 'contentLength': res.content_length, + } + processResponse(responseData) + + # readyState LOADING + async for data in res.content.iter_any(): + processBodyChunk(bytearray(data)) # PythonMonkey only accepts the mutable bytearray type + + # readyState DONE + processEndOfBody() + +# Module exports +exports['request'] = request # type: ignore diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index 2d01d8ba..277c2582 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -9,6 +9,7 @@ const { EventTarget, Event } = require('event-target'); const { DOMException } = require('dom-exception'); const { URL, URLSearchParams } = require('url'); +const { request } = require('XMLHttpRequest-internal'); // exposed /** @@ -124,6 +125,7 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget this.#synchronousFlag = true; this.#requestHeaders = {}; // clear this.#response = null; + this.#receivedBytes = []; this.#responseObject = null; // step 12 @@ -216,8 +218,7 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget if (this.#uploadObject._hasAnyListeners()) this.#uploadListenerFlag = true; - // step 6 - // TODO: Let req be a new request, initialized as follows: + // FIXME: do we have to initiate request here? (step 6) this.#uploadCompleteFlag = false; // step 7 this.#timedOutFlag = false; // step 8 @@ -265,6 +266,7 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget }; // step 11.9 + let responseLength = 0; const processResponse = (response) => { this.#response = response; // step 11.9.1 @@ -272,9 +274,45 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget this.dispatchEvent(new Event('readystatechange')); // step 11.9.5 if (this.#state !== XMLHttpRequest.HEADERS_RECEIVED) // step 11.9.6 return; - // TODO + responseLength = this.#response.contentLength; // step 11.9.8 }; - // TODO: + + const processBodyChunk = (/** @type {Uint8Array} */ bytes) => + { + this.#receivedBytes.push(bytes); + if (this.#state === XMLHttpRequest.HEADERS_RECEIVED) + this.#state = XMLHttpRequest.LOADING; + this.dispatchEvent(new Event('readystatechange')); + this.dispatchEvent(new ProgressEvent('progress', { loaded:this.#receivedLength, total:responseLength })); + }; + + /** + * @see https://xhr.spec.whatwg.org/#handle-response-end-of-body + */ + const processEndOfBody = () => + { + const transmitted = this.#receivedLength; // step 3 + const length = responseLength || 0; // step 4 + this.dispatchEvent(new ProgressEvent('progress', { loaded:transmitted, total:length })); // step 6 + this.#state = XMLHttpRequest.DONE; // step 7 + this.#sendFlag = false; // step 8 + this.dispatchEvent(new Event('readystatechange')); // step 9 + for (const eventType of ['load', 'loadend']) // step 10, step 11 + this.dispatchEvent(new ProgressEvent(eventType, { loaded:transmitted, total:length })); + }; + + // send() step 6 + request( + this.#requestMethod, + this.#requestURL.toString(), + this.#requestHeaders, + this.#requestBody ?? '', + processResponse, + processBodyChunk, + processEndOfBody, + ); + + // TODO: handle timeout } /** @@ -371,8 +409,8 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget { if (this.#state === XMLHttpRequest.LOADING || this.#state === XMLHttpRequest.DONE) throw new DOMException('responseType can only be set before send()', 'InvalidStateError'); - if (!['', 'text', 'arraybuffer', 'json'].includes(t)) - throw new DOMException('only responseType "text", "arraybuffer", or "json" is supported', 'NotSupportedError'); + if (!['', 'text', 'arraybuffer'].includes(t)) + throw new DOMException('only responseType "text" or "arraybuffer" is supported', 'NotSupportedError'); this.#responseType = t; } @@ -395,7 +433,25 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget return this.responseText; if (this.#state !== XMLHttpRequest.DONE) // step 2 return null; - // TODO + + if (this.#responseObject) // step 4 + return this.#responseObject; + if (this.#responseType === 'arraybuffer') // step 5 + { + // concatenate received bytes + let offset = 0; + const merged = new Uint8Array(this.#receivedLength); + for (const chunk of this.#receivedBytes) + { + merged.set(chunk, offset); + offset += chunk.length; + } + + this.#responseObject = merged.buffer; + return this.#responseObject; + } + + throw new DOMException(`unsupported responseType "${this.#responseType}"`, 'InvalidStateError'); } /** @@ -428,6 +484,7 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget #requestMethod = null; /** @type {URL} */ #requestURL = null; + /** @type {{ [name: string]: string; }} */ #requestHeaders = {}; /** @type {string | Uint8Array | null} */ #requestBody = null; @@ -436,9 +493,20 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget #uploadListenerFlag = false; // A flag, initially unset. #timedOutFlag = false; // A flag, initially unset. #response = null; + /** @type {Uint8Array[]} */ + #receivedBytes = []; /** @type {ResponseType} */ #responseType = ''; + /** + * cache for converting receivedBytes to the desired response type + * @type {ArrayBuffer} + */ #responseObject = null; + + get #receivedLength() + { + return this.#receivedBytes.reduce((sum, chunk) => sum + chunk.length, 0); + } } if (!globalThis.XMLHttpRequestEventTarget) From 4671dc126109940c16fd537c1d81342ffc5263f4 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 25 Aug 2023 11:15:11 +0000 Subject: [PATCH 0039/1086] feat(XHR): make `XMLHttpRequest` API globally available --- python/pythonmonkey/__init__.py | 1 + python/pythonmonkey/global.d.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/pythonmonkey/__init__.py b/python/pythonmonkey/__init__.py index 1f95e64e..d02c559e 100644 --- a/python/pythonmonkey/__init__.py +++ b/python/pythonmonkey/__init__.py @@ -14,6 +14,7 @@ require("base64") require("timers") require("url") +require("XMLHttpRequest") # Add the `.keys()` method on `Object.prototype` to get JSObjectProxy dict() conversion working # Conversion from a dict-subclass to a strict dict by `dict(subclass)` internally calls the .keys() method to read the dictionary keys, diff --git a/python/pythonmonkey/global.d.ts b/python/pythonmonkey/global.d.ts index 5e13faf9..03321ed5 100644 --- a/python/pythonmonkey/global.d.ts +++ b/python/pythonmonkey/global.d.ts @@ -47,8 +47,6 @@ declare function pmEval(code: string): any; // XXX: ↓↓↓ we must use "var" here declare var console: import("console").Console; -declare var DOMException: typeof import("dom-exception").DOMException; - // Expose `atob`/`btoa` as properties of the global object declare var atob: typeof import("base64").atob; declare var btoa: typeof import("base64").btoa; @@ -61,6 +59,9 @@ declare var clearTimeout: typeof import("timers").clearTimeout; declare var URL: typeof import("url").URL; declare var URLSearchParams: typeof import("url").URLSearchParams; +// Expose `XMLHttpRequest` (XHR) API +declare var XMLHttpRequest: typeof import("XMLHttpRequest").XMLHttpRequest; + // Keep this in sync with both https://hg.mozilla.org/releases/mozilla-esr102/file/a03fde6/js/public/Promise.h#l331 // and https://github.com/nodejs/node/blob/v20.2.0/deps/v8/include/v8-promise.h#L30 declare enum PromiseState { Pending = 0, Fulfilled = 1, Rejected = 2 } From ff00b013f90716a74dfccad4da71cbd8f301eba2 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 25 Aug 2023 11:33:48 +0000 Subject: [PATCH 0040/1086] feat(XHR): implement `responseType == "text"` --- .../XMLHttpRequest-internal.d.ts | 5 +++ .../XMLHttpRequest-internal.py | 4 ++ .../builtin_modules/XMLHttpRequest.js | 38 ++++++++++++------- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts index de804ffe..32cd664f 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts @@ -17,3 +17,8 @@ export declare function request( processBodyChunk: (bytes: Uint8Array) => void, processEndOfBody: () => void, ): string; + +/** + * Decode data using the codec registered for encoding. + */ +export declare function decodeStr(data: Uint8Array, encoding?: string): string; diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py index 7729ae25..3439da75 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py @@ -54,5 +54,9 @@ def getAllResponseHeaders(): # readyState DONE processEndOfBody() +def decodeStr(data: bytes, encoding='utf-8'): # XXX: Remove this once we get proper TextDecoder support + return str(data, encoding=encoding) + # Module exports exports['request'] = request # type: ignore +exports['decodeStr'] = decodeStr # type: ignore diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index 277c2582..d18cf554 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -9,7 +9,7 @@ const { EventTarget, Event } = require('event-target'); const { DOMException } = require('dom-exception'); const { URL, URLSearchParams } = require('url'); -const { request } = require('XMLHttpRequest-internal'); +const { request, decodeStr } = require('XMLHttpRequest-internal'); // exposed /** @@ -420,7 +420,10 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget */ #getTextResponse() { - // TODO + // TODO: refactor using proper TextDecoder API + // TODO: handle encodings other than utf-8 + this.#responseObject = decodeStr(this.#mergeReceivedBytes(), 'utf-8'); + return this.#responseObject; } /** @@ -438,16 +441,7 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget return this.#responseObject; if (this.#responseType === 'arraybuffer') // step 5 { - // concatenate received bytes - let offset = 0; - const merged = new Uint8Array(this.#receivedLength); - for (const chunk of this.#receivedBytes) - { - merged.set(chunk, offset); - offset += chunk.length; - } - - this.#responseObject = merged.buffer; + this.#responseObject = this.#mergeReceivedBytes().buffer; return this.#responseObject; } @@ -499,14 +493,32 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget #responseType = ''; /** * cache for converting receivedBytes to the desired response type - * @type {ArrayBuffer} + * @type {ArrayBuffer | string} */ #responseObject = null; + /** + * Get received bytes’s total length + */ get #receivedLength() { return this.#receivedBytes.reduce((sum, chunk) => sum + chunk.length, 0); } + + /** + * Concatenate received bytes into one single Uint8Array + */ + #mergeReceivedBytes() + { + let offset = 0; + const merged = new Uint8Array(this.#receivedLength); + for (const chunk of this.#receivedBytes) + { + merged.set(chunk, offset); + offset += chunk.length; + } + return merged; + } } if (!globalThis.XMLHttpRequestEventTarget) From a0e00ded20e9885284f9724ea2273a3c9b5279fc Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 25 Aug 2023 21:48:00 +0000 Subject: [PATCH 0041/1086] feat(XHR): pass `processRequestBodyChunkLength` and `processRequestEndOfBody` callbacks to request function --- .../pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts | 4 ++++ .../pythonmonkey/builtin_modules/XMLHttpRequest-internal.py | 4 ++++ python/pythonmonkey/builtin_modules/XMLHttpRequest.js | 2 ++ 3 files changed, 10 insertions(+) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts index 32cd664f..617889e8 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts @@ -13,6 +13,10 @@ export declare function request( url: string, headers: Record, body: string | Uint8Array, + // callbacks for request body progress + processRequestBodyChunkLength: (bytesLength: number) => void, + processRequestEndOfBody: () => void, + // callbacks for response progress processResponse: (response: any) => void, processBodyChunk: (bytes: Uint8Array) => void, processEndOfBody: () => void, diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py index 3439da75..fe964611 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py @@ -12,6 +12,10 @@ async def request( url: str, headers: dict, body: Union[str, Sequence[int]], + # callbacks for request body progress + processRequestBodyChunkLength: Callable[[int], None], + processRequestEndOfBody: Callable[[], None], + # callbacks for response progress processResponse: Callable[[Any], None], processBodyChunk: Callable[[bytearray], None], processEndOfBody: Callable[[], None], diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index d18cf554..b8d831cd 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -307,6 +307,8 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget this.#requestURL.toString(), this.#requestHeaders, this.#requestBody ?? '', + processRequestBodyChunkLength, + processRequestEndOfBody, processResponse, processBodyChunk, processEndOfBody, From 024f63eb6adb625f97594c369906ce49dfb64e71 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 25 Aug 2023 22:18:23 +0000 Subject: [PATCH 0042/1086] feat(XHR): implement upload progress monitoring --- .../XMLHttpRequest-internal.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py index fe964611..d453579a 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py @@ -5,13 +5,14 @@ import aiohttp import yarl -from typing import Union, Sequence, Callable, Any +import io +from typing import Union, ByteString, Callable, Any async def request( method: str, url: str, headers: dict, - body: Union[str, Sequence[int]], + body: Union[str, ByteString], # callbacks for request body progress processRequestBodyChunkLength: Callable[[int], None], processRequestEndOfBody: Callable[[], None], @@ -21,13 +22,25 @@ async def request( processEndOfBody: Callable[[], None], / ): + class BytesPayloadWithProgress(aiohttp.BytesPayload): + _chunkMaxLength = 2**16 # aiohttp default + + async def write(self, writer) -> None: + buf = io.BytesIO(self._value) + chunk = buf.read(self._chunkMaxLength) + while chunk: + await writer.write(chunk) + processRequestBodyChunkLength(len(chunk)) + chunk = buf.read(self._chunkMaxLength) + processRequestEndOfBody() + if isinstance(body, str): body = bytes(body, "utf-8") async with aiohttp.request(method=method, url=yarl.URL(url, encoded=True), headers=dict(headers), - data=bytes(body) + data=BytesPayloadWithProgress(body) ) as res: def getResponseHeader(name: str): return res.headers.get(name) From 8b3517e07173b1e5e00f67874f55844607a18572 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Thu, 31 Aug 2023 22:37:56 +0000 Subject: [PATCH 0043/1086] fix(XHR): typings --- .../pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts index 617889e8..40f4b667 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts @@ -20,7 +20,7 @@ export declare function request( processResponse: (response: any) => void, processBodyChunk: (bytes: Uint8Array) => void, processEndOfBody: () => void, -): string; +): Promise; /** * Decode data using the codec registered for encoding. From 01cb0847a72a9b3fcd12757eb0f4c96f16de3fa9 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Thu, 31 Aug 2023 22:57:47 +0000 Subject: [PATCH 0044/1086] fix(XHR): typings for `processResponse` callback --- .../XMLHttpRequest-internal.d.ts | 20 +++++++++++++++++- .../XMLHttpRequest-internal.py | 21 ++++++++++++++----- .../builtin_modules/XMLHttpRequest.js | 1 + 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts index 40f4b667..cd508445 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts @@ -5,6 +5,24 @@ * @date August 2023 */ +/** + * `processResponse` callback's argument type + */ +export declare interface XHRResponse { + /** Response URL */ + url: string; + /** HTTP status */ + status: number; + /** HTTP status message */ + statusText: string; + /** The `Content-Type` header value */ + contentLength: number; + /** Implementation of the `xhr.getResponseHeader` method */ + getResponseHeader(name: string): string | undefined; + /** Implementation of the `xhr.getAllResponseHeaders` method */ + getAllResponseHeaders(): string; +} + /** * Send request */ @@ -17,7 +35,7 @@ export declare function request( processRequestBodyChunkLength: (bytesLength: number) => void, processRequestEndOfBody: () => void, // callbacks for response progress - processResponse: (response: any) => void, + processResponse: (response: XHRResponse) => void, processBodyChunk: (bytes: Uint8Array) => void, processEndOfBody: () => void, ): Promise; diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py index d453579a..f9be432c 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py @@ -6,7 +6,18 @@ import aiohttp import yarl import io -from typing import Union, ByteString, Callable, Any +from typing import Union, ByteString, Callable, TypedDict + +class XHRResponse(TypedDict, total=True): + """ + See definitions in `XMLHttpRequest-internal.d.ts` + """ + url: str + status: int + statusText: str + contentLength: int + getResponseHeader: Callable[[str], Union[str, None]] + getAllResponseHeaders: Callable[[], str] async def request( method: str, @@ -17,7 +28,7 @@ async def request( processRequestBodyChunkLength: Callable[[int], None], processRequestEndOfBody: Callable[[], None], # callbacks for response progress - processResponse: Callable[[Any], None], + processResponse: Callable[[XHRResponse], None], processBodyChunk: Callable[[bytearray], None], processEndOfBody: Callable[[], None], / @@ -52,15 +63,15 @@ def getAllResponseHeaders(): return "\r\n".join(headers) # readyState HEADERS_RECEIVED - responseData = { # FIXME: PythonMonkey bug: the dict will be GCed if directly as an argument + responseData: XHRResponse = { # FIXME: PythonMonkey bug: the dict will be GCed if directly as an argument 'url': str(res.real_url), 'status': res.status, - 'statusText': res.reason, + 'statusText': str(res.reason or ''), 'getResponseHeader': getResponseHeader, 'getAllResponseHeaders': getAllResponseHeaders, - 'contentLength': res.content_length, + 'contentLength': res.content_length or 0, } processResponse(responseData) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index b8d831cd..44de8a48 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -488,6 +488,7 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget #uploadCompleteFlag = false; // A flag, initially unset. #uploadListenerFlag = false; // A flag, initially unset. #timedOutFlag = false; // A flag, initially unset. + /** @type {import('./XMLHttpRequest-internal').XHRResponse} */ #response = null; /** @type {Uint8Array[]} */ #receivedBytes = []; From b730be575512cb312b7910107bbccee83516b778 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Sep 2023 00:42:43 +0000 Subject: [PATCH 0045/1086] feat(XHR): handle timeout --- .../XMLHttpRequest-internal.d.ts | 3 + .../XMLHttpRequest-internal.py | 73 +++++++++++-------- .../builtin_modules/XMLHttpRequest.js | 63 +++++++++++++++- 3 files changed, 105 insertions(+), 34 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts index cd508445..d8d58f69 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts @@ -31,6 +31,7 @@ export declare function request( url: string, headers: Record, body: string | Uint8Array, + timeoutMs: number, // callbacks for request body progress processRequestBodyChunkLength: (bytesLength: number) => void, processRequestEndOfBody: () => void, @@ -38,6 +39,8 @@ export declare function request( processResponse: (response: XHRResponse) => void, processBodyChunk: (bytes: Uint8Array) => void, processEndOfBody: () => void, + // callbacks for known exceptions + onTimeoutError: (err: Error) => void, ): Promise; /** diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py index f9be432c..ce03509e 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py @@ -24,6 +24,7 @@ async def request( url: str, headers: dict, body: Union[str, ByteString], + timeoutMs: float, # callbacks for request body progress processRequestBodyChunkLength: Callable[[int], None], processRequestEndOfBody: Callable[[], None], @@ -31,6 +32,8 @@ async def request( processResponse: Callable[[XHRResponse], None], processBodyChunk: Callable[[bytearray], None], processEndOfBody: Callable[[], None], + # callbacks for known exceptions + onTimeoutError: Callable[[TimeoutError], None], / ): class BytesPayloadWithProgress(aiohttp.BytesPayload): @@ -48,39 +51,49 @@ async def write(self, writer) -> None: if isinstance(body, str): body = bytes(body, "utf-8") - async with aiohttp.request(method=method, - url=yarl.URL(url, encoded=True), - headers=dict(headers), - data=BytesPayloadWithProgress(body) - ) as res: - def getResponseHeader(name: str): - return res.headers.get(name) - def getAllResponseHeaders(): - headers = [] - for name, value in res.headers.items(): - headers.append(f"{name.lower()}: {value}") - headers.sort() - return "\r\n".join(headers) + if timeoutMs > 0: + timeoutOptions = aiohttp.ClientTimeout(total=timeoutMs/1000) # convert to seconds + else: + timeoutOptions = aiohttp.ClientTimeout() # default timeout - # readyState HEADERS_RECEIVED - responseData: XHRResponse = { # FIXME: PythonMonkey bug: the dict will be GCed if directly as an argument - 'url': str(res.real_url), - 'status': res.status, - 'statusText': str(res.reason or ''), + try: + async with aiohttp.request(method=method, + url=yarl.URL(url, encoded=True), + headers=dict(headers), + data=BytesPayloadWithProgress(body), + timeout=timeoutOptions, + ) as res: + def getResponseHeader(name: str): + return res.headers.get(name) + def getAllResponseHeaders(): + headers = [] + for name, value in res.headers.items(): + headers.append(f"{name.lower()}: {value}") + headers.sort() + return "\r\n".join(headers) - 'getResponseHeader': getResponseHeader, - 'getAllResponseHeaders': getAllResponseHeaders, - - 'contentLength': res.content_length or 0, - } - processResponse(responseData) + # readyState HEADERS_RECEIVED + responseData: XHRResponse = { # FIXME: PythonMonkey bug: the dict will be GCed if directly as an argument + 'url': str(res.real_url), + 'status': res.status, + 'statusText': str(res.reason or ''), + + 'getResponseHeader': getResponseHeader, + 'getAllResponseHeaders': getAllResponseHeaders, + + 'contentLength': res.content_length or 0, + } + processResponse(responseData) - # readyState LOADING - async for data in res.content.iter_any(): - processBodyChunk(bytearray(data)) # PythonMonkey only accepts the mutable bytearray type - - # readyState DONE - processEndOfBody() + # readyState LOADING + async for data in res.content.iter_any(): + processBodyChunk(bytearray(data)) # PythonMonkey only accepts the mutable bytearray type + + # readyState DONE + processEndOfBody() + except TimeoutError as e: + onTimeoutError(e) + raise # rethrow def decodeStr(data: bytes, encoding='utf-8'): # XXX: Remove this once we get proper TextDecoder support return str(data, encoding=encoding) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index 44de8a48..12fd6fc3 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -162,6 +162,21 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget this.#requestHeaders[name] = value; } + /** + * Timeout time in **milliseconds**. + * When set to a non-zero value will cause fetching to terminate after the given time has passed. + */ + timeout = 0; + + get withCredentials() + { + return false; + } + set withCredentials(flag) + { + throw new DOMException('xhr.withCredentials is not supported in PythonMonkey.', 'InvalidAccessError'); + } + /** * Returns the associated XMLHttpRequestUpload object. * It can be used to gather transmission information when data is transferred to a server. @@ -307,14 +322,14 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget this.#requestURL.toString(), this.#requestHeaders, this.#requestBody ?? '', + this.timeout, processRequestBodyChunkLength, processRequestEndOfBody, processResponse, processBodyChunk, processEndOfBody, - ); - - // TODO: handle timeout + () => (this.#timedOutFlag = true), // onTimeoutError + ).catch(this.#handleErrors); } /** @@ -326,6 +341,47 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget // TODO: handle synchronous request } + /** + * @see https://xhr.spec.whatwg.org/#handle-errors + * @param {Error} e + */ + #handleErrors(e) + { + if (!this.#sendFlag) // step 1 + return; + if (this.#timedOutFlag) // step 2 + return this.#reportRequestError('timeout', new DOMException('Timed out', 'TimeoutError')); + } + + /** + * @see {https} ://xhr.spec.whatwg.org/#request-error-steps + * @param {string} event event type + * @param {DOMException} exception + */ + #reportRequestError(event, exception) + { + this.#state = XMLHttpRequest.DONE; // step 1 + this.#sendFlag = false; // step 2 + + if (this.#synchronousFlag) // step 4 + throw exception; + + this.dispatchEvent(new Event('readystatechange')); // step 5 + + if (!this.#uploadCompleteFlag) // step 6 + { + this.#uploadCompleteFlag = true; + if (this.#uploadListenerFlag) + { + this.#uploadObject.dispatchEvent(new ProgressEvent(event, { loaded:0, total:0 })); + this.#uploadObject.dispatchEvent(new ProgressEvent('loadend', { loaded:0, total:0 })); + } + } + + this.dispatchEvent(new ProgressEvent(event, { loaded:0, total:0 })); // step 7 + this.dispatchEvent(new ProgressEvent('loadend', { loaded:0, total:0 })); // step 8 + } + abort() { // TODO @@ -475,7 +531,6 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget #uploadObject = new XMLHttpRequestUpload(); #state = XMLHttpRequest.UNSENT; // One of unsent, opened, headers received, loading, and done; initially unsent. #sendFlag = false; // A flag, initially unset. - #timeout = 0; // An unsigned integer, initially 0. /** @type {Method} */ #requestMethod = null; /** @type {URL} */ From ed83f88ceb5a0fc988e344b42fc169dbc7b42ffa Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Sep 2023 03:03:33 +0000 Subject: [PATCH 0046/1086] feat(XHR): `xhr.onerror` to handle network error --- .../builtin_modules/XMLHttpRequest-internal.d.ts | 1 + .../builtin_modules/XMLHttpRequest-internal.py | 9 +++++++-- python/pythonmonkey/builtin_modules/XMLHttpRequest.js | 11 ++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts index d8d58f69..4db2a4e4 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts @@ -41,6 +41,7 @@ export declare function request( processEndOfBody: () => void, // callbacks for known exceptions onTimeoutError: (err: Error) => void, + onNetworkError: (err: Error) => void, ): Promise; /** diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py index ce03509e..39dce94e 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py @@ -3,6 +3,7 @@ # @author Tom Tang # @date August 2023 +import asyncio import aiohttp import yarl import io @@ -33,7 +34,8 @@ async def request( processBodyChunk: Callable[[bytearray], None], processEndOfBody: Callable[[], None], # callbacks for known exceptions - onTimeoutError: Callable[[TimeoutError], None], + onTimeoutError: Callable[[asyncio.TimeoutError], None], + onNetworkError: Callable[[aiohttp.ClientError], None], / ): class BytesPayloadWithProgress(aiohttp.BytesPayload): @@ -91,9 +93,12 @@ def getAllResponseHeaders(): # readyState DONE processEndOfBody() - except TimeoutError as e: + except asyncio.TimeoutError as e: onTimeoutError(e) raise # rethrow + except aiohttp.ClientError as e: + onNetworkError(e) + raise # rethrow def decodeStr(data: bytes, encoding='utf-8'): # XXX: Remove this once we get proper TextDecoder support return str(data, encoding=encoding) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index 12fd6fc3..3c96983b 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -329,7 +329,8 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget processBodyChunk, processEndOfBody, () => (this.#timedOutFlag = true), // onTimeoutError - ).catch(this.#handleErrors); + () => (this.#response = null /* network error */), // onNetworkError + ).catch((e) => this.#handleErrors(e)); } /** @@ -350,11 +351,13 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget if (!this.#sendFlag) // step 1 return; if (this.#timedOutFlag) // step 2 - return this.#reportRequestError('timeout', new DOMException('Timed out', 'TimeoutError')); + return this.#reportRequestError('timeout', new DOMException(e.toString(), 'TimeoutError')); + if (this.#response === null /* network error */) // step 4 + return this.#reportRequestError('error', new DOMException(e.toString(), 'NetworkError')); } /** - * @see {https} ://xhr.spec.whatwg.org/#request-error-steps + * @see https://xhr.spec.whatwg.org/#request-error-steps * @param {string} event event type * @param {DOMException} exception */ @@ -363,6 +366,8 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget this.#state = XMLHttpRequest.DONE; // step 1 this.#sendFlag = false; // step 2 + this.#response = null/* network error */; // step 3 + if (this.#synchronousFlag) // step 4 throw exception; From 92fda8ae338fbc30387012b868236aa6c2b4d8e6 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Sep 2023 03:11:51 +0000 Subject: [PATCH 0047/1086] feat(XHR): print out network errors even then the error will be handled by `xhr.onerror` --- python/pythonmonkey/builtin_modules/XMLHttpRequest.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index 3c96983b..eb4692ee 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -352,8 +352,11 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget return; if (this.#timedOutFlag) // step 2 return this.#reportRequestError('timeout', new DOMException(e.toString(), 'TimeoutError')); + console.error(e); // similar to browsers, print out network errors even then the error will be handled by `xhr.onerror` if (this.#response === null /* network error */) // step 4 return this.#reportRequestError('error', new DOMException(e.toString(), 'NetworkError')); + else // unknown errors + return this.#reportRequestError('error', new DOMException(e.toString(), 'InvalidStateError')); } /** From bc230b96a7653ae72ad18cb87f5f9dcf75383565 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Sep 2023 03:50:17 +0000 Subject: [PATCH 0048/1086] feat(XHR): implement `xhr.abort()` --- .../XMLHttpRequest-internal.d.ts | 2 ++ .../XMLHttpRequest-internal.py | 4 +++ .../builtin_modules/XMLHttpRequest.js | 29 +++++++++++++++---- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts index 4db2a4e4..d6b88f56 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts @@ -21,6 +21,8 @@ export declare interface XHRResponse { getResponseHeader(name: string): string | undefined; /** Implementation of the `xhr.getAllResponseHeaders` method */ getAllResponseHeaders(): string; + /** Implementation of the `xhr.abort` method */ + abort(): void; } /** diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py index 39dce94e..967ae1c3 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py @@ -19,6 +19,7 @@ class XHRResponse(TypedDict, total=True): contentLength: int getResponseHeader: Callable[[str], Union[str, None]] getAllResponseHeaders: Callable[[], str] + abort: Callable[[], None] async def request( method: str, @@ -73,6 +74,8 @@ def getAllResponseHeaders(): headers.append(f"{name.lower()}: {value}") headers.sort() return "\r\n".join(headers) + def abort(): + res.close() # readyState HEADERS_RECEIVED responseData: XHRResponse = { # FIXME: PythonMonkey bug: the dict will be GCed if directly as an argument @@ -82,6 +85,7 @@ def getAllResponseHeaders(): 'getResponseHeader': getResponseHeader, 'getAllResponseHeaders': getAllResponseHeaders, + 'abort': abort, 'contentLength': res.content_length or 0, } diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index eb4692ee..f80bc3c3 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -62,6 +62,10 @@ const FORBIDDEN_REQUEST_METHODS = [ ]; // exposed +/** + * Implement the `XMLHttpRequest` API (`XHR` for short) according to the spec. + * @see https://xhr.spec.whatwg.org/ + */ class XMLHttpRequest extends XMLHttpRequestEventTarget { // event handler @@ -99,9 +103,6 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget */ open(method, url, async = true, username = null, password = null) { - // Reset - this.abort(); - // Normalize the method. // @ts-expect-error method = method.toString().toUpperCase(); @@ -233,7 +234,7 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget if (this.#uploadObject._hasAnyListeners()) this.#uploadListenerFlag = true; - // FIXME: do we have to initiate request here? (step 6) + // FIXME: do we have to initiate request here instead of in #sendAsync? (step 6) this.#uploadCompleteFlag = false; // step 7 this.#timedOutFlag = false; // step 8 @@ -390,9 +391,27 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget this.dispatchEvent(new ProgressEvent('loadend', { loaded:0, total:0 })); // step 8 } + /** + * Cancels any network activity. + * @see https://xhr.spec.whatwg.org/#the-abort()-method + */ abort() { - // TODO + if (this.#response) + this.#response.abort(); // step 1 + + if ( + (this.#state === XMLHttpRequest.OPENED && this.#sendFlag) + || this.#state === XMLHttpRequest.HEADERS_RECEIVED + || this.#state === XMLHttpRequest.LOADING + ) // step 2 + return this.#reportRequestError('abort', new DOMException('Aborted.', 'AbortError')); + + if (this.#state === XMLHttpRequest.DONE) // step 3 + { + this.#state = XMLHttpRequest.UNSENT; + this.#response = null; /* network error */ + } } // From c51fd0a083a31d2fe7bfe8aa89a5f48564792415 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Sep 2023 03:58:03 +0000 Subject: [PATCH 0049/1086] fix(XHR): readyState constants should be defined on the class instance as well --- .../builtin_modules/XMLHttpRequest.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index f80bc3c3..efdea02e 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -75,11 +75,18 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget // // states // - static UNSENT = 0; - static OPENED = 1; - static HEADERS_RECEIVED = 2; - static LOADING = 3; - static DONE = 4; + /** @readonly */ static UNSENT = 0; + /** @readonly */ static OPENED = 1; + /** @readonly */ static HEADERS_RECEIVED = 2; + /** @readonly */ static LOADING = 3; + /** @readonly */ static DONE = 4; + + /** @readonly */ UNSENT = 0; + /** @readonly */ OPENED = 1; + /** @readonly */ HEADERS_RECEIVED = 2; + /** @readonly */ LOADING = 3; + /** @readonly */ DONE = 4; + /** * Returns client's state. */ From de658c8ebb65ceac3c38943402b57d82ea909b2d Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Sep 2023 04:18:20 +0000 Subject: [PATCH 0050/1086] fix(event-loop): keep loop running until the Python awaitable is done event-loop shield --- src/PromiseType.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PromiseType.cc b/src/PromiseType.cc index 13365a67..bf0c6dd9 100644 --- a/src/PromiseType.cc +++ b/src/PromiseType.cc @@ -97,6 +97,8 @@ static PyObject *futureOnDoneCallback(PyObject *futureCallbackTuple, PyObject *a // see https://docs.python.org/3.9/library/asyncio-future.html#asyncio.Future.add_done_callback PyEventLoop::Future future = PyEventLoop::Future(futureObj); + PyEventLoop::_locker->decCounter(); + PyObject *exception = future.getException(); if (exception == NULL || PyErr_Occurred()) { // awaitable is cancelled, `futureObj.exception()` raises a CancelledError // Reject the promise with the CancelledError, or very unlikely, an InvalidStateError exception if the Future isn’t done yet @@ -130,6 +132,8 @@ JSObject *PromiseType::toJsPromise(JSContext *cx) { if (!loop.initialized()) return nullptr; PyEventLoop::Future future = loop.ensureFuture(pyObject); + PyEventLoop::_locker->incCounter(); + // Resolve or Reject the JS Promise once the python awaitable is done JS::PersistentRooted *rootedPtr = new JS::PersistentRooted(cx, promise); // `promise` is required to be rooted from here to the end of onDoneCallback PyObject *futureCallbackTuple = PyTuple_Pack(2, PyLong_FromVoidPtr(cx), PyLong_FromVoidPtr(rootedPtr)); From 0ded2829dbdb6546fc5dfe3a74356d6b8610ef7a Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Sep 2023 06:43:00 +0000 Subject: [PATCH 0051/1086] fix(XHR): do not send request body if empty --- python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py index 967ae1c3..1a8492d0 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py @@ -63,7 +63,7 @@ async def write(self, writer) -> None: async with aiohttp.request(method=method, url=yarl.URL(url, encoded=True), headers=dict(headers), - data=BytesPayloadWithProgress(body), + data=BytesPayloadWithProgress(body) if body else None, timeout=timeoutOptions, ) as res: def getResponseHeader(name: str): From 0b8c97ae9a8698baa46ab7765159ffff5acaf99d Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Sep 2023 06:52:38 +0000 Subject: [PATCH 0052/1086] feat(XHR): set default `User-Agent` header `Python/ PythonMonkey/` --- .../builtin_modules/XMLHttpRequest-internal.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py index 1a8492d0..0b19043f 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py @@ -7,6 +7,8 @@ import aiohttp import yarl import io +import platform +import pythonmonkey as pm from typing import Union, ByteString, Callable, TypedDict class XHRResponse(TypedDict, total=True): @@ -54,6 +56,10 @@ async def write(self, writer) -> None: if isinstance(body, str): body = bytes(body, "utf-8") + # set default headers + headers=dict(headers) + headers.setdefault("user-agent", f"Python/{platform.python_version()} PythonMonkey/{pm.__version__}") + if timeoutMs > 0: timeoutOptions = aiohttp.ClientTimeout(total=timeoutMs/1000) # convert to seconds else: @@ -62,7 +68,7 @@ async def write(self, writer) -> None: try: async with aiohttp.request(method=method, url=yarl.URL(url, encoded=True), - headers=dict(headers), + headers=headers, data=BytesPayloadWithProgress(body) if body else None, timeout=timeoutOptions, ) as res: From 30f17f7036cdae2761edc42bd1173fe101e896b7 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 29 Sep 2023 08:31:25 -0400 Subject: [PATCH 0053/1086] test(xhr): add testing for XHR --- tests/js/xhr.simple | 126 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 tests/js/xhr.simple diff --git a/tests/js/xhr.simple b/tests/js/xhr.simple new file mode 100644 index 00000000..f4c27637 --- /dev/null +++ b/tests/js/xhr.simple @@ -0,0 +1,126 @@ +/** + * @file xhr.simple + * + * Simple smoke test which ensures that XMLHttpRequest is initialized, that the + * constructor works, and that it can send requests and receive responses. + * + * @author Caleb Aikens, caleb@distributive.network + * @date September 2023 + */ + +const expectedBody = ` + + + Example Domain + + + + + + + + +
+

Example Domain

+

This domain is for use in illustrative examples in documents. You may use this + domain in literature without prior coordination or asking for permission.

+

More information...

+
+ + +`; + +new Promise(function (resolve, reject) { + let xhr = new XMLHttpRequest(); + xhr.open('GET', 'http://www.example.org/'); + + xhr.onload = function () { + if (this.status >= 200 && this.status < 300) { + resolve(this.response); + } + else { + reject({ + status: this.status, + statusText: this.statusText + }); + } + }; + + xhr.onerror = function () { + reject({ + status: this.status, + statusText: this.statusText + }); + }; + + xhr.send(); +}).then((value) => { + if (value != expectedBody) { + console.error('expected ', expectedBody, ' but got ', value); + throw new Error('Test failed'); + } + console.log('Test passed'); +}).catch((error) => { + throw error; +}) + + +new Promise(function (resolve, reject) { + let xhr = new XMLHttpRequest(); + xhr.open('POST', 'http://httpbin.org/post'); + + xhr.onload = function () { + if (this.status >= 200 && this.status < 300) { + resolve(this.response); + } + else { + reject({ + status: this.status, + statusText: this.statusText + }); + } + }; + + xhr.onerror = function () { + reject({ + status: this.status, + statusText: this.statusText + }); + }; + + xhr.send(); +}).then((value) => { + value = JSON.parse(value) + if (!value["headers"]["User-Agent"].startsWith("Python/")) { + console.error("expected Python/* User-Agent, but got ", value.headers["User-Agent"]) + } + console.log('Test passed'); +}).catch((error) => { + throw error; +}) \ No newline at end of file From c6c22ef5b1999409d338701915cf99731a869383 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 29 Sep 2023 09:34:58 -0400 Subject: [PATCH 0054/1086] feat(xhr): add all properties of Event class --- .../builtin_modules/event-target.js | 60 ++++++++++++++++++- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/event-target.js b/python/pythonmonkey/builtin_modules/event-target.js index 088d9b19..b978c049 100644 --- a/python/pythonmonkey/builtin_modules/event-target.js +++ b/python/pythonmonkey/builtin_modules/event-target.js @@ -13,14 +13,68 @@ class Event { /** - * The name identifying the type of the event. + * Indicates whether the event bubbles up through the DOM tree or not. + * @type {Boolean} */ - type = ''; + bubbles = false; + + /** + * Indicates whether the event is cancelable. + * @type {Boolean} + */ + cancelable = true; /** + * Indicates whether the event can bubble across the boundary between the shadow DOM and the regular DOM. + * @type {Boolean} + */ + composed = false; + + /** + * The element to which the event handler has been attached. * @type {EventTarget} */ - target = null; + currentTarget = null; + + /** + * Indicates whether the call to event.preventDefault() canceled the event. + * @type {Boolean} + */ + devaultPrevented = false; + + /** + * Indicates which phase of the event flow is currently being evaluated. + * @type {Number} + */ + eventPhase = Event.NONE; + static NONE = 0; // The event is not being processed + static CAPTURING_PHASE = 1; // The event is being propagated through the target's ancestor objects + static AT_TARGET = 2; // The event has arrived at the event's target + static BUBBLING_PHASE = 3; // The event is propagating back up through the target's ancestors in reverse order, starting with the parent + + /** + * Indicates whether the event was initiated by the browser or by a script. + * @type {Boolean} + */ + isTrusted = false; + + /** + * A reference to the object to which the event was originally dispatched. + * @type {EventTarget} + */ + target = null; + + /** + * The time at which the event was created (in milliseconds). By specification, this value is time since epoch. + * @type {Number} + */ + timeStamp = null; + + /** + * The name identifying the type of the event. + * @type {String} + */ + type = ''; /** * @param {string} type A string with the name of the event. From a1c135eab3747ad36348016bcfb2ab31276ff1ce Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 29 Sep 2023 10:21:12 -0400 Subject: [PATCH 0055/1086] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ffa1a7cd..348cceb6 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ js_eval("console.log")('hello, world') - [done] CommonJS module system .py loader, loads Python modules for use by JS - JS object->Python dict coercion supports inherited-property lookup (via __getattribute__?) - [done] Python host environment supplies event loop, including EventEmitter, setTimeout, etc. -- Python host environment supplies XMLHttpRequest (other project?) +- [done] Python host environment supplies XMLHttpRequest (other project?) - Python host environment supplies basic subsets of NodeJS's fs, path, process, etc, modules; as-needed by dcp-client (other project?) - [done] Python TypedArrays coerce to JS TypeArrays - [done] JS TypedArrays coerce to Python TypeArrays From d3bb1878b93fdc9393032754ec2f201b6f421385 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 28 Oct 2023 03:49:12 +0000 Subject: [PATCH 0056/1086] chore(deps): bump browserify-sign in /python/pminit/pythonmonkey Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2. - [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md) - [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.2.1...v4.2.2) --- updated-dependencies: - dependency-name: browserify-sign dependency-type: indirect ... Signed-off-by: dependabot[bot] --- python/pminit/pythonmonkey/package-lock.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/python/pminit/pythonmonkey/package-lock.json b/python/pminit/pythonmonkey/package-lock.json index faa8b2ab..f8a0c87e 100644 --- a/python/pminit/pythonmonkey/package-lock.json +++ b/python/pminit/pythonmonkey/package-lock.json @@ -81,19 +81,19 @@ } }, "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.2.tgz", + "integrity": "sha512-1rudGyeYY42Dk6texmv7c4VcQ0EsvVbLwZkA+AQB7SxvXxmcD93jcHie8bzecJ+ChDlmAm2Qyu0+Ccg5uhZXCg==", "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", + "elliptic": "^6.5.4", "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "parse-asn1": "^5.1.6", + "readable-stream": "^3.6.2", + "safe-buffer": "^5.2.1" } }, "buffer": { From 642a73da1de8c8f8a96042baefc8b69719a48350 Mon Sep 17 00:00:00 2001 From: Tom Wenzheng Tang Date: Fri, 10 Nov 2023 23:25:03 +0800 Subject: [PATCH 0057/1086] chore: upgrade numpy to the latest version to fix Python 3.12 --- pyproject.toml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c3c91d90..fe80be5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,20 +56,10 @@ pmjs = "pythonmonkey.cli.pmjs:main" [tool.poetry.group.dev.dependencies] pytest = "^7.3.1" pip = "^23.1.2" -numpy = [ - # numpy hasn't released for Python 3.12 yet on PyPI - # TODO: use the PyPI build once the wheels are released for Python 3.12 - {version = "^2.0.0.dev0", allow-prereleases = true, source = "anaconda", python = "3.12.*"}, - {version = "^1.24.3", python = "<3.12"}, -] +numpy = "^1.26.1" pminit = { path = "./python/pminit", develop = true } -[[tool.poetry.source]] -name = "anaconda" -url = "https://pypi.anaconda.org/pythonmonkey/simple" -priority = "explicit" - [build-system] requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning==0.24.0"] build-backend = "poetry_dynamic_versioning.backend" From 8f784606004a0ec2177d393e96f895d356b4000a Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 10 Nov 2023 15:39:24 +0000 Subject: [PATCH 0058/1086] chore: fix numpy 1.26 does not support Python 3.8 --- poetry.lock | 842 +++++++++++++++++++++++++------------------------ pyproject.toml | 5 +- 2 files changed, 428 insertions(+), 419 deletions(-) diff --git a/poetry.lock b/poetry.lock index af352f75..cf8d40bb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2,13 +2,13 @@ [[package]] name = "aiodns" -version = "3.0.0" +version = "3.1.1" description = "Simple DNS resolver for asyncio" optional = false python-versions = "*" files = [ - {file = "aiodns-3.0.0-py3-none-any.whl", hash = "sha256:2b19bc5f97e5c936638d28e665923c093d8af2bf3aa88d35c43417fa25d136a2"}, - {file = "aiodns-3.0.0.tar.gz", hash = "sha256:946bdfabe743fceeeb093c8a010f5d1645f708a241be849e17edfb0e49e08cd6"}, + {file = "aiodns-3.1.1-py3-none-any.whl", hash = "sha256:a387b63da4ced6aad35b1dda2d09620ad608a1c7c0fb71efa07ebb4cd511928d"}, + {file = "aiodns-3.1.1.tar.gz", hash = "sha256:1073eac48185f7a4150cad7f96a5192d6911f12b4fb894de80a088508c9b3a99"}, ] [package.dependencies] @@ -16,98 +16,98 @@ pycares = ">=4.0.0" [[package]] name = "aiohttp" -version = "3.8.5" +version = "3.8.6" description = "Async http client/server framework (asyncio)" optional = false python-versions = ">=3.6" files = [ - {file = "aiohttp-3.8.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a94159871304770da4dd371f4291b20cac04e8c94f11bdea1c3478e557fbe0d8"}, - {file = "aiohttp-3.8.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:13bf85afc99ce6f9ee3567b04501f18f9f8dbbb2ea11ed1a2e079670403a7c84"}, - {file = "aiohttp-3.8.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2ce2ac5708501afc4847221a521f7e4b245abf5178cf5ddae9d5b3856ddb2f3a"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:96943e5dcc37a6529d18766597c491798b7eb7a61d48878611298afc1fca946c"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2ad5c3c4590bb3cc28b4382f031f3783f25ec223557124c68754a2231d989e2b"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0c413c633d0512df4dc7fd2373ec06cc6a815b7b6d6c2f208ada7e9e93a5061d"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:df72ac063b97837a80d80dec8d54c241af059cc9bb42c4de68bd5b61ceb37caa"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c48c5c0271149cfe467c0ff8eb941279fd6e3f65c9a388c984e0e6cf57538e14"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:368a42363c4d70ab52c2c6420a57f190ed3dfaca6a1b19afda8165ee16416a82"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:7607ec3ce4993464368505888af5beb446845a014bc676d349efec0e05085905"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:0d21c684808288a98914e5aaf2a7c6a3179d4df11d249799c32d1808e79503b5"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:312fcfbacc7880a8da0ae8b6abc6cc7d752e9caa0051a53d217a650b25e9a691"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ad093e823df03bb3fd37e7dec9d4670c34f9e24aeace76808fc20a507cace825"}, - {file = "aiohttp-3.8.5-cp310-cp310-win32.whl", hash = "sha256:33279701c04351a2914e1100b62b2a7fdb9a25995c4a104259f9a5ead7ed4802"}, - {file = "aiohttp-3.8.5-cp310-cp310-win_amd64.whl", hash = "sha256:6e4a280e4b975a2e7745573e3fc9c9ba0d1194a3738ce1cbaa80626cc9b4f4df"}, - {file = "aiohttp-3.8.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ae871a964e1987a943d83d6709d20ec6103ca1eaf52f7e0d36ee1b5bebb8b9b9"}, - {file = "aiohttp-3.8.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:461908b2578955045efde733719d62f2b649c404189a09a632d245b445c9c975"}, - {file = "aiohttp-3.8.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:72a860c215e26192379f57cae5ab12b168b75db8271f111019509a1196dfc780"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc14be025665dba6202b6a71cfcdb53210cc498e50068bc088076624471f8bb9"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8af740fc2711ad85f1a5c034a435782fbd5b5f8314c9a3ef071424a8158d7f6b"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:841cd8233cbd2111a0ef0a522ce016357c5e3aff8a8ce92bcfa14cef890d698f"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ed1c46fb119f1b59304b5ec89f834f07124cd23ae5b74288e364477641060ff"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84f8ae3e09a34f35c18fa57f015cc394bd1389bce02503fb30c394d04ee6b938"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:62360cb771707cb70a6fd114b9871d20d7dd2163a0feafe43fd115cfe4fe845e"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:23fb25a9f0a1ca1f24c0a371523546366bb642397c94ab45ad3aedf2941cec6a"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:b0ba0d15164eae3d878260d4c4df859bbdc6466e9e6689c344a13334f988bb53"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:5d20003b635fc6ae3f96d7260281dfaf1894fc3aa24d1888a9b2628e97c241e5"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0175d745d9e85c40dcc51c8f88c74bfbaef9e7afeeeb9d03c37977270303064c"}, - {file = "aiohttp-3.8.5-cp311-cp311-win32.whl", hash = "sha256:2e1b1e51b0774408f091d268648e3d57f7260c1682e7d3a63cb00d22d71bb945"}, - {file = "aiohttp-3.8.5-cp311-cp311-win_amd64.whl", hash = "sha256:043d2299f6dfdc92f0ac5e995dfc56668e1587cea7f9aa9d8a78a1b6554e5755"}, - {file = "aiohttp-3.8.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cae533195e8122584ec87531d6df000ad07737eaa3c81209e85c928854d2195c"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f21e83f355643c345177a5d1d8079f9f28b5133bcd154193b799d380331d5d3"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a7a75ef35f2df54ad55dbf4b73fe1da96f370e51b10c91f08b19603c64004acc"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2e2e9839e14dd5308ee773c97115f1e0a1cb1d75cbeeee9f33824fa5144c7634"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c44e65da1de4403d0576473e2344828ef9c4c6244d65cf4b75549bb46d40b8dd"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78d847e4cde6ecc19125ccbc9bfac4a7ab37c234dd88fbb3c5c524e8e14da543"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:c7a815258e5895d8900aec4454f38dca9aed71085f227537208057853f9d13f2"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:8b929b9bd7cd7c3939f8bcfffa92fae7480bd1aa425279d51a89327d600c704d"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:5db3a5b833764280ed7618393832e0853e40f3d3e9aa128ac0ba0f8278d08649"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:a0215ce6041d501f3155dc219712bc41252d0ab76474615b9700d63d4d9292af"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:fd1ed388ea7fbed22c4968dd64bab0198de60750a25fe8c0c9d4bef5abe13824"}, - {file = "aiohttp-3.8.5-cp36-cp36m-win32.whl", hash = "sha256:6e6783bcc45f397fdebc118d772103d751b54cddf5b60fbcc958382d7dd64f3e"}, - {file = "aiohttp-3.8.5-cp36-cp36m-win_amd64.whl", hash = "sha256:b5411d82cddd212644cf9360879eb5080f0d5f7d809d03262c50dad02f01421a"}, - {file = "aiohttp-3.8.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:01d4c0c874aa4ddfb8098e85d10b5e875a70adc63db91f1ae65a4b04d3344cda"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5980a746d547a6ba173fd5ee85ce9077e72d118758db05d229044b469d9029a"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2a482e6da906d5e6e653be079b29bc173a48e381600161c9932d89dfae5942ef"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80bd372b8d0715c66c974cf57fe363621a02f359f1ec81cba97366948c7fc873"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1161b345c0a444ebcf46bf0a740ba5dcf50612fd3d0528883fdc0eff578006a"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cd56db019015b6acfaaf92e1ac40eb8434847d9bf88b4be4efe5bfd260aee692"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:153c2549f6c004d2754cc60603d4668899c9895b8a89397444a9c4efa282aaf4"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4a01951fabc4ce26ab791da5f3f24dca6d9a6f24121746eb19756416ff2d881b"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bfb9162dcf01f615462b995a516ba03e769de0789de1cadc0f916265c257e5d8"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:7dde0009408969a43b04c16cbbe252c4f5ef4574ac226bc8815cd7342d2028b6"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:4149d34c32f9638f38f544b3977a4c24052042affa895352d3636fa8bffd030a"}, - {file = "aiohttp-3.8.5-cp37-cp37m-win32.whl", hash = "sha256:68c5a82c8779bdfc6367c967a4a1b2aa52cd3595388bf5961a62158ee8a59e22"}, - {file = "aiohttp-3.8.5-cp37-cp37m-win_amd64.whl", hash = "sha256:2cf57fb50be5f52bda004b8893e63b48530ed9f0d6c96c84620dc92fe3cd9b9d"}, - {file = "aiohttp-3.8.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:eca4bf3734c541dc4f374ad6010a68ff6c6748f00451707f39857f429ca36ced"}, - {file = "aiohttp-3.8.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1274477e4c71ce8cfe6c1ec2f806d57c015ebf84d83373676036e256bc55d690"}, - {file = "aiohttp-3.8.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:28c543e54710d6158fc6f439296c7865b29e0b616629767e685a7185fab4a6b9"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:910bec0c49637d213f5d9877105d26e0c4a4de2f8b1b29405ff37e9fc0ad52b8"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5443910d662db951b2e58eb70b0fbe6b6e2ae613477129a5805d0b66c54b6cb7"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2e460be6978fc24e3df83193dc0cc4de46c9909ed92dd47d349a452ef49325b7"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb1558def481d84f03b45888473fc5a1f35747b5f334ef4e7a571bc0dfcb11f8"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:34dd0c107799dcbbf7d48b53be761a013c0adf5571bf50c4ecad5643fe9cfcd0"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:aa1990247f02a54185dc0dff92a6904521172a22664c863a03ff64c42f9b5410"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:0e584a10f204a617d71d359fe383406305a4b595b333721fa50b867b4a0a1548"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:a3cf433f127efa43fee6b90ea4c6edf6c4a17109d1d037d1a52abec84d8f2e42"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:c11f5b099adafb18e65c2c997d57108b5bbeaa9eeee64a84302c0978b1ec948b"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:84de26ddf621d7ac4c975dbea4c945860e08cccde492269db4e1538a6a6f3c35"}, - {file = "aiohttp-3.8.5-cp38-cp38-win32.whl", hash = "sha256:ab88bafedc57dd0aab55fa728ea10c1911f7e4d8b43e1d838a1739f33712921c"}, - {file = "aiohttp-3.8.5-cp38-cp38-win_amd64.whl", hash = "sha256:5798a9aad1879f626589f3df0f8b79b3608a92e9beab10e5fda02c8a2c60db2e"}, - {file = "aiohttp-3.8.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a6ce61195c6a19c785df04e71a4537e29eaa2c50fe745b732aa937c0c77169f3"}, - {file = "aiohttp-3.8.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:773dd01706d4db536335fcfae6ea2440a70ceb03dd3e7378f3e815b03c97ab51"}, - {file = "aiohttp-3.8.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f83a552443a526ea38d064588613aca983d0ee0038801bc93c0c916428310c28"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f7372f7341fcc16f57b2caded43e81ddd18df53320b6f9f042acad41f8e049a"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ea353162f249c8097ea63c2169dd1aa55de1e8fecbe63412a9bc50816e87b761"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e5d47ae48db0b2dcf70bc8a3bc72b3de86e2a590fc299fdbbb15af320d2659de"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d827176898a2b0b09694fbd1088c7a31836d1a505c243811c87ae53a3f6273c1"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3562b06567c06439d8b447037bb655ef69786c590b1de86c7ab81efe1c9c15d8"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4e874cbf8caf8959d2adf572a78bba17cb0e9d7e51bb83d86a3697b686a0ab4d"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6809a00deaf3810e38c628e9a33271892f815b853605a936e2e9e5129762356c"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:33776e945d89b29251b33a7e7d006ce86447b2cfd66db5e5ded4e5cd0340585c"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:eaeed7abfb5d64c539e2db173f63631455f1196c37d9d8d873fc316470dfbacd"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:e91d635961bec2d8f19dfeb41a539eb94bd073f075ca6dae6c8dc0ee89ad6f91"}, - {file = "aiohttp-3.8.5-cp39-cp39-win32.whl", hash = "sha256:00ad4b6f185ec67f3e6562e8a1d2b69660be43070bd0ef6fcec5211154c7df67"}, - {file = "aiohttp-3.8.5-cp39-cp39-win_amd64.whl", hash = "sha256:c0a9034379a37ae42dea7ac1e048352d96286626251862e448933c0f59cbd79c"}, - {file = "aiohttp-3.8.5.tar.gz", hash = "sha256:b9552ec52cc147dbf1944ac7ac98af7602e51ea2dcd076ed194ca3c0d1c7d0bc"}, + {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:41d55fc043954cddbbd82503d9cc3f4814a40bcef30b3569bc7b5e34130718c1"}, + {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1d84166673694841d8953f0a8d0c90e1087739d24632fe86b1a08819168b4566"}, + {file = "aiohttp-3.8.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:253bf92b744b3170eb4c4ca2fa58f9c4b87aeb1df42f71d4e78815e6e8b73c9e"}, + {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3fd194939b1f764d6bb05490987bfe104287bbf51b8d862261ccf66f48fb4096"}, + {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6c5f938d199a6fdbdc10bbb9447496561c3a9a565b43be564648d81e1102ac22"}, + {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2817b2f66ca82ee699acd90e05c95e79bbf1dc986abb62b61ec8aaf851e81c93"}, + {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fa375b3d34e71ccccf172cab401cd94a72de7a8cc01847a7b3386204093bb47"}, + {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9de50a199b7710fa2904be5a4a9b51af587ab24c8e540a7243ab737b45844543"}, + {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e1d8cb0b56b3587c5c01de3bf2f600f186da7e7b5f7353d1bf26a8ddca57f965"}, + {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:8e31e9db1bee8b4f407b77fd2507337a0a80665ad7b6c749d08df595d88f1cf5"}, + {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:7bc88fc494b1f0311d67f29fee6fd636606f4697e8cc793a2d912ac5b19aa38d"}, + {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:ec00c3305788e04bf6d29d42e504560e159ccaf0be30c09203b468a6c1ccd3b2"}, + {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ad1407db8f2f49329729564f71685557157bfa42b48f4b93e53721a16eb813ed"}, + {file = "aiohttp-3.8.6-cp310-cp310-win32.whl", hash = "sha256:ccc360e87341ad47c777f5723f68adbb52b37ab450c8bc3ca9ca1f3e849e5fe2"}, + {file = "aiohttp-3.8.6-cp310-cp310-win_amd64.whl", hash = "sha256:93c15c8e48e5e7b89d5cb4613479d144fda8344e2d886cf694fd36db4cc86865"}, + {file = "aiohttp-3.8.6-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6e2f9cc8e5328f829f6e1fb74a0a3a939b14e67e80832975e01929e320386b34"}, + {file = "aiohttp-3.8.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e6a00ffcc173e765e200ceefb06399ba09c06db97f401f920513a10c803604ca"}, + {file = "aiohttp-3.8.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:41bdc2ba359032e36c0e9de5a3bd00d6fb7ea558a6ce6b70acedf0da86458321"}, + {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:14cd52ccf40006c7a6cd34a0f8663734e5363fd981807173faf3a017e202fec9"}, + {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2d5b785c792802e7b275c420d84f3397668e9d49ab1cb52bd916b3b3ffcf09ad"}, + {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1bed815f3dc3d915c5c1e556c397c8667826fbc1b935d95b0ad680787896a358"}, + {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:96603a562b546632441926cd1293cfcb5b69f0b4159e6077f7c7dbdfb686af4d"}, + {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d76e8b13161a202d14c9584590c4df4d068c9567c99506497bdd67eaedf36403"}, + {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e3f1e3f1a1751bb62b4a1b7f4e435afcdade6c17a4fd9b9d43607cebd242924a"}, + {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:76b36b3124f0223903609944a3c8bf28a599b2cc0ce0be60b45211c8e9be97f8"}, + {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:a2ece4af1f3c967a4390c284797ab595a9f1bc1130ef8b01828915a05a6ae684"}, + {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:16d330b3b9db87c3883e565340d292638a878236418b23cc8b9b11a054aaa887"}, + {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:42c89579f82e49db436b69c938ab3e1559e5a4409eb8639eb4143989bc390f2f"}, + {file = "aiohttp-3.8.6-cp311-cp311-win32.whl", hash = "sha256:efd2fcf7e7b9d7ab16e6b7d54205beded0a9c8566cb30f09c1abe42b4e22bdcb"}, + {file = "aiohttp-3.8.6-cp311-cp311-win_amd64.whl", hash = "sha256:3b2ab182fc28e7a81f6c70bfbd829045d9480063f5ab06f6e601a3eddbbd49a0"}, + {file = "aiohttp-3.8.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:fdee8405931b0615220e5ddf8cd7edd8592c606a8e4ca2a00704883c396e4479"}, + {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d25036d161c4fe2225d1abff2bd52c34ed0b1099f02c208cd34d8c05729882f0"}, + {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5d791245a894be071d5ab04bbb4850534261a7d4fd363b094a7b9963e8cdbd31"}, + {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0cccd1de239afa866e4ce5c789b3032442f19c261c7d8a01183fd956b1935349"}, + {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f13f60d78224f0dace220d8ab4ef1dbc37115eeeab8c06804fec11bec2bbd07"}, + {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8a9b5a0606faca4f6cc0d338359d6fa137104c337f489cd135bb7fbdbccb1e39"}, + {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:13da35c9ceb847732bf5c6c5781dcf4780e14392e5d3b3c689f6d22f8e15ae31"}, + {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:4d4cbe4ffa9d05f46a28252efc5941e0462792930caa370a6efaf491f412bc66"}, + {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:229852e147f44da0241954fc6cb910ba074e597f06789c867cb7fb0621e0ba7a"}, + {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:713103a8bdde61d13490adf47171a1039fd880113981e55401a0f7b42c37d071"}, + {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:45ad816b2c8e3b60b510f30dbd37fe74fd4a772248a52bb021f6fd65dff809b6"}, + {file = "aiohttp-3.8.6-cp36-cp36m-win32.whl", hash = "sha256:2b8d4e166e600dcfbff51919c7a3789ff6ca8b3ecce16e1d9c96d95dd569eb4c"}, + {file = "aiohttp-3.8.6-cp36-cp36m-win_amd64.whl", hash = "sha256:0912ed87fee967940aacc5306d3aa8ba3a459fcd12add0b407081fbefc931e53"}, + {file = "aiohttp-3.8.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e2a988a0c673c2e12084f5e6ba3392d76c75ddb8ebc6c7e9ead68248101cd446"}, + {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ebf3fd9f141700b510d4b190094db0ce37ac6361a6806c153c161dc6c041ccda"}, + {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3161ce82ab85acd267c8f4b14aa226047a6bee1e4e6adb74b798bd42c6ae1f80"}, + {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d95fc1bf33a9a81469aa760617b5971331cdd74370d1214f0b3109272c0e1e3c"}, + {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c43ecfef7deaf0617cee936836518e7424ee12cb709883f2c9a1adda63cc460"}, + {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca80e1b90a05a4f476547f904992ae81eda5c2c85c66ee4195bb8f9c5fb47f28"}, + {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:90c72ebb7cb3a08a7f40061079817133f502a160561d0675b0a6adf231382c92"}, + {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:bb54c54510e47a8c7c8e63454a6acc817519337b2b78606c4e840871a3e15349"}, + {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:de6a1c9f6803b90e20869e6b99c2c18cef5cc691363954c93cb9adeb26d9f3ae"}, + {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:a3628b6c7b880b181a3ae0a0683698513874df63783fd89de99b7b7539e3e8a8"}, + {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:fc37e9aef10a696a5a4474802930079ccfc14d9f9c10b4662169671ff034b7df"}, + {file = "aiohttp-3.8.6-cp37-cp37m-win32.whl", hash = "sha256:f8ef51e459eb2ad8e7a66c1d6440c808485840ad55ecc3cafefadea47d1b1ba2"}, + {file = "aiohttp-3.8.6-cp37-cp37m-win_amd64.whl", hash = "sha256:b2fe42e523be344124c6c8ef32a011444e869dc5f883c591ed87f84339de5976"}, + {file = "aiohttp-3.8.6-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:9e2ee0ac5a1f5c7dd3197de309adfb99ac4617ff02b0603fd1e65b07dc772e4b"}, + {file = "aiohttp-3.8.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:01770d8c04bd8db568abb636c1fdd4f7140b284b8b3e0b4584f070180c1e5c62"}, + {file = "aiohttp-3.8.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:3c68330a59506254b556b99a91857428cab98b2f84061260a67865f7f52899f5"}, + {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89341b2c19fb5eac30c341133ae2cc3544d40d9b1892749cdd25892bbc6ac951"}, + {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:71783b0b6455ac8f34b5ec99d83e686892c50498d5d00b8e56d47f41b38fbe04"}, + {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f628dbf3c91e12f4d6c8b3f092069567d8eb17814aebba3d7d60c149391aee3a"}, + {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b04691bc6601ef47c88f0255043df6f570ada1a9ebef99c34bd0b72866c217ae"}, + {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ee912f7e78287516df155f69da575a0ba33b02dd7c1d6614dbc9463f43066e3"}, + {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9c19b26acdd08dd239e0d3669a3dddafd600902e37881f13fbd8a53943079dbc"}, + {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:99c5ac4ad492b4a19fc132306cd57075c28446ec2ed970973bbf036bcda1bcc6"}, + {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:f0f03211fd14a6a0aed2997d4b1c013d49fb7b50eeb9ffdf5e51f23cfe2c77fa"}, + {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:8d399dade330c53b4106160f75f55407e9ae7505263ea86f2ccca6bfcbdb4921"}, + {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ec4fd86658c6a8964d75426517dc01cbf840bbf32d055ce64a9e63a40fd7b771"}, + {file = "aiohttp-3.8.6-cp38-cp38-win32.whl", hash = "sha256:33164093be11fcef3ce2571a0dccd9041c9a93fa3bde86569d7b03120d276c6f"}, + {file = "aiohttp-3.8.6-cp38-cp38-win_amd64.whl", hash = "sha256:bdf70bfe5a1414ba9afb9d49f0c912dc524cf60141102f3a11143ba3d291870f"}, + {file = "aiohttp-3.8.6-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:d52d5dc7c6682b720280f9d9db41d36ebe4791622c842e258c9206232251ab2b"}, + {file = "aiohttp-3.8.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4ac39027011414dbd3d87f7edb31680e1f430834c8cef029f11c66dad0670aa5"}, + {file = "aiohttp-3.8.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3f5c7ce535a1d2429a634310e308fb7d718905487257060e5d4598e29dc17f0b"}, + {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b30e963f9e0d52c28f284d554a9469af073030030cef8693106d918b2ca92f54"}, + {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:918810ef188f84152af6b938254911055a72e0f935b5fbc4c1a4ed0b0584aed1"}, + {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:002f23e6ea8d3dd8d149e569fd580c999232b5fbc601c48d55398fbc2e582e8c"}, + {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4fcf3eabd3fd1a5e6092d1242295fa37d0354b2eb2077e6eb670accad78e40e1"}, + {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:255ba9d6d5ff1a382bb9a578cd563605aa69bec845680e21c44afc2670607a95"}, + {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d67f8baed00870aa390ea2590798766256f31dc5ed3ecc737debb6e97e2ede78"}, + {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:86f20cee0f0a317c76573b627b954c412ea766d6ada1a9fcf1b805763ae7feeb"}, + {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:39a312d0e991690ccc1a61f1e9e42daa519dcc34ad03eb6f826d94c1190190dd"}, + {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:e827d48cf802de06d9c935088c2924e3c7e7533377d66b6f31ed175c1620e05e"}, + {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:bd111d7fc5591ddf377a408ed9067045259ff2770f37e2d94e6478d0f3fc0c17"}, + {file = "aiohttp-3.8.6-cp39-cp39-win32.whl", hash = "sha256:caf486ac1e689dda3502567eb89ffe02876546599bbf915ec94b1fa424eeffd4"}, + {file = "aiohttp-3.8.6-cp39-cp39-win_amd64.whl", hash = "sha256:3f0e27e5b733803333bb2371249f41cf42bae8884863e8e8965ec69bebe53132"}, + {file = "aiohttp-3.8.6.tar.gz", hash = "sha256:b0cf2a4501bff9330a8a5248b4ce951851e415bdcce9dc158e76cfd55e15085c"}, ] [package.dependencies] @@ -170,93 +170,94 @@ tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pyte [[package]] name = "brotli" -version = "1.0.9" +version = "1.1.0" description = "Python bindings for the Brotli compression library" optional = false python-versions = "*" files = [ - {file = "Brotli-1.0.9-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:268fe94547ba25b58ebc724680609c8ee3e5a843202e9a381f6f9c5e8bdb5c70"}, - {file = "Brotli-1.0.9-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:c2415d9d082152460f2bd4e382a1e85aed233abc92db5a3880da2257dc7daf7b"}, - {file = "Brotli-1.0.9-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:5913a1177fc36e30fcf6dc868ce23b0453952c78c04c266d3149b3d39e1410d6"}, - {file = "Brotli-1.0.9-cp27-cp27m-win32.whl", hash = "sha256:afde17ae04d90fbe53afb628f7f2d4ca022797aa093e809de5c3cf276f61bbfa"}, - {file = "Brotli-1.0.9-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:7cb81373984cc0e4682f31bc3d6be9026006d96eecd07ea49aafb06897746452"}, - {file = "Brotli-1.0.9-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:db844eb158a87ccab83e868a762ea8024ae27337fc7ddcbfcddd157f841fdfe7"}, - {file = "Brotli-1.0.9-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:9744a863b489c79a73aba014df554b0e7a0fc44ef3f8a0ef2a52919c7d155031"}, - {file = "Brotli-1.0.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a72661af47119a80d82fa583b554095308d6a4c356b2a554fdc2799bc19f2a43"}, - {file = "Brotli-1.0.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ee83d3e3a024a9618e5be64648d6d11c37047ac48adff25f12fa4226cf23d1c"}, - {file = "Brotli-1.0.9-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:19598ecddd8a212aedb1ffa15763dd52a388518c4550e615aed88dc3753c0f0c"}, - {file = "Brotli-1.0.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:44bb8ff420c1d19d91d79d8c3574b8954288bdff0273bf788954064d260d7ab0"}, - {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e23281b9a08ec338469268f98f194658abfb13658ee98e2b7f85ee9dd06caa91"}, - {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:3496fc835370da351d37cada4cf744039616a6db7d13c430035e901443a34daa"}, - {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b83bb06a0192cccf1eb8d0a28672a1b79c74c3a8a5f2619625aeb6f28b3a82bb"}, - {file = "Brotli-1.0.9-cp310-cp310-win32.whl", hash = "sha256:26d168aac4aaec9a4394221240e8a5436b5634adc3cd1cdf637f6645cecbf181"}, - {file = "Brotli-1.0.9-cp310-cp310-win_amd64.whl", hash = "sha256:622a231b08899c864eb87e85f81c75e7b9ce05b001e59bbfbf43d4a71f5f32b2"}, - {file = "Brotli-1.0.9-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:cc0283a406774f465fb45ec7efb66857c09ffefbe49ec20b7882eff6d3c86d3a"}, - {file = "Brotli-1.0.9-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:11d3283d89af7033236fa4e73ec2cbe743d4f6a81d41bd234f24bf63dde979df"}, - {file = "Brotli-1.0.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c1306004d49b84bd0c4f90457c6f57ad109f5cc6067a9664e12b7b79a9948ad"}, - {file = "Brotli-1.0.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1375b5d17d6145c798661b67e4ae9d5496920d9265e2f00f1c2c0b5ae91fbde"}, - {file = "Brotli-1.0.9-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cab1b5964b39607a66adbba01f1c12df2e55ac36c81ec6ed44f2fca44178bf1a"}, - {file = "Brotli-1.0.9-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:8ed6a5b3d23ecc00ea02e1ed8e0ff9a08f4fc87a1f58a2530e71c0f48adf882f"}, - {file = "Brotli-1.0.9-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:cb02ed34557afde2d2da68194d12f5719ee96cfb2eacc886352cb73e3808fc5d"}, - {file = "Brotli-1.0.9-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:b3523f51818e8f16599613edddb1ff924eeb4b53ab7e7197f85cbc321cdca32f"}, - {file = "Brotli-1.0.9-cp311-cp311-win32.whl", hash = "sha256:ba72d37e2a924717990f4d7482e8ac88e2ef43fb95491eb6e0d124d77d2a150d"}, - {file = "Brotli-1.0.9-cp311-cp311-win_amd64.whl", hash = "sha256:3ffaadcaeafe9d30a7e4e1e97ad727e4f5610b9fa2f7551998471e3736738679"}, - {file = "Brotli-1.0.9-cp35-cp35m-macosx_10_6_intel.whl", hash = "sha256:c83aa123d56f2e060644427a882a36b3c12db93727ad7a7b9efd7d7f3e9cc2c4"}, - {file = "Brotli-1.0.9-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:6b2ae9f5f67f89aade1fab0f7fd8f2832501311c363a21579d02defa844d9296"}, - {file = "Brotli-1.0.9-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:68715970f16b6e92c574c30747c95cf8cf62804569647386ff032195dc89a430"}, - {file = "Brotli-1.0.9-cp35-cp35m-win32.whl", hash = "sha256:defed7ea5f218a9f2336301e6fd379f55c655bea65ba2476346340a0ce6f74a1"}, - {file = "Brotli-1.0.9-cp35-cp35m-win_amd64.whl", hash = "sha256:88c63a1b55f352b02c6ffd24b15ead9fc0e8bf781dbe070213039324922a2eea"}, - {file = "Brotli-1.0.9-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:503fa6af7da9f4b5780bb7e4cbe0c639b010f12be85d02c99452825dd0feef3f"}, - {file = "Brotli-1.0.9-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:40d15c79f42e0a2c72892bf407979febd9cf91f36f495ffb333d1d04cebb34e4"}, - {file = "Brotli-1.0.9-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:93130612b837103e15ac3f9cbacb4613f9e348b58b3aad53721d92e57f96d46a"}, - {file = "Brotli-1.0.9-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87fdccbb6bb589095f413b1e05734ba492c962b4a45a13ff3408fa44ffe6479b"}, - {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:6d847b14f7ea89f6ad3c9e3901d1bc4835f6b390a9c71df999b0162d9bb1e20f"}, - {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:495ba7e49c2db22b046a53b469bbecea802efce200dffb69b93dd47397edc9b6"}, - {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:4688c1e42968ba52e57d8670ad2306fe92e0169c6f3af0089be75bbac0c64a3b"}, - {file = "Brotli-1.0.9-cp36-cp36m-win32.whl", hash = "sha256:61a7ee1f13ab913897dac7da44a73c6d44d48a4adff42a5701e3239791c96e14"}, - {file = "Brotli-1.0.9-cp36-cp36m-win_amd64.whl", hash = "sha256:1c48472a6ba3b113452355b9af0a60da5c2ae60477f8feda8346f8fd48e3e87c"}, - {file = "Brotli-1.0.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:3b78a24b5fd13c03ee2b7b86290ed20efdc95da75a3557cc06811764d5ad1126"}, - {file = "Brotli-1.0.9-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:9d12cf2851759b8de8ca5fde36a59c08210a97ffca0eb94c532ce7b17c6a3d1d"}, - {file = "Brotli-1.0.9-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:6c772d6c0a79ac0f414a9f8947cc407e119b8598de7621f39cacadae3cf57d12"}, - {file = "Brotli-1.0.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29d1d350178e5225397e28ea1b7aca3648fcbab546d20e7475805437bfb0a130"}, - {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7bbff90b63328013e1e8cb50650ae0b9bac54ffb4be6104378490193cd60f85a"}, - {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:ec1947eabbaf8e0531e8e899fc1d9876c179fc518989461f5d24e2223395a9e3"}, - {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:12effe280b8ebfd389022aa65114e30407540ccb89b177d3fbc9a4f177c4bd5d"}, - {file = "Brotli-1.0.9-cp37-cp37m-win32.whl", hash = "sha256:f909bbbc433048b499cb9db9e713b5d8d949e8c109a2a548502fb9aa8630f0b1"}, - {file = "Brotli-1.0.9-cp37-cp37m-win_amd64.whl", hash = "sha256:97f715cf371b16ac88b8c19da00029804e20e25f30d80203417255d239f228b5"}, - {file = "Brotli-1.0.9-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e16eb9541f3dd1a3e92b89005e37b1257b157b7256df0e36bd7b33b50be73bcb"}, - {file = "Brotli-1.0.9-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:160c78292e98d21e73a4cc7f76a234390e516afcd982fa17e1422f7c6a9ce9c8"}, - {file = "Brotli-1.0.9-cp38-cp38-manylinux1_i686.whl", hash = "sha256:b663f1e02de5d0573610756398e44c130add0eb9a3fc912a09665332942a2efb"}, - {file = "Brotli-1.0.9-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:5b6ef7d9f9c38292df3690fe3e302b5b530999fa90014853dcd0d6902fb59f26"}, - {file = "Brotli-1.0.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8a674ac10e0a87b683f4fa2b6fa41090edfd686a6524bd8dedbd6138b309175c"}, - {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e2d9e1cbc1b25e22000328702b014227737756f4b5bf5c485ac1d8091ada078b"}, - {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:b336c5e9cf03c7be40c47b5fd694c43c9f1358a80ba384a21969e0b4e66a9b17"}, - {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:85f7912459c67eaab2fb854ed2bc1cc25772b300545fe7ed2dc03954da638649"}, - {file = "Brotli-1.0.9-cp38-cp38-win32.whl", hash = "sha256:35a3edbe18e876e596553c4007a087f8bcfd538f19bc116917b3c7522fca0429"}, - {file = "Brotli-1.0.9-cp38-cp38-win_amd64.whl", hash = "sha256:269a5743a393c65db46a7bb982644c67ecba4b8d91b392403ad8a861ba6f495f"}, - {file = "Brotli-1.0.9-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2aad0e0baa04517741c9bb5b07586c642302e5fb3e75319cb62087bd0995ab19"}, - {file = "Brotli-1.0.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5cb1e18167792d7d21e21365d7650b72d5081ed476123ff7b8cac7f45189c0c7"}, - {file = "Brotli-1.0.9-cp39-cp39-manylinux1_i686.whl", hash = "sha256:16d528a45c2e1909c2798f27f7bf0a3feec1dc9e50948e738b961618e38b6a7b"}, - {file = "Brotli-1.0.9-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:56d027eace784738457437df7331965473f2c0da2c70e1a1f6fdbae5402e0389"}, - {file = "Brotli-1.0.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9bf919756d25e4114ace16a8ce91eb340eb57a08e2c6950c3cebcbe3dff2a5e7"}, - {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e4c4e92c14a57c9bd4cb4be678c25369bf7a092d55fd0866f759e425b9660806"}, - {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:e48f4234f2469ed012a98f4b7874e7f7e173c167bed4934912a29e03167cf6b1"}, - {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9ed4c92a0665002ff8ea852353aeb60d9141eb04109e88928026d3c8a9e5433c"}, - {file = "Brotli-1.0.9-cp39-cp39-win32.whl", hash = "sha256:cfc391f4429ee0a9370aa93d812a52e1fee0f37a81861f4fdd1f4fb28e8547c3"}, - {file = "Brotli-1.0.9-cp39-cp39-win_amd64.whl", hash = "sha256:854c33dad5ba0fbd6ab69185fec8dab89e13cda6b7d191ba111987df74f38761"}, - {file = "Brotli-1.0.9-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9749a124280a0ada4187a6cfd1ffd35c350fb3af79c706589d98e088c5044267"}, - {file = "Brotli-1.0.9-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:73fd30d4ce0ea48010564ccee1a26bfe39323fde05cb34b5863455629db61dc7"}, - {file = "Brotli-1.0.9-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:02177603aaca36e1fd21b091cb742bb3b305a569e2402f1ca38af471777fb019"}, - {file = "Brotli-1.0.9-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:76ffebb907bec09ff511bb3acc077695e2c32bc2142819491579a695f77ffd4d"}, - {file = "Brotli-1.0.9-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:b43775532a5904bc938f9c15b77c613cb6ad6fb30990f3b0afaea82797a402d8"}, - {file = "Brotli-1.0.9-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:5bf37a08493232fbb0f8229f1824b366c2fc1d02d64e7e918af40acd15f3e337"}, - {file = "Brotli-1.0.9-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:330e3f10cd01da535c70d09c4283ba2df5fb78e915bea0a28becad6e2ac010be"}, - {file = "Brotli-1.0.9-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:e1abbeef02962596548382e393f56e4c94acd286bd0c5afba756cffc33670e8a"}, - {file = "Brotli-1.0.9-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:3148362937217b7072cf80a2dcc007f09bb5ecb96dae4617316638194113d5be"}, - {file = "Brotli-1.0.9-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:336b40348269f9b91268378de5ff44dc6fbaa2268194f85177b53463d313842a"}, - {file = "Brotli-1.0.9-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3b8b09a16a1950b9ef495a0f8b9d0a87599a9d1f179e2d4ac014b2ec831f87e7"}, - {file = "Brotli-1.0.9-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:c8e521a0ce7cf690ca84b8cc2272ddaf9d8a50294fd086da67e517439614c755"}, - {file = "Brotli-1.0.9.zip", hash = "sha256:4d1b810aa0ed773f81dceda2cc7b403d01057458730e309856356d4ef4188438"}, + {file = "Brotli-1.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e1140c64812cb9b06c922e77f1c26a75ec5e3f0fb2bf92cc8c58720dec276752"}, + {file = "Brotli-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c8fd5270e906eef71d4a8d19b7c6a43760c6abcfcc10c9101d14eb2357418de9"}, + {file = "Brotli-1.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ae56aca0402a0f9a3431cddda62ad71666ca9d4dc3a10a142b9dce2e3c0cda3"}, + {file = "Brotli-1.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:43ce1b9935bfa1ede40028054d7f48b5469cd02733a365eec8a329ffd342915d"}, + {file = "Brotli-1.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:7c4855522edb2e6ae7fdb58e07c3ba9111e7621a8956f481c68d5d979c93032e"}, + {file = "Brotli-1.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:38025d9f30cf4634f8309c6874ef871b841eb3c347e90b0851f63d1ded5212da"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e6a904cb26bfefc2f0a6f240bdf5233be78cd2488900a2f846f3c3ac8489ab80"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a37b8f0391212d29b3a91a799c8e4a2855e0576911cdfb2515487e30e322253d"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:e84799f09591700a4154154cab9787452925578841a94321d5ee8fb9a9a328f0"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f66b5337fa213f1da0d9000bc8dc0cb5b896b726eefd9c6046f699b169c41b9e"}, + {file = "Brotli-1.1.0-cp310-cp310-win32.whl", hash = "sha256:be36e3d172dc816333f33520154d708a2657ea63762ec16b62ece02ab5e4daf2"}, + {file = "Brotli-1.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:0c6244521dda65ea562d5a69b9a26120769b7a9fb3db2fe9545935ed6735b128"}, + {file = "Brotli-1.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a3daabb76a78f829cafc365531c972016e4aa8d5b4bf60660ad8ecee19df7ccc"}, + {file = "Brotli-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c8146669223164fc87a7e3de9f81e9423c67a79d6b3447994dfb9c95da16e2d6"}, + {file = "Brotli-1.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30924eb4c57903d5a7526b08ef4a584acc22ab1ffa085faceb521521d2de32dd"}, + {file = "Brotli-1.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ceb64bbc6eac5a140ca649003756940f8d6a7c444a68af170b3187623b43bebf"}, + {file = "Brotli-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a469274ad18dc0e4d316eefa616d1d0c2ff9da369af19fa6f3daa4f09671fd61"}, + {file = "Brotli-1.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:524f35912131cc2cabb00edfd8d573b07f2d9f21fa824bd3fb19725a9cf06327"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:5b3cc074004d968722f51e550b41a27be656ec48f8afaeeb45ebf65b561481dd"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:19c116e796420b0cee3da1ccec3b764ed2952ccfcc298b55a10e5610ad7885f9"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:510b5b1bfbe20e1a7b3baf5fed9e9451873559a976c1a78eebaa3b86c57b4265"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a1fd8a29719ccce974d523580987b7f8229aeace506952fa9ce1d53a033873c8"}, + {file = "Brotli-1.1.0-cp311-cp311-win32.whl", hash = "sha256:39da8adedf6942d76dc3e46653e52df937a3c4d6d18fdc94a7c29d263b1f5b50"}, + {file = "Brotli-1.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:aac0411d20e345dc0920bdec5548e438e999ff68d77564d5e9463a7ca9d3e7b1"}, + {file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:316cc9b17edf613ac76b1f1f305d2a748f1b976b033b049a6ecdfd5612c70409"}, + {file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:caf9ee9a5775f3111642d33b86237b05808dafcd6268faa492250e9b78046eb2"}, + {file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:70051525001750221daa10907c77830bc889cb6d865cc0b813d9db7fefc21451"}, + {file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7f4bf76817c14aa98cc6697ac02f3972cb8c3da93e9ef16b9c66573a68014f91"}, + {file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0c5516f0aed654134a2fc936325cc2e642f8a0e096d075209672eb321cff408"}, + {file = "Brotli-1.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6c3020404e0b5eefd7c9485ccf8393cfb75ec38ce75586e046573c9dc29967a0"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:4ed11165dd45ce798d99a136808a794a748d5dc38511303239d4e2363c0695dc"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:4093c631e96fdd49e0377a9c167bfd75b6d0bad2ace734c6eb20b348bc3ea180"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:7e4c4629ddad63006efa0ef968c8e4751c5868ff0b1c5c40f76524e894c50248"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:861bf317735688269936f755fa136a99d1ed526883859f86e41a5d43c61d8966"}, + {file = "Brotli-1.1.0-cp312-cp312-win32.whl", hash = "sha256:5f4d5ea15c9382135076d2fb28dde923352fe02951e66935a9efaac8f10e81b0"}, + {file = "Brotli-1.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:906bc3a79de8c4ae5b86d3d75a8b77e44404b0f4261714306e3ad248d8ab0951"}, + {file = "Brotli-1.1.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a090ca607cbb6a34b0391776f0cb48062081f5f60ddcce5d11838e67a01928d1"}, + {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2de9d02f5bda03d27ede52e8cfe7b865b066fa49258cbab568720aa5be80a47d"}, + {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2333e30a5e00fe0fe55903c8832e08ee9c3b1382aacf4db26664a16528d51b4b"}, + {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4d4a848d1837973bf0f4b5e54e3bec977d99be36a7895c61abb659301b02c112"}, + {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:fdc3ff3bfccdc6b9cc7c342c03aa2400683f0cb891d46e94b64a197910dc4064"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:5eeb539606f18a0b232d4ba45adccde4125592f3f636a6182b4a8a436548b914"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:fd5f17ff8f14003595ab414e45fce13d073e0762394f957182e69035c9f3d7c2"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:069a121ac97412d1fe506da790b3e69f52254b9df4eb665cd42460c837193354"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:e93dfc1a1165e385cc8239fab7c036fb2cd8093728cbd85097b284d7b99249a2"}, + {file = "Brotli-1.1.0-cp36-cp36m-win32.whl", hash = "sha256:a599669fd7c47233438a56936988a2478685e74854088ef5293802123b5b2460"}, + {file = "Brotli-1.1.0-cp36-cp36m-win_amd64.whl", hash = "sha256:d143fd47fad1db3d7c27a1b1d66162e855b5d50a89666af46e1679c496e8e579"}, + {file = "Brotli-1.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:11d00ed0a83fa22d29bc6b64ef636c4552ebafcef57154b4ddd132f5638fbd1c"}, + {file = "Brotli-1.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f733d788519c7e3e71f0855c96618720f5d3d60c3cb829d8bbb722dddce37985"}, + {file = "Brotli-1.1.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:929811df5462e182b13920da56c6e0284af407d1de637d8e536c5cd00a7daf60"}, + {file = "Brotli-1.1.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0b63b949ff929fbc2d6d3ce0e924c9b93c9785d877a21a1b678877ffbbc4423a"}, + {file = "Brotli-1.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:d192f0f30804e55db0d0e0a35d83a9fead0e9a359a9ed0285dbacea60cc10a84"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:f296c40e23065d0d6650c4aefe7470d2a25fffda489bcc3eb66083f3ac9f6643"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:919e32f147ae93a09fe064d77d5ebf4e35502a8df75c29fb05788528e330fe74"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:23032ae55523cc7bccb4f6a0bf368cd25ad9bcdcc1990b64a647e7bbcce9cb5b"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:224e57f6eac61cc449f498cc5f0e1725ba2071a3d4f48d5d9dffba42db196438"}, + {file = "Brotli-1.1.0-cp37-cp37m-win32.whl", hash = "sha256:587ca6d3cef6e4e868102672d3bd9dc9698c309ba56d41c2b9c85bbb903cdb95"}, + {file = "Brotli-1.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:2954c1c23f81c2eaf0b0717d9380bd348578a94161a65b3a2afc62c86467dd68"}, + {file = "Brotli-1.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:efa8b278894b14d6da122a72fefcebc28445f2d3f880ac59d46c90f4c13be9a3"}, + {file = "Brotli-1.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:03d20af184290887bdea3f0f78c4f737d126c74dc2f3ccadf07e54ceca3bf208"}, + {file = "Brotli-1.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6172447e1b368dcbc458925e5ddaf9113477b0ed542df258d84fa28fc45ceea7"}, + {file = "Brotli-1.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a743e5a28af5f70f9c080380a5f908d4d21d40e8f0e0c8901604d15cfa9ba751"}, + {file = "Brotli-1.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0541e747cce78e24ea12d69176f6a7ddb690e62c425e01d31cc065e69ce55b48"}, + {file = "Brotli-1.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:cdbc1fc1bc0bff1cef838eafe581b55bfbffaed4ed0318b724d0b71d4d377619"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:890b5a14ce214389b2cc36ce82f3093f96f4cc730c1cffdbefff77a7c71f2a97"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ab4fbee0b2d9098c74f3057b2bc055a8bd92ccf02f65944a241b4349229185a"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:141bd4d93984070e097521ed07e2575b46f817d08f9fa42b16b9b5f27b5ac088"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fce1473f3ccc4187f75b4690cfc922628aed4d3dd013d047f95a9b3919a86596"}, + {file = "Brotli-1.1.0-cp38-cp38-win32.whl", hash = "sha256:db85ecf4e609a48f4b29055f1e144231b90edc90af7481aa731ba2d059226b1b"}, + {file = "Brotli-1.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3d7954194c36e304e1523f55d7042c59dc53ec20dd4e9ea9d151f1b62b4415c0"}, + {file = "Brotli-1.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5fb2ce4b8045c78ebbc7b8f3c15062e435d47e7393cc57c25115cfd49883747a"}, + {file = "Brotli-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7905193081db9bfa73b1219140b3d315831cbff0d8941f22da695832f0dd188f"}, + {file = "Brotli-1.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a77def80806c421b4b0af06f45d65a136e7ac0bdca3c09d9e2ea4e515367c7e9"}, + {file = "Brotli-1.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8dadd1314583ec0bf2d1379f7008ad627cd6336625d6679cf2f8e67081b83acf"}, + {file = "Brotli-1.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:901032ff242d479a0efa956d853d16875d42157f98951c0230f69e69f9c09bac"}, + {file = "Brotli-1.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:22fc2a8549ffe699bfba2256ab2ed0421a7b8fadff114a3d201794e45a9ff578"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ae15b066e5ad21366600ebec29a7ccbc86812ed267e4b28e860b8ca16a2bc474"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:949f3b7c29912693cee0afcf09acd6ebc04c57af949d9bf77d6101ebb61e388c"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:89f4988c7203739d48c6f806f1e87a1d96e0806d44f0fba61dba81392c9e474d"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:de6551e370ef19f8de1807d0a9aa2cdfdce2e85ce88b122fe9f6b2b076837e59"}, + {file = "Brotli-1.1.0-cp39-cp39-win32.whl", hash = "sha256:f0d8a7a6b5983c2496e364b969f0e526647a06b075d034f3297dc66f3b360c64"}, + {file = "Brotli-1.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:cdad5b9014d83ca68c25d2e9444e28e967ef16e80f6b436918c700c117a85467"}, + {file = "Brotli-1.1.0.tar.gz", hash = "sha256:81de08ac11bcb85841e440c13611c00b67d3bf82698314928d0b676362546724"}, ] [[package]] @@ -299,75 +300,63 @@ files = [ [[package]] name = "cffi" -version = "1.15.1" +version = "1.16.0" description = "Foreign Function Interface for Python calling C code." optional = false -python-versions = "*" +python-versions = ">=3.8" files = [ - {file = "cffi-1.15.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2"}, - {file = "cffi-1.15.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2"}, - {file = "cffi-1.15.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914"}, - {file = "cffi-1.15.1-cp27-cp27m-win32.whl", hash = "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3"}, - {file = "cffi-1.15.1-cp27-cp27m-win_amd64.whl", hash = "sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e"}, - {file = "cffi-1.15.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162"}, - {file = "cffi-1.15.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b"}, - {file = "cffi-1.15.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21"}, - {file = "cffi-1.15.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e"}, - {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4"}, - {file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01"}, - {file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e"}, - {file = "cffi-1.15.1-cp310-cp310-win32.whl", hash = "sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2"}, - {file = "cffi-1.15.1-cp310-cp310-win_amd64.whl", hash = "sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d"}, - {file = "cffi-1.15.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac"}, - {file = "cffi-1.15.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83"}, - {file = "cffi-1.15.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9"}, - {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c"}, - {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325"}, - {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c"}, - {file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef"}, - {file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8"}, - {file = "cffi-1.15.1-cp311-cp311-win32.whl", hash = "sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d"}, - {file = "cffi-1.15.1-cp311-cp311-win_amd64.whl", hash = "sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104"}, - {file = "cffi-1.15.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405"}, - {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e"}, - {file = "cffi-1.15.1-cp36-cp36m-win32.whl", hash = "sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf"}, - {file = "cffi-1.15.1-cp36-cp36m-win_amd64.whl", hash = "sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497"}, - {file = "cffi-1.15.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c"}, - {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426"}, - {file = "cffi-1.15.1-cp37-cp37m-win32.whl", hash = "sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9"}, - {file = "cffi-1.15.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045"}, - {file = "cffi-1.15.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02"}, - {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192"}, - {file = "cffi-1.15.1-cp38-cp38-win32.whl", hash = "sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314"}, - {file = "cffi-1.15.1-cp38-cp38-win_amd64.whl", hash = "sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5"}, - {file = "cffi-1.15.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585"}, - {file = "cffi-1.15.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35"}, - {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27"}, - {file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76"}, - {file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3"}, - {file = "cffi-1.15.1-cp39-cp39-win32.whl", hash = "sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee"}, - {file = "cffi-1.15.1-cp39-cp39-win_amd64.whl", hash = "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c"}, - {file = "cffi-1.15.1.tar.gz", hash = "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9"}, + {file = "cffi-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b3d6606d369fc1da4fd8c357d026317fbb9c9b75d36dc16e90e84c26854b088"}, + {file = "cffi-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ac0f5edd2360eea2f1daa9e26a41db02dd4b0451b48f7c318e217ee092a213e9"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7e61e3e4fa664a8588aa25c883eab612a188c725755afff6289454d6362b9673"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a72e8961a86d19bdb45851d8f1f08b041ea37d2bd8d4fd19903bc3083d80c896"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5b50bf3f55561dac5438f8e70bfcdfd74543fd60df5fa5f62d94e5867deca684"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7651c50c8c5ef7bdb41108b7b8c5a83013bfaa8a935590c5d74627c047a583c7"}, + {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4108df7fe9b707191e55f33efbcb2d81928e10cea45527879a4749cbe472614"}, + {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:32c68ef735dbe5857c810328cb2481e24722a59a2003018885514d4c09af9743"}, + {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:673739cb539f8cdaa07d92d02efa93c9ccf87e345b9a0b556e3ecc666718468d"}, + {file = "cffi-1.16.0-cp310-cp310-win32.whl", hash = "sha256:9f90389693731ff1f659e55c7d1640e2ec43ff725cc61b04b2f9c6d8d017df6a"}, + {file = "cffi-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:e6024675e67af929088fda399b2094574609396b1decb609c55fa58b028a32a1"}, + {file = "cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b84834d0cf97e7d27dd5b7f3aca7b6e9263c56308ab9dc8aae9784abb774d404"}, + {file = "cffi-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b8ebc27c014c59692bb2664c7d13ce7a6e9a629be20e54e7271fa696ff2b417"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ee07e47c12890ef248766a6e55bd38ebfb2bb8edd4142d56db91b21ea68b7627"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8a9d3ebe49f084ad71f9269834ceccbf398253c9fac910c4fd7053ff1386936"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e70f54f1796669ef691ca07d046cd81a29cb4deb1e5f942003f401c0c4a2695d"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5bf44d66cdf9e893637896c7faa22298baebcd18d1ddb6d2626a6e39793a1d56"}, + {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7b78010e7b97fef4bee1e896df8a4bbb6712b7f05b7ef630f9d1da00f6444d2e"}, + {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c6a164aa47843fb1b01e941d385aab7215563bb8816d80ff3a363a9f8448a8dc"}, + {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e09f3ff613345df5e8c3667da1d918f9149bd623cd9070c983c013792a9a62eb"}, + {file = "cffi-1.16.0-cp311-cp311-win32.whl", hash = "sha256:2c56b361916f390cd758a57f2e16233eb4f64bcbeee88a4881ea90fca14dc6ab"}, + {file = "cffi-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:db8e577c19c0fda0beb7e0d4e09e0ba74b1e4c092e0e40bfa12fe05b6f6d75ba"}, + {file = "cffi-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fa3a0128b152627161ce47201262d3140edb5a5c3da88d73a1b790a959126956"}, + {file = "cffi-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:68e7c44931cc171c54ccb702482e9fc723192e88d25a0e133edd7aff8fcd1f6e"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abd808f9c129ba2beda4cfc53bde801e5bcf9d6e0f22f095e45327c038bfe68e"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88e2b3c14bdb32e440be531ade29d3c50a1a59cd4e51b1dd8b0865c54ea5d2e2"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fcc8eb6d5902bb1cf6dc4f187ee3ea80a1eba0a89aba40a5cb20a5087d961357"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7be2d771cdba2942e13215c4e340bfd76398e9227ad10402a8767ab1865d2e6"}, + {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e715596e683d2ce000574bae5d07bd522c781a822866c20495e52520564f0969"}, + {file = "cffi-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2d92b25dbf6cae33f65005baf472d2c245c050b1ce709cc4588cdcdd5495b520"}, + {file = "cffi-1.16.0-cp312-cp312-win32.whl", hash = "sha256:b2ca4e77f9f47c55c194982e10f058db063937845bb2b7a86c84a6cfe0aefa8b"}, + {file = "cffi-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:68678abf380b42ce21a5f2abde8efee05c114c2fdb2e9eef2efdb0257fba1235"}, + {file = "cffi-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a09582f178759ee8128d9270cd1344154fd473bb77d94ce0aeb2a93ebf0feaf0"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e760191dd42581e023a68b758769e2da259b5d52e3103c6060ddc02c9edb8d7b"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80876338e19c951fdfed6198e70bc88f1c9758b94578d5a7c4c91a87af3cf31c"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a6a14b17d7e17fa0d207ac08642c8820f84f25ce17a442fd15e27ea18d67c59b"}, + {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6602bc8dc6f3a9e02b6c22c4fc1e47aa50f8f8e6d3f78a5e16ac33ef5fefa324"}, + {file = "cffi-1.16.0-cp38-cp38-win32.whl", hash = "sha256:131fd094d1065b19540c3d72594260f118b231090295d8c34e19a7bbcf2e860a"}, + {file = "cffi-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:31d13b0f99e0836b7ff893d37af07366ebc90b678b6664c955b54561fc36ef36"}, + {file = "cffi-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:582215a0e9adbe0e379761260553ba11c58943e4bbe9c36430c4ca6ac74b15ed"}, + {file = "cffi-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b29ebffcf550f9da55bec9e02ad430c992a87e5f512cd63388abb76f1036d8d2"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dc9b18bf40cc75f66f40a7379f6a9513244fe33c0e8aa72e2d56b0196a7ef872"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cb4a35b3642fc5c005a6755a5d17c6c8b6bcb6981baf81cea8bfbc8903e8ba8"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b86851a328eedc692acf81fb05444bdf1891747c25af7529e39ddafaf68a4f3f"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c0f31130ebc2d37cdd8e44605fb5fa7ad59049298b3f745c74fa74c62fbfcfc4"}, + {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f8e709127c6c77446a8c0a8c8bf3c8ee706a06cd44b1e827c3e6a2ee6b8c098"}, + {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:748dcd1e3d3d7cd5443ef03ce8685043294ad6bd7c02a38d1bd367cfd968e000"}, + {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8895613bcc094d4a1b2dbe179d88d7fb4a15cee43c052e8885783fac397d91fe"}, + {file = "cffi-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed86a35631f7bfbb28e108dd96773b9d5a6ce4811cf6ea468bb6a359b256b1e4"}, + {file = "cffi-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:3686dffb02459559c74dd3d81748269ffb0eb027c39a6fc99502de37d501faa8"}, + {file = "cffi-1.16.0.tar.gz", hash = "sha256:bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0"}, ] [package.dependencies] @@ -375,86 +364,101 @@ pycparser = "*" [[package]] name = "charset-normalizer" -version = "3.2.0" +version = "3.3.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7.0" files = [ - {file = "charset-normalizer-3.2.0.tar.gz", hash = "sha256:3bb3d25a8e6c0aedd251753a79ae98a093c7e7b471faa3aa9a93a81431987ace"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0b87549028f680ca955556e3bd57013ab47474c3124dc069faa0b6545b6c9710"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7c70087bfee18a42b4040bb9ec1ca15a08242cf5867c58726530bdf3945672ed"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a103b3a7069b62f5d4890ae1b8f0597618f628b286b03d4bc9195230b154bfa9"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94aea8eff76ee6d1cdacb07dd2123a68283cb5569e0250feab1240058f53b623"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:db901e2ac34c931d73054d9797383d0f8009991e723dab15109740a63e7f902a"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b0dac0ff919ba34d4df1b6131f59ce95b08b9065233446be7e459f95554c0dc8"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:193cbc708ea3aca45e7221ae58f0fd63f933753a9bfb498a3b474878f12caaad"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09393e1b2a9461950b1c9a45d5fd251dc7c6f228acab64da1c9c0165d9c7765c"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:baacc6aee0b2ef6f3d308e197b5d7a81c0e70b06beae1f1fcacffdbd124fe0e3"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:bf420121d4c8dce6b889f0e8e4ec0ca34b7f40186203f06a946fa0276ba54029"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:c04a46716adde8d927adb9457bbe39cf473e1e2c2f5d0a16ceb837e5d841ad4f"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:aaf63899c94de41fe3cf934601b0f7ccb6b428c6e4eeb80da72c58eab077b19a"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d62e51710986674142526ab9f78663ca2b0726066ae26b78b22e0f5e571238dd"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-win32.whl", hash = "sha256:04e57ab9fbf9607b77f7d057974694b4f6b142da9ed4a199859d9d4d5c63fe96"}, - {file = "charset_normalizer-3.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:48021783bdf96e3d6de03a6e39a1171ed5bd7e8bb93fc84cc649d11490f87cea"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4957669ef390f0e6719db3613ab3a7631e68424604a7b448f079bee145da6e09"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:46fb8c61d794b78ec7134a715a3e564aafc8f6b5e338417cb19fe9f57a5a9bf2"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f779d3ad205f108d14e99bb3859aa7dd8e9c68874617c72354d7ecaec2a054ac"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f25c229a6ba38a35ae6e25ca1264621cc25d4d38dca2942a7fce0b67a4efe918"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2efb1bd13885392adfda4614c33d3b68dee4921fd0ac1d3988f8cbb7d589e72a"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f30b48dd7fa1474554b0b0f3fdfdd4c13b5c737a3c6284d3cdc424ec0ffff3a"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:246de67b99b6851627d945db38147d1b209a899311b1305dd84916f2b88526c6"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9bd9b3b31adcb054116447ea22caa61a285d92e94d710aa5ec97992ff5eb7cf3"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:8c2f5e83493748286002f9369f3e6607c565a6a90425a3a1fef5ae32a36d749d"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3170c9399da12c9dc66366e9d14da8bf7147e1e9d9ea566067bbce7bb74bd9c2"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:7a4826ad2bd6b07ca615c74ab91f32f6c96d08f6fcc3902ceeedaec8cdc3bcd6"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:3b1613dd5aee995ec6d4c69f00378bbd07614702a315a2cf6c1d21461fe17c23"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9e608aafdb55eb9f255034709e20d5a83b6d60c054df0802fa9c9883d0a937aa"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-win32.whl", hash = "sha256:f2a1d0fd4242bd8643ce6f98927cf9c04540af6efa92323e9d3124f57727bfc1"}, - {file = "charset_normalizer-3.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:681eb3d7e02e3c3655d1b16059fbfb605ac464c834a0c629048a30fad2b27489"}, - {file = "charset_normalizer-3.2.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c57921cda3a80d0f2b8aec7e25c8aa14479ea92b5b51b6876d975d925a2ea346"}, - {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41b25eaa7d15909cf3ac4c96088c1f266a9a93ec44f87f1d13d4a0e86c81b982"}, - {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f058f6963fd82eb143c692cecdc89e075fa0828db2e5b291070485390b2f1c9c"}, - {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a7647ebdfb9682b7bb97e2a5e7cb6ae735b1c25008a70b906aecca294ee96cf4"}, - {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eef9df1eefada2c09a5e7a40991b9fc6ac6ef20b1372abd48d2794a316dc0449"}, - {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e03b8895a6990c9ab2cdcd0f2fe44088ca1c65ae592b8f795c3294af00a461c3"}, - {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:ee4006268ed33370957f55bf2e6f4d263eaf4dc3cfc473d1d90baff6ed36ce4a"}, - {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c4983bf937209c57240cff65906b18bb35e64ae872da6a0db937d7b4af845dd7"}, - {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:3bb7fda7260735efe66d5107fb7e6af6a7c04c7fce9b2514e04b7a74b06bf5dd"}, - {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:72814c01533f51d68702802d74f77ea026b5ec52793c791e2da806a3844a46c3"}, - {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:70c610f6cbe4b9fce272c407dd9d07e33e6bf7b4aa1b7ffb6f6ded8e634e3592"}, - {file = "charset_normalizer-3.2.0-cp37-cp37m-win32.whl", hash = "sha256:a401b4598e5d3f4a9a811f3daf42ee2291790c7f9d74b18d75d6e21dda98a1a1"}, - {file = "charset_normalizer-3.2.0-cp37-cp37m-win_amd64.whl", hash = "sha256:c0b21078a4b56965e2b12f247467b234734491897e99c1d51cee628da9786959"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:95eb302ff792e12aba9a8b8f8474ab229a83c103d74a750ec0bd1c1eea32e669"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1a100c6d595a7f316f1b6f01d20815d916e75ff98c27a01ae817439ea7726329"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6339d047dab2780cc6220f46306628e04d9750f02f983ddb37439ca47ced7149"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4b749b9cc6ee664a3300bb3a273c1ca8068c46be705b6c31cf5d276f8628a94"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a38856a971c602f98472050165cea2cdc97709240373041b69030be15047691f"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f87f746ee241d30d6ed93969de31e5ffd09a2961a051e60ae6bddde9ec3583aa"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89f1b185a01fe560bc8ae5f619e924407efca2191b56ce749ec84982fc59a32a"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1c8a2f4c69e08e89632defbfabec2feb8a8d99edc9f89ce33c4b9e36ab63037"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2f4ac36d8e2b4cc1aa71df3dd84ff8efbe3bfb97ac41242fbcfc053c67434f46"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a386ebe437176aab38c041de1260cd3ea459c6ce5263594399880bbc398225b2"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:ccd16eb18a849fd8dcb23e23380e2f0a354e8daa0c984b8a732d9cfaba3a776d"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:e6a5bf2cba5ae1bb80b154ed68a3cfa2fa00fde979a7f50d6598d3e17d9ac20c"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:45de3f87179c1823e6d9e32156fb14c1927fcc9aba21433f088fdfb555b77c10"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-win32.whl", hash = "sha256:1000fba1057b92a65daec275aec30586c3de2401ccdcd41f8a5c1e2c87078706"}, - {file = "charset_normalizer-3.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:8b2c760cfc7042b27ebdb4a43a4453bd829a5742503599144d54a032c5dc7e9e"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:855eafa5d5a2034b4621c74925d89c5efef61418570e5ef9b37717d9c796419c"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:203f0c8871d5a7987be20c72442488a0b8cfd0f43b7973771640fc593f56321f"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e857a2232ba53ae940d3456f7533ce6ca98b81917d47adc3c7fd55dad8fab858"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e86d77b090dbddbe78867a0275cb4df08ea195e660f1f7f13435a4649e954e5"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c4fb39a81950ec280984b3a44f5bd12819953dc5fa3a7e6fa7a80db5ee853952"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2dee8e57f052ef5353cf608e0b4c871aee320dd1b87d351c28764fc0ca55f9f4"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8700f06d0ce6f128de3ccdbc1acaea1ee264d2caa9ca05daaf492fde7c2a7200"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1920d4ff15ce893210c1f0c0e9d19bfbecb7983c76b33f046c13a8ffbd570252"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c1c76a1743432b4b60ab3358c937a3fe1341c828ae6194108a94c69028247f22"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f7560358a6811e52e9c4d142d497f1a6e10103d3a6881f18d04dbce3729c0e2c"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:c8063cf17b19661471ecbdb3df1c84f24ad2e389e326ccaf89e3fb2484d8dd7e"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:cd6dbe0238f7743d0efe563ab46294f54f9bc8f4b9bcf57c3c666cc5bc9d1299"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1249cbbf3d3b04902ff081ffbb33ce3377fa6e4c7356f759f3cd076cc138d020"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-win32.whl", hash = "sha256:6c409c0deba34f147f77efaa67b8e4bb83d2f11c8806405f76397ae5b8c0d1c9"}, - {file = "charset_normalizer-3.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:7095f6fbfaa55defb6b733cfeb14efaae7a29f0b59d8cf213be4e7ca0b857b80"}, - {file = "charset_normalizer-3.2.0-py3-none-any.whl", hash = "sha256:8e098148dd37b4ce3baca71fb394c81dc5d9c7728c95df695d2dca218edf40e6"}, + {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"}, + {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, ] [[package]] @@ -470,13 +474,13 @@ files = [ [[package]] name = "exceptiongroup" -version = "1.1.1" +version = "1.1.3" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.1.1-py3-none-any.whl", hash = "sha256:232c37c63e4f682982c8b6459f33a8981039e5fb8756b2074364e5055c498c9e"}, - {file = "exceptiongroup-1.1.1.tar.gz", hash = "sha256:d484c3090ba2889ae2928419117447a14daf3c1231d5e30d0aae34f354f01785"}, + {file = "exceptiongroup-1.1.3-py3-none-any.whl", hash = "sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3"}, + {file = "exceptiongroup-1.1.3.tar.gz", hash = "sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9"}, ] [package.extras] @@ -696,73 +700,76 @@ files = [ [[package]] name = "numpy" -version = "2.0.0.dev0" +version = "1.26.1" description = "Fundamental package for array computing in Python" optional = false -python-versions = ">=3.9" +python-versions = "<3.13,>=3.9" files = [ - {file = "numpy-2.0.0.dev0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d9ee815dd72c00bf2b842f00eca5174b65e8357467561ce3a3711ea666217ebd"}, - {file = "numpy-2.0.0.dev0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9b07c082a32afacf20c72f3e7cfb84b97ac01dd7eabc11a6f339e6d0859cc73c"}, - {file = "numpy-2.0.0.dev0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9e5df60daeb76746476a02d85907a2e65661ad0180a5516dd04d6efb77202bbc"}, - {file = "numpy-2.0.0.dev0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f7f7b2e458ca033a8c28718f57bf2c6bc72b6e091d7a98b4ed0926cce475d7e"}, - {file = "numpy-2.0.0.dev0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:26fef32b250ebbbabd176d4c6f7f74b35461cd035cb7d7575141c42e96a162cb"}, - {file = "numpy-2.0.0.dev0-cp310-cp310-win_amd64.whl", hash = "sha256:95f6254daf1f067759660cfe98dc80615e68c6811130cc6edb4650be82eb3a94"}, - {file = "numpy-2.0.0.dev0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e5bb824a54c6ecedd262cedeaf148f0a20d18352bf01648d6495fad6bf90fad5"}, - {file = "numpy-2.0.0.dev0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7e2edb7eb45409a3822e8d5e5a4e84ff797f90a7ba79192f33f0c8c7fc20db29"}, - {file = "numpy-2.0.0.dev0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9a2871d629cd39048c3e75e29f80e5166dafd5eb08f0ef7292c10fd44523a376"}, - {file = "numpy-2.0.0.dev0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4d0331bc691ffbbbee176808bc3383abe9f99034d7aaba8cf2ccba62e60064c1"}, - {file = "numpy-2.0.0.dev0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3eaa3ad03c472e6d0d2d7a2c51cc8d013a0ff02219ef04c1a699da534587d924"}, - {file = "numpy-2.0.0.dev0-cp311-cp311-win_amd64.whl", hash = "sha256:b67f2d97cd5cb4839cd3c881d31c639b8ee99c3773fbf39440a086eaef6c08f0"}, - {file = "numpy-2.0.0.dev0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:4a5c13f25048bb00c6241e6f274e7882c446c9810f4897f86a79fb20a10dca57"}, - {file = "numpy-2.0.0.dev0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d5d890b2054ce93e7930f5b77fa45023a805de9670715fad2f874beabaf3e90"}, - {file = "numpy-2.0.0.dev0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b489b60da67d6e97c233982156eb6ee512a091d48868aa6e72ab5cd8eeaf629"}, - {file = "numpy-2.0.0.dev0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a9b6d9543618a0b4aba4a29b12853042adccfc416809398121a143751c0da14"}, - {file = "numpy-2.0.0.dev0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:1741a0b350a21d5aae34105760b80b1fb597082e8a8dc9c2d903a2244e0d9dfb"}, - {file = "numpy-2.0.0.dev0-cp312-cp312-win_amd64.whl", hash = "sha256:4cb78b51a2c0900e827e32b86bbf2d35e5da77034d13583eb613baef13733e5b"}, - {file = "numpy-2.0.0.dev0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d054fc187f28c68896c3d7de1120287fa3e26f905825686ef1ab99089060ef14"}, - {file = "numpy-2.0.0.dev0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:45b6e9e8a641d9ae72112bfa9abac37a0a135d522e6fb6be56b8ca10957fc737"}, - {file = "numpy-2.0.0.dev0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:022fa4ee86825096ce654cf90bd1ec57538c5a7627b28bc30ce2a83b00580aa6"}, - {file = "numpy-2.0.0.dev0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:37565dd074af4d359ace61c2c65ab6684763f2e7549c1dc9cd5a096c0be6b8e0"}, - {file = "numpy-2.0.0.dev0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:7504b42d17ed110b48363f899c1a1babc8fb8249743c9cfb85e57dbadbce02e0"}, - {file = "numpy-2.0.0.dev0-cp39-cp39-win_amd64.whl", hash = "sha256:e34d5b3b969a13355b9ee1d55e98d4264119815c19928d011b353cb87f548cc1"}, + {file = "numpy-1.26.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:82e871307a6331b5f09efda3c22e03c095d957f04bf6bc1804f30048d0e5e7af"}, + {file = "numpy-1.26.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cdd9ec98f0063d93baeb01aad472a1a0840dee302842a2746a7a8e92968f9575"}, + {file = "numpy-1.26.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d78f269e0c4fd365fc2992c00353e4530d274ba68f15e968d8bc3c69ce5f5244"}, + {file = "numpy-1.26.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8ab9163ca8aeb7fd32fe93866490654d2f7dda4e61bc6297bf72ce07fdc02f67"}, + {file = "numpy-1.26.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:78ca54b2f9daffa5f323f34cdf21e1d9779a54073f0018a3094ab907938331a2"}, + {file = "numpy-1.26.1-cp310-cp310-win32.whl", hash = "sha256:d1cfc92db6af1fd37a7bb58e55c8383b4aa1ba23d012bdbba26b4bcca45ac297"}, + {file = "numpy-1.26.1-cp310-cp310-win_amd64.whl", hash = "sha256:d2984cb6caaf05294b8466966627e80bf6c7afd273279077679cb010acb0e5ab"}, + {file = "numpy-1.26.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cd7837b2b734ca72959a1caf3309457a318c934abef7a43a14bb984e574bbb9a"}, + {file = "numpy-1.26.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1c59c046c31a43310ad0199d6299e59f57a289e22f0f36951ced1c9eac3665b9"}, + {file = "numpy-1.26.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d58e8c51a7cf43090d124d5073bc29ab2755822181fcad978b12e144e5e5a4b3"}, + {file = "numpy-1.26.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6081aed64714a18c72b168a9276095ef9155dd7888b9e74b5987808f0dd0a974"}, + {file = "numpy-1.26.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:97e5d6a9f0702c2863aaabf19f0d1b6c2628fbe476438ce0b5ce06e83085064c"}, + {file = "numpy-1.26.1-cp311-cp311-win32.whl", hash = "sha256:b9d45d1dbb9de84894cc50efece5b09939752a2d75aab3a8b0cef6f3a35ecd6b"}, + {file = "numpy-1.26.1-cp311-cp311-win_amd64.whl", hash = "sha256:3649d566e2fc067597125428db15d60eb42a4e0897fc48d28cb75dc2e0454e53"}, + {file = "numpy-1.26.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:1d1bd82d539607951cac963388534da3b7ea0e18b149a53cf883d8f699178c0f"}, + {file = "numpy-1.26.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:afd5ced4e5a96dac6725daeb5242a35494243f2239244fad10a90ce58b071d24"}, + {file = "numpy-1.26.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a03fb25610ef560a6201ff06df4f8105292ba56e7cdd196ea350d123fc32e24e"}, + {file = "numpy-1.26.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcfaf015b79d1f9f9c9fd0731a907407dc3e45769262d657d754c3a028586124"}, + {file = "numpy-1.26.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:e509cbc488c735b43b5ffea175235cec24bbc57b227ef1acc691725beb230d1c"}, + {file = "numpy-1.26.1-cp312-cp312-win32.whl", hash = "sha256:af22f3d8e228d84d1c0c44c1fbdeb80f97a15a0abe4f080960393a00db733b66"}, + {file = "numpy-1.26.1-cp312-cp312-win_amd64.whl", hash = "sha256:9f42284ebf91bdf32fafac29d29d4c07e5e9d1af862ea73686581773ef9e73a7"}, + {file = "numpy-1.26.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:bb894accfd16b867d8643fc2ba6c8617c78ba2828051e9a69511644ce86ce83e"}, + {file = "numpy-1.26.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e44ccb93f30c75dfc0c3aa3ce38f33486a75ec9abadabd4e59f114994a9c4617"}, + {file = "numpy-1.26.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9696aa2e35cc41e398a6d42d147cf326f8f9d81befcb399bc1ed7ffea339b64e"}, + {file = "numpy-1.26.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a5b411040beead47a228bde3b2241100454a6abde9df139ed087bd73fc0a4908"}, + {file = "numpy-1.26.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1e11668d6f756ca5ef534b5be8653d16c5352cbb210a5c2a79ff288e937010d5"}, + {file = "numpy-1.26.1-cp39-cp39-win32.whl", hash = "sha256:d1d2c6b7dd618c41e202c59c1413ef9b2c8e8a15f5039e344af64195459e3104"}, + {file = "numpy-1.26.1-cp39-cp39-win_amd64.whl", hash = "sha256:59227c981d43425ca5e5c01094d59eb14e8772ce6975d4b2fc1e106a833d5ae2"}, + {file = "numpy-1.26.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:06934e1a22c54636a059215d6da99e23286424f316fddd979f5071093b648668"}, + {file = "numpy-1.26.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76ff661a867d9272cd2a99eed002470f46dbe0943a5ffd140f49be84f68ffc42"}, + {file = "numpy-1.26.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:6965888d65d2848e8768824ca8288db0a81263c1efccec881cb35a0d805fcd2f"}, + {file = "numpy-1.26.1.tar.gz", hash = "sha256:c8c6c72d4a9f831f328efb1312642a1cafafaa88981d9ab76368d50d07d93cbe"}, ] -[package.source] -type = "legacy" -url = "https://pypi.anaconda.org/pythonmonkey/simple" -reference = "anaconda" - [[package]] name = "packaging" -version = "23.1" +version = "23.2" description = "Core utilities for Python packages" optional = false python-versions = ">=3.7" files = [ - {file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"}, - {file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"}, + {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, + {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, ] [[package]] name = "pip" -version = "23.1.2" +version = "23.3.1" description = "The PyPA recommended tool for installing Python packages." optional = false python-versions = ">=3.7" files = [ - {file = "pip-23.1.2-py3-none-any.whl", hash = "sha256:3ef6ac33239e4027d9a5598a381b9d30880a1477e50039db2eac6e8a8f6d1b18"}, - {file = "pip-23.1.2.tar.gz", hash = "sha256:0e7c86f486935893c708287b30bd050a36ac827ec7fe5e43fe7cb198dd835fba"}, + {file = "pip-23.3.1-py3-none-any.whl", hash = "sha256:55eb67bb6171d37447e82213be585b75fe2b12b359e993773aca4de9247a052b"}, + {file = "pip-23.3.1.tar.gz", hash = "sha256:1fcaa041308d01f14575f6d0d2ea4b75a3e2871fe4f9c694976f908768e14174"}, ] [[package]] name = "pluggy" -version = "1.2.0" +version = "1.3.0" description = "plugin and hook calling mechanisms for python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"}, - {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, + {file = "pluggy-1.3.0-py3-none-any.whl", hash = "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7"}, + {file = "pluggy-1.3.0.tar.gz", hash = "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12"}, ] [package.extras] @@ -771,63 +778,62 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pycares" -version = "4.3.0" +version = "4.4.0" description = "Python interface for c-ares" optional = false -python-versions = "*" +python-versions = ">=3.8" files = [ - {file = "pycares-4.3.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:19c9cdd3322d422931982939773e453e491dfc5c0b2e23d7266959315c7a0824"}, - {file = "pycares-4.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9e56e9cdf46a092970dc4b75bbabddea9f480be5eeadc3fcae3eb5c6807c4136"}, - {file = "pycares-4.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c75a6241c79b935048272cb77df498da64b8defc8c4b29fdf9870e43ba4cbb4"}, - {file = "pycares-4.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24d8654fac3742791b8bef59d1fbb3e19ae6a5c48876a6d98659f7c66ee546c4"}, - {file = "pycares-4.3.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ebf50b049a245880f1aa16a6f72c4408e0a65b49ea1d3bf13383a44a2cabd2bf"}, - {file = "pycares-4.3.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:84daf560962763c0359fd79c750ef480f0fda40c08b57765088dbe362e8dc452"}, - {file = "pycares-4.3.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:978d10da7ee74b9979c494afa8b646411119ad0186a29c7f13c72bb4295630c6"}, - {file = "pycares-4.3.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c5b9d7fe52eb3d243f5ead58d5c0011884226d961df8360a34618c38c7515"}, - {file = "pycares-4.3.0-cp310-cp310-win32.whl", hash = "sha256:da7c7089ae617317d2cbe38baefd3821387b3bfef7b3ee5b797b871cb1257974"}, - {file = "pycares-4.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:7106dc683db30e1d851283b7b9df7a5ea4964d6bdd000d918d91d4b1f9bed329"}, - {file = "pycares-4.3.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4e7a24ecef0b1933f2a3fdbf328d1b529a76cda113f8364fa0742e5b3bd76566"}, - {file = "pycares-4.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e7abccc2aa4771c06994e4d9ed596453061e2b8846f887d9c98a64ccdaf4790a"}, - {file = "pycares-4.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:531fed46c5ed798a914c3207be4ae7b297c4d09e4183d3cf8fd9ee59a55d5080"}, - {file = "pycares-4.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2c9335175af0c64a1e0ba67bdd349eb62d4eea0ad02c235ccdf0d535fd20f323"}, - {file = "pycares-4.3.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c5f0e95535027d2dcd51e780410632b0d3ed7e9e5ceb25dc0fe937f2c2960079"}, - {file = "pycares-4.3.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:3692179ce5fb96908ba342e1e5303608d0c976f0d5d4619fa9d3d6d9d5a9a1b4"}, - {file = "pycares-4.3.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:5c4cb6cc7fe8e0606d30b60367f59fe26d1472e88555d61e202db70dea5c8edb"}, - {file = "pycares-4.3.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3215445396c74103e2054e6b349d9e85883ceda2006d0039fc2d58c9b11818a2"}, - {file = "pycares-4.3.0-cp311-cp311-win32.whl", hash = "sha256:6a0c0c3a0adf490bba9dbb37dbd07ec81e4a6584f095036ac34f06a633710ffe"}, - {file = "pycares-4.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:995cb37cc39bd40ca87bb16555a0f7724f3be30d9f9059a4caab2fde45b1b903"}, - {file = "pycares-4.3.0-cp36-cp36m-win32.whl", hash = "sha256:4c9187be72449c975c11daa1d94d7ddcc494f8a4c37a6c18f977cd7024a531d9"}, - {file = "pycares-4.3.0-cp36-cp36m-win_amd64.whl", hash = "sha256:d7405ba10a2903a58b8b0faedcb54994c9ee002ad01963587fabf93e7e479783"}, - {file = "pycares-4.3.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:40aaa12081495f879f11f4cfc95edfec1ea14711188563102f9e33fe98728fac"}, - {file = "pycares-4.3.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4972cac24b66c5997f3a3e2cb608e408066d80103d443e36d626a88a287b9ae7"}, - {file = "pycares-4.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:35886dba7aa5b73affca8729aeb5a1f5e94d3d9a764adb1b7e75bafca44eeca5"}, - {file = "pycares-4.3.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5cea6e1f3be016f155d60f27f16c1074d58b4d6e123228fdbc3326d076016af8"}, - {file = "pycares-4.3.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:3a9fd2665b053afb39226ac6f8137a60910ca7729358456df2fb94866f4297de"}, - {file = "pycares-4.3.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:e8e9195f869120e44e0aa0a6098bb5c19947f4753054365891f592e6f9eab3ef"}, - {file = "pycares-4.3.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:674486ecf2afb25ee219171b07cdaba481a1aaa2dabb155779c7be9ded03eaa9"}, - {file = "pycares-4.3.0-cp37-cp37m-win32.whl", hash = "sha256:1b6cd3161851499b6894d1e23bfd633e7b775472f5af35ae35409c4a47a2d45e"}, - {file = "pycares-4.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:710120c97b9afdba443564350c3f5f72fd9aae74d95b73dc062ca8ac3d7f36d7"}, - {file = "pycares-4.3.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:9103649bd29d84bc6bcfaf09def9c0592bbc766018fad19d76d09989608b915d"}, - {file = "pycares-4.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c072dbaf73cb5434279578dc35322867d8d5df053e14fdcdcc589994ba4804ae"}, - {file = "pycares-4.3.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:008531733f9c7a976b59c7760a3672b191159fd69ae76c01ca051f20b5e44164"}, - {file = "pycares-4.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2aae02d97d77dcff840ab55f86cb8b99bf644acbca17e1edb7048408b9782088"}, - {file = "pycares-4.3.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:257953ae6d400a934fd9193aeb20990ac84a78648bdf5978e998bd007a4045cd"}, - {file = "pycares-4.3.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:c28d481efae26936ec08cb6beea305f4b145503b152cf2c4dc68cc4ad9644f0e"}, - {file = "pycares-4.3.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:976249b39037dbfb709ccf7e1c40d2785905a0065536385d501b94570cfed96d"}, - {file = "pycares-4.3.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:98568c30cfab6b327d94ae1acdf85bbba4cffd415980804985d34ca07e6f4791"}, - {file = "pycares-4.3.0-cp38-cp38-win32.whl", hash = "sha256:a2f3c4f49f43162f7e684419d9834c2c8ec165e54cb8dc47aa9dc0c2132701c0"}, - {file = "pycares-4.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:1730ef93e33e4682fbbf0e7fb19df2ed9822779d17de8ea6e20d5b0d71c1d2be"}, - {file = "pycares-4.3.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5a26b3f1684557025da26ce65d076619890c82b95e38cc7284ce51c3539a1ce8"}, - {file = "pycares-4.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:86112cce01655b9f63c5e53b74722084e88e784a7a8ad138d373440337c591c9"}, - {file = "pycares-4.3.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c01465a191dc78e923884bb45cd63c7e012623e520cf7ed67e542413ee334804"}, - {file = "pycares-4.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9fd5d6012f3ee8c8038cbfe16e988bbd17b2f21eea86650874bf63757ee6161"}, - {file = "pycares-4.3.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aa36b8ea91eae20b5c7205f3e6654423f066af24a1df02b274770a96cbcafaa7"}, - {file = "pycares-4.3.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:61019151130557c1788cae52e4f2f388a7520c9d92574f3a0d61c974c6740db0"}, - {file = "pycares-4.3.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:231962bb46274c52632469a1e686fab065dbd106dbef586de4f7fb101e297587"}, - {file = "pycares-4.3.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:6c979512fa51c7ccef5204fe10ed4e5c44c2bce5f335fe98a3e423f1672bd7d4"}, - {file = "pycares-4.3.0-cp39-cp39-win32.whl", hash = "sha256:655cf0df862ce3847a60e1a106dafa2ba2c14e6636bac49e874347acdc7312dc"}, - {file = "pycares-4.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:36f2251ad0f99a5ce13df45c94c3161d9734c9e9fa2b9b4cc163b853ca170dc5"}, - {file = "pycares-4.3.0.tar.gz", hash = "sha256:c542696f6dac978e9d99192384745a65f80a7d9450501151e4a7563e06010d45"}, + {file = "pycares-4.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:24da119850841d16996713d9c3374ca28a21deee056d609fbbed29065d17e1f6"}, + {file = "pycares-4.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8f64cb58729689d4d0e78f0bfb4c25ce2f851d0274c0273ac751795c04b8798a"}, + {file = "pycares-4.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d33e2a1120887e89075f7f814ec144f66a6ce06a54f5722ccefc62fbeda83cff"}, + {file = "pycares-4.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c680fef1b502ee680f8f0b95a41af4ec2c234e50e16c0af5bbda31999d3584bd"}, + {file = "pycares-4.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fff16b09042ba077f7b8aa5868d1d22456f0002574d0ba43462b10a009331677"}, + {file = "pycares-4.4.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:229a1675eb33bc9afb1fc463e73ee334950ccc485bc83a43f6ae5839fb4d5fa3"}, + {file = "pycares-4.4.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:3aebc73e5ad70464f998f77f2da2063aa617cbd8d3e8174dd7c5b4518f967153"}, + {file = "pycares-4.4.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6ef64649eba56448f65e26546d85c860709844d2fc22ef14d324fe0b27f761a9"}, + {file = "pycares-4.4.0-cp310-cp310-win32.whl", hash = "sha256:4afc2644423f4eef97857a9fd61be9758ce5e336b4b0bd3d591238bb4b8b03e0"}, + {file = "pycares-4.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:5ed4e04af4012f875b78219d34434a6d08a67175150ac1b79eb70ab585d4ba8c"}, + {file = "pycares-4.4.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:bce8db2fc6f3174bd39b81405210b9b88d7b607d33e56a970c34a0c190da0490"}, + {file = "pycares-4.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9a0303428d013ccf5c51de59c83f9127aba6200adb7fd4be57eddb432a1edd2a"}, + {file = "pycares-4.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:afb91792f1556f97be7f7acb57dc7756d89c5a87bd8b90363a77dbf9ea653817"}, + {file = "pycares-4.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b61579cecf1f4d616e5ea31a6e423a16680ab0d3a24a2ffe7bb1d4ee162477ff"}, + {file = "pycares-4.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b7af06968cbf6851566e806bf3e72825b0e6671832a2cbe840be1d2d65350710"}, + {file = "pycares-4.4.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ceb12974367b0a68a05d52f4162b29f575d241bd53de155efe632bf2c943c7f6"}, + {file = "pycares-4.4.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:2eeec144bcf6a7b6f2d74d6e70cbba7886a84dd373c886f06cb137a07de4954c"}, + {file = "pycares-4.4.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e3a6f7cfdfd11eb5493d6d632e582408c8f3b429f295f8799c584c108b28db6f"}, + {file = "pycares-4.4.0-cp311-cp311-win32.whl", hash = "sha256:34736a2ffaa9c08ca9c707011a2d7b69074bbf82d645d8138bba771479b2362f"}, + {file = "pycares-4.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:eb66c30eb11e877976b7ead13632082a8621df648c408b8e15cdb91a452dd502"}, + {file = "pycares-4.4.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:fd644505a8cfd7f6584d33a9066d4e3d47700f050ef1490230c962de5dfb28c6"}, + {file = "pycares-4.4.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:52084961262232ec04bd75f5043aed7e5d8d9695e542ff691dfef0110209f2d4"}, + {file = "pycares-4.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0c5368206057884cde18602580083aeaad9b860e2eac14fd253543158ce1e93"}, + {file = "pycares-4.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:112a4979c695b1c86f6782163d7dec58d57a3b9510536dcf4826550f9053dd9a"}, + {file = "pycares-4.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8d186dafccdaa3409194c0f94db93c1a5d191145a275f19da6591f9499b8e7b8"}, + {file = "pycares-4.4.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:64965dc19c578a683ea73487a215a8897276224e004d50eeb21f0bc7a0b63c88"}, + {file = "pycares-4.4.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:ed2a38e34bec6f2586435f6ff0bc5fe11d14bebd7ed492cf739a424e81681540"}, + {file = "pycares-4.4.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:94d6962db81541eb0396d2f0dfcbb18cdb8c8b251d165efc2d974ae652c547d4"}, + {file = "pycares-4.4.0-cp312-cp312-win32.whl", hash = "sha256:1168a48a834813aa80f412be2df4abaf630528a58d15c704857448b20b1675c0"}, + {file = "pycares-4.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:db24c4e7fea4a052c6e869cbf387dd85d53b9736cfe1ef5d8d568d1ca925e977"}, + {file = "pycares-4.4.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:21a5a0468861ec7df7befa69050f952da13db5427ae41ffe4713bc96291d1d95"}, + {file = "pycares-4.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:22c00bf659a9fa44d7b405cf1cd69b68b9d37537899898d8cbe5dffa4016b273"}, + {file = "pycares-4.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23aa3993a352491a47fcf17867f61472f32f874df4adcbb486294bd9fbe8abee"}, + {file = "pycares-4.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:813d661cbe2e37d87da2d16b7110a6860e93ddb11735c6919c8a3545c7b9c8d8"}, + {file = "pycares-4.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:77cf5a2fd5583c670de41a7f4a7b46e5cbabe7180d8029f728571f4d2e864084"}, + {file = "pycares-4.4.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:3eaa6681c0a3e3f3868c77aca14b7760fed35fdfda2fe587e15c701950e7bc69"}, + {file = "pycares-4.4.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ad58e284a658a8a6a84af2e0b62f2f961f303cedfe551854d7bd40c3cbb61912"}, + {file = "pycares-4.4.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bfb89ca9e3d0a9b5332deeb666b2ede9d3469107742158f4aeda5ce032d003f4"}, + {file = "pycares-4.4.0-cp38-cp38-win32.whl", hash = "sha256:f36bdc1562142e3695555d2f4ac0cb69af165eddcefa98efc1c79495b533481f"}, + {file = "pycares-4.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:902461a92b6a80fd5041a2ec5235680c7cc35e43615639ec2a40e63fca2dfb51"}, + {file = "pycares-4.4.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7bddc6adba8f699728f7fc1c9ce8cef359817ad78e2ed52b9502cb5f8dc7f741"}, + {file = "pycares-4.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:cb49d5805cd347c404f928c5ae7c35e86ba0c58ffa701dbe905365e77ce7d641"}, + {file = "pycares-4.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:56cf3349fa3a2e67ed387a7974c11d233734636fe19facfcda261b411af14d80"}, + {file = "pycares-4.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8bf2eaa83a5987e48fa63302f0fe7ce3275cfda87b34d40fef9ce703fb3ac002"}, + {file = "pycares-4.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82bba2ab77eb5addbf9758d514d9bdef3c1bfe7d1649a47bd9a0d55a23ef478b"}, + {file = "pycares-4.4.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c6a8bde63106f162fca736e842a916853cad3c8d9d137e11c9ffa37efa818b02"}, + {file = "pycares-4.4.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f5f646eec041db6ffdbcaf3e0756fb92018f7af3266138c756bb09d2b5baadec"}, + {file = "pycares-4.4.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9dc04c54c6ea615210c1b9e803d0e2d2255f87a3d5d119b6482c8f0dfa15b26b"}, + {file = "pycares-4.4.0-cp39-cp39-win32.whl", hash = "sha256:97892cced5794d721fb4ff8765764aa4ea48fe8b2c3820677505b96b83d4ef47"}, + {file = "pycares-4.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:917f08f0b5d9324e9a34211e68d27447c552b50ab967044776bbab7e42a553a2"}, + {file = "pycares-4.4.0.tar.gz", hash = "sha256:f47579d508f2f56eddd16ce72045782ad3b1b3b678098699e2b6a1b30733e1c2"}, ] [package.dependencies] @@ -860,13 +866,13 @@ files = [ [[package]] name = "pytest" -version = "7.4.0" +version = "7.4.3" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-7.4.0-py3-none-any.whl", hash = "sha256:78bf16451a2eb8c7a2ea98e32dc119fd2aa758f1d5d66dbf0a59d69a3969df32"}, - {file = "pytest-7.4.0.tar.gz", hash = "sha256:b4bf8c45bd59934ed84001ad51e11b4ee40d40a1229d2c79f9c592b0a3f6bd8a"}, + {file = "pytest-7.4.3-py3-none-any.whl", hash = "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac"}, + {file = "pytest-7.4.3.tar.gz", hash = "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5"}, ] [package.dependencies] @@ -981,4 +987,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "3cd492eff2ec24fd2ee9ed5d667fbb8ebf2c4643e007aac3c5997c01839efdf2" +content-hash = "5698004d31d609d8d17d163df297492d4caadf9f1745d0bc422c194eb9758e82" diff --git a/pyproject.toml b/pyproject.toml index fe80be5f..cb60032a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,10 @@ pmjs = "pythonmonkey.cli.pmjs:main" [tool.poetry.group.dev.dependencies] pytest = "^7.3.1" pip = "^23.1.2" -numpy = "^1.26.1" +numpy = [ + {version = "^1.26.1", python = ">=3.9,<3.13"}, + {version = "^1.24.3", python = "3.8.*"}, +] pminit = { path = "./python/pminit", develop = true } From 4d067dec1670faeb54da27fd7ecc7496e4218500 Mon Sep 17 00:00:00 2001 From: Tom Wenzheng Tang Date: Fri, 10 Nov 2023 23:41:43 +0800 Subject: [PATCH 0059/1086] ci: use stable Python 3.12 version --- .github/workflows/test-and-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 16351cda..daf31da6 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -85,7 +85,7 @@ jobs: matrix: # The lowest supported version is Ubuntu 20.04 + Python 3.8 or macOS 12 + Python 3.9 os: [ 'ubuntu-20.04', 'macos-12', 'windows-2019', 'm2ci' ] - python_version: [ '3.8', '3.9', '3.10', '3.11', '3.12-dev' ] + python_version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] exclude: # macOS 12 comes with Python 3.9 by default, so we drop ci support for Python 3.8 on macOS # FIXME: We can't build on macOS 11 for now because our prebuilt `uncrustify` binary requires macOS 12 From 584c925aa6428f966282b4de2deb61f2ab5da8e3 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 10 Nov 2023 15:46:12 +0000 Subject: [PATCH 0060/1086] chore: upgrade aiohttp to 3.9.0 beta to fix Python 3.12 --- poetry.lock | 346 +++++++++++++++++-------------------------------- pyproject.toml | 2 +- 2 files changed, 119 insertions(+), 229 deletions(-) diff --git a/poetry.lock b/poetry.lock index cf8d40bb..b04e0cf6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -16,114 +16,102 @@ pycares = ">=4.0.0" [[package]] name = "aiohttp" -version = "3.8.6" +version = "3.9.0b1" description = "Async http client/server framework (asyncio)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:41d55fc043954cddbbd82503d9cc3f4814a40bcef30b3569bc7b5e34130718c1"}, - {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1d84166673694841d8953f0a8d0c90e1087739d24632fe86b1a08819168b4566"}, - {file = "aiohttp-3.8.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:253bf92b744b3170eb4c4ca2fa58f9c4b87aeb1df42f71d4e78815e6e8b73c9e"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3fd194939b1f764d6bb05490987bfe104287bbf51b8d862261ccf66f48fb4096"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6c5f938d199a6fdbdc10bbb9447496561c3a9a565b43be564648d81e1102ac22"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2817b2f66ca82ee699acd90e05c95e79bbf1dc986abb62b61ec8aaf851e81c93"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fa375b3d34e71ccccf172cab401cd94a72de7a8cc01847a7b3386204093bb47"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9de50a199b7710fa2904be5a4a9b51af587ab24c8e540a7243ab737b45844543"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e1d8cb0b56b3587c5c01de3bf2f600f186da7e7b5f7353d1bf26a8ddca57f965"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:8e31e9db1bee8b4f407b77fd2507337a0a80665ad7b6c749d08df595d88f1cf5"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:7bc88fc494b1f0311d67f29fee6fd636606f4697e8cc793a2d912ac5b19aa38d"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:ec00c3305788e04bf6d29d42e504560e159ccaf0be30c09203b468a6c1ccd3b2"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ad1407db8f2f49329729564f71685557157bfa42b48f4b93e53721a16eb813ed"}, - {file = "aiohttp-3.8.6-cp310-cp310-win32.whl", hash = "sha256:ccc360e87341ad47c777f5723f68adbb52b37ab450c8bc3ca9ca1f3e849e5fe2"}, - {file = "aiohttp-3.8.6-cp310-cp310-win_amd64.whl", hash = "sha256:93c15c8e48e5e7b89d5cb4613479d144fda8344e2d886cf694fd36db4cc86865"}, - {file = "aiohttp-3.8.6-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6e2f9cc8e5328f829f6e1fb74a0a3a939b14e67e80832975e01929e320386b34"}, - {file = "aiohttp-3.8.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e6a00ffcc173e765e200ceefb06399ba09c06db97f401f920513a10c803604ca"}, - {file = "aiohttp-3.8.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:41bdc2ba359032e36c0e9de5a3bd00d6fb7ea558a6ce6b70acedf0da86458321"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:14cd52ccf40006c7a6cd34a0f8663734e5363fd981807173faf3a017e202fec9"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2d5b785c792802e7b275c420d84f3397668e9d49ab1cb52bd916b3b3ffcf09ad"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1bed815f3dc3d915c5c1e556c397c8667826fbc1b935d95b0ad680787896a358"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:96603a562b546632441926cd1293cfcb5b69f0b4159e6077f7c7dbdfb686af4d"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d76e8b13161a202d14c9584590c4df4d068c9567c99506497bdd67eaedf36403"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e3f1e3f1a1751bb62b4a1b7f4e435afcdade6c17a4fd9b9d43607cebd242924a"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:76b36b3124f0223903609944a3c8bf28a599b2cc0ce0be60b45211c8e9be97f8"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:a2ece4af1f3c967a4390c284797ab595a9f1bc1130ef8b01828915a05a6ae684"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:16d330b3b9db87c3883e565340d292638a878236418b23cc8b9b11a054aaa887"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:42c89579f82e49db436b69c938ab3e1559e5a4409eb8639eb4143989bc390f2f"}, - {file = "aiohttp-3.8.6-cp311-cp311-win32.whl", hash = "sha256:efd2fcf7e7b9d7ab16e6b7d54205beded0a9c8566cb30f09c1abe42b4e22bdcb"}, - {file = "aiohttp-3.8.6-cp311-cp311-win_amd64.whl", hash = "sha256:3b2ab182fc28e7a81f6c70bfbd829045d9480063f5ab06f6e601a3eddbbd49a0"}, - {file = "aiohttp-3.8.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:fdee8405931b0615220e5ddf8cd7edd8592c606a8e4ca2a00704883c396e4479"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d25036d161c4fe2225d1abff2bd52c34ed0b1099f02c208cd34d8c05729882f0"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5d791245a894be071d5ab04bbb4850534261a7d4fd363b094a7b9963e8cdbd31"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0cccd1de239afa866e4ce5c789b3032442f19c261c7d8a01183fd956b1935349"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f13f60d78224f0dace220d8ab4ef1dbc37115eeeab8c06804fec11bec2bbd07"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8a9b5a0606faca4f6cc0d338359d6fa137104c337f489cd135bb7fbdbccb1e39"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:13da35c9ceb847732bf5c6c5781dcf4780e14392e5d3b3c689f6d22f8e15ae31"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:4d4cbe4ffa9d05f46a28252efc5941e0462792930caa370a6efaf491f412bc66"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:229852e147f44da0241954fc6cb910ba074e597f06789c867cb7fb0621e0ba7a"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:713103a8bdde61d13490adf47171a1039fd880113981e55401a0f7b42c37d071"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:45ad816b2c8e3b60b510f30dbd37fe74fd4a772248a52bb021f6fd65dff809b6"}, - {file = "aiohttp-3.8.6-cp36-cp36m-win32.whl", hash = "sha256:2b8d4e166e600dcfbff51919c7a3789ff6ca8b3ecce16e1d9c96d95dd569eb4c"}, - {file = "aiohttp-3.8.6-cp36-cp36m-win_amd64.whl", hash = "sha256:0912ed87fee967940aacc5306d3aa8ba3a459fcd12add0b407081fbefc931e53"}, - {file = "aiohttp-3.8.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e2a988a0c673c2e12084f5e6ba3392d76c75ddb8ebc6c7e9ead68248101cd446"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ebf3fd9f141700b510d4b190094db0ce37ac6361a6806c153c161dc6c041ccda"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3161ce82ab85acd267c8f4b14aa226047a6bee1e4e6adb74b798bd42c6ae1f80"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d95fc1bf33a9a81469aa760617b5971331cdd74370d1214f0b3109272c0e1e3c"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c43ecfef7deaf0617cee936836518e7424ee12cb709883f2c9a1adda63cc460"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca80e1b90a05a4f476547f904992ae81eda5c2c85c66ee4195bb8f9c5fb47f28"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:90c72ebb7cb3a08a7f40061079817133f502a160561d0675b0a6adf231382c92"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:bb54c54510e47a8c7c8e63454a6acc817519337b2b78606c4e840871a3e15349"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:de6a1c9f6803b90e20869e6b99c2c18cef5cc691363954c93cb9adeb26d9f3ae"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:a3628b6c7b880b181a3ae0a0683698513874df63783fd89de99b7b7539e3e8a8"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:fc37e9aef10a696a5a4474802930079ccfc14d9f9c10b4662169671ff034b7df"}, - {file = "aiohttp-3.8.6-cp37-cp37m-win32.whl", hash = "sha256:f8ef51e459eb2ad8e7a66c1d6440c808485840ad55ecc3cafefadea47d1b1ba2"}, - {file = "aiohttp-3.8.6-cp37-cp37m-win_amd64.whl", hash = "sha256:b2fe42e523be344124c6c8ef32a011444e869dc5f883c591ed87f84339de5976"}, - {file = "aiohttp-3.8.6-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:9e2ee0ac5a1f5c7dd3197de309adfb99ac4617ff02b0603fd1e65b07dc772e4b"}, - {file = "aiohttp-3.8.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:01770d8c04bd8db568abb636c1fdd4f7140b284b8b3e0b4584f070180c1e5c62"}, - {file = "aiohttp-3.8.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:3c68330a59506254b556b99a91857428cab98b2f84061260a67865f7f52899f5"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89341b2c19fb5eac30c341133ae2cc3544d40d9b1892749cdd25892bbc6ac951"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:71783b0b6455ac8f34b5ec99d83e686892c50498d5d00b8e56d47f41b38fbe04"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f628dbf3c91e12f4d6c8b3f092069567d8eb17814aebba3d7d60c149391aee3a"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b04691bc6601ef47c88f0255043df6f570ada1a9ebef99c34bd0b72866c217ae"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ee912f7e78287516df155f69da575a0ba33b02dd7c1d6614dbc9463f43066e3"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9c19b26acdd08dd239e0d3669a3dddafd600902e37881f13fbd8a53943079dbc"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:99c5ac4ad492b4a19fc132306cd57075c28446ec2ed970973bbf036bcda1bcc6"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:f0f03211fd14a6a0aed2997d4b1c013d49fb7b50eeb9ffdf5e51f23cfe2c77fa"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:8d399dade330c53b4106160f75f55407e9ae7505263ea86f2ccca6bfcbdb4921"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ec4fd86658c6a8964d75426517dc01cbf840bbf32d055ce64a9e63a40fd7b771"}, - {file = "aiohttp-3.8.6-cp38-cp38-win32.whl", hash = "sha256:33164093be11fcef3ce2571a0dccd9041c9a93fa3bde86569d7b03120d276c6f"}, - {file = "aiohttp-3.8.6-cp38-cp38-win_amd64.whl", hash = "sha256:bdf70bfe5a1414ba9afb9d49f0c912dc524cf60141102f3a11143ba3d291870f"}, - {file = "aiohttp-3.8.6-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:d52d5dc7c6682b720280f9d9db41d36ebe4791622c842e258c9206232251ab2b"}, - {file = "aiohttp-3.8.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4ac39027011414dbd3d87f7edb31680e1f430834c8cef029f11c66dad0670aa5"}, - {file = "aiohttp-3.8.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3f5c7ce535a1d2429a634310e308fb7d718905487257060e5d4598e29dc17f0b"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b30e963f9e0d52c28f284d554a9469af073030030cef8693106d918b2ca92f54"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:918810ef188f84152af6b938254911055a72e0f935b5fbc4c1a4ed0b0584aed1"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:002f23e6ea8d3dd8d149e569fd580c999232b5fbc601c48d55398fbc2e582e8c"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4fcf3eabd3fd1a5e6092d1242295fa37d0354b2eb2077e6eb670accad78e40e1"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:255ba9d6d5ff1a382bb9a578cd563605aa69bec845680e21c44afc2670607a95"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d67f8baed00870aa390ea2590798766256f31dc5ed3ecc737debb6e97e2ede78"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:86f20cee0f0a317c76573b627b954c412ea766d6ada1a9fcf1b805763ae7feeb"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:39a312d0e991690ccc1a61f1e9e42daa519dcc34ad03eb6f826d94c1190190dd"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:e827d48cf802de06d9c935088c2924e3c7e7533377d66b6f31ed175c1620e05e"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:bd111d7fc5591ddf377a408ed9067045259ff2770f37e2d94e6478d0f3fc0c17"}, - {file = "aiohttp-3.8.6-cp39-cp39-win32.whl", hash = "sha256:caf486ac1e689dda3502567eb89ffe02876546599bbf915ec94b1fa424eeffd4"}, - {file = "aiohttp-3.8.6-cp39-cp39-win_amd64.whl", hash = "sha256:3f0e27e5b733803333bb2371249f41cf42bae8884863e8e8965ec69bebe53132"}, - {file = "aiohttp-3.8.6.tar.gz", hash = "sha256:b0cf2a4501bff9330a8a5248b4ce951851e415bdcce9dc158e76cfd55e15085c"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:426138a0b49717b631ffb77d5c2321030bbca96f98eb4d96a2bd874553952ae4"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9a921230d92cf7f03481ca9ad25950d7f3b916f18880fac87b878fddfea04014"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f03d008a93904a56e18c78392d3aa1afe83285353a16402104e0155faf200e6a"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ff51142b170bf3d0d988e41f9c736b0a8f095115f6d6a9bb738b5bf9f1b7cad1"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6374c9d191e14729ede73b750fa64b7c3c506bf74458a57b25803937b937a460"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2457a30567f748f96ac0110789f456f4053d28cf82ae8f436a59d7923ba057d2"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a97e65e4a1767a2f91c727ac44fb1ccfb71f6608cbf5a01931fcdd5b64e62ff8"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:97e596803d7417d6809a728058add22885e30f4256bfb6a3fab17a310df94a1f"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:9945821f4644034b9ca50ecb1eac38e186ec57b412ed4d164ada26312a7cd0b0"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a1c4fd2f0b72d88cf1c4d2f22ed33cd1706aa2734452024998a9b4b14f794799"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:cfc900b809dffe5f897cca714f9b49ad45c541a19395eaaab792500116c3a1d6"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:1269715323a2543a08695bc628ef3ee142788c56444b5a3dbea7f57bf324d40b"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b5e13ce90574fb9ea57d150474b7f39d5ef82e338106149a5e600c872437aa5e"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-win32.whl", hash = "sha256:5ab58badc08c2b96b1e5316919dd5ec63f84a9045b2310d2f4a34f8c1b8e217b"}, + {file = "aiohttp-3.9.0b1-cp310-cp310-win_amd64.whl", hash = "sha256:ecbfc86cf057ec3adf474edf3f9cfdc0e83109a1a8452beb0296fc3a00093340"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8c1fd71f282673320aa12b0eccd51c4aebfc45ccb91e0f4236b8c6c4323027c8"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3e78ddc7b21b084e919f44893e3f4fb27d959cfe520f5f644ad054f7cbb404bc"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8113d976c8ae6e501c5643a8307dbe746ccc0eac16e421a3d2c2be76ae7f94f7"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:be7bfd5016572bc1dc358ea9340862f3112f20acd9cb16a1161f470369755e47"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6549b85dc88d9a792695ac838c9a6384cb32b5df9442185a6640c253f9d8f3cd"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd6ea14850d67272abb1021fa60b831e36a119a47097acd89c880700c51a3c7c"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a122b5cc10c8b26c878279faa0c22ee48fb0a6e9b53dbfcf2d3a8d31cef8875"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3410d0a95cfe40e391bfa6cc84c8464a4d0c7a88157f65e9af3af30b20f2137b"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:b50af48cd3d25e8d247ac83d78aadc6d6c8ab51b7623b2ab675ec714f736d9c1"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:cc5d5177ecd7041b726e4936763a36b593cc929a467c698c9e8991b04b6901eb"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:2931638e81d21bf4fc2a04662ce7bf1a73003d7db15797bfe8cbfd555a7073ff"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:e40b5ecf8fc485b084adac8e7cd213111878761f4cb00f5785757e8b9af684e6"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1ad396d02e44c4f25d458ae4defe59ccc9bf6411cc490d82cf80db6ef60e5db2"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-win32.whl", hash = "sha256:d8c51c63ffe2800c2da656c2581b7ce2e27367d93b04997dce48c02493d0721a"}, + {file = "aiohttp-3.9.0b1-cp311-cp311-win_amd64.whl", hash = "sha256:21285b3fa2ff50ec764c2dc6374aaf39e87fc8eaaf9fd5e8ef1e912ad1ba632e"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:14a1067e04a15b78dacc4e828e3ba157a3d43793f1ed6b7608378e664ae66371"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b4116e6325958d2f6ceee4ff549408965bb701a535ab8859d63bab6271efb1bf"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7a2d39b4d69cca2f8d28a8bc8de532949fb2f7fa219927ac72ac56f8a69db6fb"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7b5312f3f2adba2fe46251c2ec0b8ba92d6fda64755c23d5871f28b7c9fba37"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cc2d914bde7d1d2ca1fb44ee1d086dfb51df8fd5fb780ee273af6c9038421569"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:69766ca94a289e273db1378a0f2b3044d95864bed6803c75fe3e0eb3e3432092"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ea3efa3a4c6f030d1cfe038cbc80cfa99977191521e75617ab8933e1690b3e95"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a0fb6a080b3cf848786c17e26167c76326ecdd33066a7b7dda560165a4a401d9"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:84f2fc12457e0a3b05bfbd8a5ce4a9bc4dd7f8df63101097813e8f7fd6092f81"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:049787f93dec6add786571b0bab193937da09c1331f6b4f36bee356b4a77fffd"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:1cb90917981bc3b7fb730635ec0714c1c7e879c0a2c7a30f32f24979bbb4baf5"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:cc3020b7ee936989c997de3ddc9a70beeb929a30cc68dcdef543de492a4562eb"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2d51bf99bd8669f2de4756f0d7a972a8034bb4e68c9c6e6c8346fd1e8115678e"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-win32.whl", hash = "sha256:0c09cea7177881137ae7176ec0cfeea72896a853ce1886334fb00ec3de4c857b"}, + {file = "aiohttp-3.9.0b1-cp312-cp312-win_amd64.whl", hash = "sha256:af46831aa5091d248174484a69e2656903457e283b3f359b10ebd4537e4977b0"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:cd567c0712335bfb1fdba67fcbbe876b6ee0353acdf9862706a0545c364394a7"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b807a101522d77e1d9414ad6bef668fc9f2c9b6cb33e7012657837b1518ae013"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:72cbc48927cbc772f475f1a953e78d853ef99826e171d719fe2a61c92b581939"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4ea269cd10a3482c68b3aa1d1912f7cc6106f30a809666bdc69974cfafc71f7"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a8355801fd18ddee69e3f40a762070027d35091433ff3961e7c475e5672fb94b"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b34251fc6db4912b364900206a2464d489fdcea3e3c6a96270870fd1f08c0eb8"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:767c6807e2d5457abfe77141c0629e1594400659d92d4c11b7720c1469b1b171"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:19a7d9fe4bb1ccac50a0fa22b8b14376adbd85336ef0ddffd27b3a06cacdc53b"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9f52b40c3891884eb8967f9acb6c66903747c2643accc06337f19315e16fe1b0"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:21a172580a23b4ed8b0f6dd5e10e5bbd1814d1623c1baf3fd7c7a2eb97a9fff0"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:61dcbf83148c4e4dbe047dfa1991730813d787813b99d9edaff04605fc907560"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:afa133e82ba42d7066a1545958f38fa3515df2609a44bf456ba03f92f596e73d"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:c16d7535119bd07826830f5104a0752974bf93bbb3ee5b40514f1a52a141a01c"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-win32.whl", hash = "sha256:760091662ea21ef9c73f8d198a8aa4056887a8bd46f4e6709ffd8677a5d062da"}, + {file = "aiohttp-3.9.0b1-cp38-cp38-win_amd64.whl", hash = "sha256:5fb2697b78eb6d339c6488cf371e8b9885d6a02d2d8fc32cbb0d21582e39fe2f"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:91a80a774401068ce0f0be9d8fa9fdb2f9d0a57e9d13bf4fdf63e3d7f50b7322"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:af136826ea2c15ec47d0d43e96dfab2d19f1bb71b3f77a3dcf26d9c89dc92540"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4e55a6b93f9b90a6447a9157ff9f10214b78bcd3d63b9763a6f69a9f524984b4"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8406305cabfa655607d8f0c9ea72c13fff22d8ead055a1c26ac1561067345b6b"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c8745164e738eee604c79dcbabc0317b3758b2487894712e2722fb78f8302a75"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:26dc5b5081c4fa3a9d517d8633b377d394c409182a871ada0105fc7c994ee7d5"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a29fb4399795b903a7c0089752889fb268746a946cb74f38edec231c0945ca3d"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:51a4731c67c90d101eeb778123b9e28da2ee1222a9f17d2175354d10a8c9549d"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c07413a6787273d5b491b102bc903e2eb73472a3442a400c2410025ac0070bcc"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9c316060606ba3efbe1eb56a740c9aebe40c3e2c9d1f8c04cd4aa238e87e6667"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:d22cac2aa48c365612b918ba446441d2b300b8377fa87e7776a00d4857f3eedd"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:17d6b13fd38c0ef853ef1b5485a9029dadbf93d0e772eb1c95feb043594ab8e3"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:581abaee1facdba3f7d69122e9add766b7c02b110b3011e8bc512deb2ff93c12"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-win32.whl", hash = "sha256:fd26813062148d56e46fe3e82b2e4d2dbe202aceb6038fdd06ba9a8dd782bfb4"}, + {file = "aiohttp-3.9.0b1-cp39-cp39-win_amd64.whl", hash = "sha256:3c9ca575572f0914458544180051bbaeeebb0e487e9b069fa844a6a74fd7800f"}, + {file = "aiohttp-3.9.0b1.tar.gz", hash = "sha256:d6e120b08ac168825239c64e0a850a108edb9cd17be247e25bced9b07a14a403"}, ] [package.dependencies] -aiodns = {version = "*", optional = true, markers = "extra == \"speedups\""} +aiodns = {version = "*", optional = true, markers = "(sys_platform == \"linux\" or sys_platform == \"darwin\") and extra == \"speedups\""} aiosignal = ">=1.1.2" -async-timeout = ">=4.0.0a3,<5.0" +async-timeout = {version = ">=4.0,<5.0", markers = "python_version < \"3.11\""} attrs = ">=17.3.0" -Brotli = {version = "*", optional = true, markers = "extra == \"speedups\""} -cchardet = {version = "*", optional = true, markers = "python_version < \"3.10\" and extra == \"speedups\""} -charset-normalizer = ">=2.0,<4.0" +Brotli = {version = "*", optional = true, markers = "platform_python_implementation == \"CPython\" and extra == \"speedups\""} +brotlicffi = {version = "*", optional = true, markers = "platform_python_implementation != \"CPython\" and extra == \"speedups\""} frozenlist = ">=1.1.1" multidict = ">=4.5,<7.0" yarl = ">=1.0,<2.0" [package.extras] -speedups = ["Brotli", "aiodns", "cchardet"] +speedups = ["Brotli", "aiodns", "brotlicffi"] [[package]] name = "aiosignal" @@ -261,43 +249,44 @@ files = [ ] [[package]] -name = "cchardet" -version = "2.1.7" -description = "cChardet is high speed universal character encoding detector." +name = "brotlicffi" +version = "1.1.0.0" +description = "Python CFFI bindings to the Brotli library" optional = false -python-versions = "*" +python-versions = ">=3.7" files = [ - {file = "cchardet-2.1.7-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:c6f70139aaf47ffb94d89db603af849b82efdf756f187cdd3e566e30976c519f"}, - {file = "cchardet-2.1.7-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:5a25f9577e9bebe1a085eec2d6fdd72b7a9dd680811bba652ea6090fb2ff472f"}, - {file = "cchardet-2.1.7-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:6b6397d8a32b976a333bdae060febd39ad5479817fabf489e5596a588ad05133"}, - {file = "cchardet-2.1.7-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:228d2533987c450f39acf7548f474dd6814c446e9d6bd228e8f1d9a2d210f10b"}, - {file = "cchardet-2.1.7-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:54341e7e1ba9dc0add4c9d23b48d3a94e2733065c13920e85895f944596f6150"}, - {file = "cchardet-2.1.7-cp36-cp36m-win32.whl", hash = "sha256:eee4f5403dc3a37a1ca9ab87db32b48dc7e190ef84601068f45397144427cc5e"}, - {file = "cchardet-2.1.7-cp36-cp36m-win_amd64.whl", hash = "sha256:f86e0566cb61dc4397297696a4a1b30f6391b50bc52b4f073507a48466b6255a"}, - {file = "cchardet-2.1.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:302aa443ae2526755d412c9631136bdcd1374acd08e34f527447f06f3c2ddb98"}, - {file = "cchardet-2.1.7-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:70eeae8aaf61192e9b247cf28969faef00578becd2602526ecd8ae7600d25e0e"}, - {file = "cchardet-2.1.7-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:a39526c1c526843965cec589a6f6b7c2ab07e3e56dc09a7f77a2be6a6afa4636"}, - {file = "cchardet-2.1.7-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:b154effa12886e9c18555dfc41a110f601f08d69a71809c8d908be4b1ab7314f"}, - {file = "cchardet-2.1.7-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:ec3eb5a9c475208cf52423524dcaf713c394393e18902e861f983c38eeb77f18"}, - {file = "cchardet-2.1.7-cp37-cp37m-win32.whl", hash = "sha256:50ad671e8d6c886496db62c3bd68b8d55060688c655873aa4ce25ca6105409a1"}, - {file = "cchardet-2.1.7-cp37-cp37m-win_amd64.whl", hash = "sha256:54d0b26fd0cd4099f08fb9c167600f3e83619abefeaa68ad823cc8ac1f7bcc0c"}, - {file = "cchardet-2.1.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b59ddc615883835e03c26f81d5fc3671fab2d32035c87f50862de0da7d7db535"}, - {file = "cchardet-2.1.7-cp38-cp38-manylinux1_i686.whl", hash = "sha256:27a9ba87c9f99e0618e1d3081189b1217a7d110e5c5597b0b7b7c3fedd1c340a"}, - {file = "cchardet-2.1.7-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:90086e5645f8a1801350f4cc6cb5d5bf12d3fa943811bb08667744ec1ecc9ccd"}, - {file = "cchardet-2.1.7-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:45456c59ec349b29628a3c6bfb86d818ec3a6fbb7eb72de4ff3bd4713681c0e3"}, - {file = "cchardet-2.1.7-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:f16517f3697569822c6d09671217fdeab61dfebc7acb5068634d6b0728b86c0b"}, - {file = "cchardet-2.1.7-cp38-cp38-win32.whl", hash = "sha256:0b859069bbb9d27c78a2c9eb997e6f4b738db2d7039a03f8792b4058d61d1109"}, - {file = "cchardet-2.1.7-cp38-cp38-win_amd64.whl", hash = "sha256:273699c4e5cd75377776501b72a7b291a988c6eec259c29505094553ee505597"}, - {file = "cchardet-2.1.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:48ba829badef61441e08805cfa474ccd2774be2ff44b34898f5854168c596d4d"}, - {file = "cchardet-2.1.7-cp39-cp39-manylinux1_i686.whl", hash = "sha256:bd7f262f41fd9caf5a5f09207a55861a67af6ad5c66612043ed0f81c58cdf376"}, - {file = "cchardet-2.1.7-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:fdac1e4366d0579fff056d1280b8dc6348be964fda8ebb627c0269e097ab37fa"}, - {file = "cchardet-2.1.7-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:80e6faae75ecb9be04a7b258dc4750d459529debb6b8dee024745b7b5a949a34"}, - {file = "cchardet-2.1.7-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:c96aee9ebd1147400e608a3eff97c44f49811f8904e5a43069d55603ac4d8c97"}, - {file = "cchardet-2.1.7-cp39-cp39-win32.whl", hash = "sha256:2309ff8fc652b0fc3c0cff5dbb172530c7abb92fe9ba2417c9c0bcf688463c1c"}, - {file = "cchardet-2.1.7-cp39-cp39-win_amd64.whl", hash = "sha256:24974b3e40fee9e7557bb352be625c39ec6f50bc2053f44a3d1191db70b51675"}, - {file = "cchardet-2.1.7.tar.gz", hash = "sha256:c428b6336545053c2589f6caf24ea32276c6664cb86db817e03a94c60afa0eaf"}, + {file = "brotlicffi-1.1.0.0-cp37-abi3-macosx_10_9_x86_64.whl", hash = "sha256:9b7ae6bd1a3f0df532b6d67ff674099a96d22bc0948955cb338488c31bfb8851"}, + {file = "brotlicffi-1.1.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:19ffc919fa4fc6ace69286e0a23b3789b4219058313cf9b45625016bf7ff996b"}, + {file = "brotlicffi-1.1.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9feb210d932ffe7798ee62e6145d3a757eb6233aa9a4e7db78dd3690d7755814"}, + {file = "brotlicffi-1.1.0.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84763dbdef5dd5c24b75597a77e1b30c66604725707565188ba54bab4f114820"}, + {file = "brotlicffi-1.1.0.0-cp37-abi3-win32.whl", hash = "sha256:1b12b50e07c3911e1efa3a8971543e7648100713d4e0971b13631cce22c587eb"}, + {file = "brotlicffi-1.1.0.0-cp37-abi3-win_amd64.whl", hash = "sha256:994a4f0681bb6c6c3b0925530a1926b7a189d878e6e5e38fae8efa47c5d9c613"}, + {file = "brotlicffi-1.1.0.0-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:2e4aeb0bd2540cb91b069dbdd54d458da8c4334ceaf2d25df2f4af576d6766ca"}, + {file = "brotlicffi-1.1.0.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4b7b0033b0d37bb33009fb2fef73310e432e76f688af76c156b3594389d81391"}, + {file = "brotlicffi-1.1.0.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:54a07bb2374a1eba8ebb52b6fafffa2afd3c4df85ddd38fcc0511f2bb387c2a8"}, + {file = "brotlicffi-1.1.0.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7901a7dc4b88f1c1475de59ae9be59799db1007b7d059817948d8e4f12e24e35"}, + {file = "brotlicffi-1.1.0.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:ce01c7316aebc7fce59da734286148b1d1b9455f89cf2c8a4dfce7d41db55c2d"}, + {file = "brotlicffi-1.1.0.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:246f1d1a90279bb6069de3de8d75a8856e073b8ff0b09dcca18ccc14cec85979"}, + {file = "brotlicffi-1.1.0.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc4bc5d82bc56ebd8b514fb8350cfac4627d6b0743382e46d033976a5f80fab6"}, + {file = "brotlicffi-1.1.0.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:37c26ecb14386a44b118ce36e546ce307f4810bc9598a6e6cb4f7fca725ae7e6"}, + {file = "brotlicffi-1.1.0.0-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca72968ae4eaf6470498d5c2887073f7efe3b1e7d7ec8be11a06a79cc810e990"}, + {file = "brotlicffi-1.1.0.0-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:add0de5b9ad9e9aa293c3aa4e9deb2b61e99ad6c1634e01d01d98c03e6a354cc"}, + {file = "brotlicffi-1.1.0.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9b6068e0f3769992d6b622a1cd2e7835eae3cf8d9da123d7f51ca9c1e9c333e5"}, + {file = "brotlicffi-1.1.0.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8557a8559509b61e65083f8782329188a250102372576093c88930c875a69838"}, + {file = "brotlicffi-1.1.0.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2a7ae37e5d79c5bdfb5b4b99f2715a6035e6c5bf538c3746abc8e26694f92f33"}, + {file = "brotlicffi-1.1.0.0-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:391151ec86bb1c683835980f4816272a87eaddc46bb91cbf44f62228b84d8cca"}, + {file = "brotlicffi-1.1.0.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:2f3711be9290f0453de8eed5275d93d286abe26b08ab4a35d7452caa1fef532f"}, + {file = "brotlicffi-1.1.0.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:1a807d760763e398bbf2c6394ae9da5815901aa93ee0a37bca5efe78d4ee3171"}, + {file = "brotlicffi-1.1.0.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fa8ca0623b26c94fccc3a1fdd895be1743b838f3917300506d04aa3346fd2a14"}, + {file = "brotlicffi-1.1.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3de0cf28a53a3238b252aca9fed1593e9d36c1d116748013339f0949bfc84112"}, + {file = "brotlicffi-1.1.0.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6be5ec0e88a4925c91f3dea2bb0013b3a2accda6f77238f76a34a1ea532a1cb0"}, + {file = "brotlicffi-1.1.0.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:d9eb71bb1085d996244439154387266fd23d6ad37161f6f52f1cd41dd95a3808"}, + {file = "brotlicffi-1.1.0.0.tar.gz", hash = "sha256:b77827a689905143f87915310b93b273ab17888fd43ef350d4832c4a71083c13"}, ] +[package.dependencies] +cffi = ">=1.0.0" + [[package]] name = "cffi" version = "1.16.0" @@ -362,105 +351,6 @@ files = [ [package.dependencies] pycparser = "*" -[[package]] -name = "charset-normalizer" -version = "3.3.2" -description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -optional = false -python-versions = ">=3.7.0" -files = [ - {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"}, - {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, -] - [[package]] name = "colorama" version = "0.4.6" @@ -987,4 +877,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "5698004d31d609d8d17d163df297492d4caadf9f1745d0bc422c194eb9758e82" +content-hash = "c18a4a3a6c279206c5402fa1737b197296454be8d002b65421e245150b9807e8" diff --git a/pyproject.toml b/pyproject.toml index cb60032a..40770d86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ include = [ [tool.poetry.dependencies] python = "^3.8" pyreadline3 = { version = "^3.4.1", platform = "win32" } -aiohttp = { version = "^3.8.5", extras = ["speedups"] } +aiohttp = { version = "^3.9.0b1", allow-prereleases = true, extras = ["speedups"] } pminit = { version = "*", allow-prereleases = true } From 91939b0d14fd2fd620a9128f9463127a5e1f22bb Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Wed, 22 Nov 2023 10:52:12 -0500 Subject: [PATCH 0061/1086] Cleanup unused Type methods and add Array copy constructor for List --- include/DictType.hh | 15 --------------- include/ListType.hh | 38 +++----------------------------------- include/TupleType.hh | 15 --------------- src/DictType.cc | 10 ---------- src/ListType.cc | 33 ++++++++++++++++++--------------- src/TupleType.cc | 10 +--------- 6 files changed, 22 insertions(+), 99 deletions(-) diff --git a/include/DictType.hh b/include/DictType.hh index 099caafd..780a0e73 100644 --- a/include/DictType.hh +++ b/include/DictType.hh @@ -38,21 +38,6 @@ public: DictType(JSContext *cx, JS::Handle jsObject); const TYPE returnType = TYPE::DICT; -/** - * @brief The 'set' method for a python dictionary. Sets the approprite 'key' in the dictionary with the appropriate 'value' - * - * @param key The key of the dictionary item - * @param value The value of the dictionary item - */ - void set(PyType *key, PyType *value); - -/** - * @brief Gets the dictionary item at the given 'key' - * - * @param key The key of the item in question - * @return PyType* Returns a pointer to the appropriate PyType object - */ - PyType *get(PyType *key) const; }; #endif \ No newline at end of file diff --git a/include/ListType.hh b/include/ListType.hh index 061212a8..df5ba9ac 100644 --- a/include/ListType.hh +++ b/include/ListType.hh @@ -15,7 +15,8 @@ #include "PyType.hh" #include "TypeEnum.hh" -#include +#include + /** * @brief This struct represents a list in python. It derives from the PyType struct @@ -26,40 +27,7 @@ struct ListType : public PyType { public: ListType(); ListType(PyObject *object); + ListType(JSContext *cx, JS::HandleObject arrayObj); const TYPE returnType = TYPE::LIST; -/** - * @brief - * - * - * @param index The index of the list item - * @param value The value of the list item - */ - void set(int index, PyType *value); - -/** - * @brief Gets the list item at the given index - * - * @param index The index of the item in question - * @return PyType* Returns a pointer to the appropriate PyType object - */ - PyType *get(int index) const; - -/** - * @brief Appends the given value to the list - * - * @param value The item to be appended - */ - void append(PyType *value); - -/** - * @brief - * - * - * - * @returns int length of the list - */ - int len() const; - - void sort(); }; #endif \ No newline at end of file diff --git a/include/TupleType.hh b/include/TupleType.hh index 5dd84a04..c1209cb4 100644 --- a/include/TupleType.hh +++ b/include/TupleType.hh @@ -26,20 +26,5 @@ struct TupleType : public PyType { public: TupleType(PyObject *obj); const TYPE returnType = TYPE::TUPLE; - -/** - * @brief Gets the tuple item at the given index - * - * @param index The index of the item in question - * @return PyType* Returns a pointer to the appropriate PyType object - */ - PyType *get(int index) const; - -/** - * @brief - * - * @returns int length of the tuple - */ - int len() const; }; #endif \ No newline at end of file diff --git a/src/DictType.cc b/src/DictType.cc index 6e84e15b..86e029f9 100644 --- a/src/DictType.cc +++ b/src/DictType.cc @@ -10,7 +10,6 @@ #include -#include DictType::DictType() { this->pyObject = PyDict_New(); @@ -24,13 +23,4 @@ DictType::DictType(JSContext *cx, JS::Handle jsObject) { JS_ValueToObject(cx, jsObject, &obj); proxy->jsObject.set(obj); this->pyObject = (PyObject *)proxy; -} - -void DictType::set(PyType *key, PyType *value) { - PyDict_SetItem(this->pyObject, key->getPyObject(), value->getPyObject()); -} - -PyType *DictType::get(PyType *key) const { - PyObject *retrieved_object = PyDict_GetItem(this->pyObject, key->getPyObject()); - return retrieved_object != NULL ? pyTypeFactory(retrieved_object) : nullptr; } \ No newline at end of file diff --git a/src/ListType.cc b/src/ListType.cc index 2d6e7652..d03545b5 100644 --- a/src/ListType.cc +++ b/src/ListType.cc @@ -5,27 +5,30 @@ #include -#include +#include +#include + ListType::ListType() : PyType(PyList_New(0)) {} + ListType::ListType(PyObject *object) : PyType(object) {} -PyType *ListType::get(int index) const { - return pyTypeFactory(PyList_GetItem(this->pyObject, index)); -} +ListType::ListType(JSContext *cx, JS::HandleObject arrayObj) { + uint32_t length; + JS::GetArrayLength(cx, arrayObj, &length); + + PyObject *object = PyList_New((Py_ssize_t)length); + Py_XINCREF(object); + this->pyObject = object; -void ListType::set(int index, PyType *object) { - PyList_SetItem(this->pyObject, index, object->getPyObject()); -} + JS::RootedValue rval(cx); + JS::RootedObject arrayRootedObj(cx, arrayObj); -void ListType::append(PyType *value) { - PyList_Append(this->pyObject, value->getPyObject()); -} + for (uint32_t index = 0; index < length; index++) { + JS_GetElement(cx, arrayObj, index, &rval); -int ListType::len() const { - return PyList_Size(this->pyObject); -} + PyType *pyType = pyTypeFactory(cx, &arrayRootedObj, &rval); -void ListType::sort() { - PyList_Sort(this->pyObject); + PyList_SetItem(this->pyObject, index, pyType->getPyObject()); + } } \ No newline at end of file diff --git a/src/TupleType.cc b/src/TupleType.cc index b2cda6bb..7c2018cc 100644 --- a/src/TupleType.cc +++ b/src/TupleType.cc @@ -18,12 +18,4 @@ #include -TupleType::TupleType(PyObject *object) : PyType(object) {} - -PyType *TupleType::get(int index) const { - return pyTypeFactory(PyTuple_GetItem(this->pyObject, index)); -} - -int TupleType::len() const { - return PyTuple_Size(this->pyObject); -} \ No newline at end of file +TupleType::TupleType(PyObject *object) : PyType(object) {} \ No newline at end of file From b9909e509f2bb5b5b09f27c169b492d9c586da65 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Wed, 22 Nov 2023 12:02:44 -0500 Subject: [PATCH 0062/1086] Python List to Array conversion and back We convert py List to js Array and back. Type List supports a strict subset of type Array, not an intersection. So when we go py to js we convert List to true Array, and when we go the other way we drop all of Array that is not supported by List --- README.md | 6 ++- include/PyProxyHandler.hh | 23 --------- python/pythonmonkey/helpers.py | 2 +- src/PyProxyHandler.cc | 88 --------------------------------- src/jsTypeFactory.cc | 29 +++++++---- src/pyTypeFactory.cc | 6 +-- tests/python/test_list_array.py | 15 ++++++ 7 files changed, 44 insertions(+), 125 deletions(-) create mode 100644 tests/python/test_list_array.py diff --git a/README.md b/README.md index 348cceb6..e19822b2 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ from pythonmonkey import eval as js_eval js_eval("console.log")('hello, world') ``` +TODO document eval options + ### Goals - **Fast** and memory-efficient - Make writing code in either JS or Python a developer preference @@ -33,6 +35,7 @@ js_eval("console.log")('hello, world') - JS Date objects are represented by Python datetime.datetime objects - Intrinsics (boolean, number, null, undefined) are passed by value - JS Functions are automatically wrapped so that they behave like Python functions, and vice-versa +- Python Lists are represented by JS true Arrays ### Roadmap - [done] JS instrinsics coerce to Python intrinsics @@ -54,6 +57,7 @@ js_eval("console.log")('hello, world') - Python host environment supplies basic subsets of NodeJS's fs, path, process, etc, modules; as-needed by dcp-client (other project?) - [done] Python TypedArrays coerce to JS TypeArrays - [done] JS TypedArrays coerce to Python TypeArrays +- [done] Python List coerce to JS Arrays ## Build Instructions @@ -233,7 +237,7 @@ that if you update an object in JavaScript, the corresponding Dict in Python wil | Bool | boolean | Function | function | Dict | object -| List | Array-like object +| List | Array | datetime | Date object | awaitable | Promise | Error | Error object diff --git a/include/PyProxyHandler.hh b/include/PyProxyHandler.hh index 21188e26..3ce925d6 100644 --- a/include/PyProxyHandler.hh +++ b/include/PyProxyHandler.hh @@ -159,29 +159,6 @@ public: JS::ObjectOpResult &result) const override; }; -/** - * @brief This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates - * to handle coercion from python lists to JS Array-like objects - */ -struct PyListProxyHandler : public PyBaseProxyHandler { -public: - PyListProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; - static const char family; - - bool getOwnPropertyDescriptor( - JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - JS::MutableHandle> desc - ) const override; - - bool defineProperty( - JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - JS::Handle desc, JS::ObjectOpResult &result - ) const override; - - bool ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override; - bool delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const override; -}; - /** * @brief Convert jsid to a PyObject to be used as dict keys */ diff --git a/python/pythonmonkey/helpers.py b/python/pythonmonkey/helpers.py index 8c526bb9..a491cb57 100644 --- a/python/pythonmonkey/helpers.py +++ b/python/pythonmonkey/helpers.py @@ -51,7 +51,7 @@ def new(ctor): .filter(prop => Object.keys(globalThis).indexOf(prop) === -1); """, evalOpts) -for index in range(0, int(exports.length)): +for index in range(0, len(exports)): name = exports[index] if (pmGlobals.get(name) == None): globals().update({name: globalThis[name]}) diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index db4c9011..c6fa7c7d 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -175,91 +175,3 @@ bool PyBaseProxyHandler::isExtensible(JSContext *cx, JS::HandleObject proxy, *extensible = false; return true; } - -const char PyListProxyHandler::family = 0; - -bool PyListProxyHandler::getOwnPropertyDescriptor( - JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - JS::MutableHandle> desc -) const { - // We're trying to get the "length" property - bool isLengthProperty; - if (id.isString() && JS_StringEqualsLiteral(cx, id.toString(), "length", &isLengthProperty) && isLengthProperty) { - // proxy.length = len(pyObject) - desc.set(mozilla::Some( - JS::PropertyDescriptor::Data( - JS::Int32Value(PySequence_Size(pyObject)) - ) - )); - return true; - } - - // We're trying to get an item - Py_ssize_t index; - PyObject *item; - if (idToIndex(cx, id, &index) && (item = PySequence_GetItem(pyObject, index))) { - desc.set(mozilla::Some( - JS::PropertyDescriptor::Data( - jsTypeFactory(cx, item), - {JS::PropertyAttribute::Writable, JS::PropertyAttribute::Enumerable} - ) - )); - } else { // item not found in list, or not an int-like property key - desc.set(mozilla::Nothing()); - } - return true; -} - -bool PyListProxyHandler::defineProperty( - JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - JS::Handle desc, JS::ObjectOpResult &result -) const { - Py_ssize_t index; - if (!idToIndex(cx, id, &index)) { // not an int-like property key - return result.failBadIndex(); - } - - if (desc.isAccessorDescriptor()) { // containing getter/setter - return result.failNotDataDescriptor(); - } - if (!desc.hasValue()) { - return result.failInvalidDescriptor(); - } - - // FIXME (Tom Tang): memory leak - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - JS::RootedValue *itemV = new JS::RootedValue(cx, desc.value()); - PyObject *item = pyTypeFactory(cx, global, itemV)->getPyObject(); - if (PySequence_SetItem(pyObject, index, item) < 0) { - return result.failBadIndex(); - } - return result.succeed(); -} - -bool PyListProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { - // Modified from https://hg.mozilla.org/releases/mozilla-esr102/file/3b574e1/dom/base/RemoteOuterWindowProxy.cpp#l137 - int32_t length = PySequence_Size(pyObject); - if (!props.reserve(length + 1)) { - return false; - } - // item indexes - for (int32_t i = 0; i < length; ++i) { - props.infallibleAppend(JS::PropertyKey::Int(i)); - } - // the "length" property - props.infallibleAppend(JS::PropertyKey::NonIntAtom(JS_AtomizeString(cx, "length"))); - return true; -} - -bool PyListProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const { - Py_ssize_t index; - if (!idToIndex(cx, id, &index)) { - return result.failBadIndex(); // report failure - } - - // Set to undefined instead of actually deleting it - if (PySequence_SetItem(pyObject, index, Py_None) < 0) { - return result.failCantDelete(); // report failure - } - return result.succeed(); // report success -} diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 62dd2dde..22596f82 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -27,6 +27,7 @@ #include #include #include +#include #include #include // https://docs.python.org/3/c-api/datetime.html @@ -162,16 +163,27 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { else if (PyObject_TypeCheck(object, &JSObjectProxyType)) { returnType.setObject(*((JSObjectProxy *)object)->jsObject); } - else if (PyDict_Check(object) || PyList_Check(object)) { - JS::RootedValue v(cx); - JSObject *proxy; - if (PyList_Check(object)) { - proxy = js::NewProxyObject(cx, new PyListProxyHandler(object), v, NULL); - } else { - proxy = js::NewProxyObject(cx, new PyProxyHandler(object), v, NULL); - } + else if (PyDict_Check(object)) { + JS::RootedValue v(cx); // TODO inline + JSObject *proxy = js::NewProxyObject(cx, new PyProxyHandler(object), v, NULL); returnType.setObject(*proxy); } + else if (PyList_Check(object)) { + JS::RootedValueVector jsItemVector(cx); + Py_ssize_t listSize = PyList_Size(object); + for (Py_ssize_t index = 0; index < listSize; index++) { + JS::Value jsValue = jsTypeFactorySafe(cx, PyList_GetItem(object, index)); // TODO use version with no error checking? + if (jsValue.isNull()) { + returnType.setNull(); + return returnType; + } + jsItemVector.append(jsValue); + } + + JS::HandleValueArray jsValueArray(jsItemVector); + JSObject *array = JS::NewArrayObject(cx, jsValueArray); + returnType.setObject(*array); + } else if (object == Py_None) { returnType.setUndefined(); } @@ -191,7 +203,6 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { PyErr_SetString(PyExc_TypeError, errorString.c_str()); } return returnType; - } JS::Value jsTypeFactorySafe(JSContext *cx, PyObject *object) { diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index 5a4aec6e..f21390e6 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -100,9 +100,6 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted if (js::GetProxyHandler(obj)->family() == &PyProxyHandler::family) { // this is one of our proxies for python dicts return new DictType(((PyProxyHandler *)js::GetProxyHandler(obj))->pyObject); } - if (js::GetProxyHandler(obj)->family() == &PyListProxyHandler::family) { // this is one of our proxies for python lists - return new ListType(((PyListProxyHandler *)js::GetProxyHandler(obj))->pyObject); - } } js::ESClass cls; JS::GetBuiltinClass(cx, obj, &cls); @@ -159,6 +156,9 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted memoizePyTypeAndGCThing(s, *rval); // TODO (Caleb Aikens) consider putting this in the StrType constructor return s; } + case js::ESClass::Array: { + return new ListType(cx, obj); + } default: { if (BufferType::isSupportedJsTypes(obj)) { // TypedArray or ArrayBuffer // TODO (Tom Tang): ArrayBuffers have cls == js::ESClass::ArrayBuffer diff --git a/tests/python/test_list_array.py b/tests/python/test_list_array.py new file mode 100644 index 00000000..40ed3afc --- /dev/null +++ b/tests/python/test_list_array.py @@ -0,0 +1,15 @@ +import pythonmonkey as pm + +def test_eval_list_is_array(): + items = [1, 2, 3] + isArray = pm.eval('Array.isArray')(items) + assert isArray == True + +def test_eval_array_is_list(): + pythonList = pm.eval('[]') + assert isinstance(pythonList, list) + +# extra nice but not necessary +def test_eval_array_is_list_type_string(): + pythonListTypeString = str(type(pm.eval('[]'))) + assert pythonListTypeString == "" From cd2c82d549df804b2f10294c53727568f1873102 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Wed, 22 Nov 2023 13:38:59 -0500 Subject: [PATCH 0063/1086] remove TODO --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index e19822b2..61adf5ab 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,6 @@ from pythonmonkey import eval as js_eval js_eval("console.log")('hello, world') ``` -TODO document eval options - ### Goals - **Fast** and memory-efficient - Make writing code in either JS or Python a developer preference From ede9026e1e91a4d0384149c0e05662f6d44bfb68 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Wed, 22 Nov 2023 14:40:42 -0500 Subject: [PATCH 0064/1086] chore(JSObjectProxy): add missing include guard --- include/JSObjectProxy.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index d66ac0d5..862ecc06 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -9,6 +9,9 @@ * */ +#ifndef PythonMonkey_JSObjectProxy_ +#define PythonMonkey_JSObjectProxy_ + #include #include @@ -145,3 +148,5 @@ static PyMappingMethods JSObjectProxy_mapping_methods = { * @brief Struct for the JSObjectProxyType, used by all JSObjectProxy objects */ extern PyTypeObject JSObjectProxyType; + +#endif \ No newline at end of file From 8e235b5c585c07ffed8629060416e181fa8e86b7 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Wed, 22 Nov 2023 14:49:44 -0500 Subject: [PATCH 0065/1086] feat(PyObjectProxyHandler): implement an opaque type wrapper --- include/PyProxyHandler.hh | 131 +++++++++++++++++++- src/JSObjectProxy.cc | 2 - src/PyProxyHandler.cc | 145 +++++++++++++++++++++-- src/jsTypeFactory.cc | 10 +- src/modules/pythonmonkey/pythonmonkey.cc | 2 + src/pyTypeFactory.cc | 7 +- 6 files changed, 274 insertions(+), 23 deletions(-) diff --git a/include/PyProxyHandler.hh b/include/PyProxyHandler.hh index 21188e26..f3480224 100644 --- a/include/PyProxyHandler.hh +++ b/include/PyProxyHandler.hh @@ -18,7 +18,7 @@ #include /** - * @brief base class for PyProxyHandler and PyListProxyHandler + * @brief base class for PyObjectProxyHandler, PyDictProxyHandler, and PyListProxyHandler */ struct PyBaseProxyHandler : public js::BaseProxyHandler { public: @@ -34,9 +34,134 @@ public: * @brief This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates to handle coercion from python dicts to JS Objects * */ -struct PyProxyHandler : public PyBaseProxyHandler { +struct PyDictProxyHandler : public PyBaseProxyHandler { public: - PyProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; + PyDictProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; + static const char family; + + /** + * @brief [[OwnPropertyKeys]] + * + * @param cx - pointer to JSContext + * @param proxy - The proxy object who's keys we output + * @param props - out-parameter of object IDs + * @return true - call succeeded + * @return false - call failed and an exception has been raised + */ + bool ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, + JS::MutableHandleIdVector props) const override; + /** + * @brief [[Delete]] + * + * @param cx - pointer to JSContext + * @param proxy - The proxy object who's property we wish to delete + * @param id - The key we wish to delete + * @param result - @TODO (Caleb Aikens) read up on JS::ObjectOpResult + * @return true - call succeeded + * @return false - call failed and an exception has been raised + */ + bool delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::ObjectOpResult &result) const override; + /** + * @brief [[HasProperty]] + * + * @param cx - pointer to JSContext + * @param proxy - The proxy object who's propery we wish to check + * @param id - key value of the property to check + * @param bp - out-paramter: true if object has property, false if not + * @return true - call succeeded + * @return false - call failed and an exception has been raised + */ + bool has(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + bool *bp) const override; + /** + * @brief [[Get]] + * + * @param cx pointer to JSContext + * @param proxy - The proxy object who's property we wish to check + * @param receiver @TODO (Caleb Aikens) read ECMAScript docs about this + * @param id - Key of the property we wish to get + * @param vp - out-paramter for the gotten property + * @return true - call succeeded + * @return false - call failed and an exception has been raised + */ + bool get(JSContext *cx, JS::HandleObject proxy, + JS::HandleValue receiver, JS::HandleId id, + JS::MutableHandleValue vp) const override; + /** + * @brief [[Set]] + * + * @param cx pointer to JSContext + * @param proxy The proxy object who's property we wish to set + * @param id Key of the property we wish to set + * @param v Value that we wish to set the property to + * @param receiver @TODO (Caleb Aikens) read ECMAScript docs about this + * @param result @TODO (Caleb Aikens) read ECMAScript docs about this + * @return true call succeed + * @return false call failed and an exception has been raised + */ + bool set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::HandleValue v, JS::HandleValue receiver, + JS::ObjectOpResult &result) const override; + /** + * @brief [[Enumerate]] + * + * @param cx - pointer to JSContext + * @param proxy - The proxy object who's keys we output + * @param props - out-parameter of object IDs + * @return true - call succeeded + * @return false - call failed and an exception has been raised + */ + bool enumerate(JSContext *cx, JS::HandleObject proxy, + JS::MutableHandleIdVector props) const override; + + // @TODO (Caleb Aikens) The following are Spidermonkey-unique extensions, need to read into them more + /** + * @brief @TODO (Caleb Aikens) read up on what this trap does exactly + * + * @param cx pointer to JSContext + * @param proxy The proxy object who's property we wish to check + * @param id Key of the property we wish to check + * @param bp out-paramter: true if object has property, false if not + * @return true call succeeded + * @return false call failed and an exception has been raised + */ + bool hasOwn(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + bool *bp) const override; + /** + * @brief @TODO (Caleb Aikens) read up on what this trap does exactly + * + * @param cx - pointer to JSContext + * @param proxy - The proxy object who's keys we output + * @param props - out-parameter of object IDs + * @return true - call succeeded + * @return false - call failed and an exception has been raised + */ + bool getOwnEnumerablePropertyKeys( + JSContext *cx, JS::HandleObject proxy, + JS::MutableHandleIdVector props) const override; + /** + * @brief Handles python object reference count when JS Proxy object is finalized + * + * @param gcx pointer to JS::GCContext + * @param proxy the proxy object being finalized + */ + void finalize(JS::GCContext *gcx, JSObject *proxy) const override; + + bool getOwnPropertyDescriptor( + JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::MutableHandle> desc + ) const override; + + bool defineProperty(JSContext *cx, JS::HandleObject proxy, + JS::HandleId id, + JS::Handle desc, + JS::ObjectOpResult &result) const override; +}; + +struct PyObjectProxyHandler : public PyBaseProxyHandler { +public: + PyObjectProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; static const char family; /** diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 00392ba7..af6f6cfc 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -21,8 +21,6 @@ #include -JSContext *GLOBAL_CX; /**< pointer to PythonMonkey's JSContext */ - bool keyToId(PyObject *key, JS::MutableHandleId idp) { if (PyUnicode_Check(key)) { // key is str type JS::RootedString idString(GLOBAL_CX); diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index db4c9011..d1f7cbad 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -47,9 +47,9 @@ bool idToIndex(JSContext *cx, JS::HandleId id, Py_ssize_t *index) { } } -const char PyProxyHandler::family = 0; +const char PyDictProxyHandler::family = 0; -bool PyProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { +bool PyDictProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { PyObject *keys = PyDict_Keys(pyObject); size_t length = PyList_Size(keys); if (!props.reserve(length)) { @@ -68,7 +68,7 @@ bool PyProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS:: return true; } -bool PyProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, +bool PyDictProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const { PyObject *attrName = idToKey(cx, id); if (PyDict_DelItem(pyObject, attrName) < 0) { @@ -77,12 +77,12 @@ bool PyProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId return result.succeed(); } -bool PyProxyHandler::has(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, +bool PyDictProxyHandler::has(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp) const { return hasOwn(cx, proxy, id, bp); } -bool PyProxyHandler::get(JSContext *cx, JS::HandleObject proxy, +bool PyDictProxyHandler::get(JSContext *cx, JS::HandleObject proxy, JS::HandleValue receiver, JS::HandleId id, JS::MutableHandleValue vp) const { PyObject *attrName = idToKey(cx, id); @@ -95,7 +95,7 @@ bool PyProxyHandler::get(JSContext *cx, JS::HandleObject proxy, return true; } -bool PyProxyHandler::getOwnPropertyDescriptor( +bool PyDictProxyHandler::getOwnPropertyDescriptor( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::MutableHandle> desc ) const { @@ -114,7 +114,7 @@ bool PyProxyHandler::getOwnPropertyDescriptor( return true; } -bool PyProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, +bool PyDictProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::HandleValue v, JS::HandleValue receiver, JS::ObjectOpResult &result) const { JS::RootedValue *rootedV = new JS::RootedValue(cx, v); @@ -126,28 +126,28 @@ bool PyProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, return result.succeed(); } -bool PyProxyHandler::enumerate(JSContext *cx, JS::HandleObject proxy, +bool PyDictProxyHandler::enumerate(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { return this->ownPropertyKeys(cx, proxy, props); } -bool PyProxyHandler::hasOwn(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, +bool PyDictProxyHandler::hasOwn(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp) const { PyObject *attrName = idToKey(cx, id); *bp = PyDict_Contains(pyObject, attrName) == 1; return true; } -bool PyProxyHandler::getOwnEnumerablePropertyKeys( +bool PyDictProxyHandler::getOwnEnumerablePropertyKeys( JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { return this->ownPropertyKeys(cx, proxy, props); } // @TODO (Caleb Aikens) implement this -void PyProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const {} +void PyDictProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const {} -bool PyProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, +bool PyDictProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::Handle desc, JS::ObjectOpResult &result) const { @@ -263,3 +263,124 @@ bool PyListProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::Hand } return result.succeed(); // report success } + +const char PyObjectProxyHandler::family = 0; + +bool PyObjectProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { + PyObject *keys = PyObject_Dir(pyObject); + size_t keysLength = PyList_Size(keys); + + PyObject *nonDunderKeys = PyList_New(0); + for (size_t i = 0; i < keysLength; i++) { + PyObject *key = PyList_GetItem(keys, i); + PyObject *isDunder = PyObject_CallMethod(key, "startswith", "(s)", "__"); + if (Py_IsFalse(isDunder)) { // if key starts with "__", ignore it + PyList_Append(nonDunderKeys, key); + } + } + + size_t length = PyList_Size(nonDunderKeys); + + if (!props.reserve(length)) { + return false; // out of memory + } + + for (size_t i = 0; i < length; i++) { + PyObject *key = PyList_GetItem(nonDunderKeys, i); + JS::RootedId jsId(cx); + if (!keyToId(key, &jsId)) { + // TODO (Caleb Aikens): raise exception here + return false; // key is not a str or int + } + props.infallibleAppend(jsId); + } + return true; +} + +bool PyObjectProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::ObjectOpResult &result) const { + PyObject *attrName = idToKey(cx, id); + if (PyObject_SetAttr(pyObject, attrName, NULL) < 0) { + return result.failCantDelete(); // raises JS exception + } + return result.succeed(); +} + +bool PyObjectProxyHandler::has(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + bool *bp) const { + return hasOwn(cx, proxy, id, bp); +} + +bool PyObjectProxyHandler::get(JSContext *cx, JS::HandleObject proxy, + JS::HandleValue receiver, JS::HandleId id, + JS::MutableHandleValue vp) const { + PyObject *attrName = idToKey(cx, id); + if (!PyObject_HasAttr(pyObject, attrName)) { + vp.setUndefined(); // JS objects return undefined for nonpresent keys + return true; + } + + PyObject *p = PyObject_GetAttr(pyObject, attrName); + vp.set(jsTypeFactory(cx, p)); + return true; +} + +bool PyObjectProxyHandler::getOwnPropertyDescriptor( + JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::MutableHandle> desc +) const { + PyObject *attrName = idToKey(cx, id); + PyObject *item = PyObject_GetAttr(pyObject, attrName); + if (!item) { // NULL if the key is not present + desc.set(mozilla::Nothing()); // JS objects return undefined for nonpresent keys + } else { + desc.set(mozilla::Some( + JS::PropertyDescriptor::Data( + jsTypeFactory(cx, item), + {JS::PropertyAttribute::Writable, JS::PropertyAttribute::Enumerable} + ) + )); + } + return true; +} + +bool PyObjectProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::HandleValue v, JS::HandleValue receiver, + JS::ObjectOpResult &result) const { + JS::RootedValue *rootedV = new JS::RootedValue(cx, v); + PyObject *attrName = idToKey(cx, id); + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + if (PyObject_SetAttr(pyObject, attrName, pyTypeFactory(cx, global, rootedV)->getPyObject())) { + return result.failCantSetInterposed(); // raises JS exception + } + return result.succeed(); +} + +bool PyObjectProxyHandler::enumerate(JSContext *cx, JS::HandleObject proxy, + JS::MutableHandleIdVector props) const { + return this->ownPropertyKeys(cx, proxy, props); +} + +bool PyObjectProxyHandler::hasOwn(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + bool *bp) const { + PyObject *attrName = idToKey(cx, id); + *bp = PyObject_HasAttr(pyObject, attrName) == 1; + return true; +} + +bool PyObjectProxyHandler::getOwnEnumerablePropertyKeys( + JSContext *cx, JS::HandleObject proxy, + JS::MutableHandleIdVector props) const { + return this->ownPropertyKeys(cx, proxy, props); +} + +// @TODO (Caleb Aikens) implement this +void PyObjectProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const {} + +bool PyObjectProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, + JS::HandleId id, + JS::Handle desc, + JS::ObjectOpResult &result) const { + // Block direct `Object.defineProperty` since we already have the `set` method + return result.failInvalidDescriptor(); +} \ No newline at end of file diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 62dd2dde..7885fd06 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -168,7 +169,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { if (PyList_Check(object)) { proxy = js::NewProxyObject(cx, new PyListProxyHandler(object), v, NULL); } else { - proxy = js::NewProxyObject(cx, new PyProxyHandler(object), v, NULL); + proxy = js::NewProxyObject(cx, new PyDictProxyHandler(object), v, NULL); } returnType.setObject(*proxy); } @@ -186,9 +187,10 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { // memoizePyTypeAndGCThing(p, returnType); } else { - std::string errorString("pythonmonkey cannot yet convert python objects of type: "); - errorString += Py_TYPE(object)->tp_name; - PyErr_SetString(PyExc_TypeError, errorString.c_str()); + JS::RootedValue v(cx); + JSObject *proxy; + proxy = js::NewProxyObject(cx, new PyObjectProxyHandler(object), v, NULL); + returnType.setObject(*proxy); } return returnType; diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index af98ec1d..2e1decf3 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -44,6 +44,8 @@ #include #include +JSContext *GLOBAL_CX; + typedef std::unordered_map *>>::iterator PyToGCIterator; typedef struct { PyObject_HEAD diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index 5a4aec6e..c8c810a3 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -97,12 +97,15 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted JS::Rooted obj(cx); JS_ValueToObject(cx, *rval, &obj); if (JS::GetClass(obj)->isProxyObject()) { - if (js::GetProxyHandler(obj)->family() == &PyProxyHandler::family) { // this is one of our proxies for python dicts - return new DictType(((PyProxyHandler *)js::GetProxyHandler(obj))->pyObject); + if (js::GetProxyHandler(obj)->family() == &PyDictProxyHandler::family) { // this is one of our proxies for python dicts + return new DictType(((PyDictProxyHandler *)js::GetProxyHandler(obj))->pyObject); } if (js::GetProxyHandler(obj)->family() == &PyListProxyHandler::family) { // this is one of our proxies for python lists return new ListType(((PyListProxyHandler *)js::GetProxyHandler(obj))->pyObject); } + if (js::GetProxyHandler(obj)->family() == &PyObjectProxyHandler::family) { // this is one of our proxies for python objects + return new PyType(((PyObjectProxyHandler *)js::GetProxyHandler(obj))->pyObject); + } } js::ESClass cls; JS::GetBuiltinClass(cx, obj, &cls); From cdfeb51fd052b1fd8a6467be6ce84eb45fe45b13 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 23 Nov 2023 16:55:18 -0500 Subject: [PATCH 0066/1086] Implement 'in' operation for Objects add sq_contains as part of tp_as_sequence --- include/JSObjectProxy.hh | 23 +++++++++++-------- src/JSObjectProxy.cc | 29 ++++++++++++++++-------- src/modules/pythonmonkey/pythonmonkey.cc | 7 +++--- 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index d66ac0d5..763e9160 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -74,6 +74,15 @@ public: */ static PyObject *JSObjectProxy_get(JSObjectProxy *self, PyObject *key); + /** + * @brief Getter method (.sq_contains), returns whether a key exists, used by the in operator + * + * @param self - The JSObjectProxy + * @param key - The key for the value in the JSObjectProxy + * @return int 1 if `key` is in dict, 0 if not, and -1 on error + */ + static int JSObjectProxy_contains(JSObjectProxy *self, PyObject *key); + /** * @brief Assign method (.mp_ass_subscript), assigns a key-value pair if value is non-NULL, or deletes a key-value pair if value is NULL * @@ -84,15 +93,6 @@ public: */ static int JSObjectProxy_assign(JSObjectProxy *self, PyObject *key, PyObject *value); - /** - * @brief Helper function for various JSObjectProxy methods, sets a key-value pair on a JSObject given a python string key and a JS::Value value - * - * @param jsObject - The underlying backing store JSObject for the JSObjectProxy - * @param key - The key to be assigned or deleted - * @param value - The JS::Value to be assigned - */ - static void JSObjectProxy_set_helper(JS::HandleObject jsObject, PyObject *key, JS::HandleValue value); - /** * @brief Comparison method (.tp_richcompare), returns appropriate boolean given a comparison operator and other pyobject * @@ -111,6 +111,7 @@ public: * @param visited * @return bool - Whether the compared objects are equal or not */ + // private static bool JSObjectProxy_richcompare_helper(JSObjectProxy *self, PyObject *other, std::unordered_map &visited); /** @@ -141,6 +142,10 @@ static PyMappingMethods JSObjectProxy_mapping_methods = { .mp_ass_subscript = (objobjargproc)JSObjectProxyMethodDefinitions::JSObjectProxy_assign }; +static PySequenceMethods JSObjectProxy_sequence_methods = { + .sq_contains = (objobjproc)JSObjectProxyMethodDefinitions::JSObjectProxy_contains +}; + /** * @brief Struct for the JSObjectProxyType, used by all JSObjectProxy objects */ diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 00392ba7..f2bb30bf 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -82,7 +82,23 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + PyType *pyType = pyTypeFactory(GLOBAL_CX, global, value); + delete value; + delete global; + return pyType->getPyObject(); +} + +int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, PyObject *key) +{ + JS::RootedId id(GLOBAL_CX); + if (!keyToId(key, &id)) { + // TODO (Caleb Aikens): raise exception here + return -1; // key is not a str or int + } + + JS::RootedValue value(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); + return value.isUndefined() ? 0 : 1; } int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, PyObject *key, PyObject *value) @@ -104,15 +120,9 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, Py return 0; } -void JSObjectProxyMethodDefinitions::JSObjectProxy_set_helper(JS::HandleObject jsObject, PyObject *key, JS::HandleValue value) -{ - JS::RootedId id(GLOBAL_CX); - keyToId(key, &id); - JS_SetPropertyById(GLOBAL_CX, jsObject, id, value); -} - PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare(JSObjectProxy *self, PyObject *other, int op) { + if (op != Py_EQ && op != Py_NE) { Py_RETURN_NOTIMPLEMENTED; } @@ -163,7 +173,8 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr } // iterate recursively through members of self and check for equality - for (size_t i = 0; i < props.length(); i++) + size_t length = props.length(); + for (size_t i = 0; i < length; i++) { JS::HandleId id = props[i]; JS::RootedValue *key = new JS::RootedValue(GLOBAL_CX); diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index af98ec1d..3b85ec2f 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -74,6 +74,7 @@ PyTypeObject JSObjectProxyType = { .tp_basicsize = sizeof(JSObjectProxy), .tp_dealloc = (destructor)JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc, .tp_repr = (reprfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_repr, + .tp_as_sequence = &JSObjectProxy_sequence_methods, .tp_as_mapping = &JSObjectProxy_mapping_methods, .tp_getattro = (getattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_get, .tp_setattro = (setattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_assign, @@ -312,9 +313,9 @@ PyMethodDef PythonMonkeyMethods[] = { struct PyModuleDef pythonmonkey = { PyModuleDef_HEAD_INIT, - "pythonmonkey", /* name of module */ - "A module for python to JS interoperability", /* module documentation, may be NULL */ - -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ + "pythonmonkey", /* name of module */ + "A module for Python to JavaScript interoperability", /* module documentation, may be NULL */ + -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ PythonMonkeyMethods }; From f3ec39d858aaa3e3f86bf9f89efc20e4ff30be96 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 23 Nov 2023 17:07:56 -0500 Subject: [PATCH 0067/1086] "contains" method for Object "in" operations added tp_as_sequence added --- include/JSObjectProxy.hh | 25 ++++++++++++--------- src/JSObjectProxy.cc | 28 ++++++++++++++++-------- src/modules/pythonmonkey/pythonmonkey.cc | 1 + 3 files changed, 35 insertions(+), 19 deletions(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index d66ac0d5..b65931c8 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -74,6 +74,15 @@ public: */ static PyObject *JSObjectProxy_get(JSObjectProxy *self, PyObject *key); + /** + * @brief Getter method (.sq_contains), returns whether a key exists, used by the in operator + * + * @param self - The JSObjectProxy + * @param key - The key for the value in the JSObjectProxy + * @return int 1 if `key` is in dict, 0 if not, and -1 on error + */ + static int JSObjectProxy_contains(JSObjectProxy *self, PyObject *key); + /** * @brief Assign method (.mp_ass_subscript), assigns a key-value pair if value is non-NULL, or deletes a key-value pair if value is NULL * @@ -84,15 +93,6 @@ public: */ static int JSObjectProxy_assign(JSObjectProxy *self, PyObject *key, PyObject *value); - /** - * @brief Helper function for various JSObjectProxy methods, sets a key-value pair on a JSObject given a python string key and a JS::Value value - * - * @param jsObject - The underlying backing store JSObject for the JSObjectProxy - * @param key - The key to be assigned or deleted - * @param value - The JS::Value to be assigned - */ - static void JSObjectProxy_set_helper(JS::HandleObject jsObject, PyObject *key, JS::HandleValue value); - /** * @brief Comparison method (.tp_richcompare), returns appropriate boolean given a comparison operator and other pyobject * @@ -111,6 +111,7 @@ public: * @param visited * @return bool - Whether the compared objects are equal or not */ + // private static bool JSObjectProxy_richcompare_helper(JSObjectProxy *self, PyObject *other, std::unordered_map &visited); /** @@ -141,7 +142,11 @@ static PyMappingMethods JSObjectProxy_mapping_methods = { .mp_ass_subscript = (objobjargproc)JSObjectProxyMethodDefinitions::JSObjectProxy_assign }; +static PySequenceMethods JSObjectProxy_sequence_methods = { + .sq_contains = (objobjproc)JSObjectProxyMethodDefinitions::JSObjectProxy_contains +}; + /** * @brief Struct for the JSObjectProxyType, used by all JSObjectProxy objects */ -extern PyTypeObject JSObjectProxyType; +extern PyTypeObject JSObjectProxyType; \ No newline at end of file diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 00392ba7..b2ac3f91 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -82,7 +82,23 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + PyType *pyType = pyTypeFactory(GLOBAL_CX, global, value); + delete value; + delete global; + return pyType->getPyObject(); +} + +int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, PyObject *key) +{ + JS::RootedId id(GLOBAL_CX); + if (!keyToId(key, &id)) { + // TODO (Caleb Aikens): raise exception here + return -1; // key is not a str or int + } + + JS::RootedValue value(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); + return value.isUndefined() ? 0 : 1; } int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, PyObject *key, PyObject *value) @@ -104,13 +120,6 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, Py return 0; } -void JSObjectProxyMethodDefinitions::JSObjectProxy_set_helper(JS::HandleObject jsObject, PyObject *key, JS::HandleValue value) -{ - JS::RootedId id(GLOBAL_CX); - keyToId(key, &id); - JS_SetPropertyById(GLOBAL_CX, jsObject, id, value); -} - PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare(JSObjectProxy *self, PyObject *other, int op) { if (op != Py_EQ && op != Py_NE) { @@ -163,7 +172,8 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr } // iterate recursively through members of self and check for equality - for (size_t i = 0; i < props.length(); i++) + size_t length = props.length(); + for (size_t i = 0; i < length; i++) { JS::HandleId id = props[i]; JS::RootedValue *key = new JS::RootedValue(GLOBAL_CX); diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index af98ec1d..56cf23e1 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -74,6 +74,7 @@ PyTypeObject JSObjectProxyType = { .tp_basicsize = sizeof(JSObjectProxy), .tp_dealloc = (destructor)JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc, .tp_repr = (reprfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_repr, + .tp_as_sequence = &JSObjectProxy_sequence_methods, .tp_as_mapping = &JSObjectProxy_mapping_methods, .tp_getattro = (getattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_get, .tp_setattro = (setattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_assign, From 6262788da0ad6a13e3e1550eed5a9502f818eb1d Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 23 Nov 2023 17:55:44 -0500 Subject: [PATCH 0068/1086] added "in" operation test --- tests/python/test_dicts_lists.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/python/test_dicts_lists.py b/tests/python/test_dicts_lists.py index 0f7e6618..d3f3a22e 100644 --- a/tests/python/test_dicts_lists.py +++ b/tests/python/test_dicts_lists.py @@ -126,3 +126,11 @@ def test_eval_objects_jsproxy_delete(): def test_eval_objects_jsproxy_compare(): proxy = pm.eval("({a: 1, b:2})") assert proxy == {'a': 1.0, 'b': 2.0} + +def test_eval_objects_jsproxy_contains(): + proxy = pm.eval('[1, 2, 3]') + assert 1 in proxy + +def test_eval_objects_jsproxy_does_not_contain(): + proxy = pm.eval('[1, 2, 3]') + assert not(4 in proxy) \ No newline at end of file From b9ff5f7202b7218d5dbe71ac17f9c7d7db5e3658 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 23 Nov 2023 18:01:00 -0500 Subject: [PATCH 0069/1086] improved comment --- include/JSObjectProxy.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index b65931c8..e22e146a 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -75,7 +75,7 @@ public: static PyObject *JSObjectProxy_get(JSObjectProxy *self, PyObject *key); /** - * @brief Getter method (.sq_contains), returns whether a key exists, used by the in operator + * @brief Test method (.sq_contains), returns whether a key exists, used by the in operator * * @param self - The JSObjectProxy * @param key - The key for the value in the JSObjectProxy From 4c5fcd74285e98ccab76804dde11b732a387ab36 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 23 Nov 2023 20:11:19 -0500 Subject: [PATCH 0070/1086] improved tests --- tests/python/test_dicts_lists.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/python/test_dicts_lists.py b/tests/python/test_dicts_lists.py index d3f3a22e..88f8dac1 100644 --- a/tests/python/test_dicts_lists.py +++ b/tests/python/test_dicts_lists.py @@ -128,9 +128,16 @@ def test_eval_objects_jsproxy_compare(): assert proxy == {'a': 1.0, 'b': 2.0} def test_eval_objects_jsproxy_contains(): - proxy = pm.eval('[1, 2, 3]') - assert 1 in proxy + pm.eval("let obj = {'c':5}") + a = pm.eval('obj') + assert 'c' in a def test_eval_objects_jsproxy_does_not_contain(): - proxy = pm.eval('[1, 2, 3]') - assert not(4 in proxy) \ No newline at end of file + pm.eval("let obj1 = {'c':5}") + a = pm.eval('obj1') + assert not(4 in a) + +def test_eval_objects_jsproxy_does_not_contain_value(): + pm.eval("let obj2 = {'c':5}") + a = pm.eval('obj2') + assert not(5 in a) \ No newline at end of file From 3297a2062456220c3e23cd0a837d594fe21f7a33 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 24 Nov 2023 10:26:32 -0500 Subject: [PATCH 0071/1086] Revert "Implement 'in' operation for Objects" This reverts commit cdfeb51fd052b1fd8a6467be6ce84eb45fe45b13. --- include/JSObjectProxy.hh | 23 ++++++++----------- src/JSObjectProxy.cc | 29 ++++++++---------------- src/modules/pythonmonkey/pythonmonkey.cc | 7 +++--- 3 files changed, 21 insertions(+), 38 deletions(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 763e9160..d66ac0d5 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -74,15 +74,6 @@ public: */ static PyObject *JSObjectProxy_get(JSObjectProxy *self, PyObject *key); - /** - * @brief Getter method (.sq_contains), returns whether a key exists, used by the in operator - * - * @param self - The JSObjectProxy - * @param key - The key for the value in the JSObjectProxy - * @return int 1 if `key` is in dict, 0 if not, and -1 on error - */ - static int JSObjectProxy_contains(JSObjectProxy *self, PyObject *key); - /** * @brief Assign method (.mp_ass_subscript), assigns a key-value pair if value is non-NULL, or deletes a key-value pair if value is NULL * @@ -93,6 +84,15 @@ public: */ static int JSObjectProxy_assign(JSObjectProxy *self, PyObject *key, PyObject *value); + /** + * @brief Helper function for various JSObjectProxy methods, sets a key-value pair on a JSObject given a python string key and a JS::Value value + * + * @param jsObject - The underlying backing store JSObject for the JSObjectProxy + * @param key - The key to be assigned or deleted + * @param value - The JS::Value to be assigned + */ + static void JSObjectProxy_set_helper(JS::HandleObject jsObject, PyObject *key, JS::HandleValue value); + /** * @brief Comparison method (.tp_richcompare), returns appropriate boolean given a comparison operator and other pyobject * @@ -111,7 +111,6 @@ public: * @param visited * @return bool - Whether the compared objects are equal or not */ - // private static bool JSObjectProxy_richcompare_helper(JSObjectProxy *self, PyObject *other, std::unordered_map &visited); /** @@ -142,10 +141,6 @@ static PyMappingMethods JSObjectProxy_mapping_methods = { .mp_ass_subscript = (objobjargproc)JSObjectProxyMethodDefinitions::JSObjectProxy_assign }; -static PySequenceMethods JSObjectProxy_sequence_methods = { - .sq_contains = (objobjproc)JSObjectProxyMethodDefinitions::JSObjectProxy_contains -}; - /** * @brief Struct for the JSObjectProxyType, used by all JSObjectProxy objects */ diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index f2bb30bf..00392ba7 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -82,23 +82,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - PyType *pyType = pyTypeFactory(GLOBAL_CX, global, value); - delete value; - delete global; - return pyType->getPyObject(); -} - -int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, PyObject *key) -{ - JS::RootedId id(GLOBAL_CX); - if (!keyToId(key, &id)) { - // TODO (Caleb Aikens): raise exception here - return -1; // key is not a str or int - } - - JS::RootedValue value(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); - return value.isUndefined() ? 0 : 1; + return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); } int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, PyObject *key, PyObject *value) @@ -120,9 +104,15 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, Py return 0; } -PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare(JSObjectProxy *self, PyObject *other, int op) +void JSObjectProxyMethodDefinitions::JSObjectProxy_set_helper(JS::HandleObject jsObject, PyObject *key, JS::HandleValue value) { + JS::RootedId id(GLOBAL_CX); + keyToId(key, &id); + JS_SetPropertyById(GLOBAL_CX, jsObject, id, value); +} +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare(JSObjectProxy *self, PyObject *other, int op) +{ if (op != Py_EQ && op != Py_NE) { Py_RETURN_NOTIMPLEMENTED; } @@ -173,8 +163,7 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr } // iterate recursively through members of self and check for equality - size_t length = props.length(); - for (size_t i = 0; i < length; i++) + for (size_t i = 0; i < props.length(); i++) { JS::HandleId id = props[i]; JS::RootedValue *key = new JS::RootedValue(GLOBAL_CX); diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 3b85ec2f..af98ec1d 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -74,7 +74,6 @@ PyTypeObject JSObjectProxyType = { .tp_basicsize = sizeof(JSObjectProxy), .tp_dealloc = (destructor)JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc, .tp_repr = (reprfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_repr, - .tp_as_sequence = &JSObjectProxy_sequence_methods, .tp_as_mapping = &JSObjectProxy_mapping_methods, .tp_getattro = (getattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_get, .tp_setattro = (setattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_assign, @@ -313,9 +312,9 @@ PyMethodDef PythonMonkeyMethods[] = { struct PyModuleDef pythonmonkey = { PyModuleDef_HEAD_INIT, - "pythonmonkey", /* name of module */ - "A module for Python to JavaScript interoperability", /* module documentation, may be NULL */ - -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ + "pythonmonkey", /* name of module */ + "A module for python to JS interoperability", /* module documentation, may be NULL */ + -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ PythonMonkeyMethods }; From 677f64381dc050ef5f1eaeaa1afdfda29367c5a5 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 24 Nov 2023 11:29:25 -0500 Subject: [PATCH 0072/1086] feat(JSFunctionProxy): implement JSFunctionProxy, JSMethodProxy, and fix usage. This commit introduces some GC segfault issues which must be addressed before merging --- include/FuncType.hh | 3 ++ include/JSFunctionProxy.hh | 59 +++++++++++++++++++++ include/JSMethodProxy.hh | 62 ++++++++++++++++++++++ include/pyTypeFactory.hh | 9 ---- src/FuncType.cc | 10 ++++ src/JSFunctionProxy.cc | 55 ++++++++++++++++++++ src/JSMethodProxy.cc | 66 ++++++++++++++++++++++++ src/jsTypeFactory.cc | 30 +++++++---- src/modules/pythonmonkey/pythonmonkey.cc | 53 ++++++++++++++++++- src/pyTypeFactory.cc | 35 ++----------- 10 files changed, 328 insertions(+), 54 deletions(-) create mode 100644 include/JSFunctionProxy.hh create mode 100644 include/JSMethodProxy.hh create mode 100644 src/JSFunctionProxy.cc create mode 100644 src/JSMethodProxy.cc diff --git a/include/FuncType.hh b/include/FuncType.hh index d8ce62f6..af2d2dfb 100644 --- a/include/FuncType.hh +++ b/include/FuncType.hh @@ -14,6 +14,8 @@ #include "PyType.hh" #include "TypeEnum.hh" +#include + #include /** @@ -22,6 +24,7 @@ struct FuncType : public PyType { public: FuncType(PyObject *object); + FuncType(JSContext *cx, JS::HandleValue fval); const TYPE returnType = TYPE::FUNC; const char *getValue() const; }; diff --git a/include/JSFunctionProxy.hh b/include/JSFunctionProxy.hh new file mode 100644 index 00000000..732ddad2 --- /dev/null +++ b/include/JSFunctionProxy.hh @@ -0,0 +1,59 @@ +/** + * @file JSFunctionProxy.hh + * @author Caleb Aikens (caleb@distributive.network) + * @brief JSFunctionProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a function would. + * @version 0.1 + * @date 2023-09-28 + * + * Copyright (c) 2023 Distributive Corp. + * + */ + +#ifndef PythonMonkey_JSFunctionProxy_ +#define PythonMonkey_JSFunctionProxy_ + +#include + +#include +/** + * @brief The typedef for the backing store that will be used by JSFunctionProxy objects. All it contains is a pointer to the JSFunction + * + */ +typedef struct { + PyObject_HEAD + JS::PersistentRootedObject *jsFunc; +} JSFunctionProxy; + +/** + * @brief This struct is a bundle of methods used by the JSFunctionProxy type + * + */ +struct JSFunctionProxyMethodDefinitions { +public: + /** + * @brief New method (.tp_new), creates a new instance of the JSFunctionProxy type, exposed as the __new()__ method in python + * + * @param type - The type of object to be created, will always be JSFunctionProxyType or a derived type + * @param args - arguments to the __new()__ method, not used + * @param kwds - keyword arguments to the __new()__ method, not used + * @return PyObject* - A new instance of JSFunctionProxy + */ + static PyObject *JSFunctionProxy_new(PyTypeObject *type, PyObject *args, PyObject *kwds); + + /** + * @brief Call method (.tp_call), called when the JSFunctionProxy is called + * + * @param self - this callable, might be a free function or a method + * @param args - args to the function + * @param kwargs - keyword args to the function + * @return PyObject* - Result of the function call + */ + static PyObject *JSFunctionProxy_call(PyObject *self, PyObject *args, PyObject *kwargs); +}; + +/** + * @brief Struct for the JSFunctionProxyType, used by all JSFunctionProxy objects + */ +extern PyTypeObject JSFunctionProxyType; + +#endif \ No newline at end of file diff --git a/include/JSMethodProxy.hh b/include/JSMethodProxy.hh new file mode 100644 index 00000000..a364027e --- /dev/null +++ b/include/JSMethodProxy.hh @@ -0,0 +1,62 @@ +/** + * @file JSMethodProxy.hh + * @author Caleb Aikens (caleb@distributive.network) + * @brief JSMethodProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a method would, treating `self` as `this`. + * @version 0.1 + * @date 2023-11-14 + * + * Copyright (c) 2023 Distributive Corp. + * + */ + +#ifndef PythonMonkey_JSMethodProxy_ +#define PythonMonkey_JSMethodProxy_ + +#include "include/JSFunctionProxy.hh" + +#include + +#include +/** + * @brief The typedef for the backing store that will be used by JSMethodProxy objects. All it contains is a pointer to the JSFunction and a pointer to self + * + */ +typedef struct { + PyObject_HEAD + PyObject *self; + JS::PersistentRootedObject *jsFunc; +} JSMethodProxy; + +/** + * @brief This struct is a bundle of methods used by the JSMethodProxy type + * + */ +struct JSMethodProxyMethodDefinitions { +public: + /** + * @brief New method (.tp_new), creates a new instance of the JSMethodProxy type, exposed as the __new()__ method in python + * + * @param type - The type of object to be created, will always be JSMethodProxyType or a derived type + * @param args - arguments to the __new()__ method, expected to be a JSFunctionProxy, and an object to bind self to + * @param kwds - keyword arguments to the __new()__ method, not used + * @return PyObject* - A new instance of JSMethodProxy + */ + static PyObject *JSMethodProxy_new(PyTypeObject *type, PyObject *args, PyObject *kwds); + + /** + * @brief Call method (.tp_call), called when the JSMethodProxy is called, properly handling `self` and `this` + * + * @param self - the JSMethodProxy being called + * @param args - args to the method + * @param kwargs - keyword args to the method + * @return PyObject* - Result of the method call + */ + static PyObject *JSMethodProxy_call(PyObject *self, PyObject *args, PyObject *kwargs); +}; + +/** + * @brief Struct for the JSMethodProxyType, used by all JSMethodProxy objects + */ +extern PyTypeObject JSMethodProxyType; + +#endif \ No newline at end of file diff --git a/include/pyTypeFactory.hh b/include/pyTypeFactory.hh index 68e87b74..3b79cbdd 100644 --- a/include/pyTypeFactory.hh +++ b/include/pyTypeFactory.hh @@ -42,13 +42,4 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted */ PyType *pyTypeFactorySafe(JSContext *cx, JS::Rooted *thisObj, JS::Rooted *rval); -/** - * @brief Helper function for pyTypeFactory to create FuncTypes through PyCFunction_New - * - * @param JSFuncAddress - Pointer to a PyLongObject containing the memory address of JS::Value containing the JSFunction* - * @param args - Pointer to a PyTupleObject containing the arguments to the python function - * @return PyObject* - The result of the JSFunction called with args coerced to JS types, coerced back to a PyObject type, or NULL if coercion wasn't possible - */ -PyObject *callJSFunc(PyObject *JSFuncAddress, PyObject *args); - #endif \ No newline at end of file diff --git a/src/FuncType.cc b/src/FuncType.cc index 553bf650..b2d76d6b 100644 --- a/src/FuncType.cc +++ b/src/FuncType.cc @@ -1,11 +1,21 @@ #include "include/FuncType.hh" +#include "include/modules/pythonmonkey/pythonmonkey.hh" +#include "include/JSFunctionProxy.hh" #include "include/PyType.hh" +#include + #include FuncType::FuncType(PyObject *object) : PyType(object) {} +FuncType::FuncType(JSContext *cx, JS::HandleValue fval) { + JSFunctionProxy *proxy = (JSFunctionProxy *)PyObject_CallObject((PyObject *)&JSFunctionProxyType, NULL); + proxy->jsFunc->set(&fval.toObject()); + this->pyObject = (PyObject *)proxy; +} + const char *FuncType::getValue() const { return PyUnicode_AsUTF8(PyObject_GetAttrString(pyObject, "__name__")); } \ No newline at end of file diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc new file mode 100644 index 00000000..7ed8c061 --- /dev/null +++ b/src/JSFunctionProxy.cc @@ -0,0 +1,55 @@ +/** + * @file JSFunctionProxy.cc + * @author Caleb Aikens (caleb@distributive.network) + * @brief JSFunctionProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a function would. + * @version 0.1 + * @date 2023-09-28 + * + * Copyright (c) 2023 Distributive Corp. + * + */ + +#include "include/JSFunctionProxy.hh" + +#include "include/modules/pythonmonkey/pythonmonkey.hh" +#include "include/jsTypeFactory.hh" +#include "include/pyTypeFactory.hh" +#include "include/setSpiderMonkeyException.hh" + +#include + +#include + +PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { + JSFunctionProxy *self = (JSFunctionProxy *)subtype->tp_alloc(subtype, 0); + if (self) { + self->jsFunc = new JS::PersistentRootedObject(GLOBAL_CX); + } + return (PyObject *)self; +} + +PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_call(PyObject *self, PyObject *args, PyObject *kwargs) { + JSContext *cx = GLOBAL_CX; + JS::RootedValue jsFunc(GLOBAL_CX, JS::ObjectValue(**((JSFunctionProxy *)self)->jsFunc)); + JSObject *o = jsFunc.toObjectOrNull(); + JS::RootedObject thisObj(GLOBAL_CX, JS::GetNonCCWObjectGlobal(o)); + + + JS::RootedVector jsArgsVector(cx); + for (size_t i = 0; i < PyTuple_Size(args); i++) { + JS::Value jsValue = jsTypeFactory(cx, PyTuple_GetItem(args, i)); + if (PyErr_Occurred()) { // Check if an exception has already been set in the flow of control + return NULL; // Fail-fast + } + jsArgsVector.append(jsValue); + } + + JS::HandleValueArray jsArgs(jsArgsVector); + JS::Rooted *jsReturnVal = new JS::Rooted(cx); + if (!JS_CallFunctionValue(cx, thisObj, jsFunc, jsArgs, jsReturnVal)) { + setSpiderMonkeyException(cx); + return NULL; + } + + return pyTypeFactory(cx, &thisObj, jsReturnVal)->getPyObject(); +} \ No newline at end of file diff --git a/src/JSMethodProxy.cc b/src/JSMethodProxy.cc new file mode 100644 index 00000000..939f0451 --- /dev/null +++ b/src/JSMethodProxy.cc @@ -0,0 +1,66 @@ +/** + * @file JSMethodProxy.cc + * @author Caleb Aikens (caleb@distributive.network) + * @brief JSMethodProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a method would, treating `self` as `this`. + * @version 0.1 + * @date 2023-11-14 + * + * Copyright (c) 2023 Distributive Corp. + * + */ + +#include "include/JSMethodProxy.hh" + +#include "include/modules/pythonmonkey/pythonmonkey.hh" +#include "include/jsTypeFactory.hh" +#include "include/pyTypeFactory.hh" +#include "include/setSpiderMonkeyException.hh" + +#include + +#include + +PyObject *JSMethodProxyMethodDefinitions::JSMethodProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { + JSFunctionProxy *jsFunctionProxy; + PyObject *im_self; + + if (!PyArg_ParseTuple(args, "O!O", &JSFunctionProxyType, &jsFunctionProxy, &im_self)) { + return NULL; + } + + JSMethodProxy *self = (JSMethodProxy *)subtype->tp_alloc(subtype, 0); + if (self) { + self->self = im_self; + self->jsFunc = new JS::PersistentRootedObject(GLOBAL_CX); + self->jsFunc->set(*(jsFunctionProxy->jsFunc)); + } + + return (PyObject *)self; +} + +PyObject *JSMethodProxyMethodDefinitions::JSMethodProxy_call(PyObject *self, PyObject *args, PyObject *kwargs) { + JSContext *cx = GLOBAL_CX; + JS::RootedValue jsFunc(GLOBAL_CX, JS::ObjectValue(**((JSMethodProxy *)self)->jsFunc)); + JS::RootedValue selfValue(cx, jsTypeFactory(cx, ((JSMethodProxy *)self)->self)); + JS::RootedObject selfObject(cx); + JS_ValueToObject(cx, selfValue, &selfObject); + + JS::RootedVector jsArgsVector(cx); + for (size_t i = 0; i < PyTuple_Size(args); i++) { + JS::Value jsValue = jsTypeFactory(cx, PyTuple_GetItem(args, i)); + if (PyErr_Occurred()) { // Check if an exception has already been set in the flow of control + return NULL; // Fail-fast + } + jsArgsVector.append(jsValue); + } + + JS::HandleValueArray jsArgs(jsArgsVector); + JS::Rooted *jsReturnVal = new JS::Rooted(cx); + if (!JS_CallFunctionValue(cx, selfObject, jsFunc, jsArgs, jsReturnVal)) { + setSpiderMonkeyException(cx); + return NULL; + } + + JS::RootedObject globalObj(cx, JS::CurrentGlobalOrNull(cx)); + return pyTypeFactory(cx, &globalObj, jsReturnVal)->getPyObject(); +} \ No newline at end of file diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 7885fd06..f5d50052 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -14,6 +14,8 @@ #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/PyType.hh" #include "include/FuncType.hh" +#include "include/JSFunctionProxy.hh" +#include "include/JSMethodProxy.hh" #include "include/JSObjectProxy.hh" #include "include/PyProxyHandler.hh" #include "include/pyTypeFactory.hh" @@ -122,13 +124,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { } memoizePyTypeAndGCThing(new StrType(object), returnType); } - else if (PyCFunction_Check(object) && PyCFunction_GetFunction(object) == callJSFunc) { - // If it's a wrapped JS function by us, return the underlying JS function rather than wrapping it again - PyObject *jsCxThisFuncTuple = PyCFunction_GetSelf(object); - JS::RootedValue *jsFunc = (JS::RootedValue *)PyLong_AsVoidPtr(PyTuple_GetItem(jsCxThisFuncTuple, 2)); - returnType.set(*jsFunc); - } - else if (PyFunction_Check(object) || PyCFunction_Check(object)) { + else if (PyMethod_Check(object) || PyFunction_Check(object) || PyCFunction_Check(object)) { // can't determine number of arguments for PyCFunctions, so just assume potentially unbounded uint16_t nargs = 0; if (PyFunction_Check(object)) { @@ -138,7 +134,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { } JSFunction *jsFunc = js::NewFunctionWithReserved(cx, callPyFunc, nargs, 0, NULL); - JSObject *jsFuncObject = JS_GetFunctionObject(jsFunc); + JS::RootedObject jsFuncObject(cx, JS_GetFunctionObject(jsFunc)); // We put the address of the PyObject in the JSFunction's 0th private slot so we can access it later js::SetFunctionNativeReserved(jsFuncObject, 0, JS::PrivateValue((void *)object)); @@ -163,6 +159,19 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { else if (PyObject_TypeCheck(object, &JSObjectProxyType)) { returnType.setObject(*((JSObjectProxy *)object)->jsObject); } + else if (PyObject_TypeCheck(object, &JSMethodProxyType)) { + JS::RootedObject func(cx, *((JSMethodProxy *)object)->jsFunc); + PyObject *self = ((JSMethodProxy *)object)->self; + + JS::Rooted> args(cx); + args[0].set(jsTypeFactory(cx, self)); + JS::Rooted boundFunction(cx); + JS_CallFunctionName(cx, func, "bind", args, &boundFunction); + returnType.set(boundFunction); + } + else if (PyObject_TypeCheck(object, &JSFunctionProxyType)) { + returnType.setObject(**((JSFunctionProxy *)object)->jsFunc); + } else if (PyDict_Check(object) || PyList_Check(object)) { JS::RootedValue v(cx); JSObject *proxy; @@ -234,8 +243,7 @@ bool callPyFunc(JSContext *cx, unsigned int argc, JS::Value *vp) { JS::Value pyFuncVal = js::GetFunctionNativeReserved(&(callargs.callee()), 0); PyObject *pyFunc = (PyObject *)(pyFuncVal.toPrivate()); - JS::RootedObject *thisv = new JS::RootedObject(cx); - JS_ValueToObject(cx, callargs.thisv(), thisv); + JS::RootedObject *globalObject = new JS::RootedObject(cx, JS::CurrentGlobalOrNull(cx)); if (!callargs.length()) { #if PY_VERSION_HEX >= 0x03090000 @@ -256,7 +264,7 @@ bool callPyFunc(JSContext *cx, unsigned int argc, JS::Value *vp) { PyObject *pyArgs = PyTuple_New(callargs.length()); for (size_t i = 0; i < callargs.length(); i++) { JS::RootedValue *jsArg = new JS::RootedValue(cx, callargs[i]); - PyType *pyArg = pyTypeFactory(cx, thisv, jsArg); + PyType *pyArg = pyTypeFactory(cx, globalObject, jsArg); if (!pyArg) return false; // error occurred PyObject *pyArgObj = pyArg->getPyObject(); if (!pyArgObj) return false; // error occurred diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 2e1decf3..5b03fc5f 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -11,12 +11,13 @@ #include "include/modules/pythonmonkey/pythonmonkey.hh" - #include "include/BoolType.hh" #include "include/setSpiderMonkeyException.hh" #include "include/DateType.hh" #include "include/FloatType.hh" #include "include/FuncType.hh" +#include "include/JSFunctionProxy.hh" +#include "include/JSMethodProxy.hh" #include "include/JSObjectProxy.hh" #include "include/PyType.hh" #include "include/pyTypeFactory.hh" @@ -89,6 +90,36 @@ PyTypeObject JSObjectProxyType = { .tp_new = JSObjectProxyMethodDefinitions::JSObjectProxy_new, }; +PyTypeObject JSFunctionProxyType = { + .ob_base = PyVarObject_HEAD_INIT(NULL, 0) + .tp_name = "pythonmonkey.JSFunctionProxy", + .tp_basicsize = sizeof(JSFunctionProxy), + // .tp_dealloc = (destructor)JSFunctionProxyMethodDefinitions::JSFunctionProxy_dealloc, + // .tp_repr = (reprfunc)JSFunctionProxyMethodDefinitions::JSFunctionProxy_repr, + .tp_call = JSFunctionProxyMethodDefinitions::JSFunctionProxy_call, + // .tp_getattro = (getattrofunc)JSFunctionProxyMethodDefinitions::JSFunctionProxy_get, + // .tp_setattro = (setattrofunc)JSFunctionProxyMethodDefinitions::JSFunctionProxy_assign, + .tp_flags = Py_TPFLAGS_DEFAULT, + .tp_doc = PyDoc_STR("Javascript Function proxy object"), + // .tp_iter = (getiterfunc)JSFunctionProxyMethodDefinitions::JSFunctionProxy_iter, + .tp_new = JSFunctionProxyMethodDefinitions::JSFunctionProxy_new, +}; + +PyTypeObject JSMethodProxyType = { + .ob_base = PyVarObject_HEAD_INIT(NULL, 0) + .tp_name = "pythonmonkey.JSMethodProxy", + .tp_basicsize = sizeof(JSMethodProxy), + // .tp_dealloc = (destructor)JSMethodProxyMethodDefinitions::JSMethodProxy_dealloc, + // .tp_repr = (reprfunc)JSMethodProxyMethodDefinitions::JSMethodProxy_repr, + .tp_call = JSMethodProxyMethodDefinitions::JSMethodProxy_call, + // .tp_getattro = (getattrofunc)JSMethodProxyMethodDefinitions::JSMethodProxy_get, + // .tp_setattro = (setattrofunc)JSMethodProxyMethodDefinitions::JSMethodProxy_assign, + .tp_flags = Py_TPFLAGS_DEFAULT, + .tp_doc = PyDoc_STR("Javascript Method proxy object"), + // .tp_iter = (getiterfunc)JSMethodProxyMethodDefinitions::JSMethodProxy_iter, + .tp_new = JSMethodProxyMethodDefinitions::JSMethodProxy_new, +}; + static void cleanup() { delete autoRealm; delete global; @@ -391,6 +422,10 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; if (PyType_Ready(&JSObjectProxyType) < 0) return NULL; + if (PyType_Ready(&JSFunctionProxyType) < 0) + return NULL; + if (PyType_Ready(&JSMethodProxyType) < 0) + return NULL; pyModule = PyModule_Create(&pythonmonkey); if (pyModule == NULL) @@ -416,7 +451,21 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; } - if (PyModule_AddObject(pyModule, "SpiderMonkeyError", SpiderMonkeyError)) { + Py_INCREF(&JSFunctionProxyType); + if (PyModule_AddObject(pyModule, "JSFunctionProxy", (PyObject *)&JSFunctionProxyType) < 0) { + Py_DECREF(&JSFunctionProxyType); + Py_DECREF(pyModule); + return NULL; + } + + Py_INCREF(&JSMethodProxyType); + if (PyModule_AddObject(pyModule, "JSMethodProxy", (PyObject *)&JSMethodProxyType) < 0) { + Py_DECREF(&JSMethodProxyType); + Py_DECREF(pyModule); + return NULL; + } + + if (PyModule_AddObject(pyModule, "SpiderMonkeyError", SpiderMonkeyError) < 0) { Py_DECREF(pyModule); return NULL; } diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index c8c810a3..fd07793c 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -38,9 +38,6 @@ #include -// TODO (Caleb Aikens) get below properties -static PyMethodDef callJSFuncDef = {"JSFunctionCallable", callJSFunc, METH_VARARGS, NULL}; - PyType *pyTypeFactory(PyObject *object) { PyType *pyType; @@ -132,16 +129,15 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted } case js::ESClass::Function: { PyObject *pyFunc; + FuncType *f; if (JS_IsNativeFunction(obj, callPyFunc)) { // It's a wrapped python function by us // Get the underlying python function from the 0th reserved slot JS::Value pyFuncVal = js::GetFunctionNativeReserved(obj, 0); pyFunc = (PyObject *)(pyFuncVal.toPrivate()); + f = new FuncType(pyFunc); } else { - // FIXME (Tom Tang): `jsCxThisFuncTuple` and the tuple items are not going to be GCed - PyObject *jsCxThisFuncTuple = PyTuple_Pack(3, PyLong_FromVoidPtr(cx), PyLong_FromVoidPtr(thisObj), PyLong_FromVoidPtr(rval)); - pyFunc = PyCFunction_New(&callJSFuncDef, jsCxThisFuncTuple); + f = new FuncType(cx, *rval); } - FuncType *f = new FuncType(pyFunc); memoizePyTypeAndGCThing(f, *rval); // TODO (Caleb Aikens) consider putting this in the FuncType constructor return f; } @@ -191,29 +187,4 @@ PyType *pyTypeFactorySafe(JSContext *cx, JS::Rooted *thisObj, JS::Ro return new NullType(); } return v; -} - -PyObject *callJSFunc(PyObject *jsCxThisFuncTuple, PyObject *args) { - // TODO (Caleb Aikens) convert PyObject *args to JS::Rooted JSargs - JSContext *cx = (JSContext *)PyLong_AsVoidPtr(PyTuple_GetItem(jsCxThisFuncTuple, 0)); - JS::RootedObject *thisObj = (JS::RootedObject *)PyLong_AsVoidPtr(PyTuple_GetItem(jsCxThisFuncTuple, 1)); - JS::RootedValue *jsFunc = (JS::RootedValue *)PyLong_AsVoidPtr(PyTuple_GetItem(jsCxThisFuncTuple, 2)); - - JS::RootedVector jsArgsVector(cx); - for (size_t i = 0; i < PyTuple_Size(args); i++) { - JS::Value jsValue = jsTypeFactory(cx, PyTuple_GetItem(args, i)); - if (PyErr_Occurred()) { // Check if an exception has already been set in the flow of control - return NULL; // Fail-fast - } - jsArgsVector.append(jsValue); - } - - JS::HandleValueArray jsArgs(jsArgsVector); - JS::Rooted *jsReturnVal = new JS::Rooted(cx); - if (!JS_CallFunctionValue(cx, *thisObj, *jsFunc, jsArgs, jsReturnVal)) { - setSpiderMonkeyException(cx); - return NULL; - } - - return pyTypeFactory(cx, thisObj, jsReturnVal)->getPyObject(); } \ No newline at end of file From 0d359a9bf03bf20aae5b28f13d2a618704b089dc Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 24 Nov 2023 14:14:29 -0500 Subject: [PATCH 0073/1086] Don't deleted value and global like it seems we should be able to do --- src/JSObjectProxy.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index b2ac3f91..06965285 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -82,10 +82,8 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - PyType *pyType = pyTypeFactory(GLOBAL_CX, global, value); - delete value; - delete global; - return pyType->getPyObject(); + return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + // TODO value and global appear to be leaking, but deleting them causes crashes } int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, PyObject *key) @@ -96,9 +94,9 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, return -1; // key is not a str or int } - JS::RootedValue value(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); - return value.isUndefined() ? 0 : 1; + JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); + return value->isUndefined() ? 0 : 1; } int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, PyObject *key, PyObject *value) From c1fa4c82fa070c07d6fe475322aff445ffdce77f Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 24 Nov 2023 15:04:43 -0500 Subject: [PATCH 0074/1086] tests don't pollute the scope --- tests/python/test_dicts_lists.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/python/test_dicts_lists.py b/tests/python/test_dicts_lists.py index 88f8dac1..79c620c5 100644 --- a/tests/python/test_dicts_lists.py +++ b/tests/python/test_dicts_lists.py @@ -128,16 +128,13 @@ def test_eval_objects_jsproxy_compare(): assert proxy == {'a': 1.0, 'b': 2.0} def test_eval_objects_jsproxy_contains(): - pm.eval("let obj = {'c':5}") - a = pm.eval('obj') + a = pm.eval("({'c':5})") assert 'c' in a def test_eval_objects_jsproxy_does_not_contain(): - pm.eval("let obj1 = {'c':5}") - a = pm.eval('obj1') + a = pm.eval("({'c':5})") assert not(4 in a) def test_eval_objects_jsproxy_does_not_contain_value(): - pm.eval("let obj2 = {'c':5}") - a = pm.eval('obj2') + a = pm.eval("({'c':5})") assert not(5 in a) \ No newline at end of file From 3c477b9b80d331375dba55d3ddc0af4a3010c17c Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Mon, 27 Nov 2023 18:04:18 -0500 Subject: [PATCH 0075/1086] JSObjectProxy now implements the dict "or" operation Both in place and new object "|" op implemented --- include/JSObjectProxy.hh | 21 ++++++++++++ src/JSObjectProxy.cc | 41 ++++++++++++++++++++++++ src/modules/pythonmonkey/pythonmonkey.cc | 1 + tests/python/test_dicts_lists.py | 17 +++++++++- 4 files changed, 79 insertions(+), 1 deletion(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index e22e146a..50b0fa0e 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -129,6 +129,22 @@ public: * @return the string representation (a PyUnicodeObject) on success, NULL on failure */ static PyObject *JSObjectProxy_repr(JSObjectProxy *self); + + /** + * @brief Set union method + * + * @param self - The JSObjectProxy + * @return PyObject* self + */ + static PyObject *JSObjectProxy_or(JSObjectProxy *self, PyObject *other); + + /** + * @brief Set union method, in place + * + * @param self - The JSObjectProxy + * @return PyObject* The resulting new dict + */ + static PyObject *JSObjectProxy_ior(JSObjectProxy *self, PyObject *other); }; @@ -146,6 +162,11 @@ static PySequenceMethods JSObjectProxy_sequence_methods = { .sq_contains = (objobjproc)JSObjectProxyMethodDefinitions::JSObjectProxy_contains }; +static PyNumberMethods JSObjectProxy_number_methods = { + .nb_or = (binaryfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_or, + .nb_inplace_or = (binaryfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_ior +}; + /** * @brief Struct for the JSObjectProxyType, used by all JSObjectProxy objects */ diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 06965285..51f504c7 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -258,3 +258,44 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self PyDict_DelItem(tsDict, cyclicKey); return str; } + +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, PyObject *other) { + if (!PyDict_Check(self) || !PyDict_Check(other)) { + Py_RETURN_NOTIMPLEMENTED; + } + + JS::Rooted> args(GLOBAL_CX); + args[0].setObjectOrNull(JS_NewPlainObject(GLOBAL_CX)); + args[1].setObjectOrNull(self->jsObject); + JS::RootedValue jValueOther(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, other)); + args[2].setObject(jValueOther.toObject()); + + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + + // call Object.assign + JS::RootedValue Object(GLOBAL_CX); + JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); + + JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); + JS::RootedValue ret(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; + return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); +} + +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_ior(JSObjectProxy *self, PyObject *other) { + JS::Rooted> args(GLOBAL_CX); + args[0].setObjectOrNull(self->jsObject); + JS::RootedValue jValueOther(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, other)); + args[1].setObject(jValueOther.toObject()); + + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + + // call Object.assign + JS::RootedValue Object(GLOBAL_CX); + JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); + + JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); + JS::RootedValue ret(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; + return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); +} diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 56cf23e1..c673ef73 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -74,6 +74,7 @@ PyTypeObject JSObjectProxyType = { .tp_basicsize = sizeof(JSObjectProxy), .tp_dealloc = (destructor)JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc, .tp_repr = (reprfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_repr, + .tp_as_number = &JSObjectProxy_number_methods, .tp_as_sequence = &JSObjectProxy_sequence_methods, .tp_as_mapping = &JSObjectProxy_mapping_methods, .tp_getattro = (getattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_get, diff --git a/tests/python/test_dicts_lists.py b/tests/python/test_dicts_lists.py index 79c620c5..f73cab4a 100644 --- a/tests/python/test_dicts_lists.py +++ b/tests/python/test_dicts_lists.py @@ -137,4 +137,19 @@ def test_eval_objects_jsproxy_does_not_contain(): def test_eval_objects_jsproxy_does_not_contain_value(): a = pm.eval("({'c':5})") - assert not(5 in a) \ No newline at end of file + assert not(5 in a) + +def test_eval_objects_jsproxy_or(): + a = pm.eval("({'c':5})") + b = pm.eval("({'d':6})") + c = a | b + assert a == {'c': 5.0} + assert c == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} + +def test_eval_objects_jsproxy_inplace_or(): + a = pm.eval("({'c':5})") + b = pm.eval("({'d':6})") + a |= b + assert a == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} \ No newline at end of file From 7abbcd28563f0ebf8edff098459e29ee2cbf3dc0 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 28 Nov 2023 12:49:37 -0500 Subject: [PATCH 0076/1086] A few improvements in init method, and get method implementation start of methods, have now get --- include/JSObjectProxy.hh | 38 ++++++++++++++++++++++++ src/JSObjectProxy.cc | 29 +++++++++++++++++- src/modules/pythonmonkey/pythonmonkey.cc | 1 + 3 files changed, 67 insertions(+), 1 deletion(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index e22e146a..671bd1fc 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -129,6 +129,16 @@ public: * @return the string representation (a PyUnicodeObject) on success, NULL on failure */ static PyObject *JSObjectProxy_repr(JSObjectProxy *self); + + /** + * @brief Get method, returns a value from the JSObjectProxy given a key, used by several built-in python methods as well as the [] operator + * + * @param self - The JSObjectProxy + * @return PyObject* NULL on exception, the corresponding value otherwise + */ + static PyObject *JSObjectProxy_get_2(JSObjectProxy *self, PyObject *const *args, Py_ssize_t nargs); + + }; @@ -146,6 +156,34 @@ static PySequenceMethods JSObjectProxy_sequence_methods = { .sq_contains = (objobjproc)JSObjectProxyMethodDefinitions::JSObjectProxy_contains }; +static PyMethodDef JSObjectProxy_methods[] = { + // {"__contains__", (PyCFunction)dict___contains__, METH_O|METH_COEXIST, dict___contains____doc__}, TODO + // {"__getitem__", _PyCFunction_CAST(dict_subscript), METH_O | METH_COEXIST, + // getitem__doc__}, + // {"__sizeof__", _PyCFunction_CAST(dict_sizeof), METH_NOARGS, + // sizeof__doc__}, + {"get", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_get_2), METH_FASTCALL, ""}, + /* DICT_SETDEFAULT_METHODDEF + DICT_POP_METHODDEF + DICT_POPITEM_METHODDEF + {"keys", dictkeys_new, METH_NOARGS, + keys__doc__}, + {"items", dictitems_new, METH_NOARGS, + items__doc__}, + {"values", dictvalues_new, METH_NOARGS, + values__doc__}, + {"update", _PyCFunction_CAST(dict_update), METH_VARARGS | METH_KEYWORDS, + update__doc__}, + DICT_FROMKEYS_METHODDEF + {"clear", (PyCFunction)dict_clear, METH_NOARGS, + clear__doc__}, + {"copy", (PyCFunction)dict_copy, METH_NOARGS, + copy__doc__}, + DICT___REVERSED___METHODDEF*/ + // {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},*/ + {NULL, NULL} /* sentinel */ +}; + /** * @brief Struct for the JSObjectProxyType, used by all JSObjectProxy objects */ diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 06965285..ac89bbc4 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -42,18 +42,23 @@ void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) { // TODO (Caleb Aikens): intentional override of PyDict_Type's tp_dealloc. Probably results in leaking dict memory self->jsObject.set(nullptr); + PyObject_GC_UnTrack(self); + Py_TYPE(self)->tp_free((PyObject *)self); return; } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { - PyObject *self = PyDict_Type.tp_new(subtype, args, kwds); + PyObject *self = PyDict_Type.tp_new(subtype, args, kwds); // SUPER CALL ((JSObjectProxy *)self)->jsObject = JS::RootedObject(GLOBAL_CX, nullptr); return self; } int JSObjectProxyMethodDefinitions::JSObjectProxy_init(JSObjectProxy *self, PyObject *args, PyObject *kwds) { + if (PyDict_Type.tp_init((PyObject *)self, args, kwds) < 0) { + return -1; + } // make fresh JSObject for proxy self->jsObject.set(JS_NewPlainObject(GLOBAL_CX)); return 0; @@ -258,3 +263,25 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self PyDict_DelItem(tsDict, cyclicKey); return str; } + +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get_2(JSObjectProxy *self, PyObject *const *args, Py_ssize_t nargs) { + printf("JSObjectProxy_get_2\n"); + + PyObject *key; + PyObject *default_value = Py_None; + + if (!_PyArg_CheckPositional("get", nargs, 1, 2)) { + return NULL; + } + key = args[0]; + if (nargs < 2) { + goto skip_optional; + } + default_value = args[1]; +skip_optional: + PyObject *value = JSObjectProxy_get(self, key); + if (value == NULL) { + value = default_value; + } + return value; +} diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 56cf23e1..73a48e5f 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -83,6 +83,7 @@ PyTypeObject JSObjectProxyType = { .tp_doc = PyDoc_STR("Javascript Object proxy dict"), .tp_richcompare = (richcmpfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare, .tp_iter = (getiterfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_iter, + .tp_methods = JSObjectProxy_methods, .tp_base = &PyDict_Type, .tp_init = (initproc)JSObjectProxyMethodDefinitions::JSObjectProxy_init, .tp_new = JSObjectProxyMethodDefinitions::JSObjectProxy_new, From 7a5b915512abedf364423299c38b02b7723ec97f Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:48:40 -0500 Subject: [PATCH 0077/1086] Update include/JSObjectProxy.hh Co-authored-by: Caleb Aikens --- include/JSObjectProxy.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 50b0fa0e..7dfafde3 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -142,7 +142,8 @@ public: * @brief Set union method, in place * * @param self - The JSObjectProxy - * @return PyObject* The resulting new dict + * @param other - The other PyObject to be or'd, expected to be dict or JSObjectProxy + * @return PyObject* The resulting new dict, must be same object as self */ static PyObject *JSObjectProxy_ior(JSObjectProxy *self, PyObject *other); }; From a11bde24fe47b626b1be580404dbd01cdd0b847c Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:50:08 -0500 Subject: [PATCH 0078/1086] Update include/JSObjectProxy.hh Co-authored-by: Caleb Aikens --- include/JSObjectProxy.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 7dfafde3..f65a4ee6 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -134,7 +134,8 @@ public: * @brief Set union method * * @param self - The JSObjectProxy - * @return PyObject* self + * @param other - The other PyObject to be or'd, expected to be dict or JSObjectProxy + * @return PyObject* The resulting new dict */ static PyObject *JSObjectProxy_or(JSObjectProxy *self, PyObject *other); From e03cbb636715fabdc95d65b7db8ad2a0d2d4a666 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 28 Nov 2023 17:57:37 -0500 Subject: [PATCH 0079/1086] fully indempotent "|" op and leaner self assignment left or right operand can now be true dict related tests --- src/JSObjectProxy.cc | 37 ++++++++++++++++++++------------ tests/python/test_dicts_lists.py | 30 ++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 14 deletions(-) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 51f504c7..338cfc12 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -264,25 +264,34 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, Py_RETURN_NOTIMPLEMENTED; } - JS::Rooted> args(GLOBAL_CX); - args[0].setObjectOrNull(JS_NewPlainObject(GLOBAL_CX)); - args[1].setObjectOrNull(self->jsObject); - JS::RootedValue jValueOther(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, other)); - args[2].setObject(jValueOther.toObject()); + if (!PyObject_TypeCheck(self, &JSObjectProxyType) && PyObject_TypeCheck(other, &JSObjectProxyType)) { + return PyDict_Type.tp_as_number->nb_or((PyObject *)&(self->dict), other); + } else { + JS::Rooted> args(GLOBAL_CX); + args[0].setObjectOrNull(JS_NewPlainObject(GLOBAL_CX)); + args[1].setObjectOrNull(self->jsObject); // this is null is left operand is real dict + JS::RootedValue jValueOther(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, other)); + args[2].setObject(jValueOther.toObject()); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - // call Object.assign - JS::RootedValue Object(GLOBAL_CX); - JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); + // call Object.assign + JS::RootedValue Object(GLOBAL_CX); + JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); - JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); - JS::RootedValue ret(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; - return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); + JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); + JS::RootedValue ret(GLOBAL_CX); + + if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; + return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); + } } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_ior(JSObjectProxy *self, PyObject *other) { + if (!PyDict_Check(self) || !PyDict_Check(other)) { + Py_RETURN_NOTIMPLEMENTED; + } + JS::Rooted> args(GLOBAL_CX); args[0].setObjectOrNull(self->jsObject); JS::RootedValue jValueOther(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, other)); @@ -297,5 +306,5 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_ior(JSObjectProxy *self, JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); JS::RootedValue ret(GLOBAL_CX); if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; - return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); + return Py_NewRef((PyObject *)self); } diff --git a/tests/python/test_dicts_lists.py b/tests/python/test_dicts_lists.py index f73cab4a..f009b068 100644 --- a/tests/python/test_dicts_lists.py +++ b/tests/python/test_dicts_lists.py @@ -147,9 +147,39 @@ def test_eval_objects_jsproxy_or(): assert c == {'c': 5.0, 'd': 6.0} assert b == {'d': 6.0} +def test_eval_objects_jsproxy_or_true_dict_right(): + a = pm.eval("({'c':5})") + b = {'d': 6.0} + c = a | b + assert a == {'c': 5.0} + assert c == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} + +def test_eval_objects_jsproxy_or_true_dict_left(): + a = {'c':5} + b = pm.eval("({'d':6})") + c = a | b + assert a == {'c': 5.0} + assert c == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} + def test_eval_objects_jsproxy_inplace_or(): a = pm.eval("({'c':5})") b = pm.eval("({'d':6})") a |= b assert a == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} + +def test_eval_objects_jsproxy_inplace_or_true_dict_right(): + a = pm.eval("({'c':5})") + b = {'d':6.0} + a |= b + assert a == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} + +def test_eval_objects_jsproxy_inplace_or_true_dict_left(): + a = {'c':5.0} + b = pm.eval("({'d':6})") + a |= b + assert a == {'c': 5.0, 'd': 6.0} assert b == {'d': 6.0} \ No newline at end of file From fc5dc6a83a742d054dd047f129ad68ef0945ab4e Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 28 Nov 2023 18:11:25 -0500 Subject: [PATCH 0080/1086] missing include --- src/JSObjectProxy.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 338cfc12..982b5b05 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -21,6 +21,8 @@ #include +#include + JSContext *GLOBAL_CX; /**< pointer to PythonMonkey's JSContext */ bool keyToId(PyObject *key, JS::MutableHandleId idp) { From e3b5632a2df6648b6a851d507a0db31ff99c95e7 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Wed, 29 Nov 2023 09:46:53 -0500 Subject: [PATCH 0081/1086] Py_NewRef not available in earlier python versions --- src/JSObjectProxy.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 982b5b05..3fe56d4a 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -308,5 +308,6 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_ior(JSObjectProxy *self, JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); JS::RootedValue ret(GLOBAL_CX); if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; - return Py_NewRef((PyObject *)self); + Py_INCREF(self); + return (PyObject *)self; } From d6f315a2cd52b9e968c1f0e84054d0f6a3583397 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Wed, 29 Nov 2023 10:17:46 -0500 Subject: [PATCH 0082/1086] Revert "JSObjectProxy now implements the dict "or" operation" --- include/JSObjectProxy.hh | 23 ---------- src/JSObjectProxy.cc | 53 ------------------------ src/modules/pythonmonkey/pythonmonkey.cc | 1 - tests/python/test_dicts_lists.py | 47 +-------------------- 4 files changed, 1 insertion(+), 123 deletions(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index f65a4ee6..e22e146a 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -129,24 +129,6 @@ public: * @return the string representation (a PyUnicodeObject) on success, NULL on failure */ static PyObject *JSObjectProxy_repr(JSObjectProxy *self); - - /** - * @brief Set union method - * - * @param self - The JSObjectProxy - * @param other - The other PyObject to be or'd, expected to be dict or JSObjectProxy - * @return PyObject* The resulting new dict - */ - static PyObject *JSObjectProxy_or(JSObjectProxy *self, PyObject *other); - - /** - * @brief Set union method, in place - * - * @param self - The JSObjectProxy - * @param other - The other PyObject to be or'd, expected to be dict or JSObjectProxy - * @return PyObject* The resulting new dict, must be same object as self - */ - static PyObject *JSObjectProxy_ior(JSObjectProxy *self, PyObject *other); }; @@ -164,11 +146,6 @@ static PySequenceMethods JSObjectProxy_sequence_methods = { .sq_contains = (objobjproc)JSObjectProxyMethodDefinitions::JSObjectProxy_contains }; -static PyNumberMethods JSObjectProxy_number_methods = { - .nb_or = (binaryfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_or, - .nb_inplace_or = (binaryfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_ior -}; - /** * @brief Struct for the JSObjectProxyType, used by all JSObjectProxy objects */ diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 3fe56d4a..06965285 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -21,8 +21,6 @@ #include -#include - JSContext *GLOBAL_CX; /**< pointer to PythonMonkey's JSContext */ bool keyToId(PyObject *key, JS::MutableHandleId idp) { @@ -260,54 +258,3 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self PyDict_DelItem(tsDict, cyclicKey); return str; } - -PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, PyObject *other) { - if (!PyDict_Check(self) || !PyDict_Check(other)) { - Py_RETURN_NOTIMPLEMENTED; - } - - if (!PyObject_TypeCheck(self, &JSObjectProxyType) && PyObject_TypeCheck(other, &JSObjectProxyType)) { - return PyDict_Type.tp_as_number->nb_or((PyObject *)&(self->dict), other); - } else { - JS::Rooted> args(GLOBAL_CX); - args[0].setObjectOrNull(JS_NewPlainObject(GLOBAL_CX)); - args[1].setObjectOrNull(self->jsObject); // this is null is left operand is real dict - JS::RootedValue jValueOther(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, other)); - args[2].setObject(jValueOther.toObject()); - - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - - // call Object.assign - JS::RootedValue Object(GLOBAL_CX); - JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); - - JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); - JS::RootedValue ret(GLOBAL_CX); - - if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; - return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); - } -} - -PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_ior(JSObjectProxy *self, PyObject *other) { - if (!PyDict_Check(self) || !PyDict_Check(other)) { - Py_RETURN_NOTIMPLEMENTED; - } - - JS::Rooted> args(GLOBAL_CX); - args[0].setObjectOrNull(self->jsObject); - JS::RootedValue jValueOther(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, other)); - args[1].setObject(jValueOther.toObject()); - - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - - // call Object.assign - JS::RootedValue Object(GLOBAL_CX); - JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); - - JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); - JS::RootedValue ret(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; - Py_INCREF(self); - return (PyObject *)self; -} diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index c673ef73..56cf23e1 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -74,7 +74,6 @@ PyTypeObject JSObjectProxyType = { .tp_basicsize = sizeof(JSObjectProxy), .tp_dealloc = (destructor)JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc, .tp_repr = (reprfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_repr, - .tp_as_number = &JSObjectProxy_number_methods, .tp_as_sequence = &JSObjectProxy_sequence_methods, .tp_as_mapping = &JSObjectProxy_mapping_methods, .tp_getattro = (getattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_get, diff --git a/tests/python/test_dicts_lists.py b/tests/python/test_dicts_lists.py index f009b068..79c620c5 100644 --- a/tests/python/test_dicts_lists.py +++ b/tests/python/test_dicts_lists.py @@ -137,49 +137,4 @@ def test_eval_objects_jsproxy_does_not_contain(): def test_eval_objects_jsproxy_does_not_contain_value(): a = pm.eval("({'c':5})") - assert not(5 in a) - -def test_eval_objects_jsproxy_or(): - a = pm.eval("({'c':5})") - b = pm.eval("({'d':6})") - c = a | b - assert a == {'c': 5.0} - assert c == {'c': 5.0, 'd': 6.0} - assert b == {'d': 6.0} - -def test_eval_objects_jsproxy_or_true_dict_right(): - a = pm.eval("({'c':5})") - b = {'d': 6.0} - c = a | b - assert a == {'c': 5.0} - assert c == {'c': 5.0, 'd': 6.0} - assert b == {'d': 6.0} - -def test_eval_objects_jsproxy_or_true_dict_left(): - a = {'c':5} - b = pm.eval("({'d':6})") - c = a | b - assert a == {'c': 5.0} - assert c == {'c': 5.0, 'd': 6.0} - assert b == {'d': 6.0} - -def test_eval_objects_jsproxy_inplace_or(): - a = pm.eval("({'c':5})") - b = pm.eval("({'d':6})") - a |= b - assert a == {'c': 5.0, 'd': 6.0} - assert b == {'d': 6.0} - -def test_eval_objects_jsproxy_inplace_or_true_dict_right(): - a = pm.eval("({'c':5})") - b = {'d':6.0} - a |= b - assert a == {'c': 5.0, 'd': 6.0} - assert b == {'d': 6.0} - -def test_eval_objects_jsproxy_inplace_or_true_dict_left(): - a = {'c':5.0} - b = pm.eval("({'d':6})") - a |= b - assert a == {'c': 5.0, 'd': 6.0} - assert b == {'d': 6.0} \ No newline at end of file + assert not(5 in a) \ No newline at end of file From f2ef34f4706c94c23ae8054fa75cf38e1402045c Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Thu, 30 Nov 2023 15:18:27 -0500 Subject: [PATCH 0083/1086] Missing dict methods method dispatch mechanism in skipped iteration-related methods for now --- include/JSObjectProxy.hh | 70 +++++++---- src/JSObjectProxy.cc | 150 ++++++++++++++++++++--- src/modules/pythonmonkey/pythonmonkey.cc | 1 + tests/python/test_dict_methods.py | 119 ++++++++++++++++++ 4 files changed, 303 insertions(+), 37 deletions(-) create mode 100644 tests/python/test_dict_methods.py diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 671bd1fc..a18add84 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -131,14 +131,50 @@ public: static PyObject *JSObjectProxy_repr(JSObjectProxy *self); /** - * @brief Get method, returns a value from the JSObjectProxy given a key, used by several built-in python methods as well as the [] operator + * @brief get method * * @param self - The JSObjectProxy - * @return PyObject* NULL on exception, the corresponding value otherwise + * @param args - arguments to the method + * @param nargs - number of args to the method + * @return PyObject* the value for key if first arg key is in the dictionary, else second arg default + */ + static PyObject *JSObjectProxy_get_method(JSObjectProxy *self, PyObject *const *args, Py_ssize_t nargs); + + /** + * @brief setdefault method + * + * @param self - The JSObjectProxy + * @param args - arguments to the method + * @param nargs - number of args to the method + * @return PyObject* the value for key if first arg key is in the dictionary, else second default */ - static PyObject *JSObjectProxy_get_2(JSObjectProxy *self, PyObject *const *args, Py_ssize_t nargs); + static PyObject *JSObjectProxy_setdefault_method(JSObjectProxy *self, PyObject *const *args, Py_ssize_t nargs); + /** + * @brief pop method + * + * @param self - The JSObjectProxy + * @param args - arguments to the method + * @param nargs - number of args to the method + * @return PyObject* If the first arg key is not found, return the second arg default if given; otherwise raise a KeyError + */ + static PyObject *JSObjectProxy_pop_method(JSObjectProxy *self, PyObject *const *args, Py_ssize_t nargs); + /** + * @brief clear method + * + * @param self - The JSObjectProxy + * @return None + */ + static PyObject *JSObjectProxy_clear_method(JSObjectProxy *self); + + /** + * @brief copy method + * + * @param self - The JSObjectProxy + * @return PyObject* copy of the dict + */ + static PyObject *JSObjectProxy_copy_method(JSObjectProxy *self); }; @@ -157,30 +193,20 @@ static PySequenceMethods JSObjectProxy_sequence_methods = { }; static PyMethodDef JSObjectProxy_methods[] = { - // {"__contains__", (PyCFunction)dict___contains__, METH_O|METH_COEXIST, dict___contains____doc__}, TODO - // {"__getitem__", _PyCFunction_CAST(dict_subscript), METH_O | METH_COEXIST, - // getitem__doc__}, - // {"__sizeof__", _PyCFunction_CAST(dict_sizeof), METH_NOARGS, - // sizeof__doc__}, - {"get", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_get_2), METH_FASTCALL, ""}, - /* DICT_SETDEFAULT_METHODDEF - DICT_POP_METHODDEF - DICT_POPITEM_METHODDEF - {"keys", dictkeys_new, METH_NOARGS, - keys__doc__}, - {"items", dictitems_new, METH_NOARGS, + {"get", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_get_method), METH_FASTCALL, ""}, + {"setdefault", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method), METH_FASTCALL, ""}, + {"pop", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method), METH_FASTCALL, ""}, + // {"popitem", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_popitem_method, METH_NOARGS, ""}, TODO not popular and a bit strange + // {"keys", JSObjectProxyMethodDefinitions::JSObjectProxy_keys_method, METH_NOARGS, ""}, + /* {"items", dictitems_new, METH_NOARGS, items__doc__}, {"values", dictvalues_new, METH_NOARGS, values__doc__}, {"update", _PyCFunction_CAST(dict_update), METH_VARARGS | METH_KEYWORDS, update__doc__}, - DICT_FROMKEYS_METHODDEF - {"clear", (PyCFunction)dict_clear, METH_NOARGS, - clear__doc__}, - {"copy", (PyCFunction)dict_copy, METH_NOARGS, - copy__doc__}, - DICT___REVERSED___METHODDEF*/ - // {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},*/ + DICT_FROMKEYS_METHODDEF*/ + {"clear", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method, METH_NOARGS, ""}, + {"copy", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method, METH_NOARGS, ""}, {NULL, NULL} /* sentinel */ }; diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index ac89bbc4..51c13b33 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -1,6 +1,6 @@ /** * @file JSObjectProxy.cc - * @author Caleb Aikens (caleb@distributive.network) & Tom Tang (xmader@distributive.network) + * @author Caleb Aikens (caleb@distributive.network), Tom Tang (xmader@distributive.network) and Philippe Laporte (philippe@distributive.network) * @brief JSObjectProxy is a custom C-implemented python type that derives from dict. It acts as a proxy for JSObjects from Spidermonkey, and behaves like a dict would. * @version 0.1 * @date 2023-06-26 @@ -86,9 +86,29 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); - // TODO value and global appear to be leaking, but deleting them causes crashes + + if (!value->isUndefined()) { + return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + } + else { + // look through the methods for dispatch + for (size_t index = 0;; index++) { + const char *methodName = JSObjectProxyType.tp_methods[index].ml_name; + if (methodName == NULL) { // reached end of list + return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + } + else if (PyUnicode_Check(key)) { + if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { + return PyObject_GenericGetAttr((PyObject *)self, key); + } + } + else { + return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + } + } + } } int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, PyObject *key) @@ -210,12 +230,11 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_iter(JSObjectProxy *self) { - JSContext *cx = GLOBAL_CX; - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); // Get **enumerable** own properties - JS::RootedIdVector props(cx); - if (!js::GetPropertyKeys(cx, self->jsObject, JSITER_OWNONLY, &props)) { + JS::RootedIdVector props(GLOBAL_CX); + if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { return NULL; } @@ -225,11 +244,11 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_iter(JSObjectProxy *self PyObject *seq = PyTuple_New(length); for (size_t i = 0; i < length; i++) { JS::HandleId id = props[i]; - PyObject *key = idToKey(cx, id); + PyObject *key = idToKey(GLOBAL_CX, id); - JS::RootedValue *jsVal = new JS::RootedValue(cx); - JS_GetPropertyById(cx, self->jsObject, id, jsVal); - PyObject *value = pyTypeFactory(cx, global, jsVal)->getPyObject(); + JS::RootedValue *jsVal = new JS::RootedValue(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, jsVal); + PyObject *value = pyTypeFactory(GLOBAL_CX, global, jsVal)->getPyObject(); PyTuple_SetItem(seq, i, PyTuple_Pack(2, key, value)); } @@ -264,9 +283,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self return str; } -PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get_2(JSObjectProxy *self, PyObject *const *args, Py_ssize_t nargs) { - printf("JSObjectProxy_get_2\n"); - +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get_method(JSObjectProxy *self, PyObject *const *args, Py_ssize_t nargs) { PyObject *key; PyObject *default_value = Py_None; @@ -277,11 +294,114 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get_2(JSObjectProxy *sel if (nargs < 2) { goto skip_optional; } + default_value = args[1]; + skip_optional: + PyObject *value = JSObjectProxy_get(self, key); - if (value == NULL) { + if (value == Py_None) { value = default_value; } + Py_XINCREF(value); return value; } + +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method(JSObjectProxy *self, PyObject *const *args, Py_ssize_t nargs) { + PyObject *key; + PyObject *default_value = Py_None; + + if (!_PyArg_CheckPositional("setdefault", nargs, 1, 2)) { + return NULL; + } + key = args[0]; + if (nargs < 2) { + goto skip_optional; + } + + default_value = args[1]; + +skip_optional: + + PyObject* value = JSObjectProxy_get(self, key); + if (value == Py_None) { + JSObjectProxy_assign(self, key, default_value); + Py_XINCREF(default_value); + return default_value; + } + + Py_XINCREF(value); + return value; +} + +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy *self, PyObject *const *args, Py_ssize_t nargs) { + PyObject *key; + PyObject *default_value = NULL; + + if (!_PyArg_CheckPositional("pop", nargs, 1, 2)) { + return NULL; + } + key = args[0]; + if (nargs < 2) { + goto skip_optional; + } + default_value = args[1]; + +skip_optional: + JS::RootedId id(GLOBAL_CX); + if (!keyToId(key, &id)) { + // TODO (Caleb Aikens): raise exception here PyObject *seq = PyTuple_New(length); + return NULL; + } + + JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); + if (value->isUndefined()) { + if (default_value != NULL) { + Py_INCREF(default_value); + return default_value; + } + _PyErr_SetKeyError(key); + return NULL; + } else { + JS::ObjectOpResult ignoredResult; + JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); + + return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + } +} + +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method(JSObjectProxy *self) { + JS::RootedIdVector props(GLOBAL_CX); + if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) + { + // @TODO (Caleb Aikens) raise exception here + return NULL; + } + + JS::ObjectOpResult ignoredResult; + size_t length = props.length(); + for (size_t index = 0; index < length; index++) { + JS_DeletePropertyById(GLOBAL_CX, self->jsObject, props[index], ignoredResult); + } + + Py_RETURN_NONE; +} + +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProxy *self) { + JS::Rooted> args(GLOBAL_CX); + args[0].setObjectOrNull(JS_NewPlainObject(GLOBAL_CX)); + args[1].setObjectOrNull(self->jsObject); + + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + + // call Object.assign + JS::RootedValue Object(GLOBAL_CX); + JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); + + JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); + JS::RootedValue ret(GLOBAL_CX); + + if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; + return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); +} \ No newline at end of file diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 73a48e5f..7e3117da 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -72,6 +72,7 @@ PyTypeObject JSObjectProxyType = { .ob_base = PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "pythonmonkey.JSObjectProxy", .tp_basicsize = sizeof(JSObjectProxy), + .tp_itemsize = 0, .tp_dealloc = (destructor)JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc, .tp_repr = (reprfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_repr, .tp_as_sequence = &JSObjectProxy_sequence_methods, diff --git a/tests/python/test_dict_methods.py b/tests/python/test_dict_methods.py new file mode 100644 index 00000000..b3ae6877 --- /dev/null +++ b/tests/python/test_dict_methods.py @@ -0,0 +1,119 @@ +import pythonmonkey as pm + +# get +def test_get_no_default(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + foundKey = likes.get('fruit') + assert foundKey == 'apple' + +def test_get_no_default_not_found(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + foundKey = likes.get('fuit') + assert foundKey == None + +def test_get_default_not_found(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + foundKey = likes.get('fuit', 'orange') + assert foundKey == 'orange' + +def test_get_no_params(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + try: + likes.get() + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "get expected at least 1 argument, got 0" + +# setdefault +def test_setdefault_found(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + foundKey = likes.setdefault('color') + assert foundKey == 'blue' + +def test_setdefault_found_ignore_default(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + foundKey = likes.setdefault('color', 'yello') + assert foundKey == 'blue' + +def test_setdefault_not_found_no_default(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + foundKey = likes.setdefault('colo') + assert foundKey == None + +def test_setdefault_not_found_with_default(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + foundKey = likes.setdefault('colo', 'yello') + assert foundKey == 'yello' + +def test_setdefault_no_params(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + try: + likes.setdefault() + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "setdefault expected at least 1 argument, got 0" + +#pop +def test_pop_found(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + foundKey = likes.pop('color') + assert foundKey == 'blue' + +def test_pop_not_found(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + try: + likes.pop('colo') + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "'colo'" + +def test_pop_twice_not_found(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + likes.pop('color') + try: + likes.pop('color') + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "'color'" + +def test_pop_found_ignore_default(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + foundKey = likes.pop('color', 'u') + assert foundKey == 'blue' + +def test_pop_not_found_with_default(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + foundKey = likes.pop('colo', 'unameit') + assert foundKey == 'unameit' + +def test_pop_no_params(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + try: + likes.pop() + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "pop expected at least 1 argument, got 0" + +#clear +def test_clear(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + likes.clear() + assert len(likes) == 0 + +#copy +def test_copy(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + otherLikes = likes.copy() + otherLikes["color"] = "yellow" + + assert likes == {"color": "blue", "fruit": "apple", "pet": "dog"} + assert otherLikes == {"color": "yellow", "fruit": "apple", "pet": "dog"} + + + + From 1269bba4d006489a1fca9dc81e15ce1e87317522 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Thu, 30 Nov 2023 15:36:08 -0500 Subject: [PATCH 0084/1086] fix(JSObjectProxy): do not allow '|' operand on dicts and JSObjectProxys if python version is lower than 3.9 --- src/JSObjectProxy.cc | 7 +++++++ tests/python/test_dicts_lists.py | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 3fe56d4a..364ab930 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -262,6 +262,13 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, PyObject *other) { + #if PY_VERSION_HEX < 0x03090000 + // | is not supported on dicts in python3.8 or less, so only allow if both + // operands are JSObjectProxy + if (!PyObject_TypeCheck(self, &JSObjectProxyType) || !PyObject_TypeCheck(other, &JSObjectProxyType)) { + Py_RETURN_NOTIMPLEMENTED; + } + #endif if (!PyDict_Check(self) || !PyDict_Check(other)) { Py_RETURN_NOTIMPLEMENTED; } diff --git a/tests/python/test_dicts_lists.py b/tests/python/test_dicts_lists.py index f009b068..c613b1d0 100644 --- a/tests/python/test_dicts_lists.py +++ b/tests/python/test_dicts_lists.py @@ -1,4 +1,5 @@ import pythonmonkey as pm +import sys def test_eval_dicts(): d = {"a":1} @@ -140,6 +141,7 @@ def test_eval_objects_jsproxy_does_not_contain_value(): assert not(5 in a) def test_eval_objects_jsproxy_or(): + if sys.version_info[0] >= 3 and sys.version_info[1] >=9: # | is not implemented for dicts in 3.8 or less a = pm.eval("({'c':5})") b = pm.eval("({'d':6})") c = a | b @@ -148,6 +150,7 @@ def test_eval_objects_jsproxy_or(): assert b == {'d': 6.0} def test_eval_objects_jsproxy_or_true_dict_right(): + if sys.version_info[0] >= 3 and sys.version_info[1] >=9: # | is not implemented for dicts in 3.8 or less a = pm.eval("({'c':5})") b = {'d': 6.0} c = a | b @@ -156,6 +159,7 @@ def test_eval_objects_jsproxy_or_true_dict_right(): assert b == {'d': 6.0} def test_eval_objects_jsproxy_or_true_dict_left(): + if sys.version_info[0] >= 3 and sys.version_info[1] >=9: # | is not implemented for dicts in 3.8 or less a = {'c':5} b = pm.eval("({'d':6})") c = a | b @@ -164,6 +168,7 @@ def test_eval_objects_jsproxy_or_true_dict_left(): assert b == {'d': 6.0} def test_eval_objects_jsproxy_inplace_or(): + if sys.version_info[0] >= 3 and sys.version_info[1] >=9: # | is not implemented for dicts in 3.8 or less a = pm.eval("({'c':5})") b = pm.eval("({'d':6})") a |= b @@ -171,6 +176,7 @@ def test_eval_objects_jsproxy_inplace_or(): assert b == {'d': 6.0} def test_eval_objects_jsproxy_inplace_or_true_dict_right(): + if sys.version_info[0] >= 3 and sys.version_info[1] >=9: # | is not implemented for dicts in 3.8 or less a = pm.eval("({'c':5})") b = {'d':6.0} a |= b @@ -178,6 +184,7 @@ def test_eval_objects_jsproxy_inplace_or_true_dict_right(): assert b == {'d': 6.0} def test_eval_objects_jsproxy_inplace_or_true_dict_left(): + if sys.version_info[0] >= 3 and sys.version_info[1] >=9: # | is not implemented for dicts in 3.8 or less a = {'c':5.0} b = pm.eval("({'d':6})") a |= b From 4617228ae6f01750c2cd38c63db50d1f018c8f59 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Thu, 30 Nov 2023 15:37:34 -0500 Subject: [PATCH 0085/1086] added python docs --- include/JSObjectProxy.hh | 52 +++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index a18add84..6a356b98 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -178,6 +178,38 @@ public: }; +// docs for methods, copied from cpython +PyDoc_STRVAR(dict_get__doc__, + "get($self, key, default=None, /)\n" + "--\n" + "\n" + "Return the value for key if key is in the dictionary, else default."); + +PyDoc_STRVAR(dict_setdefault__doc__, + "setdefault($self, key, default=None, /)\n" + "--\n" + "\n" + "Insert key with a value of default if key is not in the dictionary.\n" + "\n" + "Return the value for key if key is in the dictionary, else default."); + +PyDoc_STRVAR(dict_pop__doc__, + "pop($self, key, default=, /)\n" + "--\n" + "\n" + "D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\n" + "\n" + "If the key is not found, return the default if given; otherwise,\n" + "raise a KeyError."); + +PyDoc_STRVAR(clear__doc__, + "D.clear() -> None. Remove all items from D."); + +PyDoc_STRVAR(copy__doc__, + "D.copy() -> a shallow copy of D"); + + + /** * @brief Struct for the methods that define the Mapping protocol * @@ -193,20 +225,12 @@ static PySequenceMethods JSObjectProxy_sequence_methods = { }; static PyMethodDef JSObjectProxy_methods[] = { - {"get", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_get_method), METH_FASTCALL, ""}, - {"setdefault", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method), METH_FASTCALL, ""}, - {"pop", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method), METH_FASTCALL, ""}, - // {"popitem", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_popitem_method, METH_NOARGS, ""}, TODO not popular and a bit strange - // {"keys", JSObjectProxyMethodDefinitions::JSObjectProxy_keys_method, METH_NOARGS, ""}, - /* {"items", dictitems_new, METH_NOARGS, - items__doc__}, - {"values", dictvalues_new, METH_NOARGS, - values__doc__}, - {"update", _PyCFunction_CAST(dict_update), METH_VARARGS | METH_KEYWORDS, - update__doc__}, - DICT_FROMKEYS_METHODDEF*/ - {"clear", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method, METH_NOARGS, ""}, - {"copy", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method, METH_NOARGS, ""}, + {"get", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_get_method), METH_FASTCALL, dict_get__doc__}, + {"setdefault", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method), METH_FASTCALL, dict_setdefault__doc__}, + {"pop", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method), METH_FASTCALL, dict_pop__doc__}, + // {"popitem", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_popitem_method, METH_NOARGS, ""}, TODO not popular and quite a bit strange + {"clear", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method, METH_NOARGS, clear__doc__}, + {"copy", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method, METH_NOARGS, copy__doc__}, {NULL, NULL} /* sentinel */ }; From 3e4928e40948abaf6263a10dd5d320a90187c01d Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Thu, 30 Nov 2023 15:42:31 -0500 Subject: [PATCH 0086/1086] macros satisfy all --- include/JSObjectProxy.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 6a356b98..699006a4 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -225,9 +225,9 @@ static PySequenceMethods JSObjectProxy_sequence_methods = { }; static PyMethodDef JSObjectProxy_methods[] = { - {"get", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_get_method), METH_FASTCALL, dict_get__doc__}, - {"setdefault", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method), METH_FASTCALL, dict_setdefault__doc__}, - {"pop", _PyCFunction_CAST(JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method), METH_FASTCALL, dict_pop__doc__}, + {"get", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_get_method, METH_FASTCALL, dict_get__doc__}, + {"setdefault", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method, METH_FASTCALL, dict_setdefault__doc__}, + {"pop", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method, METH_FASTCALL, dict_pop__doc__}, // {"popitem", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_popitem_method, METH_NOARGS, ""}, TODO not popular and quite a bit strange {"clear", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method, METH_NOARGS, clear__doc__}, {"copy", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method, METH_NOARGS, copy__doc__}, From 363a3d866bd39efa0eb4ce269674b43f5202f0dd Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Thu, 30 Nov 2023 15:56:04 -0500 Subject: [PATCH 0087/1086] chore(merge): resolve merge conflicts Co-authored-by: Philippe Laport <151072087+philippedistributive@users.noreply.github.com> --- include/JSObjectProxy.hh | 24 ++++++++++++++++++++++++ src/JSObjectProxy.cc | 2 ++ src/modules/pythonmonkey/pythonmonkey.cc | 1 + 3 files changed, 27 insertions(+) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index e22e146a..12bfa007 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -129,6 +129,25 @@ public: * @return the string representation (a PyUnicodeObject) on success, NULL on failure */ static PyObject *JSObjectProxy_repr(JSObjectProxy *self); + + /** + * @brief Set union method + * + * @param self - The JSObjectProxy + * @param other - The other PyObject to be or'd, expected to be dict or JSObjectProxy + * @return PyObject* The resulting new dict + */ + static PyObject *JSObjectProxy_or(JSObjectProxy *self, PyObject *other); + + /** + * @brief Set union method, in place + * + * @param self - The JSObjectProxy + * @param other - The other PyObject to be or'd, expected to be dict or JSObjectProxy + * @return PyObject* The resulting new dict, must be same object as self + */ + static PyObject *JSObjectProxy_ior(JSObjectProxy *self, PyObject *other); + }; @@ -146,6 +165,11 @@ static PySequenceMethods JSObjectProxy_sequence_methods = { .sq_contains = (objobjproc)JSObjectProxyMethodDefinitions::JSObjectProxy_contains }; +static PyNumberMethods JSObjectProxy_number_methods = { + .nb_or = (binaryfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_or, + .nb_inplace_or = (binaryfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_ior +}; + /** * @brief Struct for the JSObjectProxyType, used by all JSObjectProxy objects */ diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 3ae40d93..364ab930 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -21,6 +21,8 @@ #include +#include + JSContext *GLOBAL_CX; /**< pointer to PythonMonkey's JSContext */ bool keyToId(PyObject *key, JS::MutableHandleId idp) { diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 56cf23e1..c673ef73 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -74,6 +74,7 @@ PyTypeObject JSObjectProxyType = { .tp_basicsize = sizeof(JSObjectProxy), .tp_dealloc = (destructor)JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc, .tp_repr = (reprfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_repr, + .tp_as_number = &JSObjectProxy_number_methods, .tp_as_sequence = &JSObjectProxy_sequence_methods, .tp_as_mapping = &JSObjectProxy_mapping_methods, .tp_getattro = (getattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_get, From 8c39e38fa85c6a78a6d42dd60cc3427951f46d43 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 30 Nov 2023 16:08:44 -0500 Subject: [PATCH 0088/1086] Update JSObjectProxy.cc removed comment --- src/JSObjectProxy.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 51c13b33..09717e13 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -49,7 +49,7 @@ void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { - PyObject *self = PyDict_Type.tp_new(subtype, args, kwds); // SUPER CALL + PyObject *self = PyDict_Type.tp_new(subtype, args, kwds); ((JSObjectProxy *)self)->jsObject = JS::RootedObject(GLOBAL_CX, nullptr); return self; } @@ -404,4 +404,4 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProx if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); -} \ No newline at end of file +} From 0848d94c664029a22feb1468f028cd898d93c283 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:00:57 -0500 Subject: [PATCH 0089/1086] Update JSObjectProxy.hh better doc comments --- include/JSObjectProxy.hh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 699006a4..c78cf137 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -209,7 +209,6 @@ PyDoc_STRVAR(copy__doc__, "D.copy() -> a shallow copy of D"); - /** * @brief Struct for the methods that define the Mapping protocol * @@ -220,10 +219,18 @@ static PyMappingMethods JSObjectProxy_mapping_methods = { .mp_ass_subscript = (objobjargproc)JSObjectProxyMethodDefinitions::JSObjectProxy_assign }; +/** + * @brief Struct for the methods that define the Sequence protocol + * + */ static PySequenceMethods JSObjectProxy_sequence_methods = { .sq_contains = (objobjproc)JSObjectProxyMethodDefinitions::JSObjectProxy_contains }; +/** + * @brief Struct for the other methods + * + */ static PyMethodDef JSObjectProxy_methods[] = { {"get", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_get_method, METH_FASTCALL, dict_get__doc__}, {"setdefault", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method, METH_FASTCALL, dict_setdefault__doc__}, @@ -237,4 +244,4 @@ static PyMethodDef JSObjectProxy_methods[] = { /** * @brief Struct for the JSObjectProxyType, used by all JSObjectProxy objects */ -extern PyTypeObject JSObjectProxyType; \ No newline at end of file +extern PyTypeObject JSObjectProxyType; From 2595f76f0f816119616fa4989f89c8c2a93338d8 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 1 Dec 2023 10:35:49 -0500 Subject: [PATCH 0090/1086] chore(tests): fix inconsistent spacing on comparison operators in tests --- tests/python/test_dicts_lists.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/python/test_dicts_lists.py b/tests/python/test_dicts_lists.py index bddb23b6..68c06717 100644 --- a/tests/python/test_dicts_lists.py +++ b/tests/python/test_dicts_lists.py @@ -141,7 +141,7 @@ def test_eval_objects_jsproxy_does_not_contain_value(): assert not(5 in a) def test_eval_objects_jsproxy_or(): - if sys.version_info[0] >= 3 and sys.version_info[1] >=9: # | is not implemented for dicts in 3.8 or less + if sys.version_info[0] >= 3 and sys.version_info[1] >= 9: # | is not implemented for dicts in 3.8 or less a = pm.eval("({'c':5})") b = pm.eval("({'d':6})") c = a | b @@ -150,7 +150,7 @@ def test_eval_objects_jsproxy_or(): assert b == {'d': 6.0} def test_eval_objects_jsproxy_or_true_dict_right(): - if sys.version_info[0] >= 3 and sys.version_info[1] >=9: # | is not implemented for dicts in 3.8 or less + if sys.version_info[0] >= 3 and sys.version_info[1] >= 9: # | is not implemented for dicts in 3.8 or less a = pm.eval("({'c':5})") b = {'d': 6.0} c = a | b @@ -159,7 +159,7 @@ def test_eval_objects_jsproxy_or_true_dict_right(): assert b == {'d': 6.0} def test_eval_objects_jsproxy_or_true_dict_left(): - if sys.version_info[0] >= 3 and sys.version_info[1] >=9: # | is not implemented for dicts in 3.8 or less + if sys.version_info[0] >= 3 and sys.version_info[1] >= 9: # | is not implemented for dicts in 3.8 or less a = {'c':5} b = pm.eval("({'d':6})") c = a | b @@ -168,7 +168,7 @@ def test_eval_objects_jsproxy_or_true_dict_left(): assert b == {'d': 6.0} def test_eval_objects_jsproxy_inplace_or(): - if sys.version_info[0] >= 3 and sys.version_info[1] >=9: # | is not implemented for dicts in 3.8 or less + if sys.version_info[0] >= 3 and sys.version_info[1] >= 9: # | is not implemented for dicts in 3.8 or less a = pm.eval("({'c':5})") b = pm.eval("({'d':6})") a |= b @@ -176,7 +176,7 @@ def test_eval_objects_jsproxy_inplace_or(): assert b == {'d': 6.0} def test_eval_objects_jsproxy_inplace_or_true_dict_right(): - if sys.version_info[0] >= 3 and sys.version_info[1] >=9: # | is not implemented for dicts in 3.8 or less + if sys.version_info[0] >= 3 and sys.version_info[1] >= 9: # | is not implemented for dicts in 3.8 or less a = pm.eval("({'c':5})") b = {'d':6.0} a |= b @@ -184,7 +184,7 @@ def test_eval_objects_jsproxy_inplace_or_true_dict_right(): assert b == {'d': 6.0} def test_eval_objects_jsproxy_inplace_or_true_dict_left(): - if sys.version_info[0] >= 3 and sys.version_info[1] >=9: # | is not implemented for dicts in 3.8 or less + if sys.version_info[0] >= 3 and sys.version_info[1] >= 9: # | is not implemented for dicts in 3.8 or less a = {'c':5.0} b = pm.eval("({'d':6})") a |= b From b5c381f7719a78d4582e39ef07af8ce309a1ea94 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 1 Dec 2023 16:38:14 -0500 Subject: [PATCH 0091/1086] JSArrayProxy: first batch registration into VM basic operations --- include/JSArrayProxy.hh | 344 ++++++++ include/PyProxyHandler.hh | 23 + pyproject.toml | 4 +- python/pminit/pyproject.toml | 2 +- setup.sh | 4 +- src/JSArrayProxy.cc | 788 ++++++++++++++++++ src/JSObjectProxy.cc | 26 +- src/ListType.cc | 31 +- src/PyProxyHandler.cc | 89 ++ src/jsTypeFactory.cc | 29 +- src/modules/pythonmonkey/pythonmonkey.cc | 31 + src/pyTypeFactory.cc | 6 +- .../{test_dicts_lists.py => test_dicts.py} | 0 tests/python/test_list_array.py | 7 +- tests/python/test_list_methods.py | 1 + tests/python/test_lists.py | 41 + 16 files changed, 1372 insertions(+), 54 deletions(-) create mode 100644 include/JSArrayProxy.hh create mode 100644 src/JSArrayProxy.cc rename tests/python/{test_dicts_lists.py => test_dicts.py} (100%) create mode 100644 tests/python/test_list_methods.py create mode 100644 tests/python/test_lists.py diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh new file mode 100644 index 00000000..1444023b --- /dev/null +++ b/include/JSArrayProxy.hh @@ -0,0 +1,344 @@ +/** + * @file JSArrayProxy.hh + * @author Philippe Laporte (philippe@distributive.network) + * @brief JSArrayProxy is a custom C-implemented python type that derives from list. It acts as a proxy for JSArrays from Spidermonkey, and behaves like a list would. + * @version 0.1 + * @date 2023-11-22 + * + * Copyright (c) 2023 Distributive Corp. + * + */ + + +#include + +#include + +#include + +/** + * @brief The typedef for the backing store that will be used by JSArrayProxy objects. All it contains is a pointer to the JSObject + * + */ +typedef struct { + PyListObject list; + JS::RootedObject jsObject; +} JSArrayProxy; + +/** + * @brief This struct is a bundle of methods used by the JSArrayProxy type + * + */ +struct JSArrayProxyMethodDefinitions { +public: + /** + * @brief Deallocation method (.tp_dealloc), removes the reference to the underlying JSObject before freeing the JSArrayProxy + * + * @param self - The JSArrayProxy to be free'd + */ + static void JSArrayProxy_dealloc(JSArrayProxy *self); + + /** + * @brief New method (.tp_new), creates a new instance of the JSArrayProxy type, exposed as the __new()__ method in python + * + * @param type - The type of object to be created, will always be JSArrayProxyType or a derived type + * @param args - arguments to the __new()__ method, not used + * @param kwds - keyword arguments to the __new()__ method, not used + * @return PyObject* - A new instance of JSArrayProxy + */ + static PyObject *JSArrayProxy_new(PyTypeObject *type, PyObject *args, PyObject *kwds); + + /** + * @brief Initialization method (.tp_init), initializes a newly created instance of JSArrayProxy. exposed as the __init()__ method in python + * + * @param self - The JSArrayProxy to be initialized + * @param args - arguments to the __init()__ method, expected to be a dict + * @param kwds - keyword arguments to the __init()__ method, not used + * @return int - -1 on exception, return any other value otherwise + */ + static int JSArrayProxy_init(JSArrayProxy *self, PyObject *args, PyObject *kwds); + + /** + * @brief Length method (.mp_length and .sq_length), returns the number of key-value pairs in the JSObject, used by the python len() method + * + * @param self - The JSArrayProxy + * @return Py_ssize_t The length of the JSArrayProxy + */ + static Py_ssize_t JSArrayProxy_length(JSArrayProxy *self); + + /** + * @brief Getter method (.mp_subscript), returns a value from the JSArrayProxy given a key, used by several built-in python methods as well as the [] operator + * + * @param self - The JSArrayProxy + * @param key - The key for the value in the JSArrayProxy + * @return PyObject* NULL on exception, the corresponding value otherwise + */ + static PyObject *JSArrayProxy_get(JSArrayProxy *self, PyObject *key); + + + /** + * @brief Assign method (.mp_ass_subscript), assigns a key-value pair if value is non-NULL, or deletes a key-value pair if value is NULL + * + * @param self - The JSArrayProxy + * @param key - The key to be set or deleted + * @param value If NULL, the key-value pair is deleted, if not NULL then a key-value pair is assigned + * @return int -1 on exception, any other value otherwise + */ + static int JSArrayProxy_assign_key(JSArrayProxy *self, PyObject *key, PyObject *value); + + /** + * @brief Helper function for various JSArrayProxy methods, sets a key-value pair on a JSObject given a python string key and a JS::Value value + * + * @param jsObject - The underlying backing store JSObject for the JSArrayProxy + * @param key - The key to be assigned or deleted + * @param value - The JS::Value to be assigned + */ + static void JSArrayProxy_set_helper(JS::HandleObject jsObject, PyObject *key, JS::HandleValue value); + + /** + * @brief Comparison method (.tp_richcompare), returns appropriate boolean given a comparison operator and other pyobject + * + * @param self - The JSArrayProxy + * @param other - Any other PyObject + * @param op - Which boolean operator is being performed (Py_EQ for equality, Py_NE for inequality, all other operators are not implemented) + * @return PyObject* - True or false depending on result of comparison + */ + static PyObject *JSArrayProxy_richcompare(JSArrayProxy *self, PyObject *other, int op); + + /** + * @brief Helper function for JSArrayProxy_richcompare + * + * @param self - The PyObject on the left side of the operator (guaranteed to be a JSArrayProxy *) + * @param other - The PyObject on the right side of the operator + * @param visited + * @return bool - Whether the compared objects are equal or not + */ + static bool JSArrayProxy_richcompare_helper(JSArrayProxy *self, PyObject *other, std::unordered_map &visited); + + /** + * @brief Return an iterator object to make JSArrayProxy iterable, emitting (key, value) tuples + * + * @param self - The JSArrayProxy + * @return PyObject* - iterator object + */ + static PyObject *JSArrayProxy_iter(JSArrayProxy *self); + + /** + * @brief Compute a string representation of the JSArrayProxy + * + * @param self - The JSArrayProxy + * @return the string representation (a PyUnicodeObject) on success, NULL on failure + */ + static PyObject *JSArrayProxy_repr(JSArrayProxy *self); + + /** + * @brief concat method (.sq_concat), concatenates + * + * @param self - The JSArrayProxy + * @param value - The value to be concatenated + * @return PyObject* NULL on exception, the corresponding new value otherwise + */ + // static PyObject *JSArrayProxy_concat(JSArrayProxy *self, PyObject *value); + + /** + * @brief repeat method (.sq_repeat) + * + * @param self - The JSArrayProxy + * @param n The number of times to repeat + * @return PyObject* NULL on exception, the corresponding new value otherwise + */ +// static PyObject *JSArrayProxy_repeat(JSArrayProxy *self, Py_ssize_t n); + + /** + * @brief Getter method (.sq_item), returns a value from the JSArrayProxy given an index, used by several built-in python methods as well as the [] operator + * + * @param self - The JSArrayProxy + * @param index - The index for the value in the JSArrayProxy + * @return PyObject* NULL on exception, the corresponding value otherwise + */ + // static PyObject *JSArrayProxy_item(JSArrayProxy *self, Py_ssize_t index); + + /** + * @brief Assign method (.sq_ass_item), assigns a value at index if value is non-NULL, or deletes a key-value pair if value is NULL + * + * @param self - The JSObjectProxy + * @param index - The index for the value in the JSArrayProxy + * @param value If NULL, the key-value pair is deleted, if not NULL then a key-value pair is assigned + * @return int -1 on exception, a0 on success + */ + // static int JSArrayProxy_assign_index(JSArrayProxy *self, Py_ssize_t index, PyObject *value); + + /** + * @brief Test contains method (.sq_contains), assigns a value at index if value is non-NULL, or deletes a key-value pair if value is NULL + * + * @param self - The JSObjectProxy + * @param element - The element in the JSArrayProxy + * @return int 1 if element is in List, 0 if not, and -1 on error + */ + // static int JSArrayProxy_contains(JSArrayProxy *self, PyObject *element); + + /** + * @brief inplace_concat method (.sq_inplace_concat), concatenates + * + * @param self - The JSArrayProxy + * @param value - The value to be concatenated + * @return PyObject* NULL on exception, the corresponding new value otherwise + */ + // static PyObject *JSArrayProxy_inplace_concat(JSArrayProxy *self, PyObject *value); + + /** + * @brief inplace_repeat method (.sq_inplace_repeat) + * + * @param self - The JSArrayProxy + * @param n The number of times to repeat + * @return PyObject* NULL on exception, the corresponding new value otherwise + */ + // static PyObject *JSArrayProxy_inplace_repeat(JSArrayProxy *self, Py_ssize_t n); + + /** + * @brief clear method (.tp_clear) + * + * @param self - The JSArrayProxy + * @return 0 on success + */ + // static int JSArrayProxy_clear(JSArrayProxy *self); + + /** + * @brief copy method + * + * @param self - The JSArrayProxy + * @return a shallow copy of the list + */ + // static PyObject *JSArrayProxy_copy(JSArrayProxy *self); + + + /** + * @brief append method + * + * @param self - The JSArrayProxy + * @param value - The value to be appended + * @return None + */ + // static PyObject *JSArrayProxy_append(JSArrayProxy *self, PyObject *value); + + /** + * @brief insert method + * + * @param self - The JSArrayProxy + * @return PyObject* NULL on exception, the corresponding new value otherwise + */ + // static PyObject *JSArrayProxy_insert(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs); + + /** + * @brief extend method + * + * @param self - The JSArrayProxy + * @param value - The value to be appended + * @return None + */ + // static PyObject *JSArrayProxy_extend(JSArrayProxy *self, PyObject *iterable); + + /** + * @brief pop method + * + * @param self - The JSArrayProxy + * @return PyObject* NULL on exception, the corresponding new value otherwise + */ + // static PyObject *JSArrayProxy_pop(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs); + + + /** + * @brief remove method Remove first occurrence of value + * + * @param self - The JSArrayProxy + * @param value - The value to be appended + * @return PyObject* NULL on exception, the corresponding new value otherwise + */ + // static PyObject *JSArrayProxy_remove(JSArrayProxy *self, PyObject *value); + + /** + * @brief index method + * + * @param self - The JSArrayProxy + * @return PyObject* NULL on exception, the corresponding new value otherwise + */ + // static PyObject *JSArrayProxy_index(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs); + + /** + * @brief count method Remove first occurrence of value + * + * @param self - The JSArrayProxy + * @return PyObject* NULL on exception, the corresponding new value otherwise + */ + // static PyObject *JSArrayProxy_count(JSArrayProxy *self, PyObject *value); + + /** + * @brief reverse method Reverse list in place + * + * @param self - The JSArrayProxy + * @return PyObject* NULL on exception, the corresponding new value otherwise + */ + // static PyObject *JSArrayProxy_reverse(JSArrayProxy *self); + + + /** + * @brief sort method sort in place + * + * @param self - The JSArrayProxy + * @param value - The value to be appended + * @return PyObject* NULL on exception, the corresponding new value otherwise + */ + // static PyObject *JSArrayProxy_sort(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); +}; + + +/** + * @brief Struct for the methods that define the Mapping protocol + * + */ +static PyMappingMethods JSArrayProxy_mapping_methods = { + .mp_length = (lenfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_length, + .mp_subscript = (binaryfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_get, + .mp_ass_subscript = (objobjargproc)JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key +}; + +/** + * @brief Struct for the methods that define the Sequence protocol + * + */ +static PySequenceMethods JSArrayProxy_sequence_methods = { + .sq_length = (lenfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_length, + /*.sq_concat = (binaryfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_concat, + .sq_repeat = (ssizeargfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_repeat, + .sq_item = (ssizeargfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_item, + .sq_ass_item = (ssizeobjargproc)JSArrayProxyMethodDefinitions::JSArrayProxy_assign_index, + .sq_contains = (objobjproc)JSArrayProxyMethodDefinitions::JSArrayProxy_contains, + .sq_inplace_concat = (binaryfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_concat, + .sq_inplace_repeat = (ssizeargfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat,*/ +}; + +/** + * @brief Struct for the other methods + * + */ +static PyMethodDef JSArrayProxy_methods[] = { + // {"__getitem__", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_get, METH_O|METH_COEXIST, + // PyDoc_STR("__getitem__($self, index, /)\n--\n\nReturn self[index].")}, + // {"clear", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_clear, METH_NOARGS, ""}, + // {"copy", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_copy, METH_NOARGS, ""}, + // {"append", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_append, METH_O, ""}, + // {"insert", _PyCFunction_CAST(JSArrayProxyMethodDefinitions::JSArrayProxy_insert), METH_FASTCALL, ""}, + // {"extend", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_extend, METH_O, ""}, + // {"pop", _PyCFunction_CAST(JSArrayProxyMethodDefinitions::JSArrayProxy_pop), METH_FASTCALL, ""}, // TODO can empty string be null? + // {"remove", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_remove, METH_O, ""}, + // {"index", _PyCFunction_CAST(JSArrayProxyMethodDefinitions::JSArrayProxy_remove), METH_FASTCALL, ""}, + // {"count", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_remove, METH_O, ""}, + // {"reverse", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_reverse, METH_NOARGS, ""}, + // {"sort", _PyCFunction_CAST(JSArrayProxyMethodDefinitions::JSArrayProxy_sort), METH_FASTCALL|METH_KEYWORDS, ""}, + {NULL, NULL} /* sentinel */ +}; + +/** + * @brief Struct for the JSArrayProxyType, used by all JSArrayProxy objects + */ +extern PyTypeObject JSArrayProxyType; diff --git a/include/PyProxyHandler.hh b/include/PyProxyHandler.hh index 3ce925d6..21188e26 100644 --- a/include/PyProxyHandler.hh +++ b/include/PyProxyHandler.hh @@ -159,6 +159,29 @@ public: JS::ObjectOpResult &result) const override; }; +/** + * @brief This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates + * to handle coercion from python lists to JS Array-like objects + */ +struct PyListProxyHandler : public PyBaseProxyHandler { +public: + PyListProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; + static const char family; + + bool getOwnPropertyDescriptor( + JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::MutableHandle> desc + ) const override; + + bool defineProperty( + JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::Handle desc, JS::ObjectOpResult &result + ) const override; + + bool ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override; + bool delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const override; +}; + /** * @brief Convert jsid to a PyObject to be used as dict keys */ diff --git a/pyproject.toml b/pyproject.toml index 40770d86..80d64bfe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "pythonmonkey" version = "0" # automatically set by poetry-dynamic-versioning description = "" -authors = ["Caleb Aikens ", "Tom Tang ", "Wes Garland ", "Hamada Gasmallah "] +authors = ["Caleb Aikens ", "Tom Tang ", "Wes Garland ", "Hamada Gasmallah ", "Philippe Laporte "] readme = "README.md" packages = [ { include = "pythonmonkey", from = "python" }, @@ -64,5 +64,5 @@ pminit = { path = "./python/pminit", develop = true } [build-system] -requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning==0.24.0"] +requires = ["poetry-core>=1.1.1", "poetry-dynamic-versioning==1.1.1"] build-backend = "poetry_dynamic_versioning.backend" diff --git a/python/pminit/pyproject.toml b/python/pminit/pyproject.toml index 4f6e6946..9910cc72 100644 --- a/python/pminit/pyproject.toml +++ b/python/pminit/pyproject.toml @@ -33,6 +33,6 @@ generate-setup-file = false pminit = "pminit.cli:main" [build-system] -requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning==0.24.0"] +requires = ["poetry-core>=1.1.1", "poetry-dynamic-versioning==1.1.1"] build-backend = "poetry_dynamic_versioning.backend" diff --git a/setup.sh b/setup.sh index 5532d89c..2b8c385e 100755 --- a/setup.sh +++ b/setup.sh @@ -29,7 +29,7 @@ fi # Install rust compiler curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.69 # force to use Rust 1.69 because 1.70 has linking issues on Windows # Setup Poetry -curl -sSL https://install.python-poetry.org | python3 - --version "1.5.1" +curl -sSL https://install.python-poetry.org | python3 - --version "1.7.1" if [[ "$OSTYPE" == "msys"* ]]; then # Windows POETRY_BIN="$APPDATA/Python/Scripts/poetry" else @@ -71,8 +71,8 @@ echo "Done building spidermonkey" echo "Installing spidermonkey" # install to ../../../../_spidermonkey_install/ make install -cd ../../../../_spidermonkey_install/lib/ if [[ "$OSTYPE" == "darwin"* ]]; then # macOS + cd ../../../../_spidermonkey_install/lib/ # Set the `install_name` field to use RPATH instead of an absolute path # overrides https://hg.mozilla.org/releases/mozilla-esr102/file/89d799cb/js/src/build/Makefile.in#l83 install_name_tool -id @rpath/$(basename ./libmozjs*) ./libmozjs* # making it work for whatever name the libmozjs dylib is called diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc new file mode 100644 index 00000000..7a40c58b --- /dev/null +++ b/src/JSArrayProxy.cc @@ -0,0 +1,788 @@ +/** + * @file JSArrayProxy.cc + * @author Philippe Laporte (philippe@distributive.network) + * @brief JSArrayProxy is a custom C-implemented python type that derives from list. It acts as a proxy for JSArrays from Spidermonkey, and behaves like a list would. + * @version 0.1 + * @date 2023-11-22 + * + * Copyright (c) 2023 Distributive Corp. + * + */ + + +#include "include/JSArrayProxy.hh" + +#include "include/modules/pythonmonkey/pythonmonkey.hh" +#include "include/jsTypeFactory.hh" +#include "include/pyTypeFactory.hh" +#include "include/PyProxyHandler.hh" + +#include +#include + +#include + + +void JSArrayProxyMethodDefinitions::JSArrayProxy_dealloc(JSArrayProxy *self) +{ + PyObject_GC_UnTrack(self); + Py_TYPE(self)->tp_free((PyObject *)self); + self->jsObject.set(nullptr); + return; +} + +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) +{ + PyObject *self = PyDict_Type.tp_new(subtype, args, kwds); + ((JSArrayProxy *)self)->jsObject = JS::RootedObject(GLOBAL_CX, nullptr); + return self; +} + +int JSArrayProxyMethodDefinitions::JSArrayProxy_init(JSArrayProxy *self, PyObject *args, PyObject *kwds) +{ + // make fresh JSArray for proxy + // TODO args?? + self->jsObject.set(JS::NewArrayObject(GLOBAL_CX, 0)); + return 0; +} + +Py_ssize_t JSArrayProxyMethodDefinitions::JSArrayProxy_length(JSArrayProxy *self) +{ + uint32_t length; + JS::GetArrayLength(GLOBAL_CX, self->jsObject, &length); + return (Py_ssize_t)length; +} + +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, PyObject *key) +{ + JS::RootedId id(GLOBAL_CX); + if (!keyToId(key, &id)) { + // TODO (Caleb Aikens): raise exception here + return NULL; // key is not a str or int + } + + JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); + + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + + if (!value->isUndefined()) { + return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + } + else { + // look through the methods for dispatch + for (size_t index = 0;; index++) { + const char *methodName = JSArrayProxyType.tp_methods[index].ml_name; + if (methodName == NULL) { // reached end of list + return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + } + else if (PyUnicode_Check(key)) { + if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { + return PyObject_GenericGetAttr((PyObject *)self, key); + } + } + else { + return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + } + } + } +} + +int JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key(JSArrayProxy *self, PyObject *key, PyObject *value) +{ + JS::RootedId id(GLOBAL_CX); + if (!keyToId(key, &id)) { // invalid key + // TODO (Caleb Aikens): raise exception here + return -1; + } + + if (value) { // we are setting a value + JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); + JS_SetPropertyById(GLOBAL_CX, self->jsObject, id, jValue); + } else { // we are deleting a value + JS::ObjectOpResult ignoredResult; + JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); + } + + return 0; +} + +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy *self, PyObject *other, int op) +{ + if (!PyList_Check(self) || !PyList_Check(other)) { + Py_RETURN_NOTIMPLEMENTED; + } + + if (JSArrayProxy_length(self) != Py_SIZE((PyListObject *)other) && (op == Py_EQ || op == Py_NE)) { + /* Shortcut: if the lengths differ, the lists differ */ + if (op == Py_EQ) { + Py_RETURN_FALSE; + } + else { + Py_RETURN_TRUE; + } + } + + Py_ssize_t selfLength = JSArrayProxy_length(self); + Py_ssize_t otherLength = Py_SIZE(other); + + JS::RootedValue elementVal(GLOBAL_CX); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + + Py_ssize_t index; + /* Search for the first index where items are different */ + for (index = 0; index < selfLength && index < otherLength; index++) { + JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + + PyObject *leftItem = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + PyObject *rightItem = ((PyListObject *)other)->ob_item[index]; + if (leftItem == rightItem) { + continue; + } + + Py_INCREF(leftItem); + Py_INCREF(rightItem); + int k = PyObject_RichCompareBool(leftItem, rightItem, Py_EQ); + Py_DECREF(leftItem); + Py_DECREF(rightItem); + if (k < 0) + return NULL; + if (!k) + break; + } + + if (index >= selfLength || index >= otherLength) { + /* No more items to compare -- compare sizes */ + Py_RETURN_RICHCOMPARE(selfLength, otherLength, op); + } + + /* We have an item that differs -- shortcuts for EQ/NE */ + if (op == Py_EQ) { + Py_RETURN_FALSE; + } + else if (op == Py_NE) { + Py_RETURN_TRUE; + } + + JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + /* Compare the final item again using the proper operator */ + return PyObject_RichCompare(pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(), ((PyListObject *)other)->ob_item[index], op); +} + +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { + if (JSArrayProxy_length(self) == 0) { + return PyUnicode_FromString("[]"); + } + + Py_ssize_t i = Py_ReprEnter((PyObject *)self); + if (i != 0) { + return i > 0 ? PyUnicode_FromString("[...]") : NULL; + } + + _PyUnicodeWriter writer; + + _PyUnicodeWriter_Init(&writer); + writer.overallocate = 1; + /* "[" + "1" + ", 2" * (len - 1) + "]" */ + writer.min_length = 1 + 1 + (2 + 1) * (JSArrayProxy_length(self) - 1) + 1; + + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + + if (_PyUnicodeWriter_WriteChar(&writer, '[') < 0) { + goto error; + } + + for (Py_ssize_t index = 0; index < JSArrayProxy_length(self); ++index) { + if (index > 0) { + if (_PyUnicodeWriter_WriteASCIIString(&writer, ", ", 2) < 0) { + goto error; + } + } + + JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + + PyObject *s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); + if (s == NULL) { + goto error; + } + + if (_PyUnicodeWriter_WriteStr(&writer, s) < 0) { + Py_DECREF(s); + goto error; + } + Py_DECREF(s); + } + + writer.overallocate = 0; + if (_PyUnicodeWriter_WriteChar(&writer, ']') < 0) { + goto error; + } + + Py_ReprLeave((PyObject *)self); + return _PyUnicodeWriter_Finish(&writer); + +error: + _PyUnicodeWriter_Dealloc(&writer); + Py_ReprLeave((PyObject *)self); + return NULL; +} + +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_iter(JSArrayProxy *self) { + JSContext *cx = GLOBAL_CX; + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(self->jsObject)); + + // Get **enumerable** own properties + JS::RootedIdVector props(cx); + if (!js::GetPropertyKeys(cx, self->jsObject, JSITER_OWNONLY, &props)) { + return NULL; + } + + // Populate a Python tuple with (propertyKey, value) pairs from the JS object + // Similar to `Object.entries()` + size_t length = props.length(); + PyObject *seq = PyTuple_New(length); + for (size_t i = 0; i < length; i++) { + JS::HandleId id = props[i]; + PyObject *key = idToKey(cx, id); + + JS::RootedValue *jsVal = new JS::RootedValue(cx); + JS_GetPropertyById(cx, self->jsObject, id, jsVal); + PyObject *value = pyTypeFactory(cx, global, jsVal)->getPyObject(); + + PyTuple_SetItem(seq, i, PyTuple_Pack(2, key, value)); + } + + // Convert to a Python iterator + return PyObject_GetIter(seq); +} + +/* + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_concat(JSArrayProxy *self, PyObject *value) { + printf("JSArrayProxy_concat\n"); + + // value must be a list + if (!PyList_Check(value)) { + PyErr_Format(PyExc_TypeError, "can only concatenate list (not \"%.200s\") to list", Py_TYPE(value)->tp_name); + return NULL; + } + + assert((size_t)JSArrayProxy_length(self) + (size_t)Py_SIZE(value) < PY_SSIZE_T_MAX); + + Py_ssize_t size = JSArrayProxy_length(self) + Py_SIZE(value); + if (size == 0) { + return PyList_New(0); + } + + JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); + // jValue is a JSArray since value is a List + JS::Rooted> args(GLOBAL_CX); + args[0].setObject(jValue.toObject()); + JS::RootedValue *jCombinedArray = new JS::RootedValue(GLOBAL_CX); + JS_CallFunctionName(GLOBAL_CX, self->jsObject, "concat", args, jCombinedArray); + + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + return pyTypeFactory(GLOBAL_CX, global, jCombinedArray)->getPyObject(); + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, Py_ssize_t n) { + printf("JSArrayProxy_repeat\n"); + + const Py_ssize_t input_size = JSArrayProxy_length(self); + if (input_size == 0 || n <= 0) { + return PyList_New(0); + } + assert(n > 0); + + if (input_size > PY_SSIZE_T_MAX / n) { + return PyErr_NoMemory(); + } + + JS::RootedObject jCombinedArray = JS::RootedObject(GLOBAL_CX, JS::NewArrayObject(GLOBAL_CX, input_size * n)); + // repeat within new array + // one might think of using copyWithin but in SpiderMonkey it's implemented in JS! + JS::RootedValue elementVal(GLOBAL_CX); + for (Py_ssize_t inputIdx = 0; inputIdx < input_size; inputIdx++) { + JS_GetElement(GLOBAL_CX, self->jsObject, inputIdx, &elementVal); + for (Py_ssize_t repeatIdx = 0; repeatIdx < n; repeatIdx++) { + JS_SetElement(GLOBAL_CX, jCombinedArray, repeatIdx * input_size + inputIdx, elementVal); + } + } + + JS::RootedValue *jCombinedArrayValue = new JS::RootedValue(GLOBAL_CX); + jCombinedArrayValue->setObjectOrNull(jCombinedArray); + + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + return pyTypeFactory(GLOBAL_CX, global, jCombinedArrayValue)->getPyObject(); + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_item(JSArrayProxy *self, Py_ssize_t index) + { + printf("JSArrayProxy_item\n"); + if ((size_t)index >= (size_t)JSArrayProxy_length(self)) { + PyErr_SetObject(PyExc_IndexError, PyUnicode_FromString("list index out of range")); + return NULL; + } + + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + return pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + } + + int JSArrayProxyMethodDefinitions::JSArrayProxy_assign_index(JSArrayProxy *self, Py_ssize_t index, PyObject *value) { + printf("JSArrayProxy_assign_index\n"); + + if ((size_t)index >= (size_t)JSArrayProxy_length(self)) { + PyErr_SetObject(PyExc_IndexError, PyUnicode_FromString("list assignment out of range")); + return -1; + } + + if (value == NULL) { + // TODO + } + + JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); + JS_SetElement(GLOBAL_CX, self->jsObject, index, jValue); + return 0; + } + + int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyObject *element) { + printf("JSArrayProxy_contains\n"); + + Py_ssize_t numElements = JSArrayProxy_length(self); + JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedValue elementVal(GLOBAL_CX); + for (Py_ssize_t index = 0; index < numElements; ++index) { + JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + // THIS looks wrong, we should not be comparing self ???? TODO + PyObject *isEqual = JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(self, pyTypeFactory(GLOBAL_CX, &global, &elementVal)->getPyObject(), Py_EQ); + if (isEqual == NULL) { + return -1; + } else if (Py_IsTrue(isEqual)) { + return 1; + } + } + return 0; + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_concat(JSArrayProxy *self, PyObject *value) { + printf("JSArrayProxy_inplace_concat\n"); + // TODO + return NULL; + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat(JSArrayProxy *self, Py_ssize_t n) { + printf("JSArrayProxy_inplace_repeat\n"); + + Py_ssize_t input_size = JSArrayProxy_length(self); + if (input_size == 0 || n == 1) { + return Py_NewRef(self); + } + + if (n < 1) { + JSArrayProxy_clear(self); + return Py_NewRef(self); + } + + if (input_size > PY_SSIZE_T_MAX / n) { + return PyErr_NoMemory(); + } + + JS::SetArrayLength(GLOBAL_CX, self->jsObject, input_size * n); + + // repeat within self + // one might think of using copyWithin but in SpiderMonkey it's implemented in JS! + JS::RootedValue elementVal(GLOBAL_CX); + for (Py_ssize_t inputIdx = 0; inputIdx < input_size; inputIdx++) { + JS_GetElement(GLOBAL_CX, self->jsObject, inputIdx, &elementVal); + for (Py_ssize_t repeatIdx = 0; repeatIdx < n; repeatIdx++) { + JS_SetElement(GLOBAL_CX, self->jsObject, repeatIdx * input_size + inputIdx, elementVal); + } + } + + return Py_NewRef(self); + } + + int JSArrayProxyMethodDefinitions::JSArrayProxy_clear(JSArrayProxy *self) { + printf("JSArrayProxy_clear\n"); + JS::SetArrayLength(GLOBAL_CX, self->jsObject, 0); + return 0; + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) { + printf("JSArrayProxy_copy\n"); + + JS::Rooted> jArgs(GLOBAL_CX); // TODO needs to be on the stack? + jArgs[0].setInt32(0); + jArgs[1].setInt32(JSArrayProxy_length(self)); + JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); + JS_CallFunctionName(GLOBAL_CX, self->jsObject, "slice", jArgs, jReturnedArray); + + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + return pyTypeFactory(GLOBAL_CX, global, jReturnedArray)->getPyObject(); + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_append(JSArrayProxy *self, PyObject *value) { + printf("JSArrayProxy_append\n"); + + assert(self != NULL && value != NULL); + assert(PyList_Check(self)); + + Py_ssize_t len = JSArrayProxy_length(self); + + // PyObject *inserted = Py_NewRef(value); + JS::SetArrayLength(GLOBAL_CX, self->jsObject, len + 1); + JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); + JS_SetElement(GLOBAL_CX, self->jsObject, len, jValue); + + Py_RETURN_NONE; + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_insert(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs) { + printf("JSArrayProxy_insert\n"); + + PyObject *return_value = NULL; + Py_ssize_t index; + PyObject *object; + + if (!_PyArg_CheckPositional("insert", nargs, 2, 2)) { + return NULL; + } + + { + Py_ssize_t ival = -1; + PyObject *iobj = _PyNumber_Index(args[0]); + if (iobj != NULL) { + ival = PyLong_AsSsize_t(iobj); + Py_DECREF(iobj); + } + if (ival == -1 && PyErr_Occurred()) { + return NULL; + } + index = ival; + } + + object = args[1]; + + JS::Rooted> jArgs(GLOBAL_CX); // TODO needs to be on the heap? + jArgs[0].setInt32(index); + jArgs[1].setInt32(1); + JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, object)); + jArgs[1].setObject(jValue.toObject()); + JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); + JS_CallFunctionName(GLOBAL_CX, self->jsObject, "splice", jArgs, jReturnedArray); + + Py_RETURN_NONE; + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_extend(JSArrayProxy *self, PyObject *iterable) { + printf("JSArrayProxy_extend\n"); + + // Special cases: + // 1) lists and tuples which can use PySequence_Fast ops + // 2) extending self to self requires making a copy first + if (PyList_CheckExact(iterable) || PyTuple_CheckExact(iterable) || (PyObject *)self == iterable) { + iterable = PySequence_Fast(iterable, "argument must be iterable"); + if (!iterable) { + return NULL; + } + + Py_ssize_t n = PySequence_Fast_GET_SIZE(iterable); + if (n == 0) { + /* short circuit when iterable is empty *//* + Py_RETURN_NONE; + } + + Py_ssize_t m = JSArrayProxy_length(self); + // It should not be possible to allocate a list large enough to cause + // an overflow on any relevant platform. + assert(m < PY_SSIZE_T_MAX - n); + JS::SetArrayLength(GLOBAL_CX, self->jsObject, m + n); + + // note that we may still have self == iterable here for the + // situation a.extend(a), but the following code works + // in that case too. Just make sure to resize self + // before calling PySequence_Fast_ITEMS. + // + // populate the end of self with iterable's items. + PyObject **src = PySequence_Fast_ITEMS(iterable); + for (Py_ssize_t i = 0; i < n; i++) { + PyObject *o = src[i]; + // dest[i] = Py_NewRef(o); TODO NewRef needed? + JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, o)); + JS_SetElement(GLOBAL_CX, self->jsObject, m + i, jValue); + } + + Py_DECREF(iterable); + Py_RETURN_NONE; + } + else { + PyObject *it = PyObject_GetIter(iterable); + if (it == NULL) { + return NULL; + } + PyObject *(*iternext)(PyObject *) = *Py_TYPE(it)->tp_iternext; + + + Py_ssize_t len = JSArrayProxy_length(self); + + /* Run iterator to exhaustion. *//* + for (;; ) { + PyObject *item = iternext(it); + if (item == NULL) { + if (PyErr_Occurred()) { + if (PyErr_ExceptionMatches(PyExc_StopIteration)) + PyErr_Clear(); + else + goto error; + } + break; + } + + JS::SetArrayLength(GLOBAL_CX, self->jsObject, len + 1); + JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, item)); + JS_SetElement(GLOBAL_CX, self->jsObject, len, jValue); + len++; + } + + Py_DECREF(it); + Py_RETURN_NONE; + + error: + Py_DECREF(it); + return NULL; + } + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_pop(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs) { + printf("JSArrayProxy_pop\n"); + + PyObject *return_value = NULL; + Py_ssize_t index = -1; + + if (!_PyArg_CheckPositional("pop", nargs, 0, 1)) { + return NULL; + } + + if (nargs >= 1) { + Py_ssize_t ival = -1; + PyObject *iobj = _PyNumber_Index(args[0]); + if (iobj != NULL) { + ival = PyLong_AsSsize_t(iobj); + Py_DECREF(iobj); + } + if (ival == -1 && PyErr_Occurred()) { + return return_value; + } + index = ival; + } + + JS::Rooted> jArgs(GLOBAL_CX); // TODO needs to be on the heap? + jArgs[0].setInt32(index); + jArgs[1].setInt32(1); + JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); + JS_CallFunctionName(GLOBAL_CX, self->jsObject, "splice", jArgs, jReturnedArray); + + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + return pyTypeFactory(GLOBAL_CX, global, jReturnedArray)->getPyObject(); + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self, PyObject *value) { + printf("JSArrayProxy_remove\n"); + + JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedValue elementVal(GLOBAL_CX); + for (Py_ssize_t index = 0; index < JSArrayProxy_length(self); index++) { + JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + PyObject *obj = pyTypeFactory(GLOBAL_CX, &global, &elementVal)->getPyObject(); + Py_INCREF(obj); + // int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); + // TODO + Py_DECREF(obj); + + JS::Rooted> jArgs(GLOBAL_CX); // TODO needs to be on the heap? + jArgs[0].setInt32(index); + jArgs[1].setInt32(1); + JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); + JS_CallFunctionName(GLOBAL_CX, self->jsObject, "splice", jArgs, jReturnedArray); + Py_RETURN_NONE; + } + PyErr_Format(PyExc_ValueError, "%R is not in list", value); + return NULL; + + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_index(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs) { + printf("JSArrayProxy_index\n"); + + PyObject *value; + Py_ssize_t start = 0; + Py_ssize_t stop = PY_SSIZE_T_MAX; + + if (!_PyArg_CheckPositional("index", nargs, 1, 3)) { + return NULL; + } + value = args[0]; + if (nargs < 2) { + goto skip_optional; + } + if (!_PyEval_SliceIndexNotNone(args[1], &start)) { + return NULL; + } + if (nargs < 3) { + goto skip_optional; + } + if (!_PyEval_SliceIndexNotNone(args[2], &stop)) { + return NULL; + } + + skip_optional: + if (start < 0) { + start += JSArrayProxy_length(self); + if (start < 0) + start = 0; + } + if (stop < 0) { + stop += JSArrayProxy_length(self); + if (stop < 0) + stop = 0; + } + + Py_ssize_t length = JSArrayProxy_length(self); + JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedValue elementVal(GLOBAL_CX); + for (Py_ssize_t index = start; index < stop && index < length; index++) { + JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + PyObject *obj = pyTypeFactory(GLOBAL_CX, &global, &elementVal)->getPyObject(); + Py_INCREF(obj); + // TODO + int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); + Py_DECREF(obj); + if (cmp > 0) + return PyLong_FromSsize_t(index); + else if (cmp < 0) + return NULL; + } + PyErr_Format(PyExc_ValueError, "%R is not in list", value); + return NULL; + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_count(JSArrayProxy *self, PyObject *value) { + printf("JSArrayProxy_count\n"); + + Py_ssize_t count = 0; + + Py_ssize_t length = JSArrayProxy_length(self); + JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedValue elementVal(GLOBAL_CX); + for (Py_ssize_t index = 0; index < length; index++) { + JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + PyObject *obj = pyTypeFactory(GLOBAL_CX, &global, &elementVal)->getPyObject(); + // PyObject *obj = self->ob_item[i]; + if (obj == value) { + count++; + continue; + } + Py_INCREF(obj); + // TODO + int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); + Py_DECREF(obj); + if (cmp > 0) + count++; + else if (cmp < 0) + return NULL; + } + return PyLong_FromSsize_t(count); + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_reverse(JSArrayProxy *self) { + printf("JSArrayProxy_reverse\n"); + + if (JSArrayProxy_length(self) > 1) { + JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); + JS_CallFunctionName(GLOBAL_CX, self->jsObject, "reverse", JS::HandleValueArray::empty(), jReturnedArray); + } + + Py_RETURN_NONE; + } + + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + printf("JSArrayProxy_sort\n"); + + PyObject *return_value = NULL; + #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) + + #define NUM_KEYWORDS 2 + static struct { + PyGC_Head _this_is_not_used; + PyObject_VAR_HEAD + PyObject *ob_item[NUM_KEYWORDS]; + } _kwtuple = { + .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) + .ob_item = {&_Py_ID(key), &_Py_ID(reverse), }, + }; + #undef NUM_KEYWORDS + #define KWTUPLE (&_kwtuple.ob_base.ob_base) + + #else // !Py_BUILD_CORE + # define KWTUPLE NULL + #endif // !Py_BUILD_CORE + + static const char *const _keywords[] = {"key", "reverse", NULL}; + static _PyArg_Parser _parser = { + .keywords = _keywords, + .fname = "sort", + .kwtuple = KWTUPLE, + }; + #undef KWTUPLE + + PyObject *argsbuf[2]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; + PyObject *keyfunc = Py_None; + int reverse = 0; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf); + if (!args) { + goto exit; + } + if (!noptargs) { + goto skip_optional_kwonly; + } + if (args[0]) { + keyfunc = args[0]; + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + reverse = PyObject_IsTrue(args[1]); + if (reverse < 0) { + goto exit; + } + + skip_optional_kwonly: + if (JSArrayProxy_length(self) > 1) { + JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); + if (keyfunc != Py_None) { + JS::Rooted> jArgs(GLOBAL_CX); // TODO needs to be on the heap? + JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, keyfunc)); + jArgs[0].setObject(jValue.toObject()); + JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, jReturnedArray); + } else { + JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); + JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", JS::HandleValueArray::empty(), jReturnedArray); + } + + if (reverse) { + JS_CallFunctionName(GLOBAL_CX, self->jsObject, "reverse", JS::HandleValueArray::empty(), jReturnedArray); + } + } + + Py_RETURN_NONE; + + exit: + return return_value; + } + */ + diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index f2bb30bf..1b647047 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -40,6 +40,8 @@ bool keyToId(PyObject *key, JS::MutableHandleId idp) { void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) { + printf("JSObjectProxy_dealloc\n"); + // TODO (Caleb Aikens): intentional override of PyDict_Type's tp_dealloc. Probably results in leaking dict memory self->jsObject.set(nullptr); return; @@ -47,13 +49,16 @@ void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { - PyObject *self = PyDict_Type.tp_new(subtype, args, kwds); + printf("JSObjectProxy_new\n"); + PyObject *self = PyDict_Type.tp_new(subtype, args, kwds); // SUPER CALL ((JSObjectProxy *)self)->jsObject = JS::RootedObject(GLOBAL_CX, nullptr); return self; } int JSObjectProxyMethodDefinitions::JSObjectProxy_init(JSObjectProxy *self, PyObject *args, PyObject *kwds) { + printf("JSObjectProxy_init\n"); + // make fresh JSObject for proxy self->jsObject.set(JS_NewPlainObject(GLOBAL_CX)); return 0; @@ -61,6 +66,8 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_init(JSObjectProxy *self, PyOb Py_ssize_t JSObjectProxyMethodDefinitions::JSObjectProxy_length(JSObjectProxy *self) { + printf("JSObjectProxy_length\n"); + JS::RootedIdVector props(GLOBAL_CX); if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY | JSITER_HIDDEN, &props)) { @@ -73,6 +80,8 @@ Py_ssize_t JSObjectProxyMethodDefinitions::JSObjectProxy_length(JSObjectProxy *s PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, PyObject *key) { + printf("JSObjectProxy_get\n"); + JS::RootedId id(GLOBAL_CX); if (!keyToId(key, &id)) { // TODO (Caleb Aikens): raise exception here @@ -90,19 +99,23 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, PyObject *key) { + printf("JSObjectProxy_contains\n"); + JS::RootedId id(GLOBAL_CX); if (!keyToId(key, &id)) { // TODO (Caleb Aikens): raise exception here return -1; // key is not a str or int } - JS::RootedValue value(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); - return value.isUndefined() ? 0 : 1; + JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); + return value->isUndefined() ? 0 : 1; } int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, PyObject *key, PyObject *value) { + printf("JSObjectProxy_assign\n"); + JS::RootedId id(GLOBAL_CX); if (!keyToId(key, &id)) { // invalid key // TODO (Caleb Aikens): raise exception here @@ -122,6 +135,7 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, Py PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare(JSObjectProxy *self, PyObject *other, int op) { + printf("JSObjectProxy_rich_compare\n"); if (op != Py_EQ && op != Py_NE) { Py_RETURN_NOTIMPLEMENTED; @@ -208,6 +222,8 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_iter(JSObjectProxy *self) { + printf("JSObjectProxy_iter\n"); + JSContext *cx = GLOBAL_CX; JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(self->jsObject)); @@ -237,6 +253,8 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_iter(JSObjectProxy *self } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self) { + printf("JSObjectProxy_repr\n"); + // Detect cyclic objects PyObject *objPtr = PyLong_FromVoidPtr(self->jsObject.get()); // For `Py_ReprEnter`, we must get a same PyObject when visiting the same JSObject. diff --git a/src/ListType.cc b/src/ListType.cc index d03545b5..53e65f28 100644 --- a/src/ListType.cc +++ b/src/ListType.cc @@ -1,34 +1,25 @@ #include "include/ListType.hh" +#include "include/modules/pythonmonkey/pythonmonkey.hh" +#include "include/JSArrayProxy.hh" #include "include/PyType.hh" #include "include/pyTypeFactory.hh" -#include - -#include -#include +#include +#include +#include -ListType::ListType() : PyType(PyList_New(0)) {} - -ListType::ListType(PyObject *object) : PyType(object) {} -ListType::ListType(JSContext *cx, JS::HandleObject arrayObj) { - uint32_t length; - JS::GetArrayLength(cx, arrayObj, &length); - PyObject *object = PyList_New((Py_ssize_t)length); - Py_XINCREF(object); - this->pyObject = object; - JS::RootedValue rval(cx); - JS::RootedObject arrayRootedObj(cx, arrayObj); - for (uint32_t index = 0; index < length; index++) { - JS_GetElement(cx, arrayObj, index, &rval); +ListType::ListType() : PyType(PyList_New(0)) {} - PyType *pyType = pyTypeFactory(cx, &arrayRootedObj, &rval); +ListType::ListType(PyObject *object) : PyType(object) {} - PyList_SetItem(this->pyObject, index, pyType->getPyObject()); - } +ListType::ListType(JSContext *cx, JS::HandleObject jsArrayObj) { + JSArrayProxy *proxy = (JSArrayProxy *)PyObject_CallObject((PyObject *)&JSArrayProxyType, NULL); + proxy->jsObject.set(jsArrayObj); + this->pyObject = (PyObject *)proxy; } \ No newline at end of file diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index c6fa7c7d..b9fdc0d6 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -175,3 +175,92 @@ bool PyBaseProxyHandler::isExtensible(JSContext *cx, JS::HandleObject proxy, *extensible = false; return true; } + +const char PyListProxyHandler::family = 0; + +bool PyListProxyHandler::getOwnPropertyDescriptor( + JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::MutableHandle> desc +) const { + + // We're trying to get the "length" property + bool isLengthProperty; + if (id.isString() && JS_StringEqualsLiteral(cx, id.toString(), "length", &isLengthProperty) && isLengthProperty) { + // proxy.length = len(pyObject) + desc.set(mozilla::Some( + JS::PropertyDescriptor::Data( + JS::Int32Value(PySequence_Size(pyObject)) + ) + )); + return true; + } + + // We're trying to get an item + Py_ssize_t index; + PyObject *item; + if (idToIndex(cx, id, &index) && (item = PySequence_GetItem(pyObject, index))) { + desc.set(mozilla::Some( + JS::PropertyDescriptor::Data( + jsTypeFactory(cx, item), + {JS::PropertyAttribute::Writable, JS::PropertyAttribute::Enumerable} + ) + )); + } else { // item not found in list, or not an int-like property key + desc.set(mozilla::Nothing()); + } + return true; +} + +bool PyListProxyHandler::defineProperty( + JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::Handle desc, JS::ObjectOpResult &result +) const { + Py_ssize_t index; + if (!idToIndex(cx, id, &index)) { // not an int-like property key + return result.failBadIndex(); + } + + if (desc.isAccessorDescriptor()) { // containing getter/setter + return result.failNotDataDescriptor(); + } + if (!desc.hasValue()) { + return result.failInvalidDescriptor(); + } + + // FIXME (Tom Tang): memory leak + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + JS::RootedValue *itemV = new JS::RootedValue(cx, desc.value()); + PyObject *item = pyTypeFactory(cx, global, itemV)->getPyObject(); + if (PySequence_SetItem(pyObject, index, item) < 0) { + return result.failBadIndex(); + } + return result.succeed(); +} + +bool PyListProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { + // Modified from https://hg.mozilla.org/releases/mozilla-esr102/file/3b574e1/dom/base/RemoteOuterWindowProxy.cpp#l137 + int32_t length = PySequence_Size(pyObject); + if (!props.reserve(length + 1)) { + return false; + } + // item indexes + for (int32_t i = 0; i < length; ++i) { + props.infallibleAppend(JS::PropertyKey::Int(i)); + } + // the "length" property + props.infallibleAppend(JS::PropertyKey::NonIntAtom(JS_AtomizeString(cx, "length"))); + return true; +} + +bool PyListProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const { + Py_ssize_t index; + if (!idToIndex(cx, id, &index)) { + return result.failBadIndex(); // report failure + } + + // Set to undefined instead of actually deleting it + if (PySequence_SetItem(pyObject, index, Py_None) < 0) { + return result.failCantDelete(); // report failure + } + return result.succeed(); // report success +} diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 22596f82..fa631460 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -15,6 +15,7 @@ #include "include/PyType.hh" #include "include/FuncType.hh" #include "include/JSObjectProxy.hh" +#include "include/JSArrayProxy.hh" #include "include/PyProxyHandler.hh" #include "include/pyTypeFactory.hh" #include "include/StrType.hh" @@ -163,26 +164,18 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { else if (PyObject_TypeCheck(object, &JSObjectProxyType)) { returnType.setObject(*((JSObjectProxy *)object)->jsObject); } - else if (PyDict_Check(object)) { - JS::RootedValue v(cx); // TODO inline - JSObject *proxy = js::NewProxyObject(cx, new PyProxyHandler(object), v, NULL); - returnType.setObject(*proxy); + else if (PyObject_TypeCheck(object, &JSArrayProxyType)) { + returnType.setObject(*((JSArrayProxy *)object)->jsObject); } - else if (PyList_Check(object)) { - JS::RootedValueVector jsItemVector(cx); - Py_ssize_t listSize = PyList_Size(object); - for (Py_ssize_t index = 0; index < listSize; index++) { - JS::Value jsValue = jsTypeFactorySafe(cx, PyList_GetItem(object, index)); // TODO use version with no error checking? - if (jsValue.isNull()) { - returnType.setNull(); - return returnType; - } - jsItemVector.append(jsValue); + else if (PyDict_Check(object) || PyList_Check(object)) { + JS::RootedValue v(cx); + JSObject *proxy; + if (PyList_Check(object)) { + proxy = js::NewProxyObject(cx, new PyListProxyHandler(object), v, NULL); + } else { + proxy = js::NewProxyObject(cx, new PyProxyHandler(object), v, NULL); } - - JS::HandleValueArray jsValueArray(jsItemVector); - JSObject *array = JS::NewArrayObject(cx, jsValueArray); - returnType.setObject(*array); + returnType.setObject(*proxy); } else if (object == Py_None) { returnType.setUndefined(); diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 3b85ec2f..90515399 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -17,6 +17,7 @@ #include "include/DateType.hh" #include "include/FloatType.hh" #include "include/FuncType.hh" +#include "include/JSArrayProxy.hh" #include "include/JSObjectProxy.hh" #include "include/PyType.hh" #include "include/pyTypeFactory.hh" @@ -88,6 +89,27 @@ PyTypeObject JSObjectProxyType = { .tp_new = JSObjectProxyMethodDefinitions::JSObjectProxy_new, }; +PyTypeObject JSArrayProxyType = { + .ob_base = PyVarObject_HEAD_INIT(NULL, 0) + .tp_name = "pythonmonkey.JSArrayProxy", + .tp_basicsize = sizeof(JSArrayProxy), + .tp_itemsize = 0, + .tp_dealloc = (destructor)JSArrayProxyMethodDefinitions::JSArrayProxy_dealloc, + .tp_repr = (reprfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_repr, + .tp_as_sequence = &JSArrayProxy_sequence_methods, + .tp_as_mapping = &JSArrayProxy_mapping_methods, + .tp_getattro = (getattrofunc)JSArrayProxyMethodDefinitions::JSArrayProxy_get, + .tp_setattro = (setattrofunc)JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DICT_SUBCLASS, + .tp_doc = PyDoc_STR("Javascript Array proxy list"), + .tp_richcompare = (richcmpfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare, + .tp_iter = (getiterfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_iter, // TODO review + .tp_methods = JSArrayProxy_methods, + .tp_base = &PyList_Type, + .tp_init = (initproc)JSArrayProxyMethodDefinitions::JSArrayProxy_init, + .tp_new = JSArrayProxyMethodDefinitions::JSArrayProxy_new, +}; + static void cleanup() { delete autoRealm; delete global; @@ -390,6 +412,8 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; if (PyType_Ready(&JSObjectProxyType) < 0) return NULL; + if (PyType_Ready(&JSArrayProxyType) < 0) + return NULL; pyModule = PyModule_Create(&pythonmonkey); if (pyModule == NULL) @@ -415,6 +439,13 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; } + Py_INCREF(&JSArrayProxyType); + if (PyModule_AddObject(pyModule, "JSArrayProxy", (PyObject *)&JSArrayProxyType) < 0) { + Py_DECREF(&JSArrayProxyType); + Py_DECREF(pyModule); + return NULL; + } + if (PyModule_AddObject(pyModule, "SpiderMonkeyError", SpiderMonkeyError)) { Py_DECREF(pyModule); return NULL; diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index f21390e6..626003d9 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -100,6 +100,9 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted if (js::GetProxyHandler(obj)->family() == &PyProxyHandler::family) { // this is one of our proxies for python dicts return new DictType(((PyProxyHandler *)js::GetProxyHandler(obj))->pyObject); } + if (js::GetProxyHandler(obj)->family() == &PyListProxyHandler::family) { // this is one of our proxies for python lists + return new ListType(((PyListProxyHandler *)js::GetProxyHandler(obj))->pyObject); + } } js::ESClass cls; JS::GetBuiltinClass(cx, obj, &cls); @@ -197,7 +200,8 @@ PyObject *callJSFunc(PyObject *jsCxThisFuncTuple, PyObject *args) { JS::RootedValue *jsFunc = (JS::RootedValue *)PyLong_AsVoidPtr(PyTuple_GetItem(jsCxThisFuncTuple, 2)); JS::RootedVector jsArgsVector(cx); - for (size_t i = 0; i < PyTuple_Size(args); i++) { + Py_ssize_t tupleSize = PyTuple_Size(args); + for (size_t i = 0; i < tupleSize; i++) { JS::Value jsValue = jsTypeFactory(cx, PyTuple_GetItem(args, i)); if (PyErr_Occurred()) { // Check if an exception has already been set in the flow of control return NULL; // Fail-fast diff --git a/tests/python/test_dicts_lists.py b/tests/python/test_dicts.py similarity index 100% rename from tests/python/test_dicts_lists.py rename to tests/python/test_dicts.py diff --git a/tests/python/test_list_array.py b/tests/python/test_list_array.py index 40ed3afc..4def6276 100644 --- a/tests/python/test_list_array.py +++ b/tests/python/test_list_array.py @@ -1,10 +1,5 @@ import pythonmonkey as pm -def test_eval_list_is_array(): - items = [1, 2, 3] - isArray = pm.eval('Array.isArray')(items) - assert isArray == True - def test_eval_array_is_list(): pythonList = pm.eval('[]') assert isinstance(pythonList, list) @@ -12,4 +7,4 @@ def test_eval_array_is_list(): # extra nice but not necessary def test_eval_array_is_list_type_string(): pythonListTypeString = str(type(pm.eval('[]'))) - assert pythonListTypeString == "" + assert pythonListTypeString == "" diff --git a/tests/python/test_list_methods.py b/tests/python/test_list_methods.py new file mode 100644 index 00000000..41869b55 --- /dev/null +++ b/tests/python/test_list_methods.py @@ -0,0 +1 @@ +import pythonmonkey as pm \ No newline at end of file diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py new file mode 100644 index 00000000..54adbcb2 --- /dev/null +++ b/tests/python/test_lists.py @@ -0,0 +1,41 @@ +import pythonmonkey as pm + +def test_eval_lists(): + d = [1] + proxy_d = pm.eval("(list) => { return list; }")(d) + assert d is proxy_d + +def test_equal_lists_left_literal_right(): + pyArray = pm.eval("Array(1,2)") + assert pyArray == [1,2] + +def test_equal_lists_right_literal_left(): + pyArray = pm.eval("Array(1,2)") + assert [1,2] == pyArray + +def test_equal_lists_left_list_right(): + pyArray = pm.eval("Array(1,2)") + b = [1,2] + assert pyArray == b + +def test_equal_lists_right_literal_left(): + pyArray = pm.eval("Array(1,2)") + b = [1,2] + assert b == pyArray + +def test_not_equal_lists_left_literal_right(): + pyArray = pm.eval("Array(1,2)") + assert pyArray != [1,3] + +def test_smaller_lists_left_literal_right(): + pyArray = pm.eval("Array(1,2)") + assert pyArray < [1,3] + +def test_equal_sublist(): + pyArray = pm.eval("Array(1,2,[3,4])") + assert pyArray == [1,2,[3,4]] + +def test_not_equal_sublist_right_not_sublist(): + pyArray = pm.eval("Array(1,2,[3,4])") + assert pyArray != [1,2,3,4] + From 8d180af99d065ba7a7084e9ee4a86236fd197f69 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 1 Dec 2023 16:52:31 -0500 Subject: [PATCH 0092/1086] comment formatting --- include/JSObjectProxy.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index ecfdd611..3357803b 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -130,7 +130,7 @@ public: */ static PyObject *JSObjectProxy_repr(JSObjectProxy *self); - /* + /** * @brief Set union operation * * @param self - The JSObjectProxy From 4eecd9169e6590e03832bcc6930c5e60d5e0028a Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Fri, 1 Dec 2023 18:01:36 -0500 Subject: [PATCH 0093/1086] Update test_dict_methods.py cleanup empty lines --- tests/python/test_dict_methods.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/python/test_dict_methods.py b/tests/python/test_dict_methods.py index b3ae6877..adbf5fdb 100644 --- a/tests/python/test_dict_methods.py +++ b/tests/python/test_dict_methods.py @@ -113,7 +113,3 @@ def test_copy(): assert likes == {"color": "blue", "fruit": "apple", "pet": "dog"} assert otherLikes == {"color": "yellow", "fruit": "apple", "pet": "dog"} - - - - From 26e5e30c72e6f1b80dea905701fcb5fc3a8159ca Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 5 Dec 2023 11:47:55 -0500 Subject: [PATCH 0094/1086] improved tests for new dict methods --- tests/python/test_dict_methods.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/python/test_dict_methods.py b/tests/python/test_dict_methods.py index b3ae6877..b7c5e11a 100644 --- a/tests/python/test_dict_methods.py +++ b/tests/python/test_dict_methods.py @@ -39,11 +39,13 @@ def test_setdefault_found_ignore_default(): def test_setdefault_not_found_no_default(): likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') foundKey = likes.setdefault('colo') + assert likes['colo'] == None assert foundKey == None def test_setdefault_not_found_with_default(): likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') foundKey = likes.setdefault('colo', 'yello') + assert likes['colo'] == 'yello' assert foundKey == 'yello' def test_setdefault_no_params(): @@ -59,6 +61,7 @@ def test_setdefault_no_params(): def test_pop_found(): likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') foundKey = likes.pop('color') + assert likes['color'] == None assert foundKey == 'blue' def test_pop_not_found(): @@ -90,6 +93,15 @@ def test_pop_not_found_with_default(): foundKey = likes.pop('colo', 'unameit') assert foundKey == 'unameit' +def test_pop_not_found_no_default(): + likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + try: + likes.pop('colo') + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "'colo'" + def test_pop_no_params(): likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') try: From 53fd1b01c5ac95639bb640c52cba9d5c9eec8fd5 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Fri, 8 Dec 2023 16:08:44 -0500 Subject: [PATCH 0095/1086] Remaining JS Array <-> List conversion operators and methods implemented, JSArrayProxyType introduced --- cmake/modules/FindSpiderMonkey.cmake | 1 + include/JSArrayProxy.hh | 198 ++- .../builtin_modules/internal-binding.d.ts | 2 +- src/JSArrayProxy.cc | 1205 +++++++++++------ src/JSObjectProxy.cc | 28 +- src/ListType.cc | 8 +- src/modules/pythonmonkey/pythonmonkey.cc | 5 +- tests/python/test_lists.py | 930 ++++++++++++- 8 files changed, 1874 insertions(+), 503 deletions(-) diff --git a/cmake/modules/FindSpiderMonkey.cmake b/cmake/modules/FindSpiderMonkey.cmake index bd9f7b93..0db4d2dd 100644 --- a/cmake/modules/FindSpiderMonkey.cmake +++ b/cmake/modules/FindSpiderMonkey.cmake @@ -40,6 +40,7 @@ endif() set(SPIDERMONKEY_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/_spidermonkey_install" "${CMAKE_CURRENT_SOURCE_DIR}/_spidermonkey_install/lib" + "${CMAKE_CURRENT_SOURCE_DIR}/_spidermonkey_install/include/mozjs-115" ${SPIDERMONKEY_ROOT} $ENV{SPIDERMONKEY_ROOT} ~/Library/Frameworks diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh index 1444023b..b6a9fc2d 100644 --- a/include/JSArrayProxy.hh +++ b/include/JSArrayProxy.hh @@ -14,7 +14,6 @@ #include -#include /** * @brief The typedef for the backing store that will be used by JSArrayProxy objects. All it contains is a pointer to the JSObject @@ -67,7 +66,7 @@ public: static Py_ssize_t JSArrayProxy_length(JSArrayProxy *self); /** - * @brief Getter method (.mp_subscript), returns a value from the JSArrayProxy given a key, used by several built-in python methods as well as the [] operator + * @brief returns a value from the JSArrayProxy given a key, used by several built-in python methods as well as the [] operator * * @param self - The JSArrayProxy * @param key - The key for the value in the JSArrayProxy @@ -76,6 +75,15 @@ public: static PyObject *JSArrayProxy_get(JSArrayProxy *self, PyObject *key); +/** + * @brief Getter method (.mp_subscript), returns a value from the JSArrayProxy given a key, used by several built-in python methods as well as the [] operator + * + * @param self - The JSArrayProxy + * @param key - The key for the value in the JSArrayProxy + * @return PyObject* NULL on exception, the corresponding value otherwise + */ + static PyObject *JSArrayProxy_get_subscript(JSArrayProxy *self, PyObject *key); + /** * @brief Assign method (.mp_ass_subscript), assigns a key-value pair if value is non-NULL, or deletes a key-value pair if value is NULL * @@ -105,16 +113,6 @@ public: */ static PyObject *JSArrayProxy_richcompare(JSArrayProxy *self, PyObject *other, int op); - /** - * @brief Helper function for JSArrayProxy_richcompare - * - * @param self - The PyObject on the left side of the operator (guaranteed to be a JSArrayProxy *) - * @param other - The PyObject on the right side of the operator - * @param visited - * @return bool - Whether the compared objects are equal or not - */ - static bool JSArrayProxy_richcompare_helper(JSArrayProxy *self, PyObject *other, std::unordered_map &visited); - /** * @brief Return an iterator object to make JSArrayProxy iterable, emitting (key, value) tuples * @@ -138,7 +136,7 @@ public: * @param value - The value to be concatenated * @return PyObject* NULL on exception, the corresponding new value otherwise */ - // static PyObject *JSArrayProxy_concat(JSArrayProxy *self, PyObject *value); + static PyObject *JSArrayProxy_concat(JSArrayProxy *self, PyObject *value); /** * @brief repeat method (.sq_repeat) @@ -147,7 +145,7 @@ public: * @param n The number of times to repeat * @return PyObject* NULL on exception, the corresponding new value otherwise */ -// static PyObject *JSArrayProxy_repeat(JSArrayProxy *self, Py_ssize_t n); + static PyObject *JSArrayProxy_repeat(JSArrayProxy *self, Py_ssize_t n); /** * @brief Getter method (.sq_item), returns a value from the JSArrayProxy given an index, used by several built-in python methods as well as the [] operator @@ -175,7 +173,7 @@ public: * @param element - The element in the JSArrayProxy * @return int 1 if element is in List, 0 if not, and -1 on error */ - // static int JSArrayProxy_contains(JSArrayProxy *self, PyObject *element); + static int JSArrayProxy_contains(JSArrayProxy *self, PyObject *element); /** * @brief inplace_concat method (.sq_inplace_concat), concatenates @@ -184,7 +182,7 @@ public: * @param value - The value to be concatenated * @return PyObject* NULL on exception, the corresponding new value otherwise */ - // static PyObject *JSArrayProxy_inplace_concat(JSArrayProxy *self, PyObject *value); + static PyObject *JSArrayProxy_inplace_concat(JSArrayProxy *self, PyObject *value); /** * @brief inplace_repeat method (.sq_inplace_repeat) @@ -193,7 +191,7 @@ public: * @param n The number of times to repeat * @return PyObject* NULL on exception, the corresponding new value otherwise */ - // static PyObject *JSArrayProxy_inplace_repeat(JSArrayProxy *self, Py_ssize_t n); + static PyObject *JSArrayProxy_inplace_repeat(JSArrayProxy *self, Py_ssize_t n); /** * @brief clear method (.tp_clear) @@ -201,7 +199,23 @@ public: * @param self - The JSArrayProxy * @return 0 on success */ - // static int JSArrayProxy_clear(JSArrayProxy *self); + static PyObject *JSArrayProxy_clear(JSArrayProxy *self); + + /** + * @brief .tp_clear method + * + * @param self - The JSArrayProxy + * @return 0 on success + */ + static int JSArrayProxy_clear_slot(JSArrayProxy *self); + + /** + * @brief .tp_traverse method + * + * @param self - The JSArrayProxy + * @return 0 on success + */ + static int JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg); /** * @brief copy method @@ -209,8 +223,7 @@ public: * @param self - The JSArrayProxy * @return a shallow copy of the list */ - // static PyObject *JSArrayProxy_copy(JSArrayProxy *self); - + static PyObject *JSArrayProxy_copy(JSArrayProxy *self); /** * @brief append method @@ -219,7 +232,7 @@ public: * @param value - The value to be appended * @return None */ - // static PyObject *JSArrayProxy_append(JSArrayProxy *self, PyObject *value); + static PyObject *JSArrayProxy_append(JSArrayProxy *self, PyObject *value); /** * @brief insert method @@ -227,7 +240,7 @@ public: * @param self - The JSArrayProxy * @return PyObject* NULL on exception, the corresponding new value otherwise */ - // static PyObject *JSArrayProxy_insert(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs); + static PyObject *JSArrayProxy_insert(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs); /** * @brief extend method @@ -236,7 +249,7 @@ public: * @param value - The value to be appended * @return None */ - // static PyObject *JSArrayProxy_extend(JSArrayProxy *self, PyObject *iterable); + static PyObject *JSArrayProxy_extend(JSArrayProxy *self, PyObject *iterable); /** * @brief pop method @@ -244,8 +257,7 @@ public: * @param self - The JSArrayProxy * @return PyObject* NULL on exception, the corresponding new value otherwise */ - // static PyObject *JSArrayProxy_pop(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs); - + static PyObject *JSArrayProxy_pop(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs); /** * @brief remove method Remove first occurrence of value @@ -254,7 +266,7 @@ public: * @param value - The value to be appended * @return PyObject* NULL on exception, the corresponding new value otherwise */ - // static PyObject *JSArrayProxy_remove(JSArrayProxy *self, PyObject *value); + static PyObject *JSArrayProxy_remove(JSArrayProxy *self, PyObject *value); /** * @brief index method @@ -262,15 +274,16 @@ public: * @param self - The JSArrayProxy * @return PyObject* NULL on exception, the corresponding new value otherwise */ - // static PyObject *JSArrayProxy_index(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs); + static PyObject *JSArrayProxy_index(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs); /** * @brief count method Remove first occurrence of value * * @param self - The JSArrayProxy + * @param value - The value to be appended * @return PyObject* NULL on exception, the corresponding new value otherwise */ - // static PyObject *JSArrayProxy_count(JSArrayProxy *self, PyObject *value); + static PyObject *JSArrayProxy_count(JSArrayProxy *self, PyObject *value); /** * @brief reverse method Reverse list in place @@ -278,8 +291,7 @@ public: * @param self - The JSArrayProxy * @return PyObject* NULL on exception, the corresponding new value otherwise */ - // static PyObject *JSArrayProxy_reverse(JSArrayProxy *self); - + static PyObject *JSArrayProxy_reverse(JSArrayProxy *self); /** * @brief sort method sort in place @@ -288,7 +300,7 @@ public: * @param value - The value to be appended * @return PyObject* NULL on exception, the corresponding new value otherwise */ - // static PyObject *JSArrayProxy_sort(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); + static PyObject *JSArrayProxy_sort(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); }; @@ -298,7 +310,7 @@ public: */ static PyMappingMethods JSArrayProxy_mapping_methods = { .mp_length = (lenfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_length, - .mp_subscript = (binaryfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_get, + .mp_subscript = (binaryfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript, .mp_ass_subscript = (objobjargproc)JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key }; @@ -308,33 +320,115 @@ static PyMappingMethods JSArrayProxy_mapping_methods = { */ static PySequenceMethods JSArrayProxy_sequence_methods = { .sq_length = (lenfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_length, - /*.sq_concat = (binaryfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_concat, - .sq_repeat = (ssizeargfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_repeat, - .sq_item = (ssizeargfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_item, - .sq_ass_item = (ssizeobjargproc)JSArrayProxyMethodDefinitions::JSArrayProxy_assign_index, - .sq_contains = (objobjproc)JSArrayProxyMethodDefinitions::JSArrayProxy_contains, - .sq_inplace_concat = (binaryfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_concat, - .sq_inplace_repeat = (ssizeargfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat,*/ + .sq_concat = (binaryfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_concat, + .sq_repeat = (ssizeargfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_repeat, + // .sq_item = (ssizeargfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_item, TODO how to exercise? + // .sq_ass_item = (ssizeobjargproc)JSArrayProxyMethodDefinitions::JSArrayProxy_assign_index, TODO how to exercise? + .sq_contains = (objobjproc)JSArrayProxyMethodDefinitions::JSArrayProxy_contains, + .sq_inplace_concat = (binaryfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_concat, + .sq_inplace_repeat = (ssizeargfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat }; + +PyDoc_STRVAR(py_list_clear__doc__, + "clear($self, /)\n" + "--\n" + "\n" + "Remove all items from list."); + +PyDoc_STRVAR(list_copy__doc__, + "copy($self, /)\n" + "--\n" + "\n" + "Return a shallow copy of the list."); + +PyDoc_STRVAR(list_append__doc__, + "append($self, object, /)\n" + "--\n" + "\n" + "Append object to the end of the list."); + +PyDoc_STRVAR(list_insert__doc__, + "insert($self, index, object, /)\n" + "--\n" + "\n" + "Insert object before index."); + +PyDoc_STRVAR(py_list_extend__doc__, + "extend($self, iterable, /)\n" + "--\n" + "\n" + "Extend list by appending elements from the iterable."); + +PyDoc_STRVAR(list_pop__doc__, + "pop($self, index=-1, /)\n" + "--\n" + "\n" + "Remove and return item at index (default last).\n" + "\n" + "Raises IndexError if list is empty or index is out of range."); + +PyDoc_STRVAR(list_remove__doc__, + "remove($self, value, /)\n" + "--\n" + "\n" + "Remove first occurrence of value.\n" + "\n" + "Raises ValueError if the value is not present."); + +PyDoc_STRVAR(list_index__doc__, + "index($self, value, start=0, stop=sys.maxsize, /)\n" + "--\n" + "\n" + "Return first index of value.\n" + "\n" + "Raises ValueError if the value is not present."); + + +PyDoc_STRVAR(list_count__doc__, + "count($self, value, /)\n" + "--\n" + "\n" + "Return number of occurrences of value."); + +PyDoc_STRVAR(list_reverse__doc__, + "reverse($self, /)\n" + "--\n" + "\n" + "Reverse *IN PLACE*."); + +PyDoc_STRVAR(list_sort__doc__, + "sort($self, /, *, key=None, reverse=False)\n" + "--\n" + "\n" + "Sort the list in ascending order and return None.\n" + "\n" + "The sort is in-place (i.e. the list itself is modified) and stable (i.e. the\n" + "order of two equal elements is maintained).\n" + "\n" + "If a key function is given, apply it once to each list item and sort them,\n" + "ascending or descending, according to their function values.\n" + "\n" + "The reverse flag can be set to sort in descending order."); + + + /** * @brief Struct for the other methods * */ static PyMethodDef JSArrayProxy_methods[] = { - // {"__getitem__", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_get, METH_O|METH_COEXIST, - // PyDoc_STR("__getitem__($self, index, /)\n--\n\nReturn self[index].")}, - // {"clear", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_clear, METH_NOARGS, ""}, - // {"copy", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_copy, METH_NOARGS, ""}, - // {"append", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_append, METH_O, ""}, - // {"insert", _PyCFunction_CAST(JSArrayProxyMethodDefinitions::JSArrayProxy_insert), METH_FASTCALL, ""}, - // {"extend", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_extend, METH_O, ""}, - // {"pop", _PyCFunction_CAST(JSArrayProxyMethodDefinitions::JSArrayProxy_pop), METH_FASTCALL, ""}, // TODO can empty string be null? - // {"remove", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_remove, METH_O, ""}, - // {"index", _PyCFunction_CAST(JSArrayProxyMethodDefinitions::JSArrayProxy_remove), METH_FASTCALL, ""}, - // {"count", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_remove, METH_O, ""}, - // {"reverse", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_reverse, METH_NOARGS, ""}, - // {"sort", _PyCFunction_CAST(JSArrayProxyMethodDefinitions::JSArrayProxy_sort), METH_FASTCALL|METH_KEYWORDS, ""}, + {"clear", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_clear, METH_NOARGS, py_list_clear__doc__}, + {"copy", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_copy, METH_NOARGS, list_copy__doc__}, + {"append", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_append, METH_O, list_append__doc__}, + {"insert", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_insert, METH_FASTCALL, list_insert__doc__}, + {"extend", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_extend, METH_O, py_list_extend__doc__}, + {"pop", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_pop, METH_FASTCALL, list_pop__doc__}, + {"remove", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_remove, METH_O, list_remove__doc__}, + {"index", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_index, METH_FASTCALL, list_index__doc__}, + {"count", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_count, METH_O, list_count__doc__}, + {"reverse", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_reverse, METH_NOARGS, list_reverse__doc__}, + {"sort", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_sort, METH_FASTCALL|METH_KEYWORDS, list_sort__doc__}, {NULL, NULL} /* sentinel */ }; diff --git a/python/pythonmonkey/builtin_modules/internal-binding.d.ts b/python/pythonmonkey/builtin_modules/internal-binding.d.ts index b7c3ac08..3fbf441e 100644 --- a/python/pythonmonkey/builtin_modules/internal-binding.d.ts +++ b/python/pythonmonkey/builtin_modules/internal-binding.d.ts @@ -6,7 +6,7 @@ /** * Note: `internalBinding` APIs are generally unsafe as they do not perform argument type checking, etc. - * Argument checking should be done in JavaScript side. + * Argument checking should be done on the JavaScript side. */ declare function internalBinding(namespace: string): any; // catch-all diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 7a40c58b..fccce4fe 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -25,24 +25,18 @@ void JSArrayProxyMethodDefinitions::JSArrayProxy_dealloc(JSArrayProxy *self) { - PyObject_GC_UnTrack(self); - Py_TYPE(self)->tp_free((PyObject *)self); self->jsObject.set(nullptr); - return; + Py_TYPE(self)->tp_free((PyObject *)self); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { - PyObject *self = PyDict_Type.tp_new(subtype, args, kwds); - ((JSArrayProxy *)self)->jsObject = JS::RootedObject(GLOBAL_CX, nullptr); - return self; + return PyList_Type.tp_new(subtype, args, kwds); } int JSArrayProxyMethodDefinitions::JSArrayProxy_init(JSArrayProxy *self, PyObject *args, PyObject *kwds) { - // make fresh JSArray for proxy - // TODO args?? - self->jsObject.set(JS::NewArrayObject(GLOBAL_CX, 0)); + PyList_Type.tp_init((PyObject *)self, args, kwds); return 0; } @@ -66,45 +60,365 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - if (!value->isUndefined()) { - return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); - } - else { - // look through the methods for dispatch - for (size_t index = 0;; index++) { - const char *methodName = JSArrayProxyType.tp_methods[index].ml_name; - if (methodName == NULL) { // reached end of list - return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + // look through the methods for dispatch and return key if no method found + for (size_t index = 0;; index++) { + const char *methodName = JSArrayProxyType.tp_methods[index].ml_name; + if (methodName == NULL) { // reached end of list + return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + } + else if (PyUnicode_Check(key)) { + if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { + return PyObject_GenericGetAttr((PyObject *)self, key); } - else if (PyUnicode_Check(key)) { - if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { - return PyObject_GenericGetAttr((PyObject *)self, key); - } + } + else { + return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + } + } +} + +// private +static PyObject *list_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihigh) +{ + JS::Rooted> jArgs(GLOBAL_CX); + jArgs[0].setInt32(ilow); + jArgs[1].setInt32(ihigh); + JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "slice", jArgs, jReturnedArray)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + return pyTypeFactory(GLOBAL_CX, global, jReturnedArray)->getPyObject(); +} + +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy *self, PyObject *key) +{ + if (PyIndex_Check(key)) { + Py_ssize_t index = PyNumber_AsSsize_t(key, PyExc_IndexError); + if (index == -1 && PyErr_Occurred()) { + return NULL; + } + + Py_ssize_t selfLength = JSArrayProxy_length(self); + + if (index < 0) { + index += selfLength; + } + + if ((size_t)index >= (size_t)selfLength) { + PyErr_SetObject(PyExc_IndexError, PyUnicode_FromString("list index out of range")); + return NULL; + } + + JS::RootedId id(GLOBAL_CX); + JS_IndexToId(GLOBAL_CX, index, &id); + + JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); + + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), value)->getPyObject(); + } + else if (PySlice_Check(key)) { + Py_ssize_t start, stop, step, slicelength, index; + + if (PySlice_Unpack(key, &start, &stop, &step) < 0) { + return NULL; + } + + slicelength = PySlice_AdjustIndices(JSArrayProxy_length(self), &start, &stop, step); + + if (slicelength <= 0) { + return PyList_New(0); + } + else if (step == 1) { + return list_slice(self, start, stop); + } + else { + JS::RootedObject jCombinedArray = JS::RootedObject(GLOBAL_CX, JS::NewArrayObject(GLOBAL_CX, slicelength)); + + JS::RootedValue elementVal(GLOBAL_CX); + for (size_t cur = start, index = 0; index < slicelength; cur += (size_t)step, index++) { + JS_GetElement(GLOBAL_CX, self->jsObject, cur, &elementVal); + JS_SetElement(GLOBAL_CX, jCombinedArray, index, elementVal); } - else { - return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + + JS::RootedValue *jCombinedArrayValue = new JS::RootedValue(GLOBAL_CX); + jCombinedArrayValue->setObjectOrNull(jCombinedArray); + + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + return pyTypeFactory(GLOBAL_CX, global, jCombinedArrayValue)->getPyObject(); + } + } + else { + PyErr_Format(PyExc_TypeError, "list indices must be integers or slices, not %.200s", Py_TYPE(key)->tp_name); + return NULL; + } +} + +/* a[ilow:ihigh] = v if v != NULL. + * del a[ilow:ihigh] if v == NULL. + */ +// private +static int list_ass_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihigh, PyObject *v) +{ + /* Because [X]DECREF can recursively invoke list operations on + this list, we must postpone all [X]DECREF activity until + after the list is back in its canonical shape. Therefore + we must allocate an additional array, 'recycle', into which + we temporarily copy the items that are deleted from the + list. :-( */ + PyObject **item; + PyObject **vitem = NULL; + PyObject *v_as_SF = NULL; /* PySequence_Fast(v) */ + Py_ssize_t n; /* # of elements in replacement list */ + Py_ssize_t norig; /* # of elements in list getting replaced */ + Py_ssize_t d; /* Change in size */ + Py_ssize_t k; + size_t s; + int result = -1; /* guilty until proved innocent */ +#define b ((PyListObject *)v) + if (v == NULL) { + n = 0; + } + else { + Py_ssize_t vLength; + if (PyObject_TypeCheck(v, &JSArrayProxyType)) { + vLength = JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)v); + } + else { + vLength = Py_SIZE(b); + } + + if ((PyListObject *)self == b) { + /* Special case "a[i:j] = a" -- copy b first */ + v = list_slice(self, 0, vLength); + if (v == NULL) { + return result; } + result = list_ass_slice(self, ilow, ihigh, v); + Py_DECREF(v); + return result; + } + v_as_SF = PySequence_Fast(v, "can only assign an iterable"); + if (v_as_SF == NULL) { + Py_XDECREF(v_as_SF); + return result; + } + n = PySequence_Fast_GET_SIZE(v_as_SF); + vitem = PySequence_Fast_ITEMS(v_as_SF); + } + + Py_ssize_t selfLength = JSArrayProxyMethodDefinitions::JSArrayProxy_length(self); + + if (ilow < 0) { + ilow = 0; + } + else if (ilow > selfLength) { + ilow = selfLength; + } + + if (ihigh < ilow) { + ihigh = ilow; + } + else if (ihigh > selfLength) { + ihigh = selfLength; + } + + norig = ihigh - ilow; + assert(norig >= 0); + d = n - norig; + + if (selfLength + d == 0) { + Py_XDECREF(v_as_SF); + JSArrayProxyMethodDefinitions::JSArrayProxy_clear(self); + return 0; + } + + if (d < 0) { /* Delete -d items */ + JS::RootedValue elementVal(GLOBAL_CX); + for (size_t index = ihigh, count = 0; count < selfLength - ihigh; index++, count++) { + JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + JS_SetElement(GLOBAL_CX, self->jsObject, index+d, elementVal); + } + + JS::SetArrayLength(GLOBAL_CX, self->jsObject, selfLength + d); + } + else if (d > 0) { /* Insert d items */ + k = selfLength; + + JS::SetArrayLength(GLOBAL_CX, self->jsObject, k + d); + + selfLength = k + d; + + JS::RootedValue elementVal(GLOBAL_CX); + for (size_t index = ihigh, count = 0; count < k - ihigh; index++, count++) { + JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + JS_SetElement(GLOBAL_CX, self->jsObject, index+d, elementVal); } } + + JS::RootedValue elementVal(GLOBAL_CX); + for (k = 0; k < n; k++, ilow++) { + elementVal.set(jsTypeFactory(GLOBAL_CX, vitem[k])); + JS_SetElement(GLOBAL_CX, self->jsObject, ilow, elementVal); + } + + result = 0; + Py_XDECREF(v_as_SF); + return result; +#undef b } int JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key(JSArrayProxy *self, PyObject *key, PyObject *value) { - JS::RootedId id(GLOBAL_CX); - if (!keyToId(key, &id)) { // invalid key - // TODO (Caleb Aikens): raise exception here - return -1; - } + if (PyIndex_Check(key)) { + Py_ssize_t index = PyNumber_AsSsize_t(key, PyExc_IndexError); + if (index == -1 && PyErr_Occurred()) { + return -1; + } - if (value) { // we are setting a value - JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); - JS_SetPropertyById(GLOBAL_CX, self->jsObject, id, jValue); - } else { // we are deleting a value - JS::ObjectOpResult ignoredResult; - JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); + Py_ssize_t selfLength = JSArrayProxy_length(self); + + if (index < 0) { + index += selfLength; + } + + if ((size_t)index >= (size_t)selfLength) { + PyErr_SetObject(PyExc_IndexError, PyUnicode_FromString("list assignment index out of range")); + return -1; + } + + JS::RootedId id(GLOBAL_CX); + JS_IndexToId(GLOBAL_CX, index, &id); + + if (value) { // we are setting a value + JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); + JS_SetPropertyById(GLOBAL_CX, self->jsObject, id, jValue); + } else { // we are deleting a value + JS::ObjectOpResult ignoredResult; + JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); + } + + return 0; } + else if (PySlice_Check(key)) { + Py_ssize_t start, stop, step, slicelength; - return 0; + if (PySlice_Unpack(key, &start, &stop, &step) < 0) { + return -1; + } + + Py_ssize_t selfSize = JSArrayProxy_length(self); + + slicelength = PySlice_AdjustIndices(selfSize, &start, &stop, step); + + if (step == 1) { + return list_ass_slice(self, start, stop, value); + } + + /* Make sure s[5:2] = [..] inserts at the right place: + before 5, not before 2. */ + if ((step < 0 && start < stop) || (step > 0 && start > stop)) { + stop = start; + } + + if (value == NULL) { + /* delete slice */ + size_t cur; + Py_ssize_t i; + + if (slicelength <= 0) { + return 0; + } + + if (step < 0) { + stop = start + 1; + start = stop + step*(slicelength - 1) - 1; + step = -step; + } + + /* drawing pictures might help understand these for + loops. Basically, we memmove the parts of the + list that are *not* part of the slice: step-1 + items for each item that is part of the slice, + and then tail end of the list that was not + covered by the slice */ + JS::RootedValue elementVal(GLOBAL_CX); + for (cur = start, i = 0; cur < (size_t)stop; cur += step, i++) { + Py_ssize_t lim = step - 1; + + if (cur + step >= (size_t)selfSize) { + lim = selfSize - cur - 1; + } + + for (size_t index = cur, count = 0; count < lim; index++, count++) { + JS_GetElement(GLOBAL_CX, self->jsObject, index + 1, &elementVal); + JS_SetElement(GLOBAL_CX, self->jsObject, index - i, elementVal); + } + } + + cur = start + (size_t)slicelength * step; + + if (cur < (size_t)selfSize) { + for (size_t index = cur, count = 0; count < selfSize - cur; index++, count++) { + JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + JS_SetElement(GLOBAL_CX, self->jsObject, index - slicelength, elementVal); + } + } + + JS::SetArrayLength(GLOBAL_CX, self->jsObject, selfSize - slicelength); + + return 0; + } + else { + /* assign slice */ + PyObject *ins, *seq; + PyObject **seqitems, **selfitems; + Py_ssize_t i; + size_t cur; + + /* protect against a[::-1] = a */ + if ((PyListObject *)self == (PyListObject *)value) { + seq = list_slice((JSArrayProxy *)value, 0, JSArrayProxy_length((JSArrayProxy *)value)); + } + else { + seq = PySequence_Fast(value, "must assign iterable to extended slice"); + } + + if (!seq) { + return -1; + } + + if (PySequence_Fast_GET_SIZE(seq) != slicelength) { + PyErr_Format(PyExc_ValueError, "attempt to assign sequence of size %zd to extended slice of size %zd", + PySequence_Fast_GET_SIZE(seq), slicelength); + Py_DECREF(seq); + return -1; + } + + if (!slicelength) { + Py_DECREF(seq); + return 0; + } + + seqitems = PySequence_Fast_ITEMS(seq); + + JS::RootedValue elementVal(GLOBAL_CX); + for (cur = start, i = 0; i < slicelength; cur += (size_t)step, i++) { + elementVal.set(jsTypeFactory(GLOBAL_CX, seqitems[i])); + JS_SetElement(GLOBAL_CX, self->jsObject, cur, elementVal); + } + + Py_DECREF(seq); + + return 0; + } + } + else { + PyErr_Format(PyExc_TypeError, "list indices must be integers or slices, not %.200s", Py_TYPE(key)->tp_name); + return -1; + } } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy *self, PyObject *other, int op) @@ -113,7 +427,25 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * Py_RETURN_NOTIMPLEMENTED; } - if (JSArrayProxy_length(self) != Py_SIZE((PyListObject *)other) && (op == Py_EQ || op == Py_NE)) { + if (self == (JSArrayProxy *)other && (op == Py_EQ || op == Py_NE)) { // TODO How is this potential bad cast allowed? + if (op == Py_EQ) { + Py_RETURN_TRUE; + } + else { + Py_RETURN_FALSE; + } + } + + Py_ssize_t selfLength = JSArrayProxy_length(self); + Py_ssize_t otherLength; + + if (PyObject_TypeCheck(other, &JSArrayProxyType)) { + otherLength = JSArrayProxy_length((JSArrayProxy *)other); + } else { + otherLength = Py_SIZE(other); + } + + if (selfLength != otherLength && (op == Py_EQ || op == Py_NE)) { /* Shortcut: if the lengths differ, the lists differ */ if (op == Py_EQ) { Py_RETURN_FALSE; @@ -123,9 +455,6 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * } } - Py_ssize_t selfLength = JSArrayProxy_length(self); - Py_ssize_t otherLength = Py_SIZE(other); - JS::RootedValue elementVal(GLOBAL_CX); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); @@ -135,7 +464,14 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); PyObject *leftItem = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); - PyObject *rightItem = ((PyListObject *)other)->ob_item[index]; + PyObject *rightItem; + if (PyObject_TypeCheck(other, &JSArrayProxyType)) { + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)other)->jsObject, index, &elementVal); + rightItem = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + } else { + rightItem = ((PyListObject *)other)->ob_item[index]; + } + if (leftItem == rightItem) { continue; } @@ -145,10 +481,12 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * int k = PyObject_RichCompareBool(leftItem, rightItem, Py_EQ); Py_DECREF(leftItem); Py_DECREF(rightItem); - if (k < 0) + if (k < 0) { return NULL; - if (!k) + } + if (!k) { break; + } } if (index >= selfLength || index >= otherLength) { @@ -170,7 +508,9 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { - if (JSArrayProxy_length(self) == 0) { + Py_ssize_t selfLength = JSArrayProxy_length(self); + + if (selfLength == 0) { return PyUnicode_FromString("[]"); } @@ -184,25 +524,26 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { _PyUnicodeWriter_Init(&writer); writer.overallocate = 1; /* "[" + "1" + ", 2" * (len - 1) + "]" */ - writer.min_length = 1 + 1 + (2 + 1) * (JSArrayProxy_length(self) - 1) + 1; + writer.min_length = 1 + 1 + (2 + 1) * (selfLength - 1) + 1; - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS::RootedValue elementVal(GLOBAL_CX); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); if (_PyUnicodeWriter_WriteChar(&writer, '[') < 0) { goto error; } - for (Py_ssize_t index = 0; index < JSArrayProxy_length(self); ++index) { + /* Do repr() on each element. Note that this may mutate the list, so must refetch the list size on each iteration. */ + for (Py_ssize_t index = 0; index < selfLength /*JSArrayProxy_length(self)*/; ++index) { if (index > 0) { if (_PyUnicodeWriter_WriteASCIIString(&writer, ", ", 2) < 0) { goto error; } } - JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); - PyObject *s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); + PyObject *s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject()); if (s == NULL) { goto error; } @@ -229,229 +570,229 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_iter(JSArrayProxy *self) { - JSContext *cx = GLOBAL_CX; - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(self->jsObject)); - - // Get **enumerable** own properties - JS::RootedIdVector props(cx); - if (!js::GetPropertyKeys(cx, self->jsObject, JSITER_OWNONLY, &props)) { - return NULL; - } + const Py_ssize_t selfLength = JSArrayProxy_length(self); - // Populate a Python tuple with (propertyKey, value) pairs from the JS object - // Similar to `Object.entries()` - size_t length = props.length(); - PyObject *seq = PyTuple_New(length); - for (size_t i = 0; i < length; i++) { - JS::HandleId id = props[i]; - PyObject *key = idToKey(cx, id); + PyObject *seq = PyList_New(selfLength); - JS::RootedValue *jsVal = new JS::RootedValue(cx); - JS_GetPropertyById(cx, self->jsObject, id, jsVal); - PyObject *value = pyTypeFactory(cx, global, jsVal)->getPyObject(); - - PyTuple_SetItem(seq, i, PyTuple_Pack(2, key, value)); + JS::RootedValue elementVal(GLOBAL_CX); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + for (size_t index = 0; index < selfLength; index++) { + JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + PyList_SET_ITEM(seq, index, pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject()); } // Convert to a Python iterator return PyObject_GetIter(seq); } -/* - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_concat(JSArrayProxy *self, PyObject *value) { - printf("JSArrayProxy_concat\n"); - - // value must be a list - if (!PyList_Check(value)) { +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_concat(JSArrayProxy *self, PyObject *value) { + // value must be a list + if (!PyList_Check(value)) { PyErr_Format(PyExc_TypeError, "can only concatenate list (not \"%.200s\") to list", Py_TYPE(value)->tp_name); return NULL; - } + } - assert((size_t)JSArrayProxy_length(self) + (size_t)Py_SIZE(value) < PY_SSIZE_T_MAX); + Py_ssize_t sizeSelf = JSArrayProxy_length(self); + Py_ssize_t sizeValue; + if (PyObject_TypeCheck(value, &JSArrayProxyType)) { + sizeValue = JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)value); + } else { + sizeValue = Py_SIZE(value); + } - Py_ssize_t size = JSArrayProxy_length(self) + Py_SIZE(value); - if (size == 0) { - return PyList_New(0); - } + assert((size_t)sizeSelf + (size_t)sizeValue < PY_SSIZE_T_MAX); + + if (sizeValue == 0) { + if (sizeSelf == 0) { + return PyList_New(0); + } + else { + Py_INCREF(self); + return (PyObject *)self; + } + } + + JS::RootedObject jCombinedArray = JS::RootedObject(GLOBAL_CX, JS::NewArrayObject(GLOBAL_CX, (size_t)sizeSelf + (size_t)sizeValue)); + + JS::RootedValue elementVal(GLOBAL_CX); - JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); - // jValue is a JSArray since value is a List - JS::Rooted> args(GLOBAL_CX); - args[0].setObject(jValue.toObject()); - JS::RootedValue *jCombinedArray = new JS::RootedValue(GLOBAL_CX); - JS_CallFunctionName(GLOBAL_CX, self->jsObject, "concat", args, jCombinedArray); + for (Py_ssize_t inputIdx = 0; inputIdx < sizeSelf; inputIdx++) { + JS_GetElement(GLOBAL_CX, self->jsObject, inputIdx, &elementVal); + JS_SetElement(GLOBAL_CX, jCombinedArray, inputIdx, elementVal); + } - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, jCombinedArray)->getPyObject(); - } + if (PyObject_TypeCheck(value, &JSArrayProxyType)) { + for (Py_ssize_t inputIdx = 0; inputIdx < sizeValue; inputIdx++) { + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)value)->jsObject, inputIdx, &elementVal); + JS_SetElement(GLOBAL_CX, jCombinedArray, sizeSelf + inputIdx, elementVal); + } + } else { + JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); + JS::RootedObject jRootedValue = JS::RootedObject(GLOBAL_CX, jValue.toObjectOrNull()); + for (Py_ssize_t inputIdx = 0; inputIdx < sizeValue; inputIdx++) { + JS_GetElement(GLOBAL_CX, jRootedValue, inputIdx, &elementVal); + JS_SetElement(GLOBAL_CX, jCombinedArray, sizeSelf + inputIdx, elementVal); + } + } - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, Py_ssize_t n) { - printf("JSArrayProxy_repeat\n"); + JS::RootedValue *jCombinedArrayValue = new JS::RootedValue(GLOBAL_CX); + jCombinedArrayValue->setObjectOrNull(jCombinedArray); - const Py_ssize_t input_size = JSArrayProxy_length(self); - if (input_size == 0 || n <= 0) { + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + return pyTypeFactory(GLOBAL_CX, global, jCombinedArrayValue)->getPyObject(); +} + +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, Py_ssize_t n) { + const Py_ssize_t input_size = JSArrayProxy_length(self); + if (input_size == 0 || n <= 0) { return PyList_New(0); - } - assert(n > 0); + } - if (input_size > PY_SSIZE_T_MAX / n) { + if (input_size > PY_SSIZE_T_MAX / n) { return PyErr_NoMemory(); - } + } - JS::RootedObject jCombinedArray = JS::RootedObject(GLOBAL_CX, JS::NewArrayObject(GLOBAL_CX, input_size * n)); - // repeat within new array - // one might think of using copyWithin but in SpiderMonkey it's implemented in JS! - JS::RootedValue elementVal(GLOBAL_CX); - for (Py_ssize_t inputIdx = 0; inputIdx < input_size; inputIdx++) { + JS::RootedObject jCombinedArray = JS::RootedObject(GLOBAL_CX, JS::NewArrayObject(GLOBAL_CX, input_size * n)); + // repeat within new array + // one might think of using copyWithin but in SpiderMonkey it's implemented in JS! + JS::RootedValue elementVal(GLOBAL_CX); + for (Py_ssize_t inputIdx = 0; inputIdx < input_size; inputIdx++) { JS_GetElement(GLOBAL_CX, self->jsObject, inputIdx, &elementVal); for (Py_ssize_t repeatIdx = 0; repeatIdx < n; repeatIdx++) { JS_SetElement(GLOBAL_CX, jCombinedArray, repeatIdx * input_size + inputIdx, elementVal); } - } - - JS::RootedValue *jCombinedArrayValue = new JS::RootedValue(GLOBAL_CX); - jCombinedArrayValue->setObjectOrNull(jCombinedArray); - - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, jCombinedArrayValue)->getPyObject(); - } - - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_item(JSArrayProxy *self, Py_ssize_t index) - { - printf("JSArrayProxy_item\n"); - if ((size_t)index >= (size_t)JSArrayProxy_length(self)) { - PyErr_SetObject(PyExc_IndexError, PyUnicode_FromString("list index out of range")); - return NULL; - } - - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + } - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); - } + JS::RootedValue jCombinedArrayValue(GLOBAL_CX); + jCombinedArrayValue.setObjectOrNull(jCombinedArray); - int JSArrayProxyMethodDefinitions::JSArrayProxy_assign_index(JSArrayProxy *self, Py_ssize_t index, PyObject *value) { - printf("JSArrayProxy_assign_index\n"); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + return pyTypeFactory(GLOBAL_CX, global, &jCombinedArrayValue)->getPyObject(); +} - if ((size_t)index >= (size_t)JSArrayProxy_length(self)) { - PyErr_SetObject(PyExc_IndexError, PyUnicode_FromString("list assignment out of range")); - return -1; - } +int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyObject *element) { + Py_ssize_t index; + int cmp; - if (value == NULL) { - // TODO - } + Py_ssize_t numElements = JSArrayProxy_length(self); + JS::RootedValue elementVal(GLOBAL_CX); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + for (index = 0, cmp = 0; cmp == 0 && index < numElements; ++index) { + JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + PyObject *item = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + Py_INCREF(item); + cmp = PyObject_RichCompareBool(item, element, Py_EQ); + Py_DECREF(item); + } + return cmp; +} - JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); - JS_SetElement(GLOBAL_CX, self->jsObject, index, jValue); - return 0; - } +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_concat(JSArrayProxy *self, PyObject *value) { + Py_ssize_t selfLength = JSArrayProxy_length(self); + Py_ssize_t valueLength = Py_SIZE(value); - int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyObject *element) { - printf("JSArrayProxy_contains\n"); + // allocate extra spacePy_SIZE + JS::SetArrayLength(GLOBAL_CX, self->jsObject, selfLength + valueLength); - Py_ssize_t numElements = JSArrayProxy_length(self); - JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - JS::RootedValue elementVal(GLOBAL_CX); - for (Py_ssize_t index = 0; index < numElements; ++index) { - JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); - // THIS looks wrong, we should not be comparing self ???? TODO - PyObject *isEqual = JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(self, pyTypeFactory(GLOBAL_CX, &global, &elementVal)->getPyObject(), Py_EQ); - if (isEqual == NULL) { - return -1; - } else if (Py_IsTrue(isEqual)) { - return 1; - } - } - return 0; - } + JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); + JS::RootedObject jRootedValue = JS::RootedObject(GLOBAL_CX, jValue.toObjectOrNull()); - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_concat(JSArrayProxy *self, PyObject *value) { - printf("JSArrayProxy_inplace_concat\n"); - // TODO - return NULL; - } + JS::RootedValue elementVal(GLOBAL_CX); + for (Py_ssize_t inputIdx = 0; inputIdx < valueLength; inputIdx++) { + JS_GetElement(GLOBAL_CX, jRootedValue, inputIdx, &elementVal); + JS_SetElement(GLOBAL_CX, self->jsObject, selfLength + inputIdx, elementVal); + } - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat(JSArrayProxy *self, Py_ssize_t n) { - printf("JSArrayProxy_inplace_repeat\n"); + Py_INCREF(self); + return (PyObject *)self; +} - Py_ssize_t input_size = JSArrayProxy_length(self); - if (input_size == 0 || n == 1) { - return Py_NewRef(self); - } +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat(JSArrayProxy *self, Py_ssize_t n) { + Py_ssize_t input_size = JSArrayProxy_length(self); + if (input_size == 0 || n == 1) { + Py_INCREF(self); + return (PyObject *)self; + } - if (n < 1) { + if (n < 1) { JSArrayProxy_clear(self); - return Py_NewRef(self); - } + Py_INCREF(self); + return (PyObject *)self; + } - if (input_size > PY_SSIZE_T_MAX / n) { + if (input_size > PY_SSIZE_T_MAX / n) { return PyErr_NoMemory(); - } + } - JS::SetArrayLength(GLOBAL_CX, self->jsObject, input_size * n); + JS::SetArrayLength(GLOBAL_CX, self->jsObject, input_size * n); - // repeat within self - // one might think of using copyWithin but in SpiderMonkey it's implemented in JS! - JS::RootedValue elementVal(GLOBAL_CX); - for (Py_ssize_t inputIdx = 0; inputIdx < input_size; inputIdx++) { + // repeat within self + // one might think of using copyWithin but in SpiderMonkey it's implemented in JS! + JS::RootedValue elementVal(GLOBAL_CX); + for (Py_ssize_t inputIdx = 0; inputIdx < input_size; inputIdx++) { JS_GetElement(GLOBAL_CX, self->jsObject, inputIdx, &elementVal); for (Py_ssize_t repeatIdx = 0; repeatIdx < n; repeatIdx++) { JS_SetElement(GLOBAL_CX, self->jsObject, repeatIdx * input_size + inputIdx, elementVal); } - } - - return Py_NewRef(self); - } - - int JSArrayProxyMethodDefinitions::JSArrayProxy_clear(JSArrayProxy *self) { - printf("JSArrayProxy_clear\n"); - JS::SetArrayLength(GLOBAL_CX, self->jsObject, 0); - return 0; - } - - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) { - printf("JSArrayProxy_copy\n"); + } - JS::Rooted> jArgs(GLOBAL_CX); // TODO needs to be on the stack? - jArgs[0].setInt32(0); - jArgs[1].setInt32(JSArrayProxy_length(self)); - JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); - JS_CallFunctionName(GLOBAL_CX, self->jsObject, "slice", jArgs, jReturnedArray); + Py_INCREF(self); + return (PyObject *)self; +} - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, jReturnedArray)->getPyObject(); - } +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_clear(JSArrayProxy *self) { + JS::SetArrayLength(GLOBAL_CX, self->jsObject, 0); + Py_RETURN_NONE; +} - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_append(JSArrayProxy *self, PyObject *value) { - printf("JSArrayProxy_append\n"); +int JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot(JSArrayProxy *self) { + JSArrayProxyMethodDefinitions::JSArrayProxy_clear(self); + return 0; +} - assert(self != NULL && value != NULL); - assert(PyList_Check(self)); +int JSArrayProxyMethodDefinitions::JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg) { + JS::RootedValue elementVal(GLOBAL_CX); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + for (Py_ssize_t i = JSArrayProxy_length(self); --i >= 0; ) { + JS_GetElement(GLOBAL_CX, self->jsObject, i, &elementVal); + Py_VISIT(pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject()); + } + return 0; +} - Py_ssize_t len = JSArrayProxy_length(self); +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) { + JS::Rooted> jArgs(GLOBAL_CX); + jArgs[0].setInt32(0); + jArgs[1].setInt32(JSArrayProxy_length(self)); + JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); // TODO use stack alloc + if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "slice", jArgs, jReturnedArray)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + return pyTypeFactory(GLOBAL_CX, global, jReturnedArray)->getPyObject(); +} - // PyObject *inserted = Py_NewRef(value); - JS::SetArrayLength(GLOBAL_CX, self->jsObject, len + 1); - JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); - JS_SetElement(GLOBAL_CX, self->jsObject, len, jValue); +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_append(JSArrayProxy *self, PyObject *value) { + Py_ssize_t len = JSArrayProxy_length(self); - Py_RETURN_NONE; - } + JS::SetArrayLength(GLOBAL_CX, self->jsObject, len + 1); + JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); + JS_SetElement(GLOBAL_CX, self->jsObject, len, jValue); - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_insert(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs) { - printf("JSArrayProxy_insert\n"); + Py_RETURN_NONE; +} - PyObject *return_value = NULL; - Py_ssize_t index; - PyObject *object; +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_insert(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs) { + PyObject *return_value = NULL; + Py_ssize_t index; + PyObject *value; - if (!_PyArg_CheckPositional("insert", nargs, 2, 2)) { + if (!_PyArg_CheckPositional("insert", nargs, 2, 2)) { return NULL; - } + } - { + { Py_ssize_t ival = -1; PyObject *iobj = _PyNumber_Index(args[0]); if (iobj != NULL) { @@ -462,28 +803,41 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_iter(JSArrayProxy *self) { return NULL; } index = ival; - } + } - object = args[1]; + value = args[1]; - JS::Rooted> jArgs(GLOBAL_CX); // TODO needs to be on the heap? - jArgs[0].setInt32(index); - jArgs[1].setInt32(1); - JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, object)); - jArgs[1].setObject(jValue.toObject()); - JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); - JS_CallFunctionName(GLOBAL_CX, self->jsObject, "splice", jArgs, jReturnedArray); + Py_ssize_t n = JSArrayProxy_length(self); - Py_RETURN_NONE; - } + if (index < 0) { + index += n; + if (index < 0) { + index = 0; + } + } + if (index > n) { + index = n; + } + + JS::Rooted> jArgs(GLOBAL_CX); + jArgs[0].setInt32(index); + jArgs[1].setInt32(0); + jArgs[2].set(jsTypeFactory(GLOBAL_CX, value)); - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_extend(JSArrayProxy *self, PyObject *iterable) { - printf("JSArrayProxy_extend\n"); + JS::RootedValue jReturnedArray(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "splice", jArgs, &jReturnedArray)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } + Py_RETURN_NONE; +} - // Special cases: - // 1) lists and tuples which can use PySequence_Fast ops - // 2) extending self to self requires making a copy first - if (PyList_CheckExact(iterable) || PyTuple_CheckExact(iterable) || (PyObject *)self == iterable) { +// TODO needs to be on the heap? +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_extend(JSArrayProxy *self, PyObject *iterable) { + // Special cases: + // 1) lists and tuples which can use PySequence_Fast ops + // 2) extending self to self requires making a copy first + if (PyList_CheckExact(iterable) || PyTuple_CheckExact(iterable) || (PyObject *)self == iterable) { iterable = PySequence_Fast(iterable, "argument must be iterable"); if (!iterable) { return NULL; @@ -491,52 +845,47 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_iter(JSArrayProxy *self) { Py_ssize_t n = PySequence_Fast_GET_SIZE(iterable); if (n == 0) { - /* short circuit when iterable is empty *//* + /* short circuit when iterable is empty */ + Py_DECREF(iterable); Py_RETURN_NONE; } Py_ssize_t m = JSArrayProxy_length(self); // It should not be possible to allocate a list large enough to cause // an overflow on any relevant platform. - assert(m < PY_SSIZE_T_MAX - n); JS::SetArrayLength(GLOBAL_CX, self->jsObject, m + n); - - // note that we may still have self == iterable here for the - // situation a.extend(a), but the following code works - // in that case too. Just make sure to resize self - // before calling PySequence_Fast_ITEMS. // // populate the end of self with iterable's items. PyObject **src = PySequence_Fast_ITEMS(iterable); for (Py_ssize_t i = 0; i < n; i++) { PyObject *o = src[i]; - // dest[i] = Py_NewRef(o); TODO NewRef needed? + Py_INCREF(o); // TODO in or out JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, o)); JS_SetElement(GLOBAL_CX, self->jsObject, m + i, jValue); } Py_DECREF(iterable); - Py_RETURN_NONE; - } - else { + } + else { PyObject *it = PyObject_GetIter(iterable); if (it == NULL) { return NULL; } PyObject *(*iternext)(PyObject *) = *Py_TYPE(it)->tp_iternext; - Py_ssize_t len = JSArrayProxy_length(self); - /* Run iterator to exhaustion. *//* for (;; ) { PyObject *item = iternext(it); if (item == NULL) { if (PyErr_Occurred()) { - if (PyErr_ExceptionMatches(PyExc_StopIteration)) + if (PyErr_ExceptionMatches(PyExc_StopIteration)) { PyErr_Clear(); - else - goto error; + } + else { + Py_DECREF(it); + return NULL; + } } break; } @@ -548,25 +897,18 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_iter(JSArrayProxy *self) { } Py_DECREF(it); - Py_RETURN_NONE; - - error: - Py_DECREF(it); - return NULL; - } - } - - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_pop(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs) { - printf("JSArrayProxy_pop\n"); + } + Py_RETURN_NONE; +} - PyObject *return_value = NULL; - Py_ssize_t index = -1; +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_pop(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs) { + Py_ssize_t index = -1; - if (!_PyArg_CheckPositional("pop", nargs, 0, 1)) { + if (!_PyArg_CheckPositional("pop", nargs, 0, 1)) { return NULL; - } + } - if (nargs >= 1) { + if (nargs >= 1) { Py_ssize_t ival = -1; PyObject *iobj = _PyNumber_Index(args[0]); if (iobj != NULL) { @@ -574,215 +916,248 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_iter(JSArrayProxy *self) { Py_DECREF(iobj); } if (ival == -1 && PyErr_Occurred()) { - return return_value; + return NULL; } index = ival; - } + } + + Py_ssize_t selfSize = JSArrayProxy_length(self); + + if (selfSize == 0) { + /* Special-case most common failure cause */ + PyErr_SetString(PyExc_IndexError, "pop from empty list"); + return NULL; + } + + if (index < 0) { + index += selfSize; + } + + if ((size_t)index >= (size_t)selfSize) { + PyErr_SetString(PyExc_IndexError, "pop index out of range"); + return NULL; + } - JS::Rooted> jArgs(GLOBAL_CX); // TODO needs to be on the heap? - jArgs[0].setInt32(index); - jArgs[1].setInt32(1); - JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); - JS_CallFunctionName(GLOBAL_CX, self->jsObject, "splice", jArgs, jReturnedArray); + JS::Rooted> jArgs(GLOBAL_CX); // TODO needs to be on the heap? + jArgs[0].setInt32(index); + jArgs[1].setInt32(1); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, jReturnedArray)->getPyObject(); - } + JS::RootedValue jReturnedArray(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "splice", jArgs, &jReturnedArray)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self, PyObject *value) { - printf("JSArrayProxy_remove\n"); + // need the value in the returned array, not the array itself + JS::RootedObject rootedReturnedArray(GLOBAL_CX, jReturnedArray.toObjectOrNull()); + JS::RootedValue elementVal(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, rootedReturnedArray, 0, &elementVal); - JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - JS::RootedValue elementVal(GLOBAL_CX); - for (Py_ssize_t index = 0; index < JSArrayProxy_length(self); index++) { + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + return pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); +} + +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self, PyObject *value) { + Py_ssize_t selfSize = JSArrayProxy_length(self); + + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedValue elementVal(GLOBAL_CX); + for (Py_ssize_t index = 0; index < selfSize; index++) { JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, &global, &elementVal)->getPyObject(); + PyObject *obj = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); Py_INCREF(obj); - // int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); - // TODO + int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); + if (cmp > 0) { + JS::Rooted> jArgs(GLOBAL_CX); + jArgs[0].setInt32(index); + jArgs[1].setInt32(1); + JS::RootedValue jReturnedArray(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "splice", jArgs, &jReturnedArray)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } + Py_RETURN_NONE; + } + else if (cmp < 0) { + return NULL; + } + } - JS::Rooted> jArgs(GLOBAL_CX); // TODO needs to be on the heap? - jArgs[0].setInt32(index); - jArgs[1].setInt32(1); - JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); - JS_CallFunctionName(GLOBAL_CX, self->jsObject, "splice", jArgs, jReturnedArray); - Py_RETURN_NONE; - } - PyErr_Format(PyExc_ValueError, "%R is not in list", value); - return NULL; - - } - - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_index(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs) { - printf("JSArrayProxy_index\n"); + PyErr_SetString(PyExc_ValueError, "list.remove(x): x not in list"); + return NULL; +} - PyObject *value; - Py_ssize_t start = 0; - Py_ssize_t stop = PY_SSIZE_T_MAX; +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_index(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs) { + PyObject *value; + Py_ssize_t start = 0; + Py_ssize_t stop = PY_SSIZE_T_MAX; - if (!_PyArg_CheckPositional("index", nargs, 1, 3)) { + if (!_PyArg_CheckPositional("index", nargs, 1, 3)) { return NULL; - } - value = args[0]; - if (nargs < 2) { + } + value = args[0]; + if (nargs < 2) { goto skip_optional; - } - if (!_PyEval_SliceIndexNotNone(args[1], &start)) { + } + if (!_PyEval_SliceIndexNotNone(args[1], &start)) { return NULL; - } - if (nargs < 3) { + } + if (nargs < 3) { goto skip_optional; - } - if (!_PyEval_SliceIndexNotNone(args[2], &stop)) { + } + if (!_PyEval_SliceIndexNotNone(args[2], &stop)) { return NULL; - } + } + +skip_optional: + Py_ssize_t selfSize = JSArrayProxy_length(self); - skip_optional: - if (start < 0) { - start += JSArrayProxy_length(self); - if (start < 0) + if (start < 0) { + start += selfSize; + if (start < 0) { start = 0; - } - if (stop < 0) { - stop += JSArrayProxy_length(self); - if (stop < 0) + } + } + if (stop < 0) { + stop += selfSize; + if (stop < 0) { stop = 0; - } + } + } - Py_ssize_t length = JSArrayProxy_length(self); - JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - JS::RootedValue elementVal(GLOBAL_CX); - for (Py_ssize_t index = start; index < stop && index < length; index++) { + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedValue elementVal(GLOBAL_CX); + for (Py_ssize_t index = start; index < stop && index < selfSize; index++) { JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, &global, &elementVal)->getPyObject(); + PyObject *obj = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); Py_INCREF(obj); - // TODO int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); - if (cmp > 0) + if (cmp > 0) { return PyLong_FromSsize_t(index); - else if (cmp < 0) + } + else if (cmp < 0) { return NULL; - } - PyErr_Format(PyExc_ValueError, "%R is not in list", value); - return NULL; - } + } + } - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_count(JSArrayProxy *self, PyObject *value) { - printf("JSArrayProxy_count\n"); + PyErr_Format(PyExc_ValueError, "%R is not in list", value); + return NULL; +} - Py_ssize_t count = 0; +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_count(JSArrayProxy *self, PyObject *value) { + Py_ssize_t count = 0; - Py_ssize_t length = JSArrayProxy_length(self); - JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - JS::RootedValue elementVal(GLOBAL_CX); - for (Py_ssize_t index = 0; index < length; index++) { + Py_ssize_t length = JSArrayProxy_length(self); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedValue elementVal(GLOBAL_CX); + for (Py_ssize_t index = 0; index < length; index++) { JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, &global, &elementVal)->getPyObject(); - // PyObject *obj = self->ob_item[i]; - if (obj == value) { - count++; - continue; - } + PyObject *obj = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); Py_INCREF(obj); - // TODO int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); - if (cmp > 0) + if (cmp > 0) { count++; - else if (cmp < 0) + } + else if (cmp < 0) { return NULL; - } - return PyLong_FromSsize_t(count); - } - - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_reverse(JSArrayProxy *self) { - printf("JSArrayProxy_reverse\n"); - - if (JSArrayProxy_length(self) > 1) { - JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); - JS_CallFunctionName(GLOBAL_CX, self->jsObject, "reverse", JS::HandleValueArray::empty(), jReturnedArray); - } + } + } + return PyLong_FromSsize_t(count); +} - Py_RETURN_NONE; - } +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_reverse(JSArrayProxy *self) { + if (JSArrayProxy_length(self) > 1) { + JS::RootedValue jReturnedArray(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "reverse", JS::HandleValueArray::empty(), &jReturnedArray)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } + } - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - printf("JSArrayProxy_sort\n"); + Py_RETURN_NONE; +} - PyObject *return_value = NULL; - #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) - #define NUM_KEYWORDS 2 - static struct { + #define NUM_KEYWORDS 2 + static struct { PyGC_Head _this_is_not_used; PyObject_VAR_HEAD PyObject *ob_item[NUM_KEYWORDS]; - } _kwtuple = { + } _kwtuple = { .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) .ob_item = {&_Py_ID(key), &_Py_ID(reverse), }, - }; - #undef NUM_KEYWORDS - #define KWTUPLE (&_kwtuple.ob_base.ob_base) + }; + #undef NUM_KEYWORDS + #define KWTUPLE (&_kwtuple.ob_base.ob_base) - #else // !Py_BUILD_CORE - # define KWTUPLE NULL - #endif // !Py_BUILD_CORE + #else // !Py_BUILD_CORE + # define KWTUPLE NULL + #endif // !Py_BUILD_CORE - static const char *const _keywords[] = {"key", "reverse", NULL}; - static _PyArg_Parser _parser = { + static const char *const _keywords[] = {"key", "reverse", NULL}; + static _PyArg_Parser _parser = { .keywords = _keywords, .fname = "sort", .kwtuple = KWTUPLE, - }; - #undef KWTUPLE - - PyObject *argsbuf[2]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; - PyObject *keyfunc = Py_None; - int reverse = 0; - - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf); - if (!args) { - goto exit; - } - if (!noptargs) { + }; + #undef KWTUPLE + + PyObject *argsbuf[2]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; + PyObject *keyfunc = Py_None; + int reverse = 0; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf); + if (!args) { + return NULL; + } + + if (!noptargs) { goto skip_optional_kwonly; - } - if (args[0]) { + } + + if (args[0]) { keyfunc = args[0]; if (!--noptargs) { goto skip_optional_kwonly; } - } - reverse = PyObject_IsTrue(args[1]); - if (reverse < 0) { - goto exit; - } + } - skip_optional_kwonly: - if (JSArrayProxy_length(self) > 1) { - JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); + reverse = PyObject_IsTrue(args[1]); + if (reverse < 0) { + return NULL; + } + +skip_optional_kwonly: + if (JSArrayProxy_length(self) > 1) { + JS::RootedValue jReturnedArray(GLOBAL_CX); if (keyfunc != Py_None) { - JS::Rooted> jArgs(GLOBAL_CX); // TODO needs to be on the heap? - JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, keyfunc)); - jArgs[0].setObject(jValue.toObject()); - JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, jReturnedArray); - } else { - JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); - JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", JS::HandleValueArray::empty(), jReturnedArray); + if (!PyFunction_Check(keyfunc) && !PyCFunction_Check(keyfunc)) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not callable", Py_TYPE(keyfunc)->tp_name); + return NULL; + } + JS::Rooted> jArgs(GLOBAL_CX); + jArgs[0].set(jsTypeFactory(GLOBAL_CX, keyfunc)); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, &jReturnedArray)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } + } + else { + if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", JS::HandleValueArray::empty(), &jReturnedArray)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } } if (reverse) { - JS_CallFunctionName(GLOBAL_CX, self->jsObject, "reverse", JS::HandleValueArray::empty(), jReturnedArray); + JSArrayProxy_reverse(self); } - } - - Py_RETURN_NONE; - - exit: - return return_value; - } - */ - + } + Py_RETURN_NONE; +} diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 1b647047..de6cf8d3 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -40,8 +40,6 @@ bool keyToId(PyObject *key, JS::MutableHandleId idp) { void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) { - printf("JSObjectProxy_dealloc\n"); - // TODO (Caleb Aikens): intentional override of PyDict_Type's tp_dealloc. Probably results in leaking dict memory self->jsObject.set(nullptr); return; @@ -49,25 +47,17 @@ void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { - printf("JSObjectProxy_new\n"); - PyObject *self = PyDict_Type.tp_new(subtype, args, kwds); // SUPER CALL - ((JSObjectProxy *)self)->jsObject = JS::RootedObject(GLOBAL_CX, nullptr); - return self; + return PyDict_Type.tp_new(subtype, args, kwds); } int JSObjectProxyMethodDefinitions::JSObjectProxy_init(JSObjectProxy *self, PyObject *args, PyObject *kwds) { - printf("JSObjectProxy_init\n"); - - // make fresh JSObject for proxy - self->jsObject.set(JS_NewPlainObject(GLOBAL_CX)); + PyDict_Type.tp_init((PyObject *)self, args, kwds); return 0; } Py_ssize_t JSObjectProxyMethodDefinitions::JSObjectProxy_length(JSObjectProxy *self) { - printf("JSObjectProxy_length\n"); - JS::RootedIdVector props(GLOBAL_CX); if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY | JSITER_HIDDEN, &props)) { @@ -80,8 +70,6 @@ Py_ssize_t JSObjectProxyMethodDefinitions::JSObjectProxy_length(JSObjectProxy *s PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, PyObject *key) { - printf("JSObjectProxy_get\n"); - JS::RootedId id(GLOBAL_CX); if (!keyToId(key, &id)) { // TODO (Caleb Aikens): raise exception here @@ -92,15 +80,11 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); PyType *pyType = pyTypeFactory(GLOBAL_CX, global, value); - delete value; - delete global; return pyType->getPyObject(); } int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, PyObject *key) { - printf("JSObjectProxy_contains\n"); - JS::RootedId id(GLOBAL_CX); if (!keyToId(key, &id)) { // TODO (Caleb Aikens): raise exception here @@ -114,8 +98,6 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, PyObject *key, PyObject *value) { - printf("JSObjectProxy_assign\n"); - JS::RootedId id(GLOBAL_CX); if (!keyToId(key, &id)) { // invalid key // TODO (Caleb Aikens): raise exception here @@ -135,8 +117,6 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, Py PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare(JSObjectProxy *self, PyObject *other, int op) { - printf("JSObjectProxy_rich_compare\n"); - if (op != Py_EQ && op != Py_NE) { Py_RETURN_NOTIMPLEMENTED; } @@ -222,8 +202,6 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_iter(JSObjectProxy *self) { - printf("JSObjectProxy_iter\n"); - JSContext *cx = GLOBAL_CX; JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(self->jsObject)); @@ -253,8 +231,6 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_iter(JSObjectProxy *self } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self) { - printf("JSObjectProxy_repr\n"); - // Detect cyclic objects PyObject *objPtr = PyLong_FromVoidPtr(self->jsObject.get()); // For `Py_ReprEnter`, we must get a same PyObject when visiting the same JSObject. diff --git a/src/ListType.cc b/src/ListType.cc index 53e65f28..cd619569 100644 --- a/src/ListType.cc +++ b/src/ListType.cc @@ -1,12 +1,8 @@ #include "include/ListType.hh" - -#include "include/modules/pythonmonkey/pythonmonkey.hh" -#include "include/JSArrayProxy.hh" #include "include/PyType.hh" -#include "include/pyTypeFactory.hh" +#include "include/JSArrayProxy.hh" -#include -#include +#include "include/modules/pythonmonkey/pythonmonkey.hh" #include diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 90515399..5d0c2e35 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -99,11 +99,12 @@ PyTypeObject JSArrayProxyType = { .tp_as_sequence = &JSArrayProxy_sequence_methods, .tp_as_mapping = &JSArrayProxy_mapping_methods, .tp_getattro = (getattrofunc)JSArrayProxyMethodDefinitions::JSArrayProxy_get, - .tp_setattro = (setattrofunc)JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DICT_SUBCLASS, .tp_doc = PyDoc_STR("Javascript Array proxy list"), + .tp_traverse = (traverseproc)JSArrayProxyMethodDefinitions::JSArrayProxy_traverse, + .tp_clear = (inquiry)JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot, .tp_richcompare = (richcmpfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare, - .tp_iter = (getiterfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_iter, // TODO review + .tp_iter = (getiterfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_iter, .tp_methods = JSArrayProxy_methods, .tp_base = &PyList_Type, .tp_init = (initproc)JSArrayProxyMethodDefinitions::JSArrayProxy_init, diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index 54adbcb2..5c1cbca6 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -9,6 +9,10 @@ def test_equal_lists_left_literal_right(): pyArray = pm.eval("Array(1,2)") assert pyArray == [1,2] +def test_equal_no_object_lists_left_literal_right(): + pyArray = pm.eval("[1,2]") + assert pyArray == [1,2] + def test_equal_lists_right_literal_left(): pyArray = pm.eval("Array(1,2)") assert [1,2] == pyArray @@ -37,5 +41,929 @@ def test_equal_sublist(): def test_not_equal_sublist_right_not_sublist(): pyArray = pm.eval("Array(1,2,[3,4])") - assert pyArray != [1,2,3,4] + assert pyArray != [1,2,3,4] + +def test_equal_self(): + a = pm.eval("([1,2,3,4])") + b = a + assert b == a + +def test_equal_other_instance(): + a = pm.eval("([1,2,3,4])") + b = [1,2,3,4] + assert b == a + +def test_not_equal_size(): + a = pm.eval("([1,2,3,4])") + b = [1,2] + assert b != a + +def test_equal_other_js_instance(): + a = pm.eval("([1,2,3,4])") + b = pm.eval("([1,2,3,4])") + assert b == a + +def test_not_equal_other_js_instance(): + a = pm.eval("([1,2,3,4])") + b = pm.eval("([1,2,4,3])") + assert b != a + +def test_not_smaller_self(): + a = pm.eval("([1,2,3,4])") + b = a + assert not(b < a) + +def test_not_smaller_equal_self(): + a = pm.eval("([1,2,3,4])") + b = a + assert b <= a + +def test_eval_arrays_proxy_get(): + f = pm.eval("(arr) => { return arr[0]}") + assert f([1,2]) == 1.0 + +def test_eval_arrays_proxy_set(): + f = pm.eval("(arr) => { arr[0] = 42.0; return;}") + pyObj = [1] + f(pyObj) + assert pyObj[0] == 42.0 + +#get +def test_get(): + pyArray = pm.eval("[1,2]") + assert pyArray[0] == 1 + +def test_get_negative_index(): + pyArray = pm.eval("[1,2]") + assert pyArray[-1] == 2 + +def test_get_index_out_of_range(): + pyArray = pm.eval("[1,2]") + try: + pyArray[3] + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == 'list index out of range' + +def test_get_index_wrong_type_str(): + pyArray = pm.eval("[1,2]") + try: + pyArray["g"] + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == 'list indices must be integers or slices, not str' + +def test_get_index_wrong_type_list(): + pyArray = pm.eval("[1,2]") + try: + pyArray[[2]] + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == 'list indices must be integers or slices, not list' + +def test_delete(): + pyArray = pm.eval("[1,2]") + del pyArray[0] + assert pyArray == [None, 2] + + +#assign +def test_assign(): + pyArray = pm.eval("[1,2]") + pyArray[0] = 6 + assert pyArray[0] == 6 + +def test_assign_negative_index(): + pyArray = pm.eval("[1,2]") + pyArray[-1] = 6 + assert pyArray[1] == 6 + +def test_assign_index_out_of_range(): + pyArray = pm.eval("[1,2]") + try: + pyArray[3] = 8 + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == 'list assignment index out of range' + +def test_assign_index_wrong_type_str(): + pyArray = pm.eval("[1,2]") + try: + pyArray["g"] = 4 + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == 'list indices must be integers or slices, not str' + + +def test_assign_index_wrong_type_list(): + pyArray = pm.eval("[1,2]") + try: + pyArray[[2]] = 9 + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == 'list indices must be integers or slices, not list' + + +#repr +def test_repr_empty_array(): + pyArray = pm.eval("[]") + expected = "[]" + assert repr(pyArray) == expected + assert str(pyArray) == expected + +def test_repr_non_empty_array(): + pyArray = pm.eval("[1,2]") + expected = "[1.0, 2.0]" + assert repr(pyArray) == expected + assert str(pyArray) == expected + +#concat +def test_concat_wrong_type(): + likes = pm.eval('([1,2])') + try: + likes + 3 + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == 'can only concatenate list (not "int") to list' + +def test_concat_empty_empty(): + pyArray = pm.eval("[]") + pyArray + [] + assert pyArray == [] + +def test_concat_not_empty_empty(): + pyArray = pm.eval("[1,2]") + pyArray + [] + assert pyArray == [1,2] + +def test_concat_not_in_place(): + pyArray = pm.eval("[1,2]") + b = pyArray + [3,4] + assert pyArray == [1,2] + +# TODO +#def test_concat_array_right(): +# pyArray = pm.eval("[1,2]") +# b = [3,4] + pyArray +# assert b == [1,2,3,4] + +def test_concat_pm_array_right(): + a = pm.eval("[1,2]") + b = pm.eval("[3,4]") + c = a + b + assert c == [1,2,3,4] + +#repeat +def test_repeat_negative(): + a = pm.eval("[1,2]") + b = a * -1 + assert b == [] + +def test_repeat_zero(): + a = pm.eval("[1,2]") + b = a * 0 + assert b == [] + +def test_repeat_once(): + a = pm.eval("[1,2]") + b = a * 1 + assert b == [1,2] + +def test_repeat_twice(): + a = pm.eval("[1,2]") + b = a * 2 + assert b == [1,2,1,2] + +def test_repeat_wrong_type(): + a = pm.eval('([1,2])') + try: + a * 1.0 + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "can't multiply sequence by non-int of type 'float'" + +def test_repeat_not_in_place(): + a = pm.eval("[1,2]") + b = a * 3 + assert b == [1.0, 2.0, 1.0, 2.0, 1.0, 2.0] + assert a == [1,2] + +#contains +def test_contains_found(): + a = pm.eval("[1,2]") + assert 1 in a + +def test_contains_not_found(): + a = pm.eval("[1,2]") + assert 7 not in a + +def test_contains_not_found_odd_type(): + a = pm.eval("[1,2]") + assert [1] not in a + +#concat in place += +def test_concat_is_inplace(): + pyArray = pm.eval("[1,2]") + pyArray += [3] + assert pyArray == [1,2,3] + +def test_concat_in_place_empty_empty(): + pyArray = pm.eval("[]") + pyArray += [] + assert pyArray == [] + +def test_concat_not_empty_empty(): + pyArray = pm.eval("[1,2]") + pyArray += [] + assert pyArray == [1,2] + +#repeat in place *= +def test_repeat_is_in_place(): + a = pm.eval("[1,2]") + a *= 3 + assert a == [1,2,1,2,1,2] + +def test_repeat_negative(): + a = pm.eval("[1,2]") + a *= -1 + assert a == [] + +def test_repeat_zero(): + a = pm.eval("[1,2]") + a *= 0 + assert a == [] + +def test_repeat_twice(): + a = pm.eval("[1,2]") + a *= 2 + assert a == [1,2,1,2] + +def test_repeat_wrong_type(): + a = pm.eval('([1,2])') + try: + a *= 1.7 + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "can't multiply sequence by non-int of type 'float'" + + +#clear +def test_clear(): + a = pm.eval("[1,2]") + a.clear() + assert a == [] + +def test_clear_with_arg(): + a = pm.eval('([1,2])') + try: + a.clear(8) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "JSArrayProxy.clear() takes no arguments (1 given)" + +#copy +def test_copy(): + a = pm.eval("[1,2]") + b = a.copy() + b[0] = 8 + assert a[0] == 1 + assert b[0] == 8 + +def test_copy_with_arg(): + a = pm.eval('([1,2])') + try: + b = a.copy(8) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "JSArrayProxy.copy() takes no arguments (1 given)" + +#append +def test_append(): + a = pm.eval("[1,2]") + b = a.append(3) + assert a == [1,2,3] + assert b == None + +#insert +def test_insert_list(): + a = pm.eval("[1,2]") + a.insert(0, [3,4]) + assert a == [[3,4],1,2] + +def test_insert_boolean(): + a = pm.eval("[1,2]") + a.insert(0, True) + assert a == [True,1,2] + +def test_insert_int(): + a = pm.eval("[1,2]") + a.insert(0, 3) + assert a == [3,1,2] + +def test_insert_float(): + a = pm.eval("[1,2]") + a.insert(0, 4.5) + assert a == [4.5,1,2] + +def test_insert_string(): + a = pm.eval("[1,2]") + a.insert(0, "Hey") + assert a == ["Hey",1,2] + +def test_insert_none(): + a = pm.eval("[1,2]") + a.insert(0, None) + assert a == [None,1,2] + +def test_insert_function(): + def f(): + return + a = pm.eval("[1,2]") + a.insert(0, f) + assert len(a) == 3 + +def test_insert_int_neg_index(): + a = pm.eval("[1,2]") + a.insert(-1, 3) + assert a == [1,3,2] + +def test_insert_int_too_large_index(): + a = pm.eval("[1,2]") + a.insert(5, 3) + assert a == [1,2,3] + +def test_insert_int_too_many_args(): + a = pm.eval('([1,2])') + try: + a.insert(5,6,7) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "insert expected 2 arguments, got 3" + +def test_insert_int_too_few_args(): + a = pm.eval('([1,2])') + try: + a.insert() + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "insert expected 2 arguments, got 0" + +# extend +def test_extend_with_list(): + a = pm.eval("[1,2]") + a.extend([3,4]) + assert a == [1,2,3,4] + +def test_extend_with_dict_single(): + a = pm.eval("[1,2]") + a.extend({'key':5}) + assert a == [1,2,'key'] + +def test_extend_with_dict_double(): + a = pm.eval("[1,2]") + a.extend({'key':5, 'otherKey':6}) + assert a == [1,2,'key','otherKey'] + +def test_extend_with_number(): + a = pm.eval('([1,2])') + try: + a.extend(3) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "'int' object is not iterable" + +def test_extend_with_own_list(): + a = pm.eval("[1,2]") + a.extend(a) + assert a == [1,2,1,2] + +def test_extend_with_pm_list(): + a = pm.eval("[1,2]") + b = pm.eval("[3,4]") + a.extend(b) + assert a == [1,2,3,4] + +# TODO iterable dict +#def test_extend_with_own_dict(): +# a = pm.eval("[1,2]") +# b = pm.eval("{'key':5}") +# a.extend(b) +# assert a == [1,2,"key"] + +#pop +def test_pop_no_arg(): + a = pm.eval("[1,2]") + b = a.pop() + assert a == [1] + assert b == 2 + +def test_pop_list_no_arg(): + a = pm.eval("[1,[2,3]]") + b = a.pop() + assert a == [1] + assert b == [2,3] + +def test_pop_first_item(): + a = pm.eval("[1,2]") + b = a.pop(0) + assert a == [2] + assert b == 1 + +def test_pop_second_item(): + a = pm.eval("[1,2]") + b = a.pop(1) + assert a == [1] + assert b == 2 + +def test_pop_negative_item(): + a = pm.eval("[1,2]") + b = a.pop(-1) + assert a == [1] + assert b == 2 + +def test_pop_out_of_bounds_item(): + a = pm.eval('([1,2])') + try: + a.pop(3) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "pop index out of range" + +#remove +def test_remove_found_once(): + a = pm.eval("[1,2]") + a.remove(1) + assert a == [2] + +def test_remove_found_twice(): + a = pm.eval("[1,2,1,2]") + a.remove(1) + assert a == [2,1,2] + +def test_remove_no_args(): + a = pm.eval('([1,2])') + try: + a.remove() + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "JSArrayProxy.remove() takes exactly one argument (0 given)" + +def test_remove_no_args(): + a = pm.eval('([1,2])') + try: + a.remove(3) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "list.remove(x): x not in list" + +#index +def test_index_found(): + a = pm.eval("[1,2,3,4]") + b = a.index(3) + assert b == 2 + +def test_index_not_found(): + a = pm.eval('([1,2])') + try: + a.index(3) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "3 is not in list" + +def test_index_no_args(): + a = pm.eval('([1,2,3,4])') + try: + a.index() + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "index expected at least 1 argument, got 0" + +def test_index_too_many_args(): + a = pm.eval('([1,2,3,4])') + try: + a.index(2,3,4,5) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "index expected at most 3 arguments, got 4" + +def test_index_found_with_start(): + a = pm.eval("[1,2,3,4]") + b = a.index(3, 0) + assert b == 2 + +def test_index_found_with_negative_start(): + a = pm.eval("[1,2,3,4]") + b = a.index(3, -3) + assert b == 2 + +def test_index_not_found_with_start(): + a = pm.eval('([1,2,3,4])') + try: + a.index(3, 4) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "3 is not in list" + +def test_index_found_with_start_and_stop(): + a = pm.eval("[1,2,3,4]") + b = a.index(3,1,4) + assert b == 2 + +def test_index_found_with_start_and_negative_stop(): + a = pm.eval("[1,2,3,4]") + b = a.index(3,1,-1) + assert b == 2 + +def test_index_not_found_with_start_and_stop(): + a = pm.eval('([1,2,3,4])') + try: + a.index(3,4,4) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "3 is not in list" + +def test_index_not_found_with_start_and_outofbounds_stop(): + a = pm.eval('([1,2,3,4])') + try: + a.index(3,4,7) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "3 is not in list" + +#count +def test_count_found_once(): + a = pm.eval("[1,2,3,4]") + b = a.count(1) + assert b == 1 + +def test_count_found_once_non_primitive_type(): + a = pm.eval("[1,2,[3,4]]") + b = a.count([3,4]) + assert b == 1 + +def test_count_found_twice(): + a = pm.eval("[1,2,3,4,5,1,2]") + b = a.count(2) + assert b == 2 + +def test_count_not_found(): + a = pm.eval("[1,2,3,4,5,1,2]") + b = a.count(7) + assert b == 0 + +#reverse +def test_reverse(): + a = pm.eval("[1,2,3,4]") + b = a.reverse() + assert a == [4,3,2,1] + assert b == None + +def test_reverse_zero_length(): + a = pm.eval("[]") + a.reverse() + assert a == [] + +def test_reverse_one_length(): + a = pm.eval("[2]") + a.reverse() + assert a == [2] + +def test_reverse_too_many_args(): + a = pm.eval('([1,2,3,4])') + try: + a.reverse(3) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "JSArrayProxy.reverse() takes no arguments (1 given)" + +#sort +def test_sort(): + a = pm.eval("[5,1,2,4,9,6,3,7,8]") + a.sort() + assert a == [1,2,3,4,5,6,7,8,9] + +def test_sort_reverse(): + a = pm.eval("[5,1,2,4,9,6,3,7,8]") + a.sort(reverse=True) + assert a == [9,8,7,6,5,4,3,2,1] + +def test_sort_reverse_false(): + a = pm.eval("[5,1,2,4,9,6,3,7,8]") + a.sort(reverse=False) + assert a == [1,2,3,4,5,6,7,8,9] + +def test_sort_with_function(): + def myFunc(e,f): + return len(e) - len(f) + a = pm.eval("(['Ford', 'Mitsubishi', 'BMW', 'VW'])") + a.sort(key=myFunc) + assert a == ['VW', 'BMW', 'Ford', 'Mitsubishi'] + +def test_sort_with_js_function(): + a = pm.eval("(['Ford', 'Mitsubishi', 'BMW', 'VW'])") + myFunc = pm.eval("((a, b) => a.toLocaleUpperCase() < b.toLocaleUpperCase() ? -1 : 1)") + a.sort(key=myFunc) + assert a == ['BMW', 'Ford', 'Mitsubishi', 'VW'] + +# TODO does not report exception for one-arg function +#def test_sort_with_one_arg_function(): +# def myFunc(e): +# return len(e) +# a = pm.eval("(['Ford', 'Mitsubishi', 'BMW', 'VW'])") +# a.sort(key=myFunc) +# assert a == ['VW', 'BMW', 'Ford', 'Mitsubishi'] + +def test_sort_with_function_and_reverse_false(): + def myFunc(e,f): + return len(e) - len(f) + a = pm.eval("(['Ford', 'Mitsubishi', 'BMW', 'VW'])") + a.sort(key=myFunc, reverse=False) + assert a == ['VW', 'BMW', 'Ford', 'Mitsubishi'] + +def test_sort_with_js_function_and_reverse_false(): + a = pm.eval("(['Ford', 'Mitsubishi', 'BMW', 'VW'])") + myFunc = pm.eval("((a, b) => a.toLocaleUpperCase() < b.toLocaleUpperCase() ? -1 : 1)") + a.sort(key=myFunc, reverse=False) + assert a == ['BMW', 'Ford', 'Mitsubishi', 'VW'] + +def test_sort_with_function_and_reverse(): + def myFunc(e,f): + return len(e) - len(f) + a = pm.eval("(['Ford', 'Mitsubishi', 'BMW', 'VW'])") + a.sort(key=myFunc, reverse=True) + assert a == ['Mitsubishi', 'Ford', 'BMW', 'VW'] + +def test_sort_with_js_function_and_reverse(): + a = pm.eval("(['Ford', 'Mitsubishi', 'BMW', 'VW'])") + myFunc = pm.eval("((a, b) => a.toLocaleUpperCase() < b.toLocaleUpperCase() ? -1 : 1)") + a.sort(key=myFunc, reverse=True) + assert a == ['VW', 'Mitsubishi', 'Ford', 'BMW'] + +def test_sort_with_function_wrong_type(): + a = pm.eval('([1,2,3,4])') + try: + b = 9 + a.sort(key=b) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "'int' object is not callable" + +#iter +def iter_min(): + a = pm.eval("([7,9,1,2,3,4,5,6])") + b = min(a) + assert b == 1 + +def iter_max(): + a = pm.eval("([7,9,1,2,3,4,5,6])") + b = max(a) + assert b == 9 + +def iter_op(): + a = pm.eval("(['this is a test', 'another test'])") + b = [item.upper() for item in a] + assert b == ['THIS IS A TEST', 'ANOTHER TEST'] + +# slice subscript +def test_slice_full_array_single_subscript(): + a = pm.eval("([1,2,3,4,5,6])") + b = a[:] + assert b == [1,2,3,4,5,6] + +def test_slice_full_array_double_subscript(): + a = pm.eval("([1,2,3,4,5,6])") + b = a[::] + assert b == [1,2,3,4,5,6] + +def test_slice_empty_length_left(): + a = pm.eval("([1,2,3,4,5,6])") + b = a[len(a):] + assert b == [] + +def test_slice_full_length_right(): + a = pm.eval("([1,2,3,4,5,6])") + b = a[:len(a)] + assert b == [1,2,3,4,5,6] + +def test_slice_zero_to_length(): + a = pm.eval("([1,2,3,4,5,6])") + b = a[0:6] + assert b == [1,2,3,4,5,6] + +def test_slice(): + a = pm.eval("([1,2,3,4,5,6])") + b = a[1:5] + assert b == [2,3,4,5] + +def test_slice_negative_start(): + a = pm.eval("([1,2,3,4,5,6])") + b = a[-3:5] + assert b == [4,5] + +def test_slice_negative_end(): + a = pm.eval("([1,2,3,4,5,6])") + b = a[2:-1] + assert b == [3,4,5] + +def test_slice_negative_start_negative_end(): + a = pm.eval("([1,2,3,4,5,6])") + b = a[-3:-1] + assert b == [4,5] + +def test_slice_step_zero(): + a = pm.eval('([1,2,3,4])') + try: + a[0:6:0] + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "slice step cannot be zero" + +def test_slice_step_negative(): + a = pm.eval("([1,2,3,4,5,6])") + b = a[0:5:-1] + assert b == [] + +def test_slice_step_one(): + a = pm.eval("([1,2,3,4,5,6])") + b = a[1:5:1] + assert b == [2,3,4,5] + +def test_slice_step_two(): + a = pm.eval("([1,2,3,4,5,6])") + b = a[1:5:2] + assert b == [2,4] + +def test_slice_step_three(): + a = pm.eval("([1,2,3,4,5,6])") + b = a[1:5:3] + assert b == [2,5] + +#slice subscript assign +def test_slice_assign_partial_array(): + a = pm.eval("([1,2,3,4,5,6])") + a[2:4] = [7,8,9,0,1,2] + assert a == [1,2,7,8,9,0,1,2,5,6] + +def test_slice_delete_partial_array(): + a = pm.eval("([1,2,3,4,5,6])") + del a[2:4] + assert a == [1,2,5,6] + +def test_slice_assign_own_array(): + a = pm.eval("([1,2,3,4,5,6])") + a[2:4] = a + assert a == [1,2,1,2,3,4,5,6,5,6] + +def test_slice_assign_pm_array(): + a = pm.eval("([1,2,3,4,5,6])") + b = pm.eval("([7,8])") + a[2:4] = b + assert a == [1,2,7,8,5,6] + +def test_slice_assign_wrong_type(): + a = pm.eval('([1,2,3,4])') + try: + a[2:4] = 6 + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "can only assign an iterable" + +def test_slice_assign_negative_low(): + a = pm.eval("([1,2,3,4,5,6])") + a[-3:6] = [7,8] + assert a == [1,2,3,7,8] + +def test_slice_assign_negative_low_negative_high(): + a = pm.eval("([1,2,3,4,5,6])") + a[-3:-1] = [7,8] + assert a == [1,2,3,7,8,6] + +def test_slice_assign_high_larger_than_length(): + a = pm.eval("([1,2,3,4,5,6])") + a[1:8] = [7,8] + assert a == [1,7,8] + +def test_slice_assign_clear(): + a = pm.eval("([1,2,3,4,5,6,7,8,9,1,2])") + a[0:32] = [] + assert a == [] + +def test_slice_delete_partial_array_step_negative(): + a = pm.eval("([1,2,3,4,5,6])") + del a[0:4:-1] + assert a == [1,2,3,4,5,6] + +def test_slice_delete_partial_array_step_one(): + a = pm.eval("([1,2,3,4,5,6])") + del a[2:4:1] + assert a == [1,2,5,6] + +def test_slice_delete_partial_array_step_two(): + a = pm.eval("([1,2,3,4,5,6])") + del a[2:6:2] + assert a == [1,2,4,6] + +def test_slice_delete_partial_array_step_three(): + a = pm.eval("([1,2,3,4,5,6])") + del a[0:6:3] + assert a == [2,3,5,6] + +def test_slice_delete_partial_array_step_two_negative_start(): + a = pm.eval("([1,2,3,4,5,6])") + del a[-5:6:2] + assert a == [1,3,5] + +def test_slice_delete_partial_array_step_two_negative_start_negative_end(): + a = pm.eval("([1,2,3,4,5,6])") + del a[-5:-2:2] + assert a == [1,3,5,6] + +def test_slice_assign_step_wrong_list_size(): + a = pm.eval('([1,2,3,4])') + try: + a[0:4:2] = [1] + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "attempt to assign sequence of size 1 to extended slice of size 2" + +def test_slice_assign_partial_array_step_negative(): + a = pm.eval("([1,2,3,4,5,6])") + a[2:4:2] = [7] + assert a == [1,2,7,4,5,6] + +def test_slice_assign_step_zero(): + a = pm.eval('([1,2,3,4])') + try: + a[0:4:0] = [1] + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "slice step cannot be zero" + +def test_slice_assign_partial_array_step_2(): + a = pm.eval("([1,2,3,4,5,6])") + a[2:4:2] = [7] + assert a == [1,2,7,4,5,6] + +def test_slice_assign_step_wrong_type(): + a = pm.eval('([1,2,3,4])') + try: + a[2:4:2] = 6 + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "must assign iterable to extended slice" + +def test_slice_assign_partial_array_negative_start(): + a = pm.eval("([1,2,3,4,5,6])") + a[-5:4:2] = [7,8] + assert a == [1, 7, 3, 8, 5, 6] + +def test_slice_assign_partial_array_negative_start_negative_stop(): + a = pm.eval("([1,2,3,4,5,6])") + a[-5:-1:2] = [7,8] + assert a == [1, 7, 3, 8, 5, 6] + +def test_slice_assign_own_array_no_match(): + a = pm.eval("([1,2,3,4,5,6])") + try: + a[0:4:2] = a + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "attempt to assign sequence of size 0 to extended slice of size 2" + +def test_slice_assign_pm_array_step_2(): + a = pm.eval("([1,2,3,4,5,6])") + b = pm.eval("([1,2,3])") + a[0:10:2] = b + assert a == [1, 2, 2, 4, 3, 6] \ No newline at end of file From ed8ec50f8a4522e1db7f71731e03ebc82809d29d Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Fri, 8 Dec 2023 16:22:34 -0500 Subject: [PATCH 0096/1086] cleanup --- include/JSArrayProxy.hh | 87 +++++++++++++++----------------------- include/JSObjectProxy.hh | 2 +- src/JSObjectProxy.cc | 7 ++- tests/python/test_lists.py | 1 - 4 files changed, 37 insertions(+), 60 deletions(-) diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh index b6a9fc2d..0ce8b0c8 100644 --- a/include/JSArrayProxy.hh +++ b/include/JSArrayProxy.hh @@ -58,7 +58,7 @@ public: static int JSArrayProxy_init(JSArrayProxy *self, PyObject *args, PyObject *kwds); /** - * @brief Length method (.mp_length and .sq_length), returns the number of key-value pairs in the JSObject, used by the python len() method + * @brief Length method (.mp_length and .sq_length), returns the number of keys in the JSObject, used by the python len() method * * @param self - The JSArrayProxy * @return Py_ssize_t The length of the JSArrayProxy @@ -66,7 +66,7 @@ public: static Py_ssize_t JSArrayProxy_length(JSArrayProxy *self); /** - * @brief returns a value from the JSArrayProxy given a key, used by several built-in python methods as well as the [] operator + * @brief returns a value from the JSArrayProxy given a key, or dispatches to the given key method if such method is found * * @param self - The JSArrayProxy * @param key - The key for the value in the JSArrayProxy @@ -76,7 +76,7 @@ public: /** - * @brief Getter method (.mp_subscript), returns a value from the JSArrayProxy given a key, used by several built-in python methods as well as the [] operator + * @brief Getter method (.mp_subscript), returns a value from the JSArrayProxy given a key which can be a slice, used by several built-in python methods as well as the [] and operator * * @param self - The JSArrayProxy * @param key - The key for the value in the JSArrayProxy @@ -95,16 +95,7 @@ public: static int JSArrayProxy_assign_key(JSArrayProxy *self, PyObject *key, PyObject *value); /** - * @brief Helper function for various JSArrayProxy methods, sets a key-value pair on a JSObject given a python string key and a JS::Value value - * - * @param jsObject - The underlying backing store JSObject for the JSArrayProxy - * @param key - The key to be assigned or deleted - * @param value - The JS::Value to be assigned - */ - static void JSArrayProxy_set_helper(JS::HandleObject jsObject, PyObject *key, JS::HandleValue value); - - /** - * @brief Comparison method (.tp_richcompare), returns appropriate boolean given a comparison operator and other pyobject + * @brief Comparison method (.tp_richcompare), returns appropriate boolean given a comparison operator and other pyObject * * @param self - The JSArrayProxy * @param other - Any other PyObject @@ -114,7 +105,7 @@ public: static PyObject *JSArrayProxy_richcompare(JSArrayProxy *self, PyObject *other, int op); /** - * @brief Return an iterator object to make JSArrayProxy iterable, emitting (key, value) tuples + * @brief Return an iterator object to make JSArrayProxy iterable * * @param self - The JSArrayProxy * @return PyObject* - iterator object @@ -139,7 +130,7 @@ public: static PyObject *JSArrayProxy_concat(JSArrayProxy *self, PyObject *value); /** - * @brief repeat method (.sq_repeat) + * @brief repeat method (.sq_repeat), repeat self n number of time * * @param self - The JSArrayProxy * @param n The number of times to repeat @@ -148,26 +139,7 @@ public: static PyObject *JSArrayProxy_repeat(JSArrayProxy *self, Py_ssize_t n); /** - * @brief Getter method (.sq_item), returns a value from the JSArrayProxy given an index, used by several built-in python methods as well as the [] operator - * - * @param self - The JSArrayProxy - * @param index - The index for the value in the JSArrayProxy - * @return PyObject* NULL on exception, the corresponding value otherwise - */ - // static PyObject *JSArrayProxy_item(JSArrayProxy *self, Py_ssize_t index); - - /** - * @brief Assign method (.sq_ass_item), assigns a value at index if value is non-NULL, or deletes a key-value pair if value is NULL - * - * @param self - The JSObjectProxy - * @param index - The index for the value in the JSArrayProxy - * @param value If NULL, the key-value pair is deleted, if not NULL then a key-value pair is assigned - * @return int -1 on exception, a0 on success - */ - // static int JSArrayProxy_assign_index(JSArrayProxy *self, Py_ssize_t index, PyObject *value); - - /** - * @brief Test contains method (.sq_contains), assigns a value at index if value is non-NULL, or deletes a key-value pair if value is NULL + * @brief Test contains method (.sq_contains) * * @param self - The JSObjectProxy * @param element - The element in the JSArrayProxy @@ -176,28 +148,28 @@ public: static int JSArrayProxy_contains(JSArrayProxy *self, PyObject *element); /** - * @brief inplace_concat method (.sq_inplace_concat), concatenates + * @brief inplace_concat method (.sq_inplace_concat), concatenates in_place * * @param self - The JSArrayProxy * @param value - The value to be concatenated - * @return PyObject* NULL on exception, the corresponding new value otherwise + * @return PyObject* self */ static PyObject *JSArrayProxy_inplace_concat(JSArrayProxy *self, PyObject *value); /** - * @brief inplace_repeat method (.sq_inplace_repeat) + * @brief inplace_repeat method (.sq_inplace_repeat), repeats in_place * * @param self - The JSArrayProxy * @param n The number of times to repeat - * @return PyObject* NULL on exception, the corresponding new value otherwise + * @return PyObject* self */ static PyObject *JSArrayProxy_inplace_repeat(JSArrayProxy *self, Py_ssize_t n); /** - * @brief clear method (.tp_clear) + * @brief clear method, empties the array * * @param self - The JSArrayProxy - * @return 0 on success + * @return None */ static PyObject *JSArrayProxy_clear(JSArrayProxy *self); @@ -213,6 +185,8 @@ public: * @brief .tp_traverse method * * @param self - The JSArrayProxy + * @param visitproc - The function to be applied on each element of the list + * @param arg - The argument to the visit function * @return 0 on success */ static int JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg); @@ -230,7 +204,7 @@ public: * * @param self - The JSArrayProxy * @param value - The value to be appended - * @return None + * @return PyObject* NULL on exception, None otherwise */ static PyObject *JSArrayProxy_append(JSArrayProxy *self, PyObject *value); @@ -238,7 +212,9 @@ public: * @brief insert method * * @param self - The JSArrayProxy - * @return PyObject* NULL on exception, the corresponding new value otherwise + * @param args - arguments to the insert method + * @param nargs - number of arguments to the insert method + * @return PyObject* NULL on exception, None otherwise */ static PyObject *JSArrayProxy_insert(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs); @@ -247,7 +223,7 @@ public: * * @param self - The JSArrayProxy * @param value - The value to be appended - * @return None + * @return PyObject* NULL on exception, None otherwise */ static PyObject *JSArrayProxy_extend(JSArrayProxy *self, PyObject *iterable); @@ -255,7 +231,9 @@ public: * @brief pop method * * @param self - The JSArrayProxy - * @return PyObject* NULL on exception, the corresponding new value otherwise + * @param args - arguments to the pop method + * @param nargs - number of arguments to the pop method + * @return PyObject* NULL on exception, the corresponding value otherwise */ static PyObject *JSArrayProxy_pop(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs); @@ -264,7 +242,7 @@ public: * * @param self - The JSArrayProxy * @param value - The value to be appended - * @return PyObject* NULL on exception, the corresponding new value otherwise + * @return PyObject* NULL on exception, None otherwise */ static PyObject *JSArrayProxy_remove(JSArrayProxy *self, PyObject *value); @@ -272,16 +250,18 @@ public: * @brief index method * * @param self - The JSArrayProxy - * @return PyObject* NULL on exception, the corresponding new value otherwise + * @param args - arguments to the index method + * @param nargs - number of arguments to the index method + * @return PyObject* NULL on exception, the corresponding index of the found value as PyLong otherwise */ static PyObject *JSArrayProxy_index(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs); /** - * @brief count method Remove first occurrence of value + * @brief count method * * @param self - The JSArrayProxy * @param value - The value to be appended - * @return PyObject* NULL on exception, the corresponding new value otherwise + * @return PyObject* NULL on exception, the corresponding count of the found value as PyLong otherwise */ static PyObject *JSArrayProxy_count(JSArrayProxy *self, PyObject *value); @@ -289,7 +269,7 @@ public: * @brief reverse method Reverse list in place * * @param self - The JSArrayProxy - * @return PyObject* NULL on exception, the corresponding new value otherwise + * @return PyObject* NULL on exception, None otherwise */ static PyObject *JSArrayProxy_reverse(JSArrayProxy *self); @@ -297,8 +277,9 @@ public: * @brief sort method sort in place * * @param self - The JSArrayProxy - * @param value - The value to be appended - * @return PyObject* NULL on exception, the corresponding new value otherwise + * @param args - arguments to the sort method + * @param nargs - number of arguments to the sort method + * @return PyObject* NULL on exception, None otherwise */ static PyObject *JSArrayProxy_sort(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); }; @@ -322,8 +303,6 @@ static PySequenceMethods JSArrayProxy_sequence_methods = { .sq_length = (lenfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_length, .sq_concat = (binaryfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_concat, .sq_repeat = (ssizeargfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_repeat, - // .sq_item = (ssizeargfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_item, TODO how to exercise? - // .sq_ass_item = (ssizeobjargproc)JSArrayProxyMethodDefinitions::JSArrayProxy_assign_index, TODO how to exercise? .sq_contains = (objobjproc)JSArrayProxyMethodDefinitions::JSArrayProxy_contains, .sq_inplace_concat = (binaryfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_concat, .sq_inplace_repeat = (ssizeargfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 3357803b..3aa305fa 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -129,7 +129,7 @@ public: * @return the string representation (a PyUnicodeObject) on success, NULL on failure */ static PyObject *JSObjectProxy_repr(JSObjectProxy *self); - + /** * @brief Set union operation * diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 6d6dfe3d..be2c0755 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -44,7 +44,6 @@ void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) { // TODO (Caleb Aikens): intentional override of PyDict_Type's tp_dealloc. Probably results in leaking dict memory self->jsObject.set(nullptr); - PyObject_GC_UnTrack(self); Py_TYPE(self)->tp_free((PyObject *)self); return; } @@ -86,7 +85,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - + // look through the methods for dispatch for (size_t index = 0;; index++) { const char *methodName = JSObjectProxyType.tp_methods[index].ml_name; @@ -443,7 +442,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProx JS::Rooted> args(GLOBAL_CX); args[0].setObjectOrNull(JS_NewPlainObject(GLOBAL_CX)); args[1].setObjectOrNull(self->jsObject); - + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); // call Object.assign @@ -454,4 +453,4 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProx JS::RootedValue ret(GLOBAL_CX); if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); -} \ No newline at end of file +} \ No newline at end of file diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index 5c1cbca6..4b1016ad 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -961,7 +961,6 @@ def test_slice_assign_own_array_no_match(): assert str(type(e)) == "" assert str(e) == "attempt to assign sequence of size 0 to extended slice of size 2" - def test_slice_assign_pm_array_step_2(): a = pm.eval("([1,2,3,4,5,6])") b = pm.eval("([1,2,3])") From a4c3e945f7a51d9bc2efcab48a329ab1f8ab6c0a Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Fri, 8 Dec 2023 17:12:12 -0500 Subject: [PATCH 0097/1086] merge fixup --- src/JSArrayProxy.cc | 2 +- tests/python/test_dicts.py | 65 +++++++++++++++++++++++++++++++++++++- 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index fccce4fe..81c95a00 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -1160,4 +1160,4 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P } } Py_RETURN_NONE; -} +} \ No newline at end of file diff --git a/tests/python/test_dicts.py b/tests/python/test_dicts.py index 68c06717..5e8bd4d2 100644 --- a/tests/python/test_dicts.py +++ b/tests/python/test_dicts.py @@ -68,6 +68,69 @@ def test_eval_objects_proxy_not_extensible(): assert False == pm.eval("(o) => Object.isExtensible(o)")({}) assert False == pm.eval("(o) => Object.isExtensible(o)")({ "abc": 1 }) assert True == pm.eval("(o) => Object.preventExtensions(o) === o")({}) + +def test_eval_objects_jsproxy_contains(): + a = pm.eval("({'c':5})") + assert 'c' in a + +def test_eval_objects_jsproxy_does_not_contain(): + a = pm.eval("({'c':5})") + assert not(4 in a) + +def test_eval_objects_jsproxy_does_not_contain_value(): + a = pm.eval("({'c':5})") + assert not(5 in a) + +def test_eval_objects_jsproxy_or(): + if sys.version_info[0] >= 3 and sys.version_info[1] >= 9: # | is not implemented for dicts in 3.8 or less + a = pm.eval("({'c':5})") + b = pm.eval("({'d':6})") + c = a | b + assert a == {'c': 5.0} + assert c == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} + +def test_eval_objects_jsproxy_or_true_dict_right(): + if sys.version_info[0] >= 3 and sys.version_info[1] >= 9: # | is not implemented for dicts in 3.8 or less + a = pm.eval("({'c':5})") + b = {'d': 6.0} + c = a | b + assert a == {'c': 5.0} + assert c == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} + +def test_eval_objects_jsproxy_or_true_dict_left(): + if sys.version_info[0] >= 3 and sys.version_info[1] >= 9: # | is not implemented for dicts in 3.8 or less + a = {'c':5} + b = pm.eval("({'d':6})") + c = a | b + assert a == {'c': 5.0} + assert c == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} + +def test_eval_objects_jsproxy_inplace_or(): + if sys.version_info[0] >= 3 and sys.version_info[1] >= 9: # | is not implemented for dicts in 3.8 or less + a = pm.eval("({'c':5})") + b = pm.eval("({'d':6})") + a |= b + assert a == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} + +def test_eval_objects_jsproxy_inplace_or_true_dict_right(): + if sys.version_info[0] >= 3 and sys.version_info[1] >= 9: # | is not implemented for dicts in 3.8 or less + a = pm.eval("({'c':5})") + b = {'d':6.0} + a |= b + assert a == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} + +def test_eval_objects_jsproxy_inplace_or_true_dict_left(): + if sys.version_info[0] >= 3 and sys.version_info[1] >= 9: # | is not implemented for dicts in 3.8 or less + a = {'c':5.0} + b = pm.eval("({'d':6})") + a |= b + assert a == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} assert True == pm.eval("(o) => Object.preventExtensions(o) === o")({ "abc": 1 }) def test_eval_objects_proxy_proto(): @@ -189,4 +252,4 @@ def test_eval_objects_jsproxy_inplace_or_true_dict_left(): b = pm.eval("({'d':6})") a |= b assert a == {'c': 5.0, 'd': 6.0} - assert b == {'d': 6.0} + assert b == {'d': 6.0} \ No newline at end of file From a82a28608854f94fb605b132e8f34e74b180ab61 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 11 Dec 2023 11:18:48 -0500 Subject: [PATCH 0098/1086] Improved memory management --- src/JSArrayProxy.cc | 81 +++++++++++++++++++++----------------------- src/JSObjectProxy.cc | 32 +++++++++++------ 2 files changed, 60 insertions(+), 53 deletions(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 81c95a00..d480947a 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -59,7 +59,6 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - // look through the methods for dispatch and return key if no method found for (size_t index = 0;; index++) { const char *methodName = JSArrayProxyType.tp_methods[index].ml_name; @@ -88,8 +87,7 @@ static PyObject *list_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihig PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, jReturnedArray)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), jReturnedArray)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy *self, PyObject *key) @@ -146,8 +144,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy JS::RootedValue *jCombinedArrayValue = new JS::RootedValue(GLOBAL_CX); jCombinedArrayValue->setObjectOrNull(jCombinedArray); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, jCombinedArrayValue)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), jCombinedArrayValue)->getPyObject(); } } else { @@ -455,19 +452,20 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * } } - JS::RootedValue elementVal(GLOBAL_CX); + JS::RootedValue *elementVal; JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); Py_ssize_t index; /* Search for the first index where items are different */ for (index = 0; index < selfLength && index < otherLength; index++) { - JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); - PyObject *leftItem = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + PyObject *leftItem = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); PyObject *rightItem; if (PyObject_TypeCheck(other, &JSArrayProxyType)) { - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)other)->jsObject, index, &elementVal); - rightItem = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)other)->jsObject, index, elementVal); + rightItem = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); } else { rightItem = ((PyListObject *)other)->ob_item[index]; } @@ -502,9 +500,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * Py_RETURN_TRUE; } - JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); /* Compare the final item again using the proper operator */ - return PyObject_RichCompare(pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(), ((PyListObject *)other)->ob_item[index], op); + return PyObject_RichCompare(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(), ((PyListObject *)other)->ob_item[index], op); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { @@ -526,7 +525,6 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { /* "[" + "1" + ", 2" * (len - 1) + "]" */ writer.min_length = 1 + 1 + (2 + 1) * (selfLength - 1) + 1; - JS::RootedValue elementVal(GLOBAL_CX); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); if (_PyUnicodeWriter_WriteChar(&writer, '[') < 0) { @@ -541,9 +539,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { } } - JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); - PyObject *s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject()); + PyObject *s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); if (s == NULL) { goto error; } @@ -574,11 +573,11 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_iter(JSArrayProxy *self) { PyObject *seq = PyList_New(selfLength); - JS::RootedValue elementVal(GLOBAL_CX); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); for (size_t index = 0; index < selfLength; index++) { - JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); - PyList_SET_ITEM(seq, index, pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject()); + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + PyList_SET_ITEM(seq, index, pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); } // Convert to a Python iterator @@ -638,8 +637,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_concat(JSArrayProxy *self, JS::RootedValue *jCombinedArrayValue = new JS::RootedValue(GLOBAL_CX); jCombinedArrayValue->setObjectOrNull(jCombinedArray); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, jCombinedArrayValue)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), jCombinedArrayValue)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, Py_ssize_t n) { @@ -666,8 +664,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, JS::RootedValue jCombinedArrayValue(GLOBAL_CX); jCombinedArrayValue.setObjectOrNull(jCombinedArray); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, &jCombinedArrayValue)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), &jCombinedArrayValue)->getPyObject(); } int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyObject *element) { @@ -675,11 +672,11 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyO int cmp; Py_ssize_t numElements = JSArrayProxy_length(self); - JS::RootedValue elementVal(GLOBAL_CX); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); for (index = 0, cmp = 0; cmp == 0 && index < numElements; ++index) { - JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); - PyObject *item = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + PyObject *item = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); Py_INCREF(item); cmp = PyObject_RichCompareBool(item, element, Py_EQ); Py_DECREF(item); @@ -751,11 +748,11 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot(JSArrayProxy *self) { } int JSArrayProxyMethodDefinitions::JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg) { - JS::RootedValue elementVal(GLOBAL_CX); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); for (Py_ssize_t i = JSArrayProxy_length(self); --i >= 0; ) { - JS_GetElement(GLOBAL_CX, self->jsObject, i, &elementVal); - Py_VISIT(pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject()); + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, self->jsObject, i, elementVal); + Py_VISIT(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); } return 0; } @@ -769,8 +766,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, jReturnedArray)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), jReturnedArray)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_append(JSArrayProxy *self, PyObject *value) { @@ -950,21 +946,20 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_pop(JSArrayProxy *self, Py // need the value in the returned array, not the array itself JS::RootedObject rootedReturnedArray(GLOBAL_CX, jReturnedArray.toObjectOrNull()); - JS::RootedValue elementVal(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, rootedReturnedArray, 0, &elementVal); + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, rootedReturnedArray, 0, elementVal); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), elementVal)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self, PyObject *value) { Py_ssize_t selfSize = JSArrayProxy_length(self); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t index = 0; index < selfSize; index++) { - JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1027,10 +1022,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_index(JSArrayProxy *self, } JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t index = start; index < stop && index < selfSize; index++) { - JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1051,10 +1046,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_count(JSArrayProxy *self, Py_ssize_t length = JSArrayProxy_length(self); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t index = 0; index < length; index++) { - JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index be2c0755..16d4338d 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -289,7 +289,8 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, if (!PyObject_TypeCheck(self, &JSObjectProxyType) && PyObject_TypeCheck(other, &JSObjectProxyType)) { return PyDict_Type.tp_as_number->nb_or((PyObject *)&(self->dict), other); - } else { + } + else { JS::Rooted> args(GLOBAL_CX); args[0].setObjectOrNull(JS_NewPlainObject(GLOBAL_CX)); args[1].setObjectOrNull(self->jsObject); // this is null is left operand is real dict @@ -303,10 +304,13 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); - JS::RootedValue ret(GLOBAL_CX); + JS::RootedValue *ret = new JS::RootedValue(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; - return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); + if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, ret)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); + return NULL; + } + return pyTypeFactory(GLOBAL_CX, global, ret)->getPyObject(); } } @@ -327,8 +331,11 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_ior(JSObjectProxy *self, JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); - JS::RootedValue ret(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; + JS::RootedValue *ret = new JS::RootedValue(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, ret)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); + return NULL; + } Py_INCREF(self); return (PyObject *)self; } @@ -413,10 +420,12 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy } _PyErr_SetKeyError(key); return NULL; - } else { + } + else { JS::ObjectOpResult ignoredResult; JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); } } @@ -450,7 +459,10 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProx JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); - JS::RootedValue ret(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) return NULL; - return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); + JS::RootedValue *ret = new JS::RootedValue(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, ret)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); + return NULL; + } + return pyTypeFactory(GLOBAL_CX, global, ret)->getPyObject(); } \ No newline at end of file From c6f048f4c005d842d15faacb1e0ab33b8f0cbf2d Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 11 Dec 2023 11:22:19 -0500 Subject: [PATCH 0099/1086] added test --- tests/python/test_lists.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index 4b1016ad..0089a562 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -471,6 +471,15 @@ def test_pop_no_arg(): assert a == [1] assert b == 2 +def test_pop_empty_list(): + a = pm.eval('([])') + try: + a.pop() + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "pop from empty list" + def test_pop_list_no_arg(): a = pm.eval("[1,[2,3]]") b = a.pop() From 1434e6e64ccc8a0c779814125ca309fc96fef2fb Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 12 Dec 2023 15:50:25 -0500 Subject: [PATCH 0100/1086] Acknowledge cpython --- LICENSE | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/LICENSE b/LICENSE index 6a6eff92..4899df7f 100644 --- a/LICENSE +++ b/LICENSE @@ -19,3 +19,9 @@ 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 (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 +Python Software Foundation; All Rights Reserved \ No newline at end of file From 73962b10726ba1500ad36ddb3008f2c5254334f9 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 12 Dec 2023 17:07:11 -0500 Subject: [PATCH 0101/1086] cleanup --- src/JSArrayProxy.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index d480947a..11b07d99 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -424,7 +424,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * Py_RETURN_NOTIMPLEMENTED; } - if (self == (JSArrayProxy *)other && (op == Py_EQ || op == Py_NE)) { // TODO How is this potential bad cast allowed? + if (self == (JSArrayProxy *)other && (op == Py_EQ || op == Py_NE)) { if (op == Py_EQ) { Py_RETURN_TRUE; } @@ -761,7 +761,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) { JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].setInt32(0); jArgs[1].setInt32(JSArrayProxy_length(self)); - JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); // TODO use stack alloc + JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "slice", jArgs, jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; @@ -828,7 +828,6 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_insert(JSArrayProxy *self, Py_RETURN_NONE; } -// TODO needs to be on the heap? PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_extend(JSArrayProxy *self, PyObject *iterable) { // Special cases: // 1) lists and tuples which can use PySequence_Fast ops @@ -855,7 +854,6 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_extend(JSArrayProxy *self, PyObject **src = PySequence_Fast_ITEMS(iterable); for (Py_ssize_t i = 0; i < n; i++) { PyObject *o = src[i]; - Py_INCREF(o); // TODO in or out JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, o)); JS_SetElement(GLOBAL_CX, self->jsObject, m + i, jValue); } @@ -934,7 +932,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_pop(JSArrayProxy *self, Py return NULL; } - JS::Rooted> jArgs(GLOBAL_CX); // TODO needs to be on the heap? + JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].setInt32(index); jArgs[1].setInt32(1); From adb0adeade3ed17b07b1ed1257a809495b79863a Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 14 Dec 2023 13:20:13 -0500 Subject: [PATCH 0102/1086] Improvements --- include/JSArrayProxy.hh | 5 +++++ include/JSObjectProxy.hh | 5 +++++ src/JSArrayProxy.cc | 24 ++++++++++++------------ tests/python/test_list_methods.py | 1 - tests/python/test_lists.py | 17 +++++++++++++++-- 5 files changed, 37 insertions(+), 15 deletions(-) delete mode 100644 tests/python/test_list_methods.py diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh index 0ce8b0c8..d358ccc5 100644 --- a/include/JSArrayProxy.hh +++ b/include/JSArrayProxy.hh @@ -9,6 +9,9 @@ * */ +#ifndef PythonMonkey_JSArrayProxy_ +#define PythonMonkey_JSArrayProxy_ + #include @@ -415,3 +418,5 @@ static PyMethodDef JSArrayProxy_methods[] = { * @brief Struct for the JSArrayProxyType, used by all JSArrayProxy objects */ extern PyTypeObject JSArrayProxyType; + +#endif \ No newline at end of file diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 3aa305fa..fe8fe8ce 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -9,6 +9,9 @@ * */ +#ifndef PythonMonkey_JSObjectProxy_ +#define PythonMonkey_JSObjectProxy_ + #include #include @@ -268,3 +271,5 @@ static PyMethodDef JSObjectProxy_methods[] = { * @brief Struct for the JSObjectProxyType, used by all JSObjectProxy objects */ extern PyTypeObject JSObjectProxyType; + +#endif \ No newline at end of file diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 11b07d99..5c20787a 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -530,9 +530,9 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { if (_PyUnicodeWriter_WriteChar(&writer, '[') < 0) { goto error; } - + /* Do repr() on each element. Note that this may mutate the list, so must refetch the list size on each iteration. */ - for (Py_ssize_t index = 0; index < selfLength /*JSArrayProxy_length(self)*/; ++index) { + for (Py_ssize_t index = 0; index < JSArrayProxy_length(self); index++) { if (index > 0) { if (_PyUnicodeWriter_WriteASCIIString(&writer, ", ", 2) < 0) { goto error; @@ -542,7 +542,12 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); - PyObject *s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); + PyObject *s; + if (&elementVal->toObject() == self->jsObject.get()) { + s = PyObject_Repr((PyObject *)self); + } else { + s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); + } if (s == NULL) { goto error; } @@ -626,10 +631,9 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_concat(JSArrayProxy *self, JS_SetElement(GLOBAL_CX, jCombinedArray, sizeSelf + inputIdx, elementVal); } } else { - JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); - JS::RootedObject jRootedValue = JS::RootedObject(GLOBAL_CX, jValue.toObjectOrNull()); for (Py_ssize_t inputIdx = 0; inputIdx < sizeValue; inputIdx++) { - JS_GetElement(GLOBAL_CX, jRootedValue, inputIdx, &elementVal); + PyObject *item = PyList_GetItem(value, inputIdx); + elementVal.set(jsTypeFactory(GLOBAL_CX, item)); JS_SetElement(GLOBAL_CX, jCombinedArray, sizeSelf + inputIdx, elementVal); } } @@ -829,9 +833,6 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_insert(JSArrayProxy *self, } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_extend(JSArrayProxy *self, PyObject *iterable) { - // Special cases: - // 1) lists and tuples which can use PySequence_Fast ops - // 2) extending self to self requires making a copy first if (PyList_CheckExact(iterable) || PyTuple_CheckExact(iterable) || (PyObject *)self == iterable) { iterable = PySequence_Fast(iterable, "argument must be iterable"); if (!iterable) { @@ -846,10 +847,9 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_extend(JSArrayProxy *self, } Py_ssize_t m = JSArrayProxy_length(self); - // It should not be possible to allocate a list large enough to cause - // an overflow on any relevant platform. + JS::SetArrayLength(GLOBAL_CX, self->jsObject, m + n); - // + // populate the end of self with iterable's items. PyObject **src = PySequence_Fast_ITEMS(iterable); for (Py_ssize_t i = 0; i < n; i++) { diff --git a/tests/python/test_list_methods.py b/tests/python/test_list_methods.py deleted file mode 100644 index 41869b55..00000000 --- a/tests/python/test_list_methods.py +++ /dev/null @@ -1 +0,0 @@ -import pythonmonkey as pm \ No newline at end of file diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index 0089a562..b4b66db5 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -183,6 +183,18 @@ def test_repr_non_empty_array(): assert repr(pyArray) == expected assert str(pyArray) == expected +def test_repr_recursion(): + pyArray = pm.eval(""" + () => { + let arr = [1,2]; + arr.push(arr); + return arr; + } + """)() + expected = "[1.0, 2.0, [...]]" + assert repr(pyArray) == expected + assert str(pyArray) == expected + #concat def test_concat_wrong_type(): likes = pm.eval('([1,2])') @@ -234,7 +246,8 @@ def test_repeat_zero(): def test_repeat_once(): a = pm.eval("[1,2]") b = a * 1 - assert b == [1,2] + assert b == [1,2] + assert a is not b def test_repeat_twice(): a = pm.eval("[1,2]") @@ -533,7 +546,7 @@ def test_remove_no_args(): assert str(type(e)) == "" assert str(e) == "JSArrayProxy.remove() takes exactly one argument (0 given)" -def test_remove_no_args(): +def test_remove_not_found(): a = pm.eval('([1,2])') try: a.remove(3) From e12b21119614511222796ff4ff8b26c8db0f4d66 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 14 Dec 2023 14:30:58 -0500 Subject: [PATCH 0103/1086] additional sort test --- tests/python/test_lists.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index b4b66db5..ee3afae2 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -755,6 +755,11 @@ def test_sort_with_function_wrong_type(): assert str(type(e)) == "" assert str(e) == "'int' object is not callable" +def test_tricky_sort(): + a = pm.eval("[6, -2, 2, -7]") + a.sort() + assert a == [-7, -2, 2, 6] + #iter def iter_min(): a = pm.eval("([7,9,1,2,3,4,5,6])") From 3db1a9da09e0bc0a5e3a84bea6ec2078a7a367d9 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Mon, 18 Dec 2023 16:43:25 -0500 Subject: [PATCH 0104/1086] JSArrayProxy sort method fully implemented --- src/JSArrayProxy.cc | 214 +++++++++++++++++++++++++++++++++++-- tests/python/test_lists.py | 48 +++++++-- 2 files changed, 244 insertions(+), 18 deletions(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 5c20787a..22b035bc 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -1073,6 +1073,108 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_reverse(JSArrayProxy *self Py_RETURN_NONE; } +// private +static bool sort_compare_key_func(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject callee(cx, &args.callee()); + + JS::RootedValue keyFunc(cx); + if (!JS_GetProperty(cx, callee, "_key_func_param", &keyFunc)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return false; + } + PyObject *keyfunc = (PyObject *)keyFunc.toPrivate(); + + JS::RootedValue reverseValue(cx); + if (!JS_GetProperty(cx, callee, "_reverse_param", &reverseValue)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return false; + } + bool reverse = reverseValue.toBoolean(); + + + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(&args.callee())); + + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX, args[0]); + PyObject *args_0 = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + PyObject *args_0_result = PyObject_CallFunction(keyfunc, "O", args_0); + if (!args_0_result) { + return false; + } + + elementVal = new JS::RootedValue(GLOBAL_CX, args[1]); + PyObject *args_1 = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + PyObject *args_1_result = PyObject_CallFunction(keyfunc, "O", args_1); + if (!args_1_result) { + return false; + } + + int cmp = PyObject_RichCompareBool(args_0_result, args_1_result, Py_LT); + if (cmp > 0) { + args.rval().setInt32(reverse ? 1 : -1); + } else if (cmp == 0) { + cmp = PyObject_RichCompareBool(args_0_result, args_1_result, Py_EQ); + if (cmp > 0) { + args.rval().setInt32(0); + } + else if (cmp == 0) { + args.rval().setInt32(reverse ? -1 : 1); + } + else { + return false; + } + } + else { + return false; + } + + return true; +} + +// private +static bool sort_compare_default(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject callee(cx, &args.callee()); + JS::RootedValue reverseValue(cx); + if (!JS_GetProperty(cx, callee, "_reverse_param", &reverseValue)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return false; + } + bool reverse = reverseValue.toBoolean(); + + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(&args.callee())); + + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX, args[0]); + PyObject *args_0 = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + + elementVal = new JS::RootedValue(GLOBAL_CX, args[1]); + PyObject *args_1 = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + + int cmp = PyObject_RichCompareBool(args_0, args_1, Py_LT); + if (cmp > 0) { + args.rval().setInt32(reverse ? 1 : -1); + } + else if (cmp == 0) { + cmp = PyObject_RichCompareBool(args_0, args_1, Py_EQ); + if (cmp > 0) { + args.rval().setInt32(0); + } + else if (cmp == 0) { + args.rval().setInt32(reverse ? -1 : 1); + } + else { + return false; + } + } + else { + return false; + } + + return true; +} + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) @@ -1130,26 +1232,116 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P if (JSArrayProxy_length(self) > 1) { JS::RootedValue jReturnedArray(GLOBAL_CX); if (keyfunc != Py_None) { - if (!PyFunction_Check(keyfunc) && !PyCFunction_Check(keyfunc)) { - PyErr_Format(PyExc_TypeError, "'%.200s' object is not callable", Py_TYPE(keyfunc)->tp_name); - return NULL; + if (PyFunction_Check(keyfunc)) { + // we got a python key function, check if two-argument js style or standard python 1-arg + PyObject *code = PyFunction_GetCode(keyfunc); + if (((PyCodeObject *)code)->co_argcount == 1) { + // adapt to python style, provide js-style comp wrapper that does it the python way, which is < based with calls to keyFunc + JS::RootedObject funObj(GLOBAL_CX, JS_GetFunctionObject(JS_NewFunction(GLOBAL_CX, sort_compare_key_func, 2, 0, NULL))); + + JS::RootedValue privateValue(GLOBAL_CX, JS::PrivateValue(keyfunc)); + if (!JS_SetProperty(GLOBAL_CX, funObj, "_key_func_param", privateValue)) { // JS::SetReservedSlot(functionObj, KeyFuncSlot, JS::PrivateValue(keyfunc)); does not work + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } + + JS::RootedValue reverseValue(GLOBAL_CX); + reverseValue.setBoolean(reverse); + if (!JS_SetProperty(GLOBAL_CX, funObj, "_reverse_param", reverseValue)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } + + JS::Rooted> jArgs(GLOBAL_CX); + jArgs[0].setObject(*funObj); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, &jReturnedArray)) { + if (!PyErr_Occurred()) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + } + return NULL; + } + } + else { + // two-arg js-style + JS::Rooted> jArgs(GLOBAL_CX); + jArgs[0].set(jsTypeFactory(GLOBAL_CX, keyfunc)); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, &jReturnedArray)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } + + if (reverse) { + JSArrayProxy_reverse(self); + } + } } - JS::Rooted> jArgs(GLOBAL_CX); - jArgs[0].set(jsTypeFactory(GLOBAL_CX, keyfunc)); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, &jReturnedArray)) { - PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + else if (PyCFunction_Check(keyfunc)) { + // check if builtin 1-arg python or js 2-arg compare + int flags = PyCFunction_GetFlags((PyObject *)keyfunc); + + if (flags & METH_VARARGS) { + // we got a JS compare function, use it as-is + JS::Rooted> jArgs(GLOBAL_CX); + jArgs[0].set(jsTypeFactory(GLOBAL_CX, keyfunc)); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, &jReturnedArray)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } + + if (reverse) { + JSArrayProxy_reverse(self); + } + } + else { + // we got a built-in python function + JS::RootedObject funObj(GLOBAL_CX, JS_GetFunctionObject(JS_NewFunction(GLOBAL_CX, sort_compare_key_func, 2, 0, NULL))); + + JS::RootedValue privateValue(GLOBAL_CX, JS::PrivateValue(keyfunc)); + if (!JS_SetProperty(GLOBAL_CX, funObj, "_key_func_param", privateValue)) { // JS::SetReservedSlot(functionObj, KeyFuncSlot, JS::PrivateValue(keyfunc)); does not work + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } + + JS::RootedValue reverseValue(GLOBAL_CX); + reverseValue.setBoolean(reverse); + if (!JS_SetProperty(GLOBAL_CX, funObj, "_reverse_param", reverseValue)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } + + JS::Rooted> jArgs(GLOBAL_CX); + jArgs[0].setObject(*funObj); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, &jReturnedArray)) { + if (!PyErr_Occurred()) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + } + return NULL; + } + } + } + else { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not callable", Py_TYPE(keyfunc)->tp_name); return NULL; } } else { - if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", JS::HandleValueArray::empty(), &jReturnedArray)) { + // adapt to python style, provide js-style comp wrapper that does it the python way, which is < based + JSFunction *cmpFunction = JS_NewFunction(GLOBAL_CX, sort_compare_default, 2, 0, NULL); + JS::RootedObject funObj(GLOBAL_CX, JS_GetFunctionObject(cmpFunction)); + + JS::RootedValue reverseValue(GLOBAL_CX); + reverseValue.setBoolean(reverse); + if (!JS_SetProperty(GLOBAL_CX, funObj, "_reverse_param", reverseValue)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } - } - if (reverse) { - JSArrayProxy_reverse(self); + JS::Rooted> jArgs(GLOBAL_CX); + jArgs[0].setObject(*funObj); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, &jReturnedArray)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } } } Py_RETURN_NONE; diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index ee3afae2..064a004b 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -711,13 +711,23 @@ def test_sort_with_js_function(): a.sort(key=myFunc) assert a == ['BMW', 'Ford', 'Mitsubishi', 'VW'] -# TODO does not report exception for one-arg function -#def test_sort_with_one_arg_function(): -# def myFunc(e): -# return len(e) -# a = pm.eval("(['Ford', 'Mitsubishi', 'BMW', 'VW'])") -# a.sort(key=myFunc) -# assert a == ['VW', 'BMW', 'Ford', 'Mitsubishi'] +def test_sort_with_one_arg_function(): + def myFunc(e): + return len(e) + a = pm.eval("(['Ford', 'Mitsubishi', 'BMW', 'VW'])") + a.sort(key=myFunc) + assert a == ['VW', 'BMW', 'Ford', 'Mitsubishi'] + +def test_sort_with_one_arg_function_wrong_data_type(): + def myFunc(e): + return len(e) + a = pm.eval('([1,2,3,4])') + try: + a.sort(key=myFunc) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "object of type 'float' has no len()" def test_sort_with_function_and_reverse_false(): def myFunc(e,f): @@ -760,6 +770,30 @@ def test_tricky_sort(): a.sort() assert a == [-7, -2, 2, 6] +def test_tricky_sort_reverse(): + a = pm.eval("[6, -2, 2, -7]") + a.sort(reverse=True) + assert a == [6, 2, -2, -7] + +def test_sort_with_builtin_function(): # + wrong type of entries + a = pm.eval("(['Ford', 'Mitsubishi', 'BMW', 'VW'])") + a.sort(key=len) + assert a == ['VW', 'BMW', 'Ford', 'Mitsubishi'] + +def test_sort_with_builtin_function_and_reverse(): # + wrong type of entries + a = pm.eval("(['Ford', 'Mitsubishi', 'BMW', 'VW'])") + a.sort(key=len, reverse=True) + assert a == ['Mitsubishi', 'Ford', 'BMW', 'VW'] + +def test_sort_with_builtin_function_wrong_data_type(): + a = pm.eval('([1,2,3,4])') + try: + a.sort(key=len) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "object of type 'float' has no len()" + #iter def iter_min(): a = pm.eval("([7,9,1,2,3,4,5,6])") From 35f6375837858359f7a849f10200c2dc7dc1147f Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Tue, 19 Dec 2023 17:21:51 -0500 Subject: [PATCH 0105/1086] logic improvement --- src/JSArrayProxy.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 22b035bc..809df45a 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -1279,7 +1279,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P // check if builtin 1-arg python or js 2-arg compare int flags = PyCFunction_GetFlags((PyObject *)keyfunc); - if (flags & METH_VARARGS) { + if (flags & METH_VARARGS && !(flags & METH_KEYWORDS)) { // we got a JS compare function, use it as-is JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].set(jsTypeFactory(GLOBAL_CX, keyfunc)); From 789b4e54fe020b5e58b0c1908a3cfeb6a6653bfb Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 20 Dec 2023 12:13:18 -0500 Subject: [PATCH 0106/1086] Several List to Array conversion methods done Further List proxy work --- README.md | 3 +- include/PyProxyHandler.hh | 15 +- include/jsTypeFactory.hh | 10 + src/JSArrayProxy.cc | 3 +- src/PyProxyHandler.cc | 844 +++++++++++++++++++++++++++++++- src/jsTypeFactory.cc | 28 +- tests/python/test_arrays.py | 827 +++++++++++++++++++++++++++++++ tests/python/test_list_array.py | 11 + 8 files changed, 1729 insertions(+), 12 deletions(-) create mode 100644 tests/python/test_arrays.py diff --git a/README.md b/README.md index 61adf5ab..af96b1f9 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ js_eval("console.log")('hello, world') - [done] Python TypedArrays coerce to JS TypeArrays - [done] JS TypedArrays coerce to Python TypeArrays - [done] Python List coerce to JS Arrays +- [done] JS Arrays coerce to Python Lists ## Build Instructions @@ -250,7 +251,7 @@ that if you update an object in JavaScript, the corresponding Dict in Python wil | function | Function | object - most | pythonmonkey.JSObjectProxy (Dict) | object - Date | datetime -| object - Array | List +| object - Array | pythonmonkey.JSArrayProxy (List) | object - Promise | awaitable | object - ArrayBuffer | Buffer | object - type arrays | Buffer diff --git a/include/PyProxyHandler.hh b/include/PyProxyHandler.hh index 21188e26..7c97dd17 100644 --- a/include/PyProxyHandler.hh +++ b/include/PyProxyHandler.hh @@ -1,7 +1,7 @@ /** * @file PyProxy.hh - * @author Caleb Aikens (caleb@distributive.network) - * @brief Struct for creating JS proxy objects. Used by DictType for object coercion + * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) + * @brief Struct for creating JS proxy objects. Used by DictType for object coercion and by ListType for List coercion * @version 0.1 * @date 2023-04-20 * @@ -30,6 +30,14 @@ public: bool isExtensible(JSContext *cx, JS::HandleObject proxy, bool *extensible) const override final; }; +enum ProxySlots {PyObjectSlot}; + +typedef struct { + const char *name; /* The name of the method */ + JSNative call; /* The C function that implements it */ + uint16_t nargs; /* The argument count for the method */ +} JSMethodDef; + /** * @brief This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates to handle coercion from python dicts to JS Objects * @@ -180,6 +188,9 @@ public: bool ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override; bool delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const override; + bool isArray(JSContext *cx, JS::HandleObject proxy, JS::IsArrayAnswer *answer) const override; + bool getBuiltinClass(JSContext *cx, JS::Handle obj, js::ESClass *cls) const override; + const char *className(JSContext *cx, JS::HandleObject proxy) const override; }; /** diff --git a/include/jsTypeFactory.hh b/include/jsTypeFactory.hh index 6ec68412..23339c54 100644 --- a/include/jsTypeFactory.hh +++ b/include/jsTypeFactory.hh @@ -37,6 +37,16 @@ size_t UCS4ToUTF16(const uint32_t *chars, size_t length, uint16_t *outStr); * @return JS::Value - A JS::Value corresponding to the PyType */ JS::Value jsTypeFactory(JSContext *cx, PyObject *object); + +/** + * @brief Function that takes a PyObject and returns a corresponding JS::Value which is a copy, not a reference + * + * @param cx - Pointer to the JSContext + * @param object - Pointer to the PyListObject + * @return JS::Value - A JS::Value corresponding to the PyType + */ +JS::Value jsTypeFactoryCopy(JSContext *cx, PyObject *object); + /** * @brief same to jsTypeFactory, but it's guaranteed that no error would be set on the Python error stack, instead * return JS `null` on error, and output a warning in Python-land diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 809df45a..b2ab2316 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -530,7 +530,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { if (_PyUnicodeWriter_WriteChar(&writer, '[') < 0) { goto error; } - + /* Do repr() on each element. Note that this may mutate the list, so must refetch the list size on each iteration. */ for (Py_ssize_t index = 0; index < JSArrayProxy_length(self); index++) { if (index > 0) { @@ -752,6 +752,7 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot(JSArrayProxy *self) { } int JSArrayProxyMethodDefinitions::JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg) { + // TODO untested JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); for (Py_ssize_t i = JSArrayProxy_length(self); --i >= 0; ) { JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index b9fdc0d6..d0b27f90 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -176,12 +176,832 @@ bool PyBaseProxyHandler::isExtensible(JSContext *cx, JS::HandleObject proxy, return true; } + + +// PyList ---------------------------------------------------------------------- const char PyListProxyHandler::family = 0; +static bool array_reverse(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + if (PyList_GET_SIZE(self) > 1) { + PyList_Reverse(self); + } + + args.rval().setUndefined(); + return true; +} + +static bool array_pop(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + if (PyList_GET_SIZE(self) == 0) { + args.rval().setUndefined(); + return true; + } + + PyObject *result = PyObject_CallMethod(self, "pop", NULL); + + if (!result) { + PyErr_Clear(); + args.rval().setUndefined(); + return true; + } + + args.rval().set(jsTypeFactory(cx, result)); + return true; +} + +static bool array_at(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "at", 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + int64_t index; + if (!JS::ToInt64(cx, args[0], &index)) { + return false; + } + + Py_ssize_t selfSize = PyList_GET_SIZE(self); + + if (index < 0) { + index += selfSize; + } + + if (index < 0 || index >= selfSize) { + args.rval().setUndefined(); + return true; + } + + PyObject *result = PyList_GetItem(self, (Py_ssize_t)index); + + args.rval().set(jsTypeFactory(cx, result)); + return true; +} + +static bool array_join(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + // convert to JSArray (copy) then call join on it + JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); + + JS::RootedString sepstr(cx); + if (args.hasDefined(0)) { + sepstr = JS::ToString(cx, args[0]); + if (!sepstr) { + return false; + } + } else { + sepstr = JS_NewStringCopyZ(cx, ","); + } + + JS::Rooted> jArgs(cx); + jArgs[0].setString(sepstr); + JS::RootedValue jRet(cx); + if (!JS_CallFunctionName(cx, selfCopy, "join", jArgs, &jRet)) { + return false; + } + + args.rval().setString(jRet.toString()); + return true; +} + +static bool array_toString(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); + + JS::RootedValue jRet(cx); + if (!JS_CallFunctionName(cx, selfCopy, "toString", JS::HandleValueArray::empty(), &jRet)) { + return false; + } + + args.rval().setString(jRet.toString()); + return true; +} + +static bool array_push(JSContext *cx, unsigned argc, JS::Value *vp) { // surely the function name is in there...review JSAPI examples + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + unsigned numArgs = args.length(); + for (unsigned index = 0; index < numArgs; index++) { + JS::RootedValue *elementVal = new JS::RootedValue(cx); + elementVal->set(args[index].get()); + PyList_Append(self, pyTypeFactory(cx, global, elementVal)->getPyObject()); + } + + args.rval().setInt32(PyList_GET_SIZE(self)); + return true; +} + +static bool array_shift(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + Py_ssize_t selfSize = PyList_GET_SIZE(self); + + if (selfSize == 0) { + args.rval().setUndefined(); + return true; + } + + PyObject *result = PyList_GetItem(self, 0); + PySequence_DelItem(self, 0); + + args.rval().set(jsTypeFactory(cx, result)); + return true; +} + +static bool array_unshift(JSContext *cx, unsigned argc, JS::Value *vp) { // surely the function name is in there...review JSAPI examples + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + for (int index = args.length() - 1; index >= 0; index--) { + JS::RootedValue *elementVal = new JS::RootedValue(cx); + elementVal->set(args[index].get()); + PyList_Insert(self, 0, pyTypeFactory(cx, global, elementVal)->getPyObject()); + } + + args.rval().setInt32(PyList_GET_SIZE(self)); + return true; +} + +static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); + + JS::HandleValueArray jArgs(args); + + JS::RootedValue jRet(cx); + if (!JS_CallFunctionName(cx, selfCopy, "concat", jArgs, &jRet)) { + return false; + } + + args.rval().setObject(jRet.toObject()); + return true; +} + +static inline uint64_t normalizeSliceTerm(int64_t value, uint64_t length) { + if (value < 0) { + value += length; + if (value < 0) { + return 0; + } + } + else if (double(value) > double(length)) { + return length; + } + return value; +} + +static bool array_slice(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "slice", 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + Py_ssize_t selfLength = PyList_GET_SIZE(self); + + uint64_t start = 0; + uint64_t stop = selfLength; + if (args.length() > 0) { + int64_t d; + + if (!JS::ToInt64(cx, args[0], &d)) { + return false; + } + + start = normalizeSliceTerm(d, selfLength); + + if (args.hasDefined(1)) { + if (!JS::ToInt64(cx, args[1], &d)) { + return false; + } + + stop = normalizeSliceTerm(d, selfLength); + } + } + + PyObject *result = PyList_GetSlice(self, (Py_ssize_t)start, (Py_ssize_t)stop); + + args.rval().set(jsTypeFactory(cx, result)); + return true; +} + +static bool array_indexOf(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "indexOf", 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + Py_ssize_t selfLength = PyList_GET_SIZE(self); + + if (selfLength == 0) { + args.rval().setInt32(-1); + return true; + } + + uint64_t start = 0; + if (args.length() > 1) { + int64_t n; + if (!JS::ToInt64(cx, args[1], &n)) { + return false; + } + + if (n >= selfLength) { + args.rval().setInt32(-1); + return true; + } + + if (n >= 0) { + start = uint64_t(n); + } + else { + int64_t d = selfLength + n; + if (d >= 0) { + start = d; + } + } + } + + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + JS::RootedValue *elementVal = new JS::RootedValue(cx, args[0].get()); + PyObject *result = PyObject_CallMethod(self, "index", "Oi", pyTypeFactory(cx, global, elementVal)->getPyObject(), start); + + if (!result) { + PyErr_Clear(); + args.rval().setInt32(-1); + return true; + } + + args.rval().set(jsTypeFactory(cx, result)); + return true; +} + +static bool array_lastIndexOf(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "lastIndexOf", 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); + + JS::HandleValueArray jArgs(args); + + JS::RootedValue jRet(cx); + if (!JS_CallFunctionName(cx, selfCopy, "lastIndexOf", jArgs, &jRet)) { + return false; + } + + args.rval().setInt32(jRet.toInt32()); + return true; +} + +static bool array_splice(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + uint64_t selfLength = (uint64_t)PyList_GET_SIZE(self); + + int64_t relativeStart; + if (!JS::ToInt64(cx, args.get(0), &relativeStart)) { + return false; + } + + /* actualStart is the index after which elements will be + deleted and/or new elements will be added */ + uint64_t actualStart; + if (relativeStart < 0) { + actualStart = uint64_t(std::max(double(selfLength) + relativeStart, 0.0)); + } else { + actualStart = uint64_t(std::min(double(relativeStart), double(selfLength))); + } + + unsigned int argsLength = args.length(); + + /* insertCount is the number of elements being added */ + uint32_t insertCount; + if (argsLength < 2) { + insertCount = 0; + } + else { + insertCount = argsLength - 2; + } + + /* actualDeleteCount is the number of elements being deleted */ + uint64_t actualDeleteCount; + if (argsLength < 1) { + actualDeleteCount = 0; + } + else if (argsLength < 2) { + actualDeleteCount = selfLength - actualStart; + } + else { + int64_t deleteCount; + if (!JS::ToInt64(cx, args.get(1), &deleteCount)) { + return false; + } + + actualDeleteCount = uint64_t(std::min(std::max(0.0, double(deleteCount)), double(selfLength - actualStart))); + } + + // get deleted items for return value + PyObject *deleted = PyList_GetSlice(self, actualStart, actualStart + actualDeleteCount); + + // build list for SetSlice call + PyObject *inserted = PyList_New(insertCount); + + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + for (int index = 0; index < insertCount; index++) { + JS::RootedValue *elementVal = new JS::RootedValue(cx, args[index + 2].get()); + PyList_SetItem(inserted, index, pyTypeFactory(cx, global, elementVal)->getPyObject()); + } + + PyList_SetSlice(self, actualStart, actualStart + actualDeleteCount, inserted); + + args.rval().set(jsTypeFactory(cx, deleted)); + return true; +} + +static bool array_sort(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + uint64_t selfLength = (uint64_t)PyList_GET_SIZE(self); + + if (selfLength > 0) { + if (args.length() < 1) { + PyList_Sort(self); + } + else { + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + + PyObject *pyFunc = pyTypeFactory(cx, global, new JS::RootedValue(cx, args[0].get()))->getPyObject(); + // check if JS or Python function + if (PyFunction_Check(pyFunc)) { + // it's a user-defined python function, more than 1-arg will get TypeError + PyObject *callable = PyObject_GetAttrString(self, "sort"); + if (callable == NULL) { + return false; + } + PyObject *result = PyObject_Call(callable, PyTuple_New(0), Py_BuildValue("{s:O}", "key", pyFunc)); + if (!result) { + return false; + } + } else { + // it's either a JS function or a builtin python func + int flags = PyCFunction_GetFlags(pyFunc); + + if (flags & METH_VARARGS && !(flags & METH_KEYWORDS)) { + // it's a JS func + + // copy to JS for sorting + JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); + + JS::RootedValue jReturnedArray(cx); + JS::HandleValueArray jArgs(args); + if (!JS_CallFunctionName(cx, selfCopy, "sort", jArgs, &jReturnedArray)) { + return false; + } + + // copy back into Python self + for (int index = 0; index < selfLength; index++) { + JS::RootedValue *elementVal = new JS::RootedValue(cx); + JS_GetElement(cx, selfCopy, index, elementVal); + PyList_SetItem(self, index, pyTypeFactory(cx, global, elementVal)->getPyObject()); + } + } else { + // it's a built-in python function, more than 1-arg will get TypeError + PyObject *callable = PyObject_GetAttrString(self, "sort"); + if (callable == NULL) { + return false; + } + PyObject *result = PyObject_Call(callable, PyTuple_New(0), Py_BuildValue("{s:O}", "key", pyFunc)); + if (!result) { + return false; + } + } + } + } + } + + // return ref to self + args.rval().set(jsTypeFactory(cx, self)); + return true; +} + +static bool array_fill(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "fill", 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + uint64_t selfLength = (uint64_t)PyList_GET_SIZE(self); + + unsigned int argsLength = args.length(); + + JS::RootedValue *fillValue = new JS::RootedValue(cx, args[0].get()); + + int64_t relativeStart; + if (argsLength > 1) { + if (!JS::ToInt64(cx, args.get(1), &relativeStart)) { + return false; + } + } else { + relativeStart = 0; + } + + uint64_t actualStart; + if (relativeStart < 0) { + actualStart = uint64_t(std::max(double(selfLength) + relativeStart, 0.0)); + } else { + actualStart = uint64_t(std::min(double(relativeStart), double(selfLength))); + } + + int64_t relativeEnd; + if (argsLength > 2) { + if (!JS::ToInt64(cx, args.get(2), &relativeEnd)) { + return false; + } + } else { + relativeEnd = selfLength; + } + + uint64_t actualEnd; + if (relativeEnd < 0) { + actualEnd = uint64_t(std::max(double(selfLength) + relativeEnd, 0.0)); + } else { + actualEnd = uint64_t(std::min(double(relativeEnd), double(selfLength))); + } + + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + for (int index = actualStart; index < actualEnd; index++) { + PyList_SetItem(self, index, pyTypeFactory(cx, global, fillValue)->getPyObject()); + } + + // return ref to self + args.rval().set(jsTypeFactory(cx, self)); + return true; +} + +static bool array_copyWithin(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + uint64_t selfLength = (uint64_t)PyList_GET_SIZE(self); + + unsigned int argsLength = args.length(); + + int64_t relativeTarget; + if (argsLength > 0) { + if (!JS::ToInt64(cx, args.get(0), &relativeTarget)) { + return false; + } + } else { + relativeTarget = 0; + } + + uint64_t actualTarget; + if (relativeTarget < 0) { + actualTarget = uint64_t(std::max(double(selfLength) + relativeTarget, 0.0)); + } else { + actualTarget = uint64_t(std::min(double(relativeTarget), double(selfLength))); + } + + int64_t relativeStart; + if (argsLength > 1) { + if (!JS::ToInt64(cx, args.get(1), &relativeStart)) { + return false; + } + } else { + relativeStart = 0; + } + + uint64_t actualStart; + if (relativeStart < 0) { + actualStart = uint64_t(std::max(double(selfLength) + relativeStart, 0.0)); + } else { + actualStart = uint64_t(std::min(double(relativeStart), double(selfLength))); + } + + int64_t relativeEnd; + if (argsLength > 2) { + if (!JS::ToInt64(cx, args.get(2), &relativeEnd)) { + return false; + } + } else { + relativeEnd = selfLength; + } + + uint64_t actualEnd; + if (relativeEnd < 0) { + actualEnd = uint64_t(std::max(double(selfLength) + relativeEnd, 0.0)); + } else { + actualEnd = uint64_t(std::min(double(relativeEnd), double(selfLength))); + } + + int64_t count = int64_t(std::min(actualEnd - actualStart, selfLength - actualTarget)); + + if (actualStart < actualTarget && actualTarget < actualStart + count) { + actualStart = actualStart + count - 1; + actualTarget = actualTarget + count - 1; + + while (count > 0) { + PyObject *itemStart = PyList_GetItem(self, actualStart); + PyList_SetItem(self, actualTarget, itemStart); + + actualStart--; + actualTarget--; + count--; + } + } else { + while (count > 0) { + PyObject *itemStart = PyList_GetItem(self, actualStart); + PyList_SetItem(self, actualTarget, itemStart); + + actualStart++; + actualTarget++; + count--; + } + } + + // return ref to self + args.rval().set(jsTypeFactory(cx, self)); + return true; +} + +static bool array_copy_func(JSContext *cx, JS::CallArgs args, const char *fName, JS::MutableHandle rval) { + if (!args.requireAtLeast(cx, fName, 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); + + JS::HandleValueArray jArgs(args); + + if (!JS_CallFunctionName(cx, selfCopy, fName, jArgs, rval)) { + return false; + } + + return true; +} + +static bool array_includes(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedValue jRet(cx); + + if (!array_copy_func(cx, args, "includes", &jRet)) { + return false; + } + + args.rval().setBoolean(jRet.toBoolean()); + return true; +} + +static bool array_forEach(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedValue jRet(cx); + + if (!array_copy_func(cx, args, "forEach", &jRet)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +static bool array_map(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedValue jRet(cx); + + if (!array_copy_func(cx, args, "map", &jRet)) { + return false; + } + + args.rval().setObject(jRet.toObject()); + return true; +} + +static bool array_filter(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedValue jRet(cx); + + if (!array_copy_func(cx, args, "filter", &jRet)) { + return false; + } + + args.rval().setObject(jRet.toObject()); + return true; +} + +static bool array_reduce(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedValue jRet(cx); + + if (!array_copy_func(cx, args, "reduce", &jRet)) { + return false; + } + + if (jRet.isNumber()) { + args.rval().setNumber(jRet.toNumber()); + } + else if (jRet.isString()) { + args.rval().setString(jRet.toString()); + } + else if (jRet.isObject()) { + args.rval().setObject(jRet.toObject()); + } + + return true; +} + +static bool array_reduceRight(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedValue jRet(cx); + + if (!array_copy_func(cx, args, "reduceRight", &jRet)) { + return false; + } + + if (jRet.isNumber()) { + args.rval().setNumber(jRet.toNumber()); + } + else if (jRet.isString()) { + args.rval().setString(jRet.toString()); + } + else if (jRet.isObject()) { + args.rval().setObject(jRet.toObject()); + } + + return true; +} + + +static JSMethodDef array_methods[] = { + {"reverse", array_reverse, 0}, + {"pop", array_pop, 0}, + {"at", array_at, 1}, + {"join", array_join, 1}, + {"toString", array_toString, 0}, + {"push", array_push, 1}, + {"shift", array_shift, 0}, + {"unshift", array_unshift, 1}, + {"concat", array_concat, 1}, + {"slice", array_slice, 2}, + {"indexOf", array_indexOf, 1}, + {"lastIndexOf", array_lastIndexOf, 1}, + {"splice", array_splice, 2}, + {"sort", array_sort, 1}, + {"fill", array_fill, 3}, + {"copyWithin", array_copyWithin, 3}, + {"includes", array_includes, 1}, + {"forEach", array_forEach, 1}, + {"map", array_map, 1}, + {"filter", array_filter, 1}, + {"reduce", array_reduce, 1}, + {"reduceRight", array_reduceRight, 1}, + {NULL, NULL} +}; + + bool PyListProxyHandler::getOwnPropertyDescriptor( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::MutableHandle> desc ) const { + // see if we're calling a function + if (id.isString()) { + for (size_t index = 0;; index++) { + bool isThatFunction; + const char *methodName = array_methods[index].name; + if (methodName == NULL) { // reached end of list + break; + } + else if (JS_StringEqualsAscii(cx, id.toString(), methodName, &isThatFunction) && isThatFunction) { + JSFunction *newFunction = JS_NewFunction(cx, array_methods[index].call, array_methods[index].nargs, 0, NULL); + if (!newFunction) return false; + JS::RootedObject funObj(cx, JS_GetFunctionObject(newFunction)); + desc.set(mozilla::Some( + JS::PropertyDescriptor::Data( + JS::ObjectValue(*funObj), + {JS::PropertyAttribute::Enumerable} + ) + )); + return true; + } + } + } // We're trying to get the "length" property bool isLengthProperty; @@ -189,7 +1009,7 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( // proxy.length = len(pyObject) desc.set(mozilla::Some( JS::PropertyDescriptor::Data( - JS::Int32Value(PySequence_Size(pyObject)) + JS::Int32Value(PyList_Size(pyObject)) ) )); return true; @@ -198,7 +1018,7 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( // We're trying to get an item Py_ssize_t index; PyObject *item; - if (idToIndex(cx, id, &index) && (item = PySequence_GetItem(pyObject, index))) { + if (idToIndex(cx, id, &index) && (item = PyList_GetItem(pyObject, index))) { desc.set(mozilla::Some( JS::PropertyDescriptor::Data( jsTypeFactory(cx, item), @@ -231,7 +1051,7 @@ bool PyListProxyHandler::defineProperty( JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); JS::RootedValue *itemV = new JS::RootedValue(cx, desc.value()); PyObject *item = pyTypeFactory(cx, global, itemV)->getPyObject(); - if (PySequence_SetItem(pyObject, index, item) < 0) { + if (PyList_SetItem(pyObject, index, item) < 0) { return result.failBadIndex(); } return result.succeed(); @@ -239,7 +1059,7 @@ bool PyListProxyHandler::defineProperty( bool PyListProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { // Modified from https://hg.mozilla.org/releases/mozilla-esr102/file/3b574e1/dom/base/RemoteOuterWindowProxy.cpp#l137 - int32_t length = PySequence_Size(pyObject); + int32_t length = PyList_Size(pyObject); if (!props.reserve(length + 1)) { return false; } @@ -259,8 +1079,22 @@ bool PyListProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::Hand } // Set to undefined instead of actually deleting it - if (PySequence_SetItem(pyObject, index, Py_None) < 0) { + if (PyList_SetItem(pyObject, index, Py_None) < 0) { return result.failCantDelete(); // report failure } return result.succeed(); // report success } + +bool PyListProxyHandler::isArray(JSContext *cx, JS::HandleObject proxy, JS::IsArrayAnswer *answer) const { + return true; +} + +bool PyListProxyHandler::getBuiltinClass(JSContext *cx, JS::Handle obj, js::ESClass *cls) const { + *cls = js::ESClass::Array; + return true; +} + +const char *PyListProxyHandler::className(JSContext *cx, JS::HandleObject proxy) const { + // TODO untested + return "object"; +} \ No newline at end of file diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index fa631460..cc8daea5 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -172,6 +172,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { JSObject *proxy; if (PyList_Check(object)) { proxy = js::NewProxyObject(cx, new PyListProxyHandler(object), v, NULL); + JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(object)); } else { proxy = js::NewProxyObject(cx, new PyProxyHandler(object), v, NULL); } @@ -198,6 +199,25 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { return returnType; } +JS::Value jsTypeFactoryCopy(JSContext *cx, PyObject *object) { + JS::RootedValue returnType(cx); + if (PyList_Check(object)) { + Py_ssize_t listSize = PyList_Size(object); + JSObject *array = JS::NewArrayObject(cx, listSize); + JS::RootedObject arrayObj(cx, array); + for (Py_ssize_t index = 0; index < listSize; index++) { + JS::RootedValue jsValue(cx, jsTypeFactorySafe(cx, PyList_GetItem(object, index))); + JS_SetElement(cx, arrayObj, index, jsValue); + } + returnType.setObject(*array); + } + else { + returnType.setUndefined(); + } + + return returnType; +} + JS::Value jsTypeFactorySafe(JSContext *cx, PyObject *object) { JS::Value v = jsTypeFactory(cx, object); if (PyErr_Occurred()) { @@ -239,7 +259,9 @@ bool callPyFunc(JSContext *cx, unsigned int argc, JS::Value *vp) { JS::RootedObject *thisv = new JS::RootedObject(cx); JS_ValueToObject(cx, callargs.thisv(), thisv); - if (!callargs.length()) { + unsigned int callArgsLength = callargs.length(); + + if (!callArgsLength) { #if PY_VERSION_HEX >= 0x03090000 PyObject *pyRval = PyObject_CallNoArgs(pyFunc); #else @@ -255,8 +277,8 @@ bool callPyFunc(JSContext *cx, unsigned int argc, JS::Value *vp) { } // populate python args tuple - PyObject *pyArgs = PyTuple_New(callargs.length()); - for (size_t i = 0; i < callargs.length(); i++) { + PyObject *pyArgs = PyTuple_New(callArgsLength); + for (size_t i = 0; i < callArgsLength; i++) { JS::RootedValue *jsArg = new JS::RootedValue(cx, callargs[i]); PyType *pyArg = pyTypeFactory(cx, thisv, jsArg); if (!pyArg) return false; // error occurred diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py new file mode 100644 index 00000000..16f471bf --- /dev/null +++ b/tests/python/test_arrays.py @@ -0,0 +1,827 @@ +import pythonmonkey as pm + +def test_assign(): + items = [1,2,3] + pm.eval("(arr) => {arr[0] = 42}")(items) + assert items[0] == 42 + +def test_get(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr[1]}")(result, items) + assert result[0] == 2 + +def test_get_length(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.length}")(result, items) + assert result[0] == 3 + +def test_missing_func(): + items = [1,2,3] + try: + pm.eval("(arr) => {arr.after()}")(items) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__('TypeError: arr.after is not a function') + +#reverse +def test_reverse(): + items = [1,2,3] + pm.eval("(arr) => {arr.reverse()}")(items) + assert items == [3,2,1] + +def test_reverse_size_one(): + items = [1] + pm.eval("(arr) => {arr.reverse()}")(items) + assert items == [1] + +def test_reverse_size_zero(): + items = [] + pm.eval("(arr) => {arr.reverse()}")(items) + assert items == [] + +def test_reverse_returns_undefined(): + items = [1,2,3] + pm.eval("(arr) => {arr[0] = arr.reverse()}")(items) + assert items == [None,2,1] + + +def test_reverse_ignores_extra_args(): + items = [1,2,3] + pm.eval("(arr) => {arr.reverse(9)}")(items) + assert items == [3,2,1] + +#pop +def test_pop(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.pop()}")(result, items) + assert items == [1,2] + assert result[0] == 3 + +def test_pop_empty(): + items = [] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.pop()}")(result, items) + assert items == [] + assert result[0] == None + +def test_pop_ignore_extra_args(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.pop(1)}")(result, items) + assert items == [1,2] + assert result[0] == 3 + +#at +def test_at_no_arg(): + items = [1,2,3] + try: + pm.eval("(arr) => {arr.at()}")(items) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__('TypeError: at: At least 1 argument required, but only 0 passed') + +def test_at(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.at(0)}")(result, items) + assert result[0] == 1 + +def test_at_wrong_index_type(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.at('f')}")(result, items) + assert result[0] == 1 + +def test_at_index_too_large(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.at(10)}")(result, items) + assert result[0] == None + +def test_at_index_negative(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.at(-2)}")(result, items) + assert result[0] == 2 + +#join +def test_join_no_arg(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.join()}")(result, items) + assert result[0] == '1,2,3' + +def test_join_no_arg_diff_types(): + items = [1,False,"END"] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.join()}")(result, items) + assert result[0] == '1,false,END' + +def test_join_no_arg_with_embedded_list_type(): + items = [1,[2,3],"END"] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.join()}")(result, items) + assert result[0] == '1,2,3,END' + +def test_join_with_sep(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.join('-')}")(result, items) + assert result[0] == '1-2-3' + +#toString +def test_toString(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.toString()}")(result, items) + assert result[0] == '1,2,3' + +#push +def test_push(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.push(4)}")(result, items) + assert items == [1,2,3,4] + assert result[0] == 4 + +def test_push_no_arg(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.push()}")(result, items) + assert items == [1,2,3,] + assert result[0] == 3 + +def test_push_two_args(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.push(4,false)}")(result, items) + assert items == [1,2,3,4,False] + assert result[0] == 5 + +def test_push_list(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.push([4,5])}")(result, items) + assert items == [1,2,3,[4,5]] + assert result[0] == 4 + +#shift +def test_shift(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.shift()}")(result, items) + assert items == [2,3] + assert result[0] == 1 + +def test_shift_empty(): + items = [] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.shift()}")(result, items) + assert items == [] + assert result[0] == None + +#unshift +def test_unshift_zero_arg(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.unshift()}")(result, items) + assert items == [1,2,3] + assert result[0] == 3 + +def test_unshift_one_arg(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.unshift(6)}")(result, items) + assert items == [6,1,2,3] + assert result[0] == 4 + +def test_unshift_two_args(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.unshift(6,7)}")(result, items) + assert items == [6,7,1,2,3] + assert result[0] == 5 + +#concat +def test_concat_primitive(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.concat(4)}")(result, items) + assert items == [1,2,3] + assert result[0] == [1,2,3,4] + +def test_concat_array(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.concat([4,5])}")(result, items) + assert items == [1,2,3] + assert result[0] == [1,2,3,4,5] + +def test_concat_empty_arg(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.concat()}")(result, items) + assert items == [1,2,3] + assert result[0] == [1,2,3] + +def test_concat_two_arrays(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.concat([7,8], [0,1])}")(result, items) + assert items == [1,2,3] + assert result[0] == [1,2,3,7,8,0,1] + +def test_concat_mix(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.concat([7,8], true, [0,1])}")(result, items) + assert items == [1,2,3] + assert result[0] == [1,2,3,7,8,True, 0,1] + +#slice +def test_slice(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.slice(1,2)}")(result, items) + assert items == [1,2,3] + assert result[0] == [2] + +def test_slice_start_zero(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.slice(0,2)}")(result, items) + assert items == [1,2,3] + assert result[0] == [1,2] + +def test_slice_stop_length(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.slice(1,3)}")(result, items) + assert items == [1,2,3] + assert result[0] == [2,3] + +def test_slice_stop_beyond_length(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.slice(1,4)}")(result, items) + assert items == [1,2,3] + assert result[0] == [2,3] + +def test_slice_start_negative(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.slice(-3,-1)}")(result, items) + assert result[0] == [1,2] + +#indexOf +def test_indexOf(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.indexOf(1)}")(result, items) + assert result[0] == 0 + +def test_indexOf_with_start(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.indexOf(3, 1)}")(result, items) + assert result[0] == 2 + +def test_indexOf_with_negative_start(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.indexOf(3, -2)}")(result, items) + assert result[0] == 2 + +def test_indexOf_zero_size(): + items = [] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.indexOf(1)}")(result, items) + assert result[0] == -1 + +def test_indexOf_start_beyond_length(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.indexOf(1, 10)}")(result, items) + assert result[0] == -1 + +def test_indexOf_not_found(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.indexOf(10)}")(result, items) + assert result[0] == -1 + +#lastIndexOf +def test_lastIndexOf(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.lastIndexOf(1)}")(result, items) + assert result[0] == 0 + +def test_lastIndexOf_dup(): + items = [1,2,3,1] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.lastIndexOf(1)}")(result, items) + assert result[0] == 3 + +def test_lastIndexOf_with_from_index(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.lastIndexOf(1, 2)}")(result, items) + assert result[0] == 0 + +def test_lastIndexOf_with_from_index_greater_than_size(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.lastIndexOf(1, 10)}")(result, items) + assert result[0] == 0 + +def test_lastIndexOf_with_negative_from_index(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.lastIndexOf(1, -2)}")(result, items) + assert result[0] == 0 + +def test_lastIndexOf_not_found(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.lastIndexOf(3, 0)}")(result, items) + assert result[0] == -1 + +#splice +def test_splice_no_args(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.splice()}")(result, items) + assert items == [1,2,3] + assert result[0] == [] + +def test_splice_one_arg(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.splice(1)}")(result, items) + assert items == [1] + assert result[0] == [2,3] + +def test_splice_one_arg_negative(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.splice(-2)}")(result, items) + assert items == [1] + assert result[0] == [2,3] + +def test_splice_two_args_negative_count(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.splice(1, -1)}")(result, items) + assert items == [1,2,3] + assert result[0] == [] + +def test_splice_two_args_zero_count(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.splice(1, 0)}")(result, items) + assert items == [1,2,3] + assert result[0] == [] + +def test_splice_two_args_one_count(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.splice(1, 1)}")(result, items) + assert items == [1,3] + assert result[0] == [2] + +def test_splice_two_args_two_count(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.splice(1, 2)}")(result, items) + assert items == [1] + assert result[0] == [2,3] + +def test_splice_three_args_zero_count(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.splice(1,0,5)}")(result, items) + assert items == [1,5,2,3] + assert result[0] == [] + +def test_splice_three_args_one_count(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.splice(1,1,5)}")(result, items) + assert items == [1,5,3] + assert result[0] == [2] + +def test_splice_three_args_two_count(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.splice(1,2,5)}")(result, items) + assert items == [1,5] + assert result[0] == [2,3] + +def test_splice_four_args_zero_count(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.splice(1,0,5,6)}")(result, items) + assert items == [1,5,6,2,3] + assert result[0] == [] + +def test_splice_four_args_one_count(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.splice(1,1,5,6)}")(result, items) + assert items == [1,5,6,3] + assert result[0] == [2] + +def test_splice_four_args_two_count(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.splice(1,2,5,6)}")(result, items) + assert items == [1,5,6] + assert result[0] == [2,3] + +#fill +def test_fill_returns_ref_to_self(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.fill(8)}")(result, items) + assert items == [8,8,8] + assert result[0] == [8,8,8] + result[0][0] = 9 + assert items == [9,8,8] + +def test_fill_other_type(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.fill(false)}")(result, items) + assert items == [False,False,False] + +def test_fill_with_start(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.fill(8,1)}")(result, items) + assert items == [1,8,8] + +def test_fill_with_start_negative(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.fill(8,-2)}")(result, items) + assert items == [1,8,8] + +def test_fill_with_start_too_high(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.fill(8,7)}")(result, items) + assert items == [1,2,3] + +def test_fill_with_stop(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.fill(8,1,2)}")(result, items) + assert items == [1,8,3] + +def test_fill_with_negative_stop(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.fill(8,1,-1)}")(result, items) + assert items == [1,8,3] + +def test_fill_with_stop_too_high(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.fill(8,1,10)}")(result, items) + assert items == [1,8,8] + +#copyWithin +def test_copyWithin_returns_ref_to_self(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(0,1)}")(result, items) + assert items == [2,3,3] + assert result[0] == [2,3,3] + result[0][0] = 9 + assert items == [9,3,3] + +def test_copyWithin(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(0,1)}")(result, items) + assert items == [2,3,3] + assert result[0] == [2,3,3] + result[0][0] = 9 + assert items == [9,3,3] + +def test_copyWithin_no_args(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin()}")(result, items) + assert items == [1,2,3] + +def test_copyWithin_target_only_overwrite_all(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(0)}")(result, items) + assert items == [1,2,3] + +def test_copyWithin_target_only(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(1)}")(result, items) + assert items == [1,1,2] + +def test_copyWithin_negative_target_only(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(-1)}")(result, items) + assert items == [1,2,1] + +def test_copyWithin_target_too_large(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(10)}")(result, items) + assert items == [1,2,3] + +def test_copyWithin_target_and_start(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(1, 2)}")(result, items) + assert items == [1,3,3] + +def test_copyWithin_target_and_start_too_large(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(1, 2)}")(result, items) + assert items == [1,3,3] + +def test_copyWithin_target_and_negative_start(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(1, -1)}")(result, items) + assert items == [1,3,3] + +def test_copyWithin_target_and_start_and_end(): + items = [1,2,3,4,5] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(1,2,3)}")(result, items) + assert items == [1,3,3,4,5] + +def test_copyWithin_target_and_start_and_negative_end(): + items = [1,2,3,4,5] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(1,2,-2)}")(result, items) + assert items == [1,3,3,4,5] + +#includes +def test_includes(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.includes(1)}")(result, items) + assert result[0] == True + +def test_includes_other_type(): + items = [1,2,'Hi'] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.includes('Hi')}")(result, items) + assert result[0] == True + +def test_includes_not(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.includes(5)}")(result, items) + assert result[0] == False + +def test_includes_not_other_type(): + items = [1,2,'Hi'] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.includes('Joe')}")(result, items) + assert result[0] == False + +def test_includes_too_few_args(): + items = [4,2,6,7] + try: + pm.eval("(arr) => {arr.includes()}")(items) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("TypeError: includes: At least 1 argument required, but only 0 passed") + + +#sort +def test_sort_empty(): + items = [] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.sort()}")(result, items) + assert result[0] == items + assert items == [] + +def test_sort_numbers(): + items = [4,2,6,7] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.sort()}")(result, items) + assert result[0] == items + assert items == [2,4,6,7] + +def test_sort_strings(): + items = ['Four', 'Three', 'One'] + pm.eval("(arr) => {arr.sort()}")(items) + assert items == ['Four', 'One', 'Three'] + +def test_sort_with_two_args_keyfunc(): + items = [4,2,6,7] + def myFunc(e,f): + return len(e) - len(f) + try: + pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, myFunc) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("myFunc() missing 1 required positional argument: 'f'") + +def test_sort_with_one_arg_keyfunc(): + items = ['Four', 'Three', 'One'] + def myFunc(e): + return len(e) + pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, myFunc) + assert items == ['One', 'Four', 'Three'] + +def test_sort_with_builtin_keyfunc(): + items = ['Four', 'Three', 'One'] + pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, len) + assert items == ['One', 'Four', 'Three'] + +def test_sort_with_builtin_keyfunc_wrong_data_type(): + items = [4,2,6,7] + try: + pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, len) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("object of type 'int' has no len()") + +def test_sort_with_js_func(): + items = ['Four', 'Three', 'One'] + result = [None] + myFunc = pm.eval("((a, b) => a.toLocaleUpperCase() < b.toLocaleUpperCase() ? -1 : 1)") + pm.eval("(result, arr, compareFun) => {result[0] = arr.sort(compareFun)}")(result, items, myFunc) + assert result[0] == items + assert items == ['Four', 'One', 'Three'] + +def test_sort_with_js_func_wrong_data_type(): + items = [4,2,6,7] + myFunc = pm.eval("((a, b) => a.toLocaleUpperCase() < b.toLocaleUpperCase() ? -1 : 1)") + try: + pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, myFunc) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("TypeError: a.toLocaleUpperCase is not a function") + +#forEach +def test_forEach(): + items = ['Four', 'Three', 'One'] + result = [''] + pm.eval("(result, arr) => {arr.forEach((element) => result[0] += element)}")(result, items) + assert items == ['Four', 'Three', 'One'] + assert result == ['FourThreeOne'] + +def test_forEach_check_index(): + items = ['Four', 'Three', 'One'] + result = [''] + pm.eval("(result, arr) => {arr.forEach((element, index) => result[0] += index)}")(result, items) + assert result == ['012'] + +def test_forEach_check_array(): + items = ['Four', 'Three', 'One'] + result = [''] + pm.eval("(result, arr) => {arr.forEach((element, index, array) => result[0] = array)}")(result, items) + assert result == [items] + +def test_forEach_check_this_arg(): + items = ['Four', 'Three', 'One'] + result = [None] + pm.eval("(result, arr) => {class Counter { constructor() { this.count = 0;} add(array) { array.forEach(function countEntry(entry) { ++this.count; }, this);}} const obj = new Counter(); obj.add(arr); result[0] = obj.count;}")(result, items) + assert result == [3] + +def test_forEach_too_few_args(): + items = [4,2,6,7] + try: + pm.eval("(arr) => {arr.forEach()}")(items) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("TypeError: forEach: At least 1 argument required, but only 0 passed") + +#map +def test_map(): + items = [4,2,6,7] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.map((x) => x * x)}")(result, items) + assert items == [4,2,6,7] + assert result[0] == [16,4,36,49] + +def test_map_too_few_args(): + items = [4,2,6,7] + try: + pm.eval("(arr) => {arr.map()}")(items) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("TypeError: map: At least 1 argument required, but only 0 passed") + +def test_map_check_index(): + items = ['Four', 'Three', 'One'] + result = [''] + pm.eval("(result, arr) => {arr.map((element, index) => result[0] += index)}")(result, items) + assert result == ['012'] + +def test_map_check_array(): + items = ['Four', 'Three', 'One'] + result = [''] + pm.eval("(result, arr) => {arr.map((element, index, array) => result[0] = array)}")(result, items) + assert result == [items] + +#filter +def test_filter(): + words = ['spray', 'elite', 'exuberant', 'destruction', 'present'] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.filter((word) => word.length > 6)}")(result, words) + assert words == ['spray', 'elite', 'exuberant', 'destruction', 'present'] + assert result[0] == ['exuberant', 'destruction', 'present'] + +def test_filter_too_few_args(): + items = [4,2,6,7] + try: + pm.eval("(arr) => {arr.filter()}")(items) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("TypeError: filter: At least 1 argument required, but only 0 passed") + +#reduce index, array param, too few args same as previous few +def test_reduce(): + items = [1,2,3,4,5] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reduce((accumulator, currentValue) => accumulator + currentValue, 0)}")(result, items) + assert items == [1,2,3,4,5] + assert result[0] == 15 + +def test_reduce_float(): + items = [1.9, 4.6, 9.3, 16.5] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reduce((accumulator, currentValue) => accumulator + currentValue, 0)}")(result, items) + assert result[0] == 32.3 + +def test_reduce_string(): + items = ['Hi', 'There'] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reduce((accumulator, currentValue) => accumulator + currentValue, "")}")(result, items) + assert result[0] == 'HiThere' + +def test_reduce_initial_value_not_zero(): + items = [1,2,3,4,5] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reduce((accumulator, currentValue) => accumulator + currentValue, 5)}")(result, items) + assert items == [1,2,3,4,5] + assert result[0] == 20 + +def test_reduce_no_initial_value(): + items = [1,2,3,4,5] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reduce((accumulator, currentValue) => accumulator + currentValue)}")(result, items) + assert items == [1,2,3,4,5] + assert result[0] == 15 + +def test_reduce_list_meaningless(): + items = [['Hi', 'There']] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reduce((x) => x * 2)}")(result, items) + assert result[0] == ['Hi', 'There'] + +#reduceRight +def test_reduceRight_list_concat(): + items = [[0, 1],[2, 3],[4, 5]] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reduceRight((accumulator, currentValue) => accumulator.concat(currentValue))}")(result, items) + assert result[0] == [4, 5, 2, 3, 0, 1] + +def test_reduceRight_list_concat_with_initial_value(): + items = [[0, 1],[2, 3],[4, 5]] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reduceRight((accumulator, currentValue) => accumulator.concat(currentValue), [7,8])}")(result, items) + assert result[0] == [7, 8, 4, 5, 2, 3, 0, 1] + +def test_reduceRight(): + items = [0,1,2,3,4] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reduceRight((accumulator, currentValue, index, array) => accumulator + currentValue)}")(result, items) + assert result[0] == 10 + +def test_reduceRight_float(): + items = [1.9, 4.6, 9.3, 16.5] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reduceRight((accumulator, currentValue, index, array) => accumulator + currentValue)}")(result, items) + assert result[0] == 32.3 \ No newline at end of file diff --git a/tests/python/test_list_array.py b/tests/python/test_list_array.py index 4def6276..7d8182e8 100644 --- a/tests/python/test_list_array.py +++ b/tests/python/test_list_array.py @@ -8,3 +8,14 @@ def test_eval_array_is_list(): def test_eval_array_is_list_type_string(): pythonListTypeString = str(type(pm.eval('[]'))) assert pythonListTypeString == "" + +def test_eval_list_is_array(): + items = [1, 2, 3] + isArray = pm.eval('Array.isArray')(items) + assert isArray == True + +def test_typeof_array(): + items = [1, 2, 3] + result = [None] + pm.eval("(result, arr) => {result[0] = typeof arr}")(result, items) + assert result[0] == 'object' \ No newline at end of file From f836271cf0c1589d4c0c396ac1d554a1654816f7 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 20 Dec 2023 12:24:49 -0500 Subject: [PATCH 0107/1086] Use public version of cpython functions --- src/JSArrayProxy.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 809df45a..b389ba7e 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -530,7 +530,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { if (_PyUnicodeWriter_WriteChar(&writer, '[') < 0) { goto error; } - + /* Do repr() on each element. Note that this may mutate the list, so must refetch the list size on each iteration. */ for (Py_ssize_t index = 0; index < JSArrayProxy_length(self); index++) { if (index > 0) { @@ -794,7 +794,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_insert(JSArrayProxy *self, { Py_ssize_t ival = -1; - PyObject *iobj = _PyNumber_Index(args[0]); + PyObject *iobj = PyNumber_Index(args[0]); if (iobj != NULL) { ival = PyLong_AsSsize_t(iobj); Py_DECREF(iobj); @@ -904,7 +904,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_pop(JSArrayProxy *self, Py if (nargs >= 1) { Py_ssize_t ival = -1; - PyObject *iobj = _PyNumber_Index(args[0]); + PyObject *iobj = PyNumber_Index(args[0]); if (iobj != NULL) { ival = PyLong_AsSsize_t(iobj); Py_DECREF(iobj); From f47ba057e944af17ab54cc96f8297aa4eebdfcf8 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 20 Dec 2023 12:46:09 -0500 Subject: [PATCH 0108/1086] tests made backwards-compatible --- tests/python/test_lists.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index 064a004b..8dcf2b03 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -342,7 +342,7 @@ def test_clear_with_arg(): assert (False) except Exception as e: assert str(type(e)) == "" - assert str(e) == "JSArrayProxy.clear() takes no arguments (1 given)" + assert str(e).__contains__('clear() takes no arguments (1 given)') #copy def test_copy(): @@ -359,7 +359,7 @@ def test_copy_with_arg(): assert (False) except Exception as e: assert str(type(e)) == "" - assert str(e) == "JSArrayProxy.copy() takes no arguments (1 given)" + assert str(e).__contains__('copy() takes no arguments (1 given)') #append def test_append(): @@ -544,7 +544,7 @@ def test_remove_no_args(): assert (False) except Exception as e: assert str(type(e)) == "" - assert str(e) == "JSArrayProxy.remove() takes exactly one argument (0 given)" + assert str(e).__contains__('remove() takes exactly one argument (0 given)') def test_remove_not_found(): a = pm.eval('([1,2])') @@ -680,7 +680,7 @@ def test_reverse_too_many_args(): assert (False) except Exception as e: assert str(type(e)) == "" - assert str(e) == "JSArrayProxy.reverse() takes no arguments (1 given)" + assert str(e).__contains__('reverse() takes no arguments (1 given)') #sort def test_sort(): From c12ae1669d1ab7b33cb040f507352206682a6990 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 20 Dec 2023 13:10:28 -0500 Subject: [PATCH 0109/1086] clean up self assign slice operation --- src/JSArrayProxy.cc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index b389ba7e..17cbac02 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -175,21 +175,14 @@ static int list_ass_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihigh, size_t s; int result = -1; /* guilty until proved innocent */ #define b ((PyListObject *)v) + Py_ssize_t selfLength = JSArrayProxyMethodDefinitions::JSArrayProxy_length(self); if (v == NULL) { n = 0; } else { - Py_ssize_t vLength; - if (PyObject_TypeCheck(v, &JSArrayProxyType)) { - vLength = JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)v); - } - else { - vLength = Py_SIZE(b); - } - if ((PyListObject *)self == b) { /* Special case "a[i:j] = a" -- copy b first */ - v = list_slice(self, 0, vLength); + v = list_slice(self, 0, selfLength); if (v == NULL) { return result; } @@ -206,8 +199,6 @@ static int list_ass_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihigh, vitem = PySequence_Fast_ITEMS(v_as_SF); } - Py_ssize_t selfLength = JSArrayProxyMethodDefinitions::JSArrayProxy_length(self); - if (ilow < 0) { ilow = 0; } From b8c8b92ecc6175ebfb4ffbeca55955a54526628a Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 20 Dec 2023 13:31:55 -0500 Subject: [PATCH 0110/1086] Improved docs --- LICENSE | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- README.md | 2 +- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 4899df7f..e488de74 100644 --- a/LICENSE +++ b/LICENSE @@ -22,6 +22,54 @@ SOFTWARE. ------------------------------------------------------------------------------- +Python Software Foundation License Version 2 + Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 -Python Software Foundation; All Rights Reserved \ No newline at end of file +Python Software Foundation; All Rights Reserved + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. \ No newline at end of file diff --git a/README.md b/README.md index 61adf5ab..b9f00f07 100644 --- a/README.md +++ b/README.md @@ -250,7 +250,7 @@ that if you update an object in JavaScript, the corresponding Dict in Python wil | function | Function | object - most | pythonmonkey.JSObjectProxy (Dict) | object - Date | datetime -| object - Array | List +| object - Array | pythonmonkey.JSArrayProxy (List) | object - Promise | awaitable | object - ArrayBuffer | Buffer | object - type arrays | Buffer From 0cf389a4356d2bede5f12384e289de0c8a3c8952 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Wed, 20 Dec 2023 17:01:23 -0500 Subject: [PATCH 0111/1086] comment --- src/JSArrayProxy.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index f43858f9..17cbac02 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -743,7 +743,6 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot(JSArrayProxy *self) { } int JSArrayProxyMethodDefinitions::JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg) { - // TODO untested JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); for (Py_ssize_t i = JSArrayProxy_length(self); --i >= 0; ) { JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); From 2239514982f05aef6cf4a9f1524f4f881d085c2e Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Wed, 20 Dec 2023 17:32:05 -0500 Subject: [PATCH 0112/1086] All Python List Proxy methods in except for iterator-based ones --- src/PyProxyHandler.cc | 221 +++++++++--------------------------- tests/python/test_arrays.py | 212 ++++++++++++++++++++++++++++------ 2 files changed, 231 insertions(+), 202 deletions(-) diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index d0b27f90..2a22b32d 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -224,94 +224,6 @@ static bool array_pop(JSContext *cx, unsigned argc, JS::Value *vp) { return true; } -static bool array_at(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - if (!args.requireAtLeast(cx, "at", 1)) { - return false; - } - - JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); - if (!proxy) { - return false; - } - PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - - int64_t index; - if (!JS::ToInt64(cx, args[0], &index)) { - return false; - } - - Py_ssize_t selfSize = PyList_GET_SIZE(self); - - if (index < 0) { - index += selfSize; - } - - if (index < 0 || index >= selfSize) { - args.rval().setUndefined(); - return true; - } - - PyObject *result = PyList_GetItem(self, (Py_ssize_t)index); - - args.rval().set(jsTypeFactory(cx, result)); - return true; -} - -static bool array_join(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); - if (!proxy) { - return false; - } - PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - - // convert to JSArray (copy) then call join on it - JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); - - JS::RootedString sepstr(cx); - if (args.hasDefined(0)) { - sepstr = JS::ToString(cx, args[0]); - if (!sepstr) { - return false; - } - } else { - sepstr = JS_NewStringCopyZ(cx, ","); - } - - JS::Rooted> jArgs(cx); - jArgs[0].setString(sepstr); - JS::RootedValue jRet(cx); - if (!JS_CallFunctionName(cx, selfCopy, "join", jArgs, &jRet)) { - return false; - } - - args.rval().setString(jRet.toString()); - return true; -} - -static bool array_toString(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); - if (!proxy) { - return false; - } - PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - - JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); - - JS::RootedValue jRet(cx); - if (!JS_CallFunctionName(cx, selfCopy, "toString", JS::HandleValueArray::empty(), &jRet)) { - return false; - } - - args.rval().setString(jRet.toString()); - return true; -} - static bool array_push(JSContext *cx, unsigned argc, JS::Value *vp) { // surely the function name is in there...review JSAPI examples JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -643,9 +555,12 @@ static bool array_sort(JSContext *cx, unsigned argc, JS::Value *vp) { if (flags & METH_VARARGS && !(flags & METH_KEYWORDS)) { // it's a JS func + // We don't want to put in all the sort code so we'll tolerate the following slight O(n) inefficiency + // copy to JS for sorting JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); + // sort JS::RootedValue jReturnedArray(cx); JS::HandleValueArray jArgs(args); if (!JS_CallFunctionName(cx, selfCopy, "sort", jArgs, &jReturnedArray)) { @@ -830,8 +745,11 @@ static bool array_copyWithin(JSContext *cx, unsigned argc, JS::Value *vp) { return true; } -static bool array_copy_func(JSContext *cx, JS::CallArgs args, const char *fName, JS::MutableHandle rval) { - if (!args.requireAtLeast(cx, fName, 1)) { +// private util +static bool array_copy_func(JSContext *cx, unsigned argc, JS::Value *vp, const char *fName, bool checkRequireAtLeastOne = true) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (checkRequireAtLeastOne && !args.requireAtLeast(cx, fName, 1)) { return false; } @@ -844,117 +762,81 @@ static bool array_copy_func(JSContext *cx, JS::CallArgs args, const char *fName, JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); JS::HandleValueArray jArgs(args); + JS::RootedValue rval(cx); - if (!JS_CallFunctionName(cx, selfCopy, fName, jArgs, rval)) { + if (!JS_CallFunctionName(cx, selfCopy, fName, jArgs, &rval)) { return false; } + args.rval().set(rval); + return true; } static bool array_includes(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - JS::RootedValue jRet(cx); - - if (!array_copy_func(cx, args, "includes", &jRet)) { - return false; - } - - args.rval().setBoolean(jRet.toBoolean()); - return true; + return array_copy_func(cx, argc, vp, "includes"); } static bool array_forEach(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - JS::RootedValue jRet(cx); - - if (!array_copy_func(cx, args, "forEach", &jRet)) { - return false; - } - - args.rval().setUndefined(); - return true; + return array_copy_func(cx, argc, vp, "forEach"); } static bool array_map(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - JS::RootedValue jRet(cx); - - if (!array_copy_func(cx, args, "map", &jRet)) { - return false; - } - - args.rval().setObject(jRet.toObject()); - return true; + return array_copy_func(cx, argc, vp, "map"); } static bool array_filter(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - JS::RootedValue jRet(cx); - - if (!array_copy_func(cx, args, "filter", &jRet)) { - return false; - } - - args.rval().setObject(jRet.toObject()); - return true; + return array_copy_func(cx, argc, vp, "filter"); } static bool array_reduce(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + return array_copy_func(cx, argc, vp, "reduce"); +} - JS::RootedValue jRet(cx); +static bool array_reduceRight(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "reduceRight"); +} - if (!array_copy_func(cx, args, "reduce", &jRet)) { - return false; - } +static bool array_some(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "some"); +} - if (jRet.isNumber()) { - args.rval().setNumber(jRet.toNumber()); - } - else if (jRet.isString()) { - args.rval().setString(jRet.toString()); - } - else if (jRet.isObject()) { - args.rval().setObject(jRet.toObject()); - } +static bool array_every(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "every"); +} - return true; +static bool array_find(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "find"); } -static bool array_reduceRight(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); +static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "findIndex"); +} - JS::RootedValue jRet(cx); +static bool array_flat(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "flat", false); +} - if (!array_copy_func(cx, args, "reduceRight", &jRet)) { - return false; - } +static bool array_flatMap(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "flatMap"); +} - if (jRet.isNumber()) { - args.rval().setNumber(jRet.toNumber()); - } - else if (jRet.isString()) { - args.rval().setString(jRet.toString()); - } - else if (jRet.isObject()) { - args.rval().setObject(jRet.toObject()); - } +static bool array_join(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "join", false); +} - return true; +static bool array_toString(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "toString", false); +} + +static bool array_toLocaleString(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "toLocaleString", false); } static JSMethodDef array_methods[] = { {"reverse", array_reverse, 0}, {"pop", array_pop, 0}, - {"at", array_at, 1}, - {"join", array_join, 1}, - {"toString", array_toString, 0}, {"push", array_push, 1}, {"shift", array_shift, 0}, {"unshift", array_unshift, 1}, @@ -972,6 +854,15 @@ static JSMethodDef array_methods[] = { {"filter", array_filter, 1}, {"reduce", array_reduce, 1}, {"reduceRight", array_reduceRight, 1}, + {"some", array_some, 1}, + {"every", array_every, 1}, + {"find", array_find, 1}, + {"findIndex", array_findIndex, 1}, + {"flat", array_flat, 1}, + {"flatMap", array_flatMap, 1}, + {"join", array_join, 1}, + {"toString", array_toString, 0}, + {"toLocaleString", array_toLocaleString, 0}, {NULL, NULL} }; diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 16f471bf..8ce0955a 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -75,40 +75,6 @@ def test_pop_ignore_extra_args(): assert items == [1,2] assert result[0] == 3 -#at -def test_at_no_arg(): - items = [1,2,3] - try: - pm.eval("(arr) => {arr.at()}")(items) - assert (False) - except Exception as e: - assert str(type(e)) == "" - assert str(e).__contains__('TypeError: at: At least 1 argument required, but only 0 passed') - -def test_at(): - items = [1,2,3] - result = [None] - pm.eval("(result, arr) => {result[0] = arr.at(0)}")(result, items) - assert result[0] == 1 - -def test_at_wrong_index_type(): - items = [1,2,3] - result = [None] - pm.eval("(result, arr) => {result[0] = arr.at('f')}")(result, items) - assert result[0] == 1 - -def test_at_index_too_large(): - items = [1,2,3] - result = [None] - pm.eval("(result, arr) => {result[0] = arr.at(10)}")(result, items) - assert result[0] == None - -def test_at_index_negative(): - items = [1,2,3] - result = [None] - pm.eval("(result, arr) => {result[0] = arr.at(-2)}")(result, items) - assert result[0] == 2 - #join def test_join_no_arg(): items = [1,2,3] @@ -141,6 +107,13 @@ def test_toString(): pm.eval("(result, arr) => {result[0] = arr.toString()}")(result, items) assert result[0] == '1,2,3' +#toString +def test_LocaleString(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.toString()}")(result, items) + assert result[0] == '1,2,3' + #push def test_push(): items = [1,2,3] @@ -684,9 +657,11 @@ def test_sort_with_js_func_wrong_data_type(): def test_forEach(): items = ['Four', 'Three', 'One'] result = [''] - pm.eval("(result, arr) => {arr.forEach((element) => result[0] += element)}")(result, items) + returnResult = [0] + pm.eval("(returnResult, result, arr) => {returnResult[0] = arr.forEach((element) => result[0] += element)}")(returnResult, result, items) assert items == ['Four', 'Three', 'One'] assert result == ['FourThreeOne'] + assert returnResult == [None] def test_forEach_check_index(): items = ['Four', 'Three', 'One'] @@ -761,7 +736,7 @@ def test_filter_too_few_args(): assert str(type(e)) == "" assert str(e).__contains__("TypeError: filter: At least 1 argument required, but only 0 passed") -#reduce index, array param, too few args same as previous few +#reduce index, array param, too few args same impl as previous few for all below def test_reduce(): items = [1,2,3,4,5] result = [None] @@ -824,4 +799,167 @@ def test_reduceRight_float(): items = [1.9, 4.6, 9.3, 16.5] result = [None] pm.eval("(result, arr) => {result[0] = arr.reduceRight((accumulator, currentValue, index, array) => accumulator + currentValue)}")(result, items) - assert result[0] == 32.3 \ No newline at end of file + assert result[0] == 32.3 + +#some +def test_some_true(): + items = [1, 2, 3, 4, 5] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.some((element) => element % 2 === 0)}")(result, items) + assert items == [1, 2, 3, 4, 5] + assert result[0] == True + +def test_some_false(): + items = [1,3,5] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.some((element) => element % 2 === 0)}")(result, items) + assert result[0] == False + +def test_some_truthy_conversion(): + result = [None] + pm.eval('(result) => {const TRUTHY_VALUES = [true, "true", 1]; function getBoolean(value) { if (typeof value === "string") { value = value.toLowerCase().trim(); } return TRUTHY_VALUES.some((t) => t === value);} result[0] = getBoolean(1);}')(result) + assert result[0] == True + +#every +def test_every_true(): + items = [2,4,6] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.every((element) => element % 2 === 0)}")(result, items) + assert items == [2,4,6] + assert result[0] == True + +def test_every_false(): + items = [1,2,4,6] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.every((element) => element % 2 === 0)}")(result, items) + assert result[0] == False + +#find +def test_find_found_once(): + items = [5, 12, 8, 130, 44] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.find((element) => element > 100)}")(result, items) + assert items == [5, 12, 8, 130, 44] + assert result[0] == 130 + +def test_find_found_twice(): + items = [5, 12, 8, 130, 4] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.find((element) => element > 10)}")(result, items) + assert result[0] == 12 + +def test_find_not_found(): + items = [5, 12, 8, 130, 44] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.find((element) => element > 1000)}")(result, items) + assert result[0] == None + +#findIndex +def test_findIndex_found_once(): + items = [5, 12, 8, 130, 44] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.findIndex((element) => element > 100)}")(result, items) + assert items == [5, 12, 8, 130, 44] + assert result[0] == 3 + +def test_findIndex_found_twice(): + items = [5, 12, 8, 130, 4] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.findIndex((element) => element > 10)}")(result, items) + assert result[0] == 1 + +def test_findIndex_not_found(): + items = [5, 12, 8, 130, 4] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.findIndex((element) => element > 1000)}")(result, items) + assert result[0] == -1 + +#flat +def test_flat(): + items = [0, 1, 2, [3, 4]] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.flat()}")(result, items) + assert items == [0, 1, 2, [3, 4]] + assert result[0] == [0, 1, 2, 3, 4] + +def test_flat_depth_zero(): + items = [0, 1, [2, [3, [4, 5]]]] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.flat(0)}")(result, items) + assert result[0] == [0, 1, [2, [3, [4, 5]]]] + +def test_flat_depth_one(): + items = [0, 1, [2, [3, [4, 5]]]] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.flat(1)}")(result, items) + assert items == [0, 1, [2, [3, [4, 5]]]] + assert result[0] == [0, 1, 2, [3, [4, 5]]] + +########## TODO these two fail as tests but work in the interactive console ########### +#def test_flat_depth_two(): +# items = [0, 1, [2, [3, [4, 5]]]] +# result = [0] +# pm.eval("(result, arr) => {result[0] = arr.flat(2)}")(result, items) +# assert items == [0, 1, [2, [3, [4, 5]]]] +# assert result[0] == [0, 1, 2, 3, [4, 5]] + +#def test_flat_depth_infinite(): +# items = [0, 1, [2, [3, [4, 5]]]] +# result = [0] +# pm.eval("(result, arr) => {result[0] = arr.flat(Infinity)}")(result, items) +# assert result[0] == [0, 1, 2, 3, 4, 5] + +#flatMap +def test_flatMap(): + items = [1, 2, 1] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.flatMap((num) => (num === 2 ? [2, 2] : 1))}")(result, items) + assert items == [1,2,1] + assert result[0] == [1,2,2,1] + +def test_flatMap_equivalence(): + items = [1, 2, 1] + result = [0] + result2 = [0] + pm.eval("(result, arr) => {result[0] = arr.flatMap((num) => (num === 2 ? [2, 2] : 1))}")(result, items) + pm.eval("(result, arr) => {result[0] = arr.map((num) => (num === 2 ? [2, 2] : 1)).flat()}")(result2, items) + assert result[0] == result2[0] + +# toLocaleString +def test_toLocaleString(): + result = [None] + pm.eval("(result) => {array1 = [1, 'a', new Date('21 Dec 1997 14:12:00 UTC')]; result[0] = array1.toLocaleString('en', { timeZone: 'UTC' })}")(result) + assert result[0] == '1,a,12/21/1997, 2:12:00 PM' + +def test_toLocaleString_no_args(): + result = [None] + pm.eval("(result) => {array1 = [1, 'a', new Date('21 Dec 1997 14:12:00 UTC')]; result[0] = array1.toLocaleString()}")(result) + assert result[0] == '1,a,1997-12-21, 9:12:00 a.m.' + +def test_toLocaleString_one_arg_en(): + result = [None] + pm.eval("(result) => {array1 = [1, 'a', new Date('21 Dec 1997 14:12:00 UTC')]; result[0] = array1.toLocaleString('en')}")(result) + assert result[0] == '1,a,12/21/1997, 9:12:00 AM' + +def test_toLocaleString_one_arg_fr(): + result = [None] + pm.eval("(result) => {array1 = [1, 'a', new Date('21 Dec 1997 14:12:00 UTC')]; result[0] = array1.toLocaleString('fr')}")(result) + assert result[0] == '1,a,21/12/1997 09:12:00' + +def test_toLocaleString_one_arg_invalid_locale(): + result = [None] + try: + pm.eval("(result) => {array1 = [1, 'a', new Date('21 Dec 1997 14:12:00 UTC')]; result[0] = array1.toLocaleString('endzfasdf')}")(result) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("RangeError: invalid language tag:") + +def test_toLocaleString_two_args_invalid_timeZone(): + result = [None] + try: + pm.eval("(result) => {array1 = [1, 'a', new Date('21 Dec 1997 14:12:00 UTC')]; result[0] = array1.toLocaleString('en', { timeZone: 'UT' })}")(result) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("RangeError: invalid time zone in DateTimeFormat(): UT") \ No newline at end of file From 3760ac58377658f4da08212b549231735abeb02e Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 21 Dec 2023 01:32:34 -0500 Subject: [PATCH 0113/1086] fix leak introduced in philippe/176 --- src/JSObjectProxy.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 16d4338d..248e6576 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -331,8 +331,8 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_ior(JSObjectProxy *self, JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); - JS::RootedValue *ret = new JS::RootedValue(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, ret)) { + JS::RootedValue ret(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } From ae060ae9eec0da33ea1c5b76e4979e058f6e9861 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 21 Dec 2023 01:38:18 -0500 Subject: [PATCH 0114/1086] better naming --- include/JSArrayProxy.hh | 2 +- src/JSArrayProxy.cc | 146 ++++++++++++++++++++-------------------- src/ListType.cc | 2 +- src/jsTypeFactory.cc | 2 +- 4 files changed, 76 insertions(+), 76 deletions(-) diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh index d358ccc5..0e04b760 100644 --- a/include/JSArrayProxy.hh +++ b/include/JSArrayProxy.hh @@ -24,7 +24,7 @@ */ typedef struct { PyListObject list; - JS::RootedObject jsObject; + JS::RootedObject jsArray; } JSArrayProxy; /** diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 17cbac02..f127c165 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -25,7 +25,7 @@ void JSArrayProxyMethodDefinitions::JSArrayProxy_dealloc(JSArrayProxy *self) { - self->jsObject.set(nullptr); + self->jsArray.set(nullptr); Py_TYPE(self)->tp_free((PyObject *)self); } @@ -43,7 +43,7 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_init(JSArrayProxy *self, PyObjec Py_ssize_t JSArrayProxyMethodDefinitions::JSArrayProxy_length(JSArrayProxy *self) { uint32_t length; - JS::GetArrayLength(GLOBAL_CX, self->jsObject, &length); + JS::GetArrayLength(GLOBAL_CX, self->jsArray, &length); return (Py_ssize_t)length; } @@ -56,9 +56,9 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py } JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); + JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, value); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); // look through the methods for dispatch and return key if no method found for (size_t index = 0;; index++) { const char *methodName = JSArrayProxyType.tp_methods[index].ml_name; @@ -83,11 +83,11 @@ static PyObject *list_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihig jArgs[0].setInt32(ilow); jArgs[1].setInt32(ihigh); JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "slice", jArgs, jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "slice", jArgs, jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), jReturnedArray)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jReturnedArray)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy *self, PyObject *key) @@ -113,9 +113,9 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy JS_IndexToId(GLOBAL_CX, index, &id); JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); + JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, value); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), value)->getPyObject(); } else if (PySlice_Check(key)) { Py_ssize_t start, stop, step, slicelength, index; @@ -137,14 +137,14 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy JS::RootedValue elementVal(GLOBAL_CX); for (size_t cur = start, index = 0; index < slicelength; cur += (size_t)step, index++) { - JS_GetElement(GLOBAL_CX, self->jsObject, cur, &elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, cur, &elementVal); JS_SetElement(GLOBAL_CX, jCombinedArray, index, elementVal); } JS::RootedValue *jCombinedArrayValue = new JS::RootedValue(GLOBAL_CX); jCombinedArrayValue->setObjectOrNull(jCombinedArray); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), jCombinedArrayValue)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jCombinedArrayValue)->getPyObject(); } } else { @@ -226,30 +226,30 @@ static int list_ass_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihigh, if (d < 0) { /* Delete -d items */ JS::RootedValue elementVal(GLOBAL_CX); for (size_t index = ihigh, count = 0; count < selfLength - ihigh; index++, count++) { - JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); - JS_SetElement(GLOBAL_CX, self->jsObject, index+d, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + JS_SetElement(GLOBAL_CX, self->jsArray, index+d, elementVal); } - JS::SetArrayLength(GLOBAL_CX, self->jsObject, selfLength + d); + JS::SetArrayLength(GLOBAL_CX, self->jsArray, selfLength + d); } else if (d > 0) { /* Insert d items */ k = selfLength; - JS::SetArrayLength(GLOBAL_CX, self->jsObject, k + d); + JS::SetArrayLength(GLOBAL_CX, self->jsArray, k + d); selfLength = k + d; JS::RootedValue elementVal(GLOBAL_CX); for (size_t index = ihigh, count = 0; count < k - ihigh; index++, count++) { - JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); - JS_SetElement(GLOBAL_CX, self->jsObject, index+d, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + JS_SetElement(GLOBAL_CX, self->jsArray, index+d, elementVal); } } JS::RootedValue elementVal(GLOBAL_CX); for (k = 0; k < n; k++, ilow++) { elementVal.set(jsTypeFactory(GLOBAL_CX, vitem[k])); - JS_SetElement(GLOBAL_CX, self->jsObject, ilow, elementVal); + JS_SetElement(GLOBAL_CX, self->jsArray, ilow, elementVal); } result = 0; @@ -282,10 +282,10 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key(JSArrayProxy *self, P if (value) { // we are setting a value JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); - JS_SetPropertyById(GLOBAL_CX, self->jsObject, id, jValue); + JS_SetPropertyById(GLOBAL_CX, self->jsArray, id, jValue); } else { // we are deleting a value JS::ObjectOpResult ignoredResult; - JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); + JS_DeletePropertyById(GLOBAL_CX, self->jsArray, id, ignoredResult); } return 0; @@ -341,8 +341,8 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key(JSArrayProxy *self, P } for (size_t index = cur, count = 0; count < lim; index++, count++) { - JS_GetElement(GLOBAL_CX, self->jsObject, index + 1, &elementVal); - JS_SetElement(GLOBAL_CX, self->jsObject, index - i, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index + 1, &elementVal); + JS_SetElement(GLOBAL_CX, self->jsArray, index - i, elementVal); } } @@ -350,12 +350,12 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key(JSArrayProxy *self, P if (cur < (size_t)selfSize) { for (size_t index = cur, count = 0; count < selfSize - cur; index++, count++) { - JS_GetElement(GLOBAL_CX, self->jsObject, index, &elementVal); - JS_SetElement(GLOBAL_CX, self->jsObject, index - slicelength, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + JS_SetElement(GLOBAL_CX, self->jsArray, index - slicelength, elementVal); } } - JS::SetArrayLength(GLOBAL_CX, self->jsObject, selfSize - slicelength); + JS::SetArrayLength(GLOBAL_CX, self->jsArray, selfSize - slicelength); return 0; } @@ -395,7 +395,7 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key(JSArrayProxy *self, P JS::RootedValue elementVal(GLOBAL_CX); for (cur = start, i = 0; i < slicelength; cur += (size_t)step, i++) { elementVal.set(jsTypeFactory(GLOBAL_CX, seqitems[i])); - JS_SetElement(GLOBAL_CX, self->jsObject, cur, elementVal); + JS_SetElement(GLOBAL_CX, self->jsArray, cur, elementVal); } Py_DECREF(seq); @@ -444,18 +444,18 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * } JS::RootedValue *elementVal; - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); Py_ssize_t index; /* Search for the first index where items are different */ for (index = 0; index < selfLength && index < otherLength; index++) { elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); PyObject *leftItem = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); PyObject *rightItem; if (PyObject_TypeCheck(other, &JSArrayProxyType)) { - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)other)->jsObject, index, elementVal); + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)other)->jsArray, index, elementVal); rightItem = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); } else { rightItem = ((PyListObject *)other)->ob_item[index]; @@ -492,7 +492,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * } elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); /* Compare the final item again using the proper operator */ return PyObject_RichCompare(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(), ((PyListObject *)other)->ob_item[index], op); } @@ -516,7 +516,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { /* "[" + "1" + ", 2" * (len - 1) + "]" */ writer.min_length = 1 + 1 + (2 + 1) * (selfLength - 1) + 1; - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); if (_PyUnicodeWriter_WriteChar(&writer, '[') < 0) { goto error; @@ -531,10 +531,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { } JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); PyObject *s; - if (&elementVal->toObject() == self->jsObject.get()) { + if (&elementVal->toObject() == self->jsArray.get()) { s = PyObject_Repr((PyObject *)self); } else { s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); @@ -569,10 +569,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_iter(JSArrayProxy *self) { PyObject *seq = PyList_New(selfLength); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (size_t index = 0; index < selfLength; index++) { JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); PyList_SET_ITEM(seq, index, pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); } @@ -612,13 +612,13 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_concat(JSArrayProxy *self, JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t inputIdx = 0; inputIdx < sizeSelf; inputIdx++) { - JS_GetElement(GLOBAL_CX, self->jsObject, inputIdx, &elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, inputIdx, &elementVal); JS_SetElement(GLOBAL_CX, jCombinedArray, inputIdx, elementVal); } if (PyObject_TypeCheck(value, &JSArrayProxyType)) { for (Py_ssize_t inputIdx = 0; inputIdx < sizeValue; inputIdx++) { - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)value)->jsObject, inputIdx, &elementVal); + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)value)->jsArray, inputIdx, &elementVal); JS_SetElement(GLOBAL_CX, jCombinedArray, sizeSelf + inputIdx, elementVal); } } else { @@ -632,7 +632,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_concat(JSArrayProxy *self, JS::RootedValue *jCombinedArrayValue = new JS::RootedValue(GLOBAL_CX); jCombinedArrayValue->setObjectOrNull(jCombinedArray); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), jCombinedArrayValue)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jCombinedArrayValue)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, Py_ssize_t n) { @@ -650,7 +650,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, // one might think of using copyWithin but in SpiderMonkey it's implemented in JS! JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t inputIdx = 0; inputIdx < input_size; inputIdx++) { - JS_GetElement(GLOBAL_CX, self->jsObject, inputIdx, &elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, inputIdx, &elementVal); for (Py_ssize_t repeatIdx = 0; repeatIdx < n; repeatIdx++) { JS_SetElement(GLOBAL_CX, jCombinedArray, repeatIdx * input_size + inputIdx, elementVal); } @@ -659,7 +659,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, JS::RootedValue jCombinedArrayValue(GLOBAL_CX); jCombinedArrayValue.setObjectOrNull(jCombinedArray); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), &jCombinedArrayValue)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), &jCombinedArrayValue)->getPyObject(); } int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyObject *element) { @@ -667,10 +667,10 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyO int cmp; Py_ssize_t numElements = JSArrayProxy_length(self); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (index = 0, cmp = 0; cmp == 0 && index < numElements; ++index) { JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); PyObject *item = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); Py_INCREF(item); cmp = PyObject_RichCompareBool(item, element, Py_EQ); @@ -684,7 +684,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_concat(JSArrayProx Py_ssize_t valueLength = Py_SIZE(value); // allocate extra spacePy_SIZE - JS::SetArrayLength(GLOBAL_CX, self->jsObject, selfLength + valueLength); + JS::SetArrayLength(GLOBAL_CX, self->jsArray, selfLength + valueLength); JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); JS::RootedObject jRootedValue = JS::RootedObject(GLOBAL_CX, jValue.toObjectOrNull()); @@ -692,7 +692,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_concat(JSArrayProx JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t inputIdx = 0; inputIdx < valueLength; inputIdx++) { JS_GetElement(GLOBAL_CX, jRootedValue, inputIdx, &elementVal); - JS_SetElement(GLOBAL_CX, self->jsObject, selfLength + inputIdx, elementVal); + JS_SetElement(GLOBAL_CX, self->jsArray, selfLength + inputIdx, elementVal); } Py_INCREF(self); @@ -716,15 +716,15 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat(JSArrayProx return PyErr_NoMemory(); } - JS::SetArrayLength(GLOBAL_CX, self->jsObject, input_size * n); + JS::SetArrayLength(GLOBAL_CX, self->jsArray, input_size * n); // repeat within self // one might think of using copyWithin but in SpiderMonkey it's implemented in JS! JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t inputIdx = 0; inputIdx < input_size; inputIdx++) { - JS_GetElement(GLOBAL_CX, self->jsObject, inputIdx, &elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, inputIdx, &elementVal); for (Py_ssize_t repeatIdx = 0; repeatIdx < n; repeatIdx++) { - JS_SetElement(GLOBAL_CX, self->jsObject, repeatIdx * input_size + inputIdx, elementVal); + JS_SetElement(GLOBAL_CX, self->jsArray, repeatIdx * input_size + inputIdx, elementVal); } } @@ -733,7 +733,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat(JSArrayProx } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_clear(JSArrayProxy *self) { - JS::SetArrayLength(GLOBAL_CX, self->jsObject, 0); + JS::SetArrayLength(GLOBAL_CX, self->jsArray, 0); Py_RETURN_NONE; } @@ -743,10 +743,10 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot(JSArrayProxy *self) { } int JSArrayProxyMethodDefinitions::JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg) { - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (Py_ssize_t i = JSArrayProxy_length(self); --i >= 0; ) { JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsObject, i, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, i, elementVal); Py_VISIT(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); } return 0; @@ -757,19 +757,19 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) { jArgs[0].setInt32(0); jArgs[1].setInt32(JSArrayProxy_length(self)); JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "slice", jArgs, jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "slice", jArgs, jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), jReturnedArray)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jReturnedArray)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_append(JSArrayProxy *self, PyObject *value) { Py_ssize_t len = JSArrayProxy_length(self); - JS::SetArrayLength(GLOBAL_CX, self->jsObject, len + 1); + JS::SetArrayLength(GLOBAL_CX, self->jsArray, len + 1); JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); - JS_SetElement(GLOBAL_CX, self->jsObject, len, jValue); + JS_SetElement(GLOBAL_CX, self->jsArray, len, jValue); Py_RETURN_NONE; } @@ -816,7 +816,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_insert(JSArrayProxy *self, jArgs[2].set(jsTypeFactory(GLOBAL_CX, value)); JS::RootedValue jReturnedArray(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "splice", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "splice", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -839,14 +839,14 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_extend(JSArrayProxy *self, Py_ssize_t m = JSArrayProxy_length(self); - JS::SetArrayLength(GLOBAL_CX, self->jsObject, m + n); + JS::SetArrayLength(GLOBAL_CX, self->jsArray, m + n); // populate the end of self with iterable's items. PyObject **src = PySequence_Fast_ITEMS(iterable); for (Py_ssize_t i = 0; i < n; i++) { PyObject *o = src[i]; JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, o)); - JS_SetElement(GLOBAL_CX, self->jsObject, m + i, jValue); + JS_SetElement(GLOBAL_CX, self->jsArray, m + i, jValue); } Py_DECREF(iterable); @@ -875,9 +875,9 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_extend(JSArrayProxy *self, break; } - JS::SetArrayLength(GLOBAL_CX, self->jsObject, len + 1); + JS::SetArrayLength(GLOBAL_CX, self->jsArray, len + 1); JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, item)); - JS_SetElement(GLOBAL_CX, self->jsObject, len, jValue); + JS_SetElement(GLOBAL_CX, self->jsArray, len, jValue); len++; } @@ -928,7 +928,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_pop(JSArrayProxy *self, Py jArgs[1].setInt32(1); JS::RootedValue jReturnedArray(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "splice", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "splice", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -938,16 +938,16 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_pop(JSArrayProxy *self, Py JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); JS_GetElement(GLOBAL_CX, rootedReturnedArray, 0, elementVal); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)), elementVal)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), elementVal)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self, PyObject *value) { Py_ssize_t selfSize = JSArrayProxy_length(self); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (Py_ssize_t index = 0; index < selfSize; index++) { JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); @@ -957,7 +957,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self, jArgs[0].setInt32(index); jArgs[1].setInt32(1); JS::RootedValue jReturnedArray(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "splice", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "splice", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -1010,10 +1010,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_index(JSArrayProxy *self, } } - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (Py_ssize_t index = start; index < stop && index < selfSize; index++) { JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); @@ -1034,10 +1034,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_count(JSArrayProxy *self, Py_ssize_t count = 0; Py_ssize_t length = JSArrayProxy_length(self); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (Py_ssize_t index = 0; index < length; index++) { JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsObject, index, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); @@ -1055,7 +1055,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_count(JSArrayProxy *self, PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_reverse(JSArrayProxy *self) { if (JSArrayProxy_length(self) > 1) { JS::RootedValue jReturnedArray(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "reverse", JS::HandleValueArray::empty(), &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "reverse", JS::HandleValueArray::empty(), &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -1245,7 +1245,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].setObject(*funObj); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { if (!PyErr_Occurred()) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); } @@ -1256,7 +1256,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P // two-arg js-style JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].set(jsTypeFactory(GLOBAL_CX, keyfunc)); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -1274,7 +1274,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P // we got a JS compare function, use it as-is JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].set(jsTypeFactory(GLOBAL_CX, keyfunc)); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -1302,7 +1302,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].setObject(*funObj); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { if (!PyErr_Occurred()) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); } @@ -1329,7 +1329,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].setObject(*funObj); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsObject, "sort", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } diff --git a/src/ListType.cc b/src/ListType.cc index cd619569..96eeec53 100644 --- a/src/ListType.cc +++ b/src/ListType.cc @@ -16,6 +16,6 @@ ListType::ListType(PyObject *object) : PyType(object) {} ListType::ListType(JSContext *cx, JS::HandleObject jsArrayObj) { JSArrayProxy *proxy = (JSArrayProxy *)PyObject_CallObject((PyObject *)&JSArrayProxyType, NULL); - proxy->jsObject.set(jsArrayObj); + proxy->jsArray.set(jsArrayObj); this->pyObject = (PyObject *)proxy; } \ No newline at end of file diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index cc8daea5..0c461bbc 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -165,7 +165,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { returnType.setObject(*((JSObjectProxy *)object)->jsObject); } else if (PyObject_TypeCheck(object, &JSArrayProxyType)) { - returnType.setObject(*((JSArrayProxy *)object)->jsObject); + returnType.setObject(*((JSArrayProxy *)object)->jsArray); } else if (PyDict_Check(object) || PyList_Check(object)) { JS::RootedValue v(cx); From c4c9675c66c6b96b97c6d1d189e9e10c1104369a Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 21 Dec 2023 01:42:48 -0500 Subject: [PATCH 0115/1086] improved naming --- tests/python/test_lists.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index 8dcf2b03..01d01b83 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -729,7 +729,7 @@ def myFunc(e): assert str(type(e)) == "" assert str(e) == "object of type 'float' has no len()" -def test_sort_with_function_and_reverse_false(): +def test_sort_with_function_two_arg_and_reverse_false(): def myFunc(e,f): return len(e) - len(f) a = pm.eval("(['Ford', 'Mitsubishi', 'BMW', 'VW'])") From e926e9f99b4c30eb2ac0e9f7ab23f8170912e5b5 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Thu, 21 Dec 2023 14:51:28 -0500 Subject: [PATCH 0116/1086] implemented valueOf --- src/JSObjectProxy.cc | 1 + src/PyProxyHandler.cc | 11 ++++++++-- tests/python/test_arrays.py | 44 +++++++++++++++++++++++-------------- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 248e6576..1fc4a6b1 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -44,6 +44,7 @@ void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) { // TODO (Caleb Aikens): intentional override of PyDict_Type's tp_dealloc. Probably results in leaking dict memory self->jsObject.set(nullptr); + // PyObject_GC_UnTrack(self); TODO what is the history of this line? Py_TYPE(self)->tp_free((PyObject *)self); return; } diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index 2a22b32d..912e9100 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -833,6 +833,10 @@ static bool array_toLocaleString(JSContext *cx, unsigned argc, JS::Value *vp) { return array_copy_func(cx, argc, vp, "toLocaleString", false); } +static bool array_valueOf(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "valueOf", false); +} + static JSMethodDef array_methods[] = { {"reverse", array_reverse, 0}, @@ -863,9 +867,11 @@ static JSMethodDef array_methods[] = { {"join", array_join, 1}, {"toString", array_toString, 0}, {"toLocaleString", array_toLocaleString, 0}, + {"valueOf", array_valueOf, 0}, {NULL, NULL} }; +static bool sawValueOf = false; bool PyListProxyHandler::getOwnPropertyDescriptor( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, @@ -873,6 +879,7 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( ) const { // see if we're calling a function if (id.isString()) { + JS::RootedString message(cx, id.toString()); for (size_t index = 0;; index++) { bool isThatFunction; const char *methodName = array_methods[index].name; @@ -897,7 +904,6 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( // We're trying to get the "length" property bool isLengthProperty; if (id.isString() && JS_StringEqualsLiteral(cx, id.toString(), "length", &isLengthProperty) && isLengthProperty) { - // proxy.length = len(pyObject) desc.set(mozilla::Some( JS::PropertyDescriptor::Data( JS::Int32Value(PyList_Size(pyObject)) @@ -977,6 +983,7 @@ bool PyListProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::Hand } bool PyListProxyHandler::isArray(JSContext *cx, JS::HandleObject proxy, JS::IsArrayAnswer *answer) const { + *answer = JS::IsArrayAnswer::Array; return true; } @@ -987,5 +994,5 @@ bool PyListProxyHandler::getBuiltinClass(JSContext *cx, JS::Handle o const char *PyListProxyHandler::className(JSContext *cx, JS::HandleObject proxy) const { // TODO untested - return "object"; + return "Array"; } \ No newline at end of file diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 8ce0955a..3f3a21ed 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -925,41 +925,51 @@ def test_flatMap_equivalence(): pm.eval("(result, arr) => {result[0] = arr.map((num) => (num === 2 ? [2, 2] : 1)).flat()}")(result2, items) assert result[0] == result2[0] -# toLocaleString +#valueOf +def test_valueOf(): + items = [1, 2, 1] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.valueOf()}")(result, items) + assert result[0] == [1,2,1] + +#toLocaleString def test_toLocaleString(): + prices = ["¥7", 500, 8123, 12] result = [None] - pm.eval("(result) => {array1 = [1, 'a', new Date('21 Dec 1997 14:12:00 UTC')]; result[0] = array1.toLocaleString('en', { timeZone: 'UTC' })}")(result) - assert result[0] == '1,a,12/21/1997, 2:12:00 PM' + pm.eval("(result, arr) => {result[0] = arr.toLocaleString('ja-JP', { style: 'currency', currency: 'JPY' })}")(result, prices) + assert result[0] == '¥7,¥500,¥8,123,¥12' def test_toLocaleString_no_args(): + prices = ["¥7", 500, 8123, 12] result = [None] - pm.eval("(result) => {array1 = [1, 'a', new Date('21 Dec 1997 14:12:00 UTC')]; result[0] = array1.toLocaleString()}")(result) - assert result[0] == '1,a,1997-12-21, 9:12:00 a.m.' + pm.eval("(result, arr) => {result[0] = arr.toLocaleString()}")(result, prices) + assert result[0] == '¥7,500,8,123,12' -def test_toLocaleString_one_arg_en(): +def test_toLocaleString_one_arg_(): + prices = ["¥7", 500, 8123, 12] result = [None] - pm.eval("(result) => {array1 = [1, 'a', new Date('21 Dec 1997 14:12:00 UTC')]; result[0] = array1.toLocaleString('en')}")(result) - assert result[0] == '1,a,12/21/1997, 9:12:00 AM' - -def test_toLocaleString_one_arg_fr(): - result = [None] - pm.eval("(result) => {array1 = [1, 'a', new Date('21 Dec 1997 14:12:00 UTC')]; result[0] = array1.toLocaleString('fr')}")(result) - assert result[0] == '1,a,21/12/1997 09:12:00' + pm.eval("(result, arr) => {result[0] = arr.toLocaleString('ja-JP')}")(result, prices) + assert result[0] == '¥7,500,8,123,12' def test_toLocaleString_one_arg_invalid_locale(): + prices = ["¥7", 500, 8123, 12] result = [None] try: - pm.eval("(result) => {array1 = [1, 'a', new Date('21 Dec 1997 14:12:00 UTC')]; result[0] = array1.toLocaleString('endzfasdf')}")(result) + pm.eval("(result, arr) => {result[0] = arr.toLocaleString('asfasfsafsdf')}")(result, prices) assert (False) except Exception as e: assert str(type(e)) == "" assert str(e).__contains__("RangeError: invalid language tag:") -def test_toLocaleString_two_args_invalid_timeZone(): +def test_toLocaleString_two_args_invalid_currency(): + prices = ["¥7", 500, 8123, 12] result = [None] try: - pm.eval("(result) => {array1 = [1, 'a', new Date('21 Dec 1997 14:12:00 UTC')]; result[0] = array1.toLocaleString('en', { timeZone: 'UT' })}")(result) + pm.eval("(result, arr) => {result[0] = arr.toLocaleString('ja-JP', { style: 'currency', currency: 'JPYsdagasfgas' })}")(result, prices) assert (False) except Exception as e: assert str(type(e)) == "" - assert str(e).__contains__("RangeError: invalid time zone in DateTimeFormat(): UT") \ No newline at end of file + assert str(e).__contains__("RangeError: invalid currency code in NumberFormat():") + +#entries + \ No newline at end of file From aa35a20d9cf0b7f5572a6bf0549eed5d1935b882 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Fri, 22 Dec 2023 11:14:56 -0500 Subject: [PATCH 0117/1086] Additional Python List to JS Array conversion functionality --- include/PyProxyHandler.hh | 2 +- src/JSObjectProxy.cc | 15 ++++++-- src/PyProxyHandler.cc | 72 +++++++++++++++++++++++++++++++++---- tests/python/test_arrays.py | 51 +++++++++++++++++++++++++- 4 files changed, 129 insertions(+), 11 deletions(-) diff --git a/include/PyProxyHandler.hh b/include/PyProxyHandler.hh index 7c97dd17..1ee9fcbc 100644 --- a/include/PyProxyHandler.hh +++ b/include/PyProxyHandler.hh @@ -169,7 +169,7 @@ public: /** * @brief This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates - * to handle coercion from python lists to JS Array-like objects + * to handle coercion from python lists to JS Array objects */ struct PyListProxyHandler : public PyBaseProxyHandler { public: diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 1fc4a6b1..380feab8 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -302,7 +302,10 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, // call Object.assign JS::RootedValue Object(GLOBAL_CX); - JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); + if (!JS_GetProperty(GLOBAL_CX, *global, "Object", &Object)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); + return NULL; + } JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); JS::RootedValue *ret = new JS::RootedValue(GLOBAL_CX); @@ -329,7 +332,10 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_ior(JSObjectProxy *self, // call Object.assign JS::RootedValue Object(GLOBAL_CX); - JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); + if (!JS_GetProperty(GLOBAL_CX, *global, "Object", &Object)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); + return NULL; + } JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); JS::RootedValue ret(GLOBAL_CX); @@ -457,7 +463,10 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProx // call Object.assign JS::RootedValue Object(GLOBAL_CX); - JS_GetProperty(GLOBAL_CX, *global, "Object", &Object); + if (!JS_GetProperty(GLOBAL_CX, *global, "Object", &Object)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); + return NULL; + } JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); JS::RootedValue *ret = new JS::RootedValue(GLOBAL_CX); diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index 912e9100..ca80e805 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -834,7 +834,31 @@ static bool array_toLocaleString(JSContext *cx, unsigned argc, JS::Value *vp) { } static bool array_valueOf(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "valueOf", false); + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + // return ref to self + args.rval().set(jsTypeFactory(cx, self)); + return true; +} + +static bool array_entries(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "entries", false); +} + +/* see note in tests + static bool array_keys(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "keys", false); + } + */ + +static bool array_values(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "values", false); } @@ -868,10 +892,12 @@ static JSMethodDef array_methods[] = { {"toString", array_toString, 0}, {"toLocaleString", array_toLocaleString, 0}, {"valueOf", array_valueOf, 0}, - {NULL, NULL} + {"entries", array_entries, 0}, + // {"keys", array_keys, 0}, + {"values", array_values, 0}, + {NULL, NULL, 0} }; -static bool sawValueOf = false; bool PyListProxyHandler::getOwnPropertyDescriptor( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, @@ -879,7 +905,6 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( ) const { // see if we're calling a function if (id.isString()) { - JS::RootedString message(cx, id.toString()); for (size_t index = 0;; index++) { bool isThatFunction; const char *methodName = array_methods[index].name; @@ -901,7 +926,7 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( } } - // We're trying to get the "length" property + // "length" property bool isLengthProperty; if (id.isString() && JS_StringEqualsLiteral(cx, id.toString(), "length", &isLengthProperty) && isLengthProperty) { desc.set(mozilla::Some( @@ -912,7 +937,42 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( return true; } - // We're trying to get an item + // "constructor" property + bool isConstructorProperty; + if (id.isString() && JS_StringEqualsLiteral(cx, id.toString(), "constructor", &isConstructorProperty) && isConstructorProperty) { + JS::RootedObject global(cx, JS::GetNonCCWObjectGlobal(proxy)); + + JS::RootedValue Array(cx); + if (!JS_GetProperty(cx, global, "Array", &Array)) { + return false; + } + + JS::RootedObject rootedArray(cx, Array.toObjectOrNull()); + + JS::RootedValue Array_Prototype(cx); + if (!JS_GetProperty(cx, rootedArray, "prototype", &Array_Prototype)) { + return false; + } + + JS::RootedObject rootedArrayPrototype(cx, Array_Prototype.toObjectOrNull()); + + JS::RootedValue Array_Prototype_Constructor(cx); + if (!JS_GetProperty(cx, rootedArrayPrototype, "constructor", &Array_Prototype_Constructor)) { + return false; + } + + JS::RootedObject rootedArrayPrototypeConstructor(cx, Array_Prototype_Constructor.toObjectOrNull()); + + desc.set(mozilla::Some( + JS::PropertyDescriptor::Data( + JS::ObjectValue(*rootedArrayPrototypeConstructor), + {JS::PropertyAttribute::Enumerable} + ) + )); + return true; + } + + // item Py_ssize_t index; PyObject *item; if (idToIndex(cx, id, &index) && (item = PyList_GetItem(pyObject, index))) { diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 3f3a21ed..8157db7f 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -931,6 +931,9 @@ def test_valueOf(): result = [0] pm.eval("(result, arr) => {result[0] = arr.valueOf()}")(result, items) assert result[0] == [1,2,1] + result[0][1] = 5 + assert result[0] == [1,5,1] + assert items == [1,5,1] #toLocaleString def test_toLocaleString(): @@ -972,4 +975,50 @@ def test_toLocaleString_two_args_invalid_currency(): assert str(e).__contains__("RangeError: invalid currency code in NumberFormat():") #entries - \ No newline at end of file +def test_entries_next(): + items = ['a', 'b', 'c'] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.entries(); result[0] = result[0].next().value}")(result, items) + assert items == ['a', 'b', 'c'] + assert result[0] == [0, 'a'] + +def test_entries_next_next(): + items = ['a', 'b', 'c'] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.entries(); result[0].next(); result[0] = result[0].next().value}")(result, items) + assert result[0] == [1, 'b'] + +def test_entries_next_next_undefined(): + items = ['a'] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.entries(); result[0].next(); result[0] = result[0].next().value}")(result, items) + assert result[0] == None + +#keys this gets TypeError: iterator is not iterable +#def test_keys(): +# items = ['a', 'b', 'c'] +# result = [7,8,9] +# pm.eval("(result, arr) => { index = 0; iterator = arr.keys(); for (const key of iterator) { result[index] = key; index++;} }")(result, items) +# assert result == [0,1,2] + +#values +def test_values(): + items = ['a', 'b', 'c'] + result = [7,8,9] + pm.eval("(result, arr) => { index = 0; iterator = arr.values(); for (const key of iterator) { result[index] = key; index++;} }")(result, items) + items[0] = 'd' + assert result == ['a', 'b', 'c'] + +#constructor property +def test_constructor_creates_array(): + items = [1,2] + result = [0] + pm.eval("(result, arr) => { result[0] = arr.constructor; result[0] = new result[0]; result[0][0] = 9}")(result, items) + assert result[0] == [9] + +#length property +def test_constructor_creates_array(): + items = [1,2] + result = [0] + pm.eval("(result, arr) => { result[0] = arr.length}")(result, items) + assert result[0] == 2 \ No newline at end of file From c7e0f1c0cf285f7981b974f91b03d5c28f1941f9 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Fri, 22 Dec 2023 11:29:31 -0500 Subject: [PATCH 0118/1086] finalize outline --- src/PyProxyHandler.cc | 6 ++++++ src/jsTypeFactory.cc | 1 + 2 files changed, 7 insertions(+) diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index ca80e805..41e06e06 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -988,6 +988,12 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( return true; } +void PyListProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { + // TODO + // PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + // Py_DECREF(self); +} + bool PyListProxyHandler::defineProperty( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::Handle desc, JS::ObjectOpResult &result diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 0c461bbc..813a92fd 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -173,6 +173,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { if (PyList_Check(object)) { proxy = js::NewProxyObject(cx, new PyListProxyHandler(object), v, NULL); JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(object)); + //Py_INCREF(object); TODO } else { proxy = js::NewProxyObject(cx, new PyProxyHandler(object), v, NULL); } From 174501744fd40fdc19ac7bf5dfac9899776cc310 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Fri, 22 Dec 2023 11:31:02 -0500 Subject: [PATCH 0119/1086] cleanup --- include/PyProxyHandler.hh | 8 ++++++++ src/JSObjectProxy.cc | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/PyProxyHandler.hh b/include/PyProxyHandler.hh index 1ee9fcbc..8b7e8916 100644 --- a/include/PyProxyHandler.hh +++ b/include/PyProxyHandler.hh @@ -176,6 +176,14 @@ public: PyListProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; static const char family; + /** + * @brief Handles python object reference count when JS Proxy object is finalized + * + * @param gcx pointer to JS::GCContext + * @param proxy the proxy object being finalized + */ + void finalize(JS::GCContext *gcx, JSObject *proxy) const override; + bool getOwnPropertyDescriptor( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::MutableHandle> desc diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 380feab8..a152550f 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -44,7 +44,6 @@ void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) { // TODO (Caleb Aikens): intentional override of PyDict_Type's tp_dealloc. Probably results in leaking dict memory self->jsObject.set(nullptr); - // PyObject_GC_UnTrack(self); TODO what is the history of this line? Py_TYPE(self)->tp_free((PyObject *)self); return; } From 4e94f70b532cf20f4ce68bfcc77910ffc133807b Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Fri, 22 Dec 2023 12:25:46 -0500 Subject: [PATCH 0120/1086] comments --- include/PyProxyHandler.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/PyProxyHandler.hh b/include/PyProxyHandler.hh index 8b7e8916..291c82e0 100644 --- a/include/PyProxyHandler.hh +++ b/include/PyProxyHandler.hh @@ -1,7 +1,7 @@ /** - * @file PyProxy.hh + * @file PyProxyHandler.hh * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) - * @brief Struct for creating JS proxy objects. Used by DictType for object coercion and by ListType for List coercion + * @brief Structs for creating JS proxy objects. Used by DictType for object coercion and by ListType for List coercion * @version 0.1 * @date 2023-04-20 * From 44fd194a7a796afca65d29d42fa7d39a29da6cef Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Fri, 22 Dec 2023 12:31:30 -0500 Subject: [PATCH 0121/1086] cleanup --- tests/python/test_arrays.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 8157db7f..55d0d440 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -105,15 +105,8 @@ def test_toString(): items = [1,2,3] result = [None] pm.eval("(result, arr) => {result[0] = arr.toString()}")(result, items) - assert result[0] == '1,2,3' - -#toString -def test_LocaleString(): - items = [1,2,3] - result = [None] - pm.eval("(result, arr) => {result[0] = arr.toString()}")(result, items) - assert result[0] == '1,2,3' - + assert result[0] == '1,2,3' + #push def test_push(): items = [1,2,3] From 7553c833979a97a5b5c470a6498b8f236efdb9f2 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Wed, 3 Jan 2024 16:15:22 -0500 Subject: [PATCH 0122/1086] Added Symbol.iterator as a defined property --- include/PyProxyHandler.hh | 2 +- src/PyProxyHandler.cc | 29 ++++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/include/PyProxyHandler.hh b/include/PyProxyHandler.hh index 291c82e0..df28dd80 100644 --- a/include/PyProxyHandler.hh +++ b/include/PyProxyHandler.hh @@ -5,7 +5,7 @@ * @version 0.1 * @date 2023-04-20 * - * Copyright (c) 2023 Distributive Corp. + * Copyright (c) 2023-2024 Distributive Corp. * */ diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index 41e06e06..6c9bdb78 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -1,11 +1,11 @@ /** * @file PyProxyHandler.cc - * @author Caleb Aikens (caleb@distributive.network) - * @brief Struct for creating JS proxy objects. Used by DictType for object coercion + * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) + * @brief Struct for creating JS proxy objects. Used by DictType for object coercion TODO * @version 0.1 * @date 2023-04-20 * - * Copyright (c) 2023 Distributive Corp. + * Copyright (c) 2023-2024 Distributive Corp. * */ @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -972,6 +973,24 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( return true; } + // iterator symbol property + if (id.isSymbol()) { + JS::RootedSymbol rootedSymbol(cx, id.toSymbol()); + + if (JS::GetSymbolCode(rootedSymbol) == JS::SymbolCode::iterator) { + JSFunction *newFunction = JS_NewFunction(cx, array_values, 0, 0, NULL); + if (!newFunction) return false; + JS::RootedObject funObj(cx, JS_GetFunctionObject(newFunction)); + desc.set(mozilla::Some( + JS::PropertyDescriptor::Data( + JS::ObjectValue(*funObj), + {JS::PropertyAttribute::Enumerable} + ) + )); + return true; + } + } + // item Py_ssize_t index; PyObject *item; @@ -990,8 +1009,8 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( void PyListProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { // TODO - // PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - // Py_DECREF(self); + // PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + // Py_DECREF(self); } bool PyListProxyHandler::defineProperty( From 88de8bb737ff496491397973b0806f2a46aec51a Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Wed, 3 Jan 2024 16:32:56 -0500 Subject: [PATCH 0123/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 55d0d440..9275f078 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -194,6 +194,7 @@ def test_concat_empty_arg(): pm.eval("(result, arr) => {result[0] = arr.concat()}")(result, items) assert items == [1,2,3] assert result[0] == [1,2,3] + assert items is not result[0] def test_concat_two_arrays(): items = [1,2,3] From 3b9b6b736b480c9d2b5bd98e3559a78f82f3d382 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Wed, 3 Jan 2024 17:12:40 -0500 Subject: [PATCH 0124/1086] keys back in, better tests, reverse fix --- src/PyProxyHandler.cc | 15 +++---- tests/python/test_arrays.py | 86 +++++++++++++++++++++++++++++++------ 2 files changed, 80 insertions(+), 21 deletions(-) diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index 6c9bdb78..cbe8648b 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -195,7 +195,7 @@ static bool array_reverse(JSContext *cx, unsigned argc, JS::Value *vp) { PyList_Reverse(self); } - args.rval().setUndefined(); + args.rval().set(jsTypeFactory(cx, self)); return true; } @@ -852,11 +852,9 @@ static bool array_entries(JSContext *cx, unsigned argc, JS::Value *vp) { return array_copy_func(cx, argc, vp, "entries", false); } -/* see note in tests - static bool array_keys(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "keys", false); - } - */ +static bool array_keys(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_copy_func(cx, argc, vp, "keys", false); +} static bool array_values(JSContext *cx, unsigned argc, JS::Value *vp) { return array_copy_func(cx, argc, vp, "values", false); @@ -894,7 +892,7 @@ static JSMethodDef array_methods[] = { {"toLocaleString", array_toLocaleString, 0}, {"valueOf", array_valueOf, 0}, {"entries", array_entries, 0}, - // {"keys", array_keys, 0}, + {"keys", array_keys, 0}, {"values", array_values, 0}, {NULL, NULL, 0} }; @@ -973,7 +971,7 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( return true; } - // iterator symbol property + // symbol property if (id.isSymbol()) { JS::RootedSymbol rootedSymbol(cx, id.toSymbol()); @@ -1010,6 +1008,7 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( void PyListProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { // TODO // PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + // printf("finalize self=%p\n", self); // Py_DECREF(self); } diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 9275f078..ee41ddc5 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -40,13 +40,14 @@ def test_reverse_size_one(): def test_reverse_size_zero(): items = [] pm.eval("(arr) => {arr.reverse()}")(items) - assert items == [] + assert items == [] -def test_reverse_returns_undefined(): +def test_reverse_returns_reference(): items = [1,2,3] - pm.eval("(arr) => {arr[0] = arr.reverse()}")(items) - assert items == [None,2,1] - + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reverse(); result[0][0] = 4}")(result, items) + assert result[0] == [4,2,1] + assert items == [4,2,1] def test_reverse_ignores_extra_args(): items = [1,2,3] @@ -100,6 +101,18 @@ def test_join_with_sep(): pm.eval("(result, arr) => {result[0] = arr.join('-')}")(result, items) assert result[0] == '1-2-3' +def test_join_none(): + items = [None,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.join()}")(result, items) + assert result[0] == ',2,3' + +def test_join_null(): + items = [pm.null,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.join()}")(result, items) + assert result[0] == ',2,3' + #toString def test_toString(): items = [1,2,3] @@ -208,7 +221,18 @@ def test_concat_mix(): result = [None] pm.eval("(result, arr) => {result[0] = arr.concat([7,8], true, [0,1])}")(result, items) assert items == [1,2,3] - assert result[0] == [1,2,3,7,8,True, 0,1] + assert result[0] == [1,2,3,7,8,True,0,1] + +def test_concat_object_element(): + d = {"a":1} + items = [1, 2, d] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.concat()}")(result, items) + assert items == [1, 2, d] + assert result[0] == [1, 2, d] + assert items is not result[0] + assert d is items[2] + assert d is result[0][2] #slice def test_slice(): @@ -218,6 +242,14 @@ def test_slice(): assert items == [1,2,3] assert result[0] == [2] +def test_slice_copy(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.slice(0,3)}")(result, items) + assert items == [1,2,3] + assert result[0] == [1,2,3] + assert items is not result[0] + def test_slice_start_zero(): items = [1,2,3] result = [None] @@ -988,12 +1020,12 @@ def test_entries_next_next_undefined(): pm.eval("(result, arr) => {result[0] = arr.entries(); result[0].next(); result[0] = result[0].next().value}")(result, items) assert result[0] == None -#keys this gets TypeError: iterator is not iterable -#def test_keys(): -# items = ['a', 'b', 'c'] -# result = [7,8,9] -# pm.eval("(result, arr) => { index = 0; iterator = arr.keys(); for (const key of iterator) { result[index] = key; index++;} }")(result, items) -# assert result == [0,1,2] +#keys +def test_keys(): + items = ['a', 'b', 'c'] + result = [7,8,9] + pm.eval("(result, arr) => { index = 0; iterator = arr.keys(); for (const key of iterator) { result[index] = key; index++;} }")(result, items) + assert result == ['0','1','2'] #values def test_values(): @@ -1015,4 +1047,32 @@ def test_constructor_creates_array(): items = [1,2] result = [0] pm.eval("(result, arr) => { result[0] = arr.length}")(result, items) - assert result[0] == 2 \ No newline at end of file + assert result[0] == 2 + +#iterator symbol property +def test_iterator_type_function(): + items = [1,2] + result = [0] + pm.eval("(result, arr) => { result[0] = typeof arr[Symbol.iterator]}")(result, items) + assert result[0] == 'function' + +def test_iterator_first_next(): + items = [1,2] + result = [0] + pm.eval("(result, arr) => { result[0] = arr[Symbol.iterator]().next()}")(result, items) + assert result[0].value == 1 + assert result[0].done == False + +def test_iterator_second_next(): + items = [1,2] + result = [0] + pm.eval("(result, arr) => { let iterator = arr[Symbol.iterator](); iterator.next(); result[0] = iterator.next()}")(result, items) + assert result[0].value == 2 + assert result[0].done == False + +def test_iterator_last_next(): + items = [1,2] + result = [0] + pm.eval("(result, arr) => { let iterator = arr[Symbol.iterator](); iterator.next(); iterator.next(); result[0] = iterator.next()}")(result, items) + assert result[0].value == None + assert result[0].done == True \ No newline at end of file From 138a84d0aedb1265c73a6e124af5ad682c29b2b4 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 11 Jan 2024 13:57:19 -0500 Subject: [PATCH 0125/1086] All copying methods replaced with non-copying ones --- include/PyProxyHandler.hh | 1 - include/jsTypeFactory.hh | 9 - setup.sh | 1 + src/PyProxyHandler.cc | 1492 +++++++++++++++++++++++++++++++---- src/jsTypeFactory.cc | 21 +- tests/python/test_arrays.py | 158 +++- 6 files changed, 1461 insertions(+), 221 deletions(-) diff --git a/include/PyProxyHandler.hh b/include/PyProxyHandler.hh index df28dd80..b95c4778 100644 --- a/include/PyProxyHandler.hh +++ b/include/PyProxyHandler.hh @@ -198,7 +198,6 @@ public: bool delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const override; bool isArray(JSContext *cx, JS::HandleObject proxy, JS::IsArrayAnswer *answer) const override; bool getBuiltinClass(JSContext *cx, JS::Handle obj, js::ESClass *cls) const override; - const char *className(JSContext *cx, JS::HandleObject proxy) const override; }; /** diff --git a/include/jsTypeFactory.hh b/include/jsTypeFactory.hh index 23339c54..1ae6b131 100644 --- a/include/jsTypeFactory.hh +++ b/include/jsTypeFactory.hh @@ -38,15 +38,6 @@ size_t UCS4ToUTF16(const uint32_t *chars, size_t length, uint16_t *outStr); */ JS::Value jsTypeFactory(JSContext *cx, PyObject *object); -/** - * @brief Function that takes a PyObject and returns a corresponding JS::Value which is a copy, not a reference - * - * @param cx - Pointer to the JSContext - * @param object - Pointer to the PyListObject - * @return JS::Value - A JS::Value corresponding to the PyType - */ -JS::Value jsTypeFactoryCopy(JSContext *cx, PyObject *object); - /** * @brief same to jsTypeFactory, but it's guaranteed that no error would be set on the Python error stack, instead * return JS `null` on error, and output a warning in Python-land diff --git a/setup.sh b/setup.sh index 2b8c385e..71655d2d 100755 --- a/setup.sh +++ b/setup.sh @@ -53,6 +53,7 @@ sed -i'' -e '/"winheap.cpp"/d' ./memory/mozalloc/moz.build # https://bugzilla.mo sed -i'' -e 's/"install-name-tool"/"install_name_tool"/' ./moz.configure # `install-name-tool` does not exist, but we have `install_name_tool` sed -i'' -e 's/bool Unbox/JS_PUBLIC_API bool Unbox/g' ./js/public/Class.h # need to manually add JS_PUBLIC_API to js::Unbox until it gets fixed in Spidermonkey sed -i'' -e 's/bool js::Unbox/JS_PUBLIC_API bool js::Unbox/g' ./js/src/vm/JSObject.cpp # same here +sed -i'' -e 's/bool iteratorHelpers_ = false;/bool iteratorHelpers_ = true;/g' ./js/public/RealmOptions.h # turn this on, todo make it available to embedders, currently only available via command-line cd js/src mkdir -p _build cd _build diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index cbe8648b..c21d66ae 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -11,6 +11,7 @@ #include "include/PyProxyHandler.hh" +#include "include/JSArrayProxy.hh" #include "include/jsTypeFactory.hh" #include "include/pyTypeFactory.hh" #include "include/StrType.hh" @@ -20,6 +21,7 @@ #include #include #include +#include #include @@ -192,9 +194,12 @@ static bool array_reverse(JSContext *cx, unsigned argc, JS::Value *vp) { PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); if (PyList_GET_SIZE(self) > 1) { - PyList_Reverse(self); + if (PyList_Reverse(self) < 0) { + return false; + } } + // return ref to self args.rval().set(jsTypeFactory(cx, self)); return true; } @@ -239,7 +244,9 @@ static bool array_push(JSContext *cx, unsigned argc, JS::Value *vp) { // surely for (unsigned index = 0; index < numArgs; index++) { JS::RootedValue *elementVal = new JS::RootedValue(cx); elementVal->set(args[index].get()); - PyList_Append(self, pyTypeFactory(cx, global, elementVal)->getPyObject()); + if (PyList_Append(self, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + return false; + } } args.rval().setInt32(PyList_GET_SIZE(self)); @@ -263,7 +270,12 @@ static bool array_shift(JSContext *cx, unsigned argc, JS::Value *vp) { } PyObject *result = PyList_GetItem(self, 0); - PySequence_DelItem(self, 0); + if (!result) { + return false; + } + if (PySequence_DelItem(self, 0) < 0) { + return false; + } args.rval().set(jsTypeFactory(cx, result)); return true; @@ -282,35 +294,16 @@ static bool array_unshift(JSContext *cx, unsigned argc, JS::Value *vp) { // sure for (int index = args.length() - 1; index >= 0; index--) { JS::RootedValue *elementVal = new JS::RootedValue(cx); elementVal->set(args[index].get()); - PyList_Insert(self, 0, pyTypeFactory(cx, global, elementVal)->getPyObject()); + if (PyList_Insert(self, 0, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + return false; + } } args.rval().setInt32(PyList_GET_SIZE(self)); return true; } -static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); - if (!proxy) { - return false; - } - PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - - JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); - - JS::HandleValueArray jArgs(args); - - JS::RootedValue jRet(cx); - if (!JS_CallFunctionName(cx, selfCopy, "concat", jArgs, &jRet)) { - return false; - } - - args.rval().setObject(jRet.toObject()); - return true; -} - +// private util static inline uint64_t normalizeSliceTerm(int64_t value, uint64_t length) { if (value < 0) { value += length; @@ -360,6 +353,9 @@ static bool array_slice(JSContext *cx, unsigned argc, JS::Value *vp) { } PyObject *result = PyList_GetSlice(self, (Py_ssize_t)start, (Py_ssize_t)stop); + if (!result) { + return false; + } args.rval().set(jsTypeFactory(cx, result)); return true; @@ -422,32 +418,6 @@ static bool array_indexOf(JSContext *cx, unsigned argc, JS::Value *vp) { return true; } -static bool array_lastIndexOf(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - if (!args.requireAtLeast(cx, "lastIndexOf", 1)) { - return false; - } - - JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); - if (!proxy) { - return false; - } - PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - - JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); - - JS::HandleValueArray jArgs(args); - - JS::RootedValue jRet(cx); - if (!JS_CallFunctionName(cx, selfCopy, "lastIndexOf", jArgs, &jRet)) { - return false; - } - - args.rval().setInt32(jRet.toInt32()); - return true; -} - static bool array_splice(JSContext *cx, unsigned argc, JS::Value *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -503,17 +473,27 @@ static bool array_splice(JSContext *cx, unsigned argc, JS::Value *vp) { // get deleted items for return value PyObject *deleted = PyList_GetSlice(self, actualStart, actualStart + actualDeleteCount); + if (!deleted) { + return false; + } // build list for SetSlice call PyObject *inserted = PyList_New(insertCount); + if (!inserted) { + return false; + } JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); for (int index = 0; index < insertCount; index++) { JS::RootedValue *elementVal = new JS::RootedValue(cx, args[index + 2].get()); - PyList_SetItem(inserted, index, pyTypeFactory(cx, global, elementVal)->getPyObject()); + if (PyList_SetItem(inserted, index, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + return false; + } } - PyList_SetSlice(self, actualStart, actualStart + actualDeleteCount, inserted); + if (PyList_SetSlice(self, actualStart, actualStart + actualDeleteCount, inserted) < 0) { + return false; + } args.rval().set(jsTypeFactory(cx, deleted)); return true; @@ -611,8 +591,6 @@ static bool array_fill(JSContext *cx, unsigned argc, JS::Value *vp) { unsigned int argsLength = args.length(); - JS::RootedValue *fillValue = new JS::RootedValue(cx, args[0].get()); - int64_t relativeStart; if (argsLength > 1) { if (!JS::ToInt64(cx, args.get(1), &relativeStart)) { @@ -647,7 +625,10 @@ static bool array_fill(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); for (int index = actualStart; index < actualEnd; index++) { - PyList_SetItem(self, index, pyTypeFactory(cx, global, fillValue)->getPyObject()); + JS::RootedValue *fillValue = new JS::RootedValue(cx, args[0].get()); + if (PyList_SetItem(self, index, pyTypeFactory(cx, global, fillValue)->getPyObject()) < 0) { + return false; + } } // return ref to self @@ -724,7 +705,9 @@ static bool array_copyWithin(JSContext *cx, unsigned argc, JS::Value *vp) { while (count > 0) { PyObject *itemStart = PyList_GetItem(self, actualStart); - PyList_SetItem(self, actualTarget, itemStart); + if (PyList_SetItem(self, actualTarget, itemStart) < 0) { + return false; + } actualStart--; actualTarget--; @@ -733,7 +716,9 @@ static bool array_copyWithin(JSContext *cx, unsigned argc, JS::Value *vp) { } else { while (count > 0) { PyObject *itemStart = PyList_GetItem(self, actualStart); - PyList_SetItem(self, actualTarget, itemStart); + if (PyList_SetItem(self, actualTarget, itemStart) < 0) { + return false; + } actualStart++; actualTarget++; @@ -746,11 +731,68 @@ static bool array_copyWithin(JSContext *cx, unsigned argc, JS::Value *vp) { return true; } -// private util -static bool array_copy_func(JSContext *cx, unsigned argc, JS::Value *vp, const char *fName, bool checkRequireAtLeastOne = true) { +static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + + Py_ssize_t selfSize = PyList_GET_SIZE(self); + + PyObject *result = PyList_New(selfSize); + + for (Py_ssize_t index = 0; index < selfSize; index++) { + PyList_SetItem(result, index, PyList_GetItem(self, index)); + } + + unsigned numArgs = args.length(); + for (unsigned index = 0; index < numArgs; index++) { + JS::RootedValue *elementVal = new JS::RootedValue(cx); + elementVal->set(args[index].get()); + + PyObject *item = pyTypeFactory(cx, global, elementVal)->getPyObject(); + if (PyObject_TypeCheck(item, &JSArrayProxyType)) { + // flatten the array only a depth 1 + Py_ssize_t itemLength = JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)item); + for (Py_ssize_t flatIndex = 0; flatIndex < itemLength; flatIndex++) { + elementVal = new JS::RootedValue(cx); + if (!JS_GetElement(cx, ((JSArrayProxy *)item)->jsArray, flatIndex, elementVal)) { + return false; + } + if (PyList_Append(result, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + return false; + } + } + } + else if (PyObject_TypeCheck(item, &PyList_Type)) { + // flatten the array only at depth 1 + Py_ssize_t itemLength = PyList_GET_SIZE(item); + for (Py_ssize_t flatIndex = 0; flatIndex < itemLength; flatIndex++) { + if (PyList_Append(result, PyList_GetItem(item, flatIndex)) < 0) { + return false; + } + } + } + else { + if (PyList_Append(result, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + return false; + } + } + } + + args.rval().set(jsTypeFactory(cx, result)); + return true; +} + +static bool array_lastIndexOf(JSContext *cx, unsigned argc, JS::Value *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (checkRequireAtLeastOne && !args.requireAtLeast(cx, fName, 1)) { + if (!args.requireAtLeast(cx, "lastIndexOf", 1)) { return false; } @@ -760,142 +802,1267 @@ static bool array_copy_func(JSContext *cx, unsigned argc, JS::Value *vp, const c } PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); + Py_ssize_t selfLength = PyList_GET_SIZE(self); - JS::HandleValueArray jArgs(args); - JS::RootedValue rval(cx); + if (selfLength == 0) { + args.rval().setInt32(-1); + return true; + } - if (!JS_CallFunctionName(cx, selfCopy, fName, jArgs, &rval)) { - return false; + uint64_t start = selfLength - 1; + if (args.length() > 1) { + int64_t n; + if (!JS::ToInt64(cx, args[1], &n)) { + return false; + } + + if (n < 0) { + double d = double(selfLength) + n; + if (d < 0) { + args.rval().setInt32(-1); + return true; + } + start = uint64_t(d); + } else if (n < double(start)) { + start = uint64_t(n); + } } - args.rval().set(rval); + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + JS::RootedValue *elementVal = new JS::RootedValue(cx, args[0].get()); + PyObject *element = pyTypeFactory(cx, global, elementVal)->getPyObject(); + for (int64_t index = start; index >= 0; index--) { + PyObject *item = PyList_GetItem(self, index); + Py_INCREF(item); + int cmp = PyObject_RichCompareBool(item, element, Py_EQ); + Py_DECREF(item); + if (cmp < 0) { + return false; + } + else if (cmp == 1) { + args.rval().setInt32(index); + return true; + } + } + args.rval().setInt32(-1); return true; } static bool array_includes(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "includes"); + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "includes", 1)) { + return false; + } + + if (!array_indexOf(cx, argc, vp)) { + return false; + } + + args.rval().setBoolean(args.rval().get().toInt32() >= 0 ? true : false); + return true; } static bool array_forEach(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "forEach"); -} + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); -static bool array_map(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "map"); -} + if (!args.requireAtLeast(cx, "forEach", 1)) { + return false; + } -static bool array_filter(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "filter"); -} + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); -static bool array_reduce(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "reduce"); -} + JS::Value callbackfn = args[0].get(); -static bool array_reduceRight(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "reduceRight"); -} + if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_FUNCTION, "forEach: callback"); + return false; + } -static bool array_some(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "some"); -} + JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue callBack(cx, callbackfn); -static bool array_every(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "every"); -} + JS::Rooted> jArgs(cx); + JS::RootedValue rval(cx); -static bool array_find(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "find"); -} + Py_ssize_t len = PyList_GET_SIZE(self); -static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "findIndex"); -} + JS::RootedObject *rootedThisArg = nullptr; + if (args.length() > 1) { + JS::Value thisArg = args[1].get(); + if (!thisArg.isObjectOrNull()) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_OBJORNULL, "'this' argument"); + return false; + } -static bool array_flat(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "flat", false); -} + // TODO support null, currently gets TypeError + rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + } -static bool array_flatMap(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "flatMap"); -} + for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { + jArgs[0].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[1].setInt32(index); + jArgs[2].set(selfValue); -static bool array_join(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "join", false); -} + if (args.length() > 1) { + if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { + delete rootedThisArg; + return false; + } + } + else { + if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { + return false; + } + } + } -static bool array_toString(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "toString", false); -} + if (rootedThisArg) { + delete rootedThisArg; + } -static bool array_toLocaleString(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "toLocaleString", false); + args.rval().setUndefined(); + return true; } -static bool array_valueOf(JSContext *cx, unsigned argc, JS::Value *vp) { +static bool array_map(JSContext *cx, unsigned argc, JS::Value *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + if (!args.requireAtLeast(cx, "map", 1)) { + return false; + } + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); if (!proxy) { return false; } PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - // return ref to self - args.rval().set(jsTypeFactory(cx, self)); - return true; -} + JS::Value callbackfn = args[0].get(); -static bool array_entries(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "entries", false); -} + if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { + // Decompiling the faulty arg is not accessible through the JSAPI so we do the best effort for the error message + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_FUNCTION, "map: callback"); + return false; + } -static bool array_keys(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "keys", false); -} + Py_ssize_t len = PyList_GET_SIZE(self); -static bool array_values(JSContext *cx, unsigned argc, JS::Value *vp) { - return array_copy_func(cx, argc, vp, "values", false); -} + JSObject *retArray = JS::NewArrayObject(cx, len); + JS::RootedObject rootedRetArray(cx, retArray); + JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue callBack(cx, callbackfn); -static JSMethodDef array_methods[] = { - {"reverse", array_reverse, 0}, - {"pop", array_pop, 0}, - {"push", array_push, 1}, - {"shift", array_shift, 0}, - {"unshift", array_unshift, 1}, - {"concat", array_concat, 1}, - {"slice", array_slice, 2}, - {"indexOf", array_indexOf, 1}, - {"lastIndexOf", array_lastIndexOf, 1}, - {"splice", array_splice, 2}, - {"sort", array_sort, 1}, - {"fill", array_fill, 3}, - {"copyWithin", array_copyWithin, 3}, - {"includes", array_includes, 1}, - {"forEach", array_forEach, 1}, - {"map", array_map, 1}, - {"filter", array_filter, 1}, - {"reduce", array_reduce, 1}, - {"reduceRight", array_reduceRight, 1}, - {"some", array_some, 1}, - {"every", array_every, 1}, - {"find", array_find, 1}, - {"findIndex", array_findIndex, 1}, - {"flat", array_flat, 1}, - {"flatMap", array_flatMap, 1}, - {"join", array_join, 1}, - {"toString", array_toString, 0}, - {"toLocaleString", array_toLocaleString, 0}, - {"valueOf", array_valueOf, 0}, - {"entries", array_entries, 0}, - {"keys", array_keys, 0}, - {"values", array_values, 0}, - {NULL, NULL, 0} -}; + JS::Rooted> jArgs(cx); + JS::RootedValue rval(cx); + + JS::RootedObject *rootedThisArg = nullptr; + if (args.length() > 1) { + JS::Value thisArg = args[1].get(); + if (!thisArg.isObjectOrNull()) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_OBJORNULL, "'this' argument"); + return false; + } + + // TODO support null, currently gets TypeError + rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + } + + for (Py_ssize_t index = 0; index < len; index++) { + jArgs[0].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[1].setInt32(index); + jArgs[2].set(selfValue); + + if (args.length() > 1) { + if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { + delete rootedThisArg; + return false; + } + } + else { + if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { + return false; + } + } + + JS_SetElement(cx, rootedRetArray, index, rval); + } + + if (rootedThisArg) { + delete rootedThisArg; + } + + args.rval().setObject(*retArray); + return true; +} + +static bool array_filter(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "filter", 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::Value callbackfn = args[0].get(); + + if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_FUNCTION, "filter: callback"); + return false; + } + + JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue callBack(cx, callbackfn); + + JS::Rooted> jArgs(cx); + JS::RootedValue rval(cx); + + JS::RootedValueVector retVector(cx); + + JS::RootedObject *rootedThisArg = nullptr; + if (args.length() > 1) { + JS::Value thisArg = args[1].get(); + if (!thisArg.isObjectOrNull()) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_OBJORNULL, "'this' argument"); + return false; + } + + // TODO support null, currently gets TypeError + rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + } + + Py_ssize_t len = PyList_GET_SIZE(self); + for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { + JS::Value item = jsTypeFactorySafe(cx, PyList_GetItem(self, index)); + jArgs[0].set(item); + jArgs[1].setInt32(index); + jArgs[2].set(selfValue); + + if (args.length() > 1) { + if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { + delete rootedThisArg; + return false; + } + } + else { + if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { + return false; + } + } + + if (rval.toBoolean()) { + if (!retVector.append(item)) { + return false; + } + } + } + + if (rootedThisArg) { + delete rootedThisArg; + } + + JS::HandleValueArray jsValueArray(retVector); + JSObject *retArray = JS::NewArrayObject(cx, jsValueArray); + + args.rval().setObject(*retArray); + return true; +} + +static bool array_reduce(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "reduce", 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::Value callbackfn = args[0].get(); + + if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_FUNCTION, "reduce: callback"); + return false; + } + + JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue callBack(cx, callbackfn); + + JS::Rooted> jArgs(cx); + JS::RootedValue *accumulator; + + Py_ssize_t len = PyList_GET_SIZE(self); + + if (args.length() > 1) { + accumulator = new JS::RootedValue(cx, args[1].get()); + } + else { + if (len == 0) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_EMPTY_ARRAY_REDUCE); + return false; + } + accumulator = new JS::RootedValue(cx, jsTypeFactory(cx, PyList_GetItem(self, 0))); + } + + for (Py_ssize_t index = args.length() > 1 ? 0 : 1; index < len; index++) { + jArgs[0].set(*accumulator); + jArgs[1].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[2].setInt32(index); + jArgs[3].set(selfValue); + + if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, accumulator)) { + delete accumulator; + return false; + } + } + + args.rval().set(accumulator->get()); + delete accumulator; + return true; +} + +static bool array_reduceRight(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "reduceRight", 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::Value callbackfn = args[0].get(); + + if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_FUNCTION, "reduceRight: callback"); + return false; + } + + JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue callBack(cx, callbackfn); + + JS::Rooted> jArgs(cx); + JS::RootedValue *accumulator; + + Py_ssize_t len = PyList_GET_SIZE(self); + + if (args.length() > 1) { + accumulator = new JS::RootedValue(cx, args[1].get()); + } + else { + if (len == 0) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_EMPTY_ARRAY_REDUCE); + return false; + } + accumulator = new JS::RootedValue(cx, jsTypeFactory(cx, PyList_GetItem(self, len - 1))); + } + + for (int64_t index = args.length() > 1 ? len - 1 : len - 2; index >= 0; index--) { + jArgs[0].set(*accumulator); + jArgs[1].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[2].setInt32(index); + jArgs[3].set(selfValue); + + if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, accumulator)) { + delete accumulator; + return false; + } + } + + args.rval().set(accumulator->get()); + delete accumulator; + return true; +} + +static bool array_some(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "some", 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::Value callbackfn = args[0].get(); + + if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_FUNCTION, "some: callback"); + return false; + } + + JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue callBack(cx, callbackfn); + + JS::Rooted> jArgs(cx); + JS::RootedValue rval(cx); + + JS::RootedObject *rootedThisArg = nullptr; + if (args.length() > 1) { + JS::Value thisArg = args[1].get(); + if (!thisArg.isObjectOrNull()) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_OBJORNULL, "'this' argument"); + return false; + } + + // TODO support null, currently gets TypeError + rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + } + + Py_ssize_t len = PyList_GET_SIZE(self); + for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { + jArgs[0].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[1].setInt32(index); + jArgs[2].set(selfValue); + + if (args.length() > 1) { + if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { + delete rootedThisArg; + return false; + } + } + else { + if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { + return false; + } + } + + if (rval.toBoolean()) { + if (rootedThisArg) { + delete rootedThisArg; + } + args.rval().setBoolean(true); + return true; + } + } + + if (rootedThisArg) { + delete rootedThisArg; + } + + args.rval().setBoolean(false); + return true; +} + +static bool array_every(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "every", 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::Value callbackfn = args[0].get(); + + if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_FUNCTION, "every: callback"); + return false; + } + + JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue callBack(cx, callbackfn); + + JS::Rooted> jArgs(cx); + JS::RootedValue rval(cx); + + JS::RootedObject *rootedThisArg = nullptr; + if (args.length() > 1) { + JS::Value thisArg = args[1].get(); + if (!thisArg.isObjectOrNull()) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_OBJORNULL, "'this' argument"); + return false; + } + + // TODO support null, currently gets TypeError + rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + } + + Py_ssize_t len = PyList_GET_SIZE(self); + for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { + jArgs[0].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[1].setInt32(index); + jArgs[2].set(selfValue); + + if (args.length() > 1) { + if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { + delete rootedThisArg; + return false; + } + } + else { + if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { + return false; + } + } + + if (!rval.toBoolean()) { + if (rootedThisArg) { + delete rootedThisArg; + } + args.rval().setBoolean(false); + return true; + } + } + + if (rootedThisArg) { + delete rootedThisArg; + } + + args.rval().setBoolean(true); + return true; +} + +static bool array_find(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "find", 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::Value callbackfn = args[0].get(); + + if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_FUNCTION, "find: callback"); + return false; + } + + JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue callBack(cx, callbackfn); + + JS::Rooted> jArgs(cx); + JS::RootedValue rval(cx); + + JS::RootedObject *rootedThisArg = nullptr; + if (args.length() > 1) { + JS::Value thisArg = args[1].get(); + if (!thisArg.isObjectOrNull()) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_OBJORNULL, "'this' argument"); + return false; + } + + // TODO support null, currently gets TypeError + rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + } + + Py_ssize_t len = PyList_GET_SIZE(self); + for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { + JS::Value item = jsTypeFactorySafe(cx, PyList_GetItem(self, index)); + jArgs[0].set(item); + jArgs[1].setInt32(index); + jArgs[2].set(selfValue); + + if (args.length() > 1) { + if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { + delete rootedThisArg; + return false; + } + } + else { + if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { + return false; + } + } + + if (rval.toBoolean()) { + if (rootedThisArg) { + delete rootedThisArg; + } + args.rval().set(item); + return true; + } + } + + if (rootedThisArg) { + delete rootedThisArg; + } + + args.rval().setUndefined(); + return true; +} + +static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "findIndex", 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::Value callbackfn = args[0].get(); + + if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_FUNCTION, "findIndex: callback"); + return false; + } + + JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue callBack(cx, callbackfn); + + JS::Rooted> jArgs(cx); + JS::RootedValue rval(cx); + + JS::RootedObject *rootedThisArg = nullptr; + if (args.length() > 1) { + JS::Value thisArg = args[1].get(); + if (!thisArg.isObjectOrNull()) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_OBJORNULL, "'this' argument"); + return false; + } + + // TODO support null, currently gets TypeError + rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + } + + Py_ssize_t len = PyList_GET_SIZE(self); + for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { + jArgs[0].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[1].setInt32(index); + jArgs[2].set(selfValue); + + if (args.length() > 1) { + if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { + delete rootedThisArg; + return false; + } + } + else { + if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { + return false; + } + } + + if (rval.toBoolean()) { + if (rootedThisArg) { + delete rootedThisArg; + } + args.rval().setInt32(index); + return true; + } + } + + if (rootedThisArg) { + delete rootedThisArg; + } + + args.rval().setInt32(-1); + return true; +} + +// private +static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject global, + JSObject *retArray, PyObject *source, + Py_ssize_t sourceLen, uint32_t start, uint32_t depth) { + uint32_t targetIndex = start; + + JS::RootedObject rootedGlobal(cx, global); + + JS::RootedValue elementVal(cx); + for (uint32_t sourceIndex = 0; sourceIndex < sourceLen; sourceIndex++) { + if (PyObject_TypeCheck(source, &JSArrayProxyType)) { + JS_GetElement(cx, ((JSArrayProxy *)source)->jsArray, sourceIndex, &elementVal); + } + else if (PyObject_TypeCheck(source, &PyList_Type)) { + elementVal.set(jsTypeFactory(cx, PyList_GetItem(source, sourceIndex))); + } + + PyObject *element = pyTypeFactory(cx, &rootedGlobal, &elementVal)->getPyObject(); + + bool shouldFlatten; + if (depth > 0) { + shouldFlatten = PyObject_TypeCheck(element, &JSArrayProxyType) || PyObject_TypeCheck(element, &PyList_Type); + } else { + shouldFlatten = false; + } + + if (shouldFlatten) { + Py_ssize_t elementLen; + if (PyObject_TypeCheck(element, &JSArrayProxyType)) { + elementLen = JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)element); + } + else if (PyObject_TypeCheck(element, &PyList_Type)) { + elementLen = PyList_GET_SIZE(element); + } + + targetIndex = FlattenIntoArray(cx, global, + retArray, + element, + elementLen, + targetIndex, + depth - 1 + ); + } + else { + JS::RootedObject rootedRetArray(cx, retArray); + + uint32_t length; + JS::GetArrayLength(cx, rootedRetArray, &length); + if (targetIndex >= length) { + JS::SetArrayLength(cx, rootedRetArray, targetIndex + 1); + } + + JS_SetElement(cx, rootedRetArray, targetIndex, elementVal); + + targetIndex++; + } + } + + return targetIndex; +} + +// private +static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject global, + JSObject *retArray, PyObject *source, + Py_ssize_t sourceLen, uint32_t start, uint32_t depth, + JS::HandleValue callBack, JS::HandleObject thisArg) { + uint32_t targetIndex = start; + + JS::RootedObject rootedGlobal(cx, global); + JS::RootedValue sourceValue(cx, jsTypeFactorySafe(cx, source)); + JS::Rooted> jArgs(cx); + JS::RootedValue elementVal(cx); + JS::RootedValue retVal(cx); + + for (uint32_t sourceIndex = 0; sourceIndex < sourceLen; sourceIndex++) { + if (PyObject_TypeCheck(source, &JSArrayProxyType)) { + JS_GetElement(cx, ((JSArrayProxy *)source)->jsArray, sourceIndex, &elementVal); + } + else if (PyObject_TypeCheck(source, &PyList_Type)) { + elementVal.set(jsTypeFactory(cx, PyList_GetItem(source, sourceIndex))); + } + + jArgs[0].set(elementVal); + jArgs[1].setInt32(sourceIndex); + jArgs[2].set(sourceValue); + if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &retVal)) { + return false; + } + + PyObject *element = pyTypeFactory(cx, &rootedGlobal, &retVal)->getPyObject(); + + bool shouldFlatten; + if (depth > 0) { + shouldFlatten = PyObject_TypeCheck(element, &JSArrayProxyType) || PyObject_TypeCheck(element, &PyList_Type); + } else { + shouldFlatten = false; + } + + Py_ssize_t elementLen; + if (PyObject_TypeCheck(element, &JSArrayProxyType)) { + elementLen = JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)element); + } + else if (PyObject_TypeCheck(element, &PyList_Type)) { + elementLen = PyList_GET_SIZE(element); + } + + if (shouldFlatten) { + targetIndex = FlattenIntoArrayWithCallBack(cx, global, + retArray, + element, + elementLen, + targetIndex, + depth - 1, + callBack, + thisArg + ); + } + else { + JS::RootedObject rootedRetArray(cx, retArray); + + uint32_t length; + JS::GetArrayLength(cx, rootedRetArray, &length); + + if (PyObject_TypeCheck(element, &JSArrayProxyType) || PyObject_TypeCheck(element, &PyList_Type)) { + // flatten array callBack result to depth 1 + JS::RootedValue elementIndexVal(cx); + for (uint32_t elementIndex = 0; elementIndex < elementLen; elementIndex++, targetIndex++) { + if (PyObject_TypeCheck(element, &JSArrayProxyType)) { + JS_GetElement(cx, ((JSArrayProxy *)element)->jsArray, elementIndex, &elementIndexVal); + } + else { + elementIndexVal.set(jsTypeFactory(cx, PyList_GetItem(element, elementIndex))); + } + + if (targetIndex >= length) { + JS::SetArrayLength(cx, rootedRetArray, length = targetIndex + 1); + } + + JS_SetElement(cx, rootedRetArray, targetIndex, elementIndexVal); + } + + return targetIndex; + } + else { + if (targetIndex >= length) { + JS::SetArrayLength(cx, rootedRetArray, targetIndex + 1); + } + + JS_SetElement(cx, rootedRetArray, targetIndex, retVal); + + targetIndex++; + } + } + } + + return targetIndex; +} + +static bool array_flat(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + Py_ssize_t sourceLen = PyList_GET_SIZE(self); + + uint32_t depthNum; + if (args.length() > 0) { + depthNum = args[0].get().toInt32(); + } + else { + depthNum = 1; + } + + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + + JSObject *retArray = JS::NewArrayObject(cx, sourceLen); // min end length + + FlattenIntoArray(cx, *global, retArray, self, sourceLen, 0, depthNum); + + args.rval().setObject(*retArray); + return true; +} + +static bool array_flatMap(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.requireAtLeast(cx, "flatMap", 1)) { + return false; + } + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + Py_ssize_t sourceLen = PyList_GET_SIZE(self); + + JS::Value callbackfn = args[0].get(); + + if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_FUNCTION, "flatMap: callback"); + return false; + } + + JS::RootedValue callBack(cx, callbackfn); + + JS::RootedObject *rootedThisArg = nullptr; + if (args.length() > 1) { + JS::Value thisArg = args[1].get(); + if (!thisArg.isObjectOrNull()) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_OBJORNULL, "'this' argument"); + return false; + } + + // TODO support null, currently gets TypeError + rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + } + + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + + JSObject *retArray = JS::NewArrayObject(cx, sourceLen); // min end length + + FlattenIntoArrayWithCallBack(cx, *global, retArray, self, sourceLen, 0, 1, callBack, *rootedThisArg); + + delete rootedThisArg; + + args.rval().setObject(*retArray); + return true; +} + +static bool array_join(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + Py_ssize_t selfLength = PyList_GET_SIZE(self); + + if (selfLength == 0) { + args.rval().setString(JS_NewStringCopyZ(cx, "")); + return true; + } + + JS::RootedString *rootedSeparator; + if (args.hasDefined(0)) { + rootedSeparator = new JS::RootedString(cx, JS::ToString(cx, args[0])); + } + else { + rootedSeparator = new JS::RootedString(cx, JS_NewStringCopyZ(cx, ",")); + } + + JSString *writer = JS_NewStringCopyZ(cx, ""); + JS::RootedString rootedWriter(cx); + + for (Py_ssize_t index = 0; index < selfLength; index++) { + rootedWriter.set(writer); + if (index > 0) { + writer = JS_ConcatStrings(cx, rootedWriter, *rootedSeparator); + rootedWriter.set(writer); + } + + JS::RootedValue element(cx, jsTypeFactory(cx, PyList_GetItem(self, index))); + if (!element.isNullOrUndefined()) { + JS::RootedValue rval(cx); + + JS::RootedObject retObject(cx); + + if (!JS_ValueToObject(cx, element, &retObject)) { + delete rootedSeparator; + return false; + } + + if (!JS_CallFunctionName(cx, retObject, "toString", JS::HandleValueArray::empty(), &rval)) { + delete rootedSeparator; + return false; + } + + JS::RootedString retString(cx, rval.toString()); + writer = JS_ConcatStrings(cx, rootedWriter, retString); + } + } + + delete rootedSeparator; + + args.rval().setString(writer); + return true; +} + +static bool array_toString(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_join(cx, argc, vp); +} + +static bool array_toLocaleString(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + Py_ssize_t selfLength = PyList_GET_SIZE(self); + + if (selfLength == 0) { + args.rval().setString(JS_NewStringCopyZ(cx, "")); + return true; + } + + JS::RootedString rootedSeparator(cx, JS_NewStringCopyZ(cx, ",")); + + JSString *writer = JS_NewStringCopyZ(cx, ""); + JS::RootedString rootedWriter(cx); + + JS::HandleValueArray jArgs(args); + + for (Py_ssize_t index = 0; index < selfLength; index++) { + rootedWriter.set(writer); + if (index > 0) { + writer = JS_ConcatStrings(cx, rootedWriter, rootedSeparator); + rootedWriter.set(writer); + } + + JS::RootedValue element(cx, jsTypeFactory(cx, PyList_GetItem(self, index))); + if (!element.isNullOrUndefined()) { + JS::RootedValue rval(cx); + + JS::RootedObject retObject(cx); + + if (!JS_ValueToObject(cx, element, &retObject)) { + return false; + } + + if (!JS_CallFunctionName(cx, retObject, "toLocaleString", jArgs, &rval)) { + return false; + } + + JS::RootedString retString(cx, rval.toString()); + writer = JS_ConcatStrings(cx, rootedWriter, retString); + } + } + + args.rval().setString(writer); + return true; +} + +static bool array_valueOf(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + // return ref to self + args.rval().set(jsTypeFactory(cx, self)); + return true; +} + + + +// ListIterator + + +#define ITEM_KIND_KEY 0 +#define ITEM_KIND_VALUE 1 +#define ITEM_KIND_KEY_AND_VALUE 2 + +enum { + ListIteratorSlotIteratedObject, + ListIteratorSlotNextIndex, + ListIteratorSlotItemKind, + ListIteratorSlotCount +}; + +static JSClass listIteratorClass = {"ListIterator", JSCLASS_HAS_RESERVED_SLOTS(ListIteratorSlotCount)}; + +static bool iterator_next(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject thisObj(cx); + if (!args.computeThis(cx, &thisObj)) return false; // TODO needed ? + + PyObject *self = JS::GetMaybePtrFromReservedSlot(thisObj, ListIteratorSlotIteratedObject); + + JS::RootedValue rootedNextIndex(cx, JS::GetReservedSlot(thisObj, ListIteratorSlotNextIndex)); + JS::RootedValue rootedItemKind(cx, JS::GetReservedSlot(thisObj, ListIteratorSlotItemKind)); + + int32_t nextIndex; + int32_t itemKind; + if (!JS::ToInt32(cx, rootedNextIndex, &nextIndex) || !JS::ToInt32(cx, rootedItemKind, &itemKind)) return false; + + JS::RootedObject result(cx, JS_NewPlainObject(cx)); + if (!result) return false; + + Py_ssize_t len = PyList_GET_SIZE(self); + + if (nextIndex >= len) { + // UnsafeSetReservedSlot(obj, ITERATOR_SLOT_TARGET, null); // TODO lose ref + JS::RootedValue done(cx, JS::BooleanValue(true)); + if (!JS_SetProperty(cx, result, "done", done)) return false; + args.rval().setObject(*result); + return result; + } + + JS::SetReservedSlot(thisObj, ListIteratorSlotNextIndex, JS::Int32Value(nextIndex + 1)); + + JS::RootedValue done(cx, JS::BooleanValue(false)); + if (!JS_SetProperty(cx, result, "done", done)) return false; + + if (itemKind == ITEM_KIND_VALUE) { + PyObject *item = PyList_GetItem(self, nextIndex); + if (!item) { + return false; + } + JS::RootedValue value(cx, jsTypeFactory(cx, item)); + if (!JS_SetProperty(cx, result, "value", value)) return false; + } + else if (itemKind == ITEM_KIND_KEY_AND_VALUE) { + JS::Rooted> items(cx); + + JS::RootedValue rootedNextIndex(cx, JS::Int32Value(nextIndex)); + items[0].set(rootedNextIndex); + + PyObject *item = PyList_GetItem(self, nextIndex); + if (!item) { + return false; + } + JS::RootedValue value(cx, jsTypeFactory(cx, item)); + items[1].set(value); + + JS::RootedValue pair(cx); + JSObject *array = JS::NewArrayObject(cx, items); + pair.setObject(*array); + if (!JS_SetProperty(cx, result, "value", pair)) return false; + } + else { // itemKind == ITEM_KIND_KEY + JS::RootedValue value(cx, JS::Int32Value(nextIndex)); + if (!JS_SetProperty(cx, result, "value", value)) return false; + } + + args.rval().setObject(*result); + return true; +} + +static JSFunctionSpec list_iterator_methods[] = { + JS_FN("next", iterator_next, 0, JSPROP_ENUMERATE), + JS_FS_END +}; + +static bool ListIteratorConstructor(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + if (!args.isConstructing()) { + JS_ReportErrorASCII(cx, "You must call this constructor with 'new'"); + return false; + } + + JS::RootedObject thisObj(cx, JS_NewObjectForConstructor(cx, &listIteratorClass, args)); + if (!thisObj) { + return false; + } + + args.rval().setObject(*thisObj); + return true; +} + +static bool DefineListIterator(JSContext *cx, JS::HandleObject global) { + JS::RootedObject iteratorPrototype(cx); + if (!JS_GetClassPrototype(cx, JSProto_Iterator, &iteratorPrototype)) { + return false; + } + + JS::RootedObject protoObj(cx, + JS_InitClass(cx, global, + nullptr, iteratorPrototype, + "ListIterator", + ListIteratorConstructor, 0, + nullptr, list_iterator_methods, + nullptr, nullptr) + ); + + return protoObj; // != nullptr +} + +// private util +static bool array_iterator_func(JSContext *cx, unsigned argc, JS::Value *vp, int itemKind) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + JS::RootedObject global(cx, JS::GetNonCCWObjectGlobal(proxy)); + + JS::RootedValue constructor_val(cx); + if (!JS_GetProperty(cx, global, "ListIterator", &constructor_val)) return false; + if (!constructor_val.isObject()) { + if (!DefineListIterator(cx, global)) { + return false; + } + + if (!JS_GetProperty(cx, global, "ListIterator", &constructor_val)) return false; + if (!constructor_val.isObject()) { + JS_ReportErrorASCII(cx, "ListIterator is not a constructor"); + return false; + } + } + JS::RootedObject constructor(cx, &constructor_val.toObject()); + + JS::RootedObject obj(cx); + if (!JS::Construct(cx, constructor_val, JS::HandleValueArray::empty(), &obj)) return false; + if (!obj) return false; + + JS::SetReservedSlot(obj, ListIteratorSlotIteratedObject, JS::PrivateValue((void *)self)); + JS::SetReservedSlot(obj, ListIteratorSlotNextIndex, JS::Int32Value(0)); + JS::SetReservedSlot(obj, ListIteratorSlotItemKind, JS::Int32Value(itemKind)); + + args.rval().setObject(*obj); + return true; +} + +static bool array_entries(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_iterator_func(cx, argc, vp, ITEM_KIND_KEY_AND_VALUE); +} + +static bool array_keys(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_iterator_func(cx, argc, vp, ITEM_KIND_KEY); +} + +static bool array_values(JSContext *cx, unsigned argc, JS::Value *vp) { + return array_iterator_func(cx, argc, vp, ITEM_KIND_VALUE); +} + + +static JSMethodDef array_methods[] = { + {"reverse", array_reverse, 0}, + {"pop", array_pop, 0}, + {"push", array_push, 1}, + {"shift", array_shift, 0}, + {"unshift", array_unshift, 1}, + {"concat", array_concat, 1}, + {"slice", array_slice, 2}, + {"indexOf", array_indexOf, 1}, + {"lastIndexOf", array_lastIndexOf, 1}, + {"splice", array_splice, 2}, + {"sort", array_sort, 1}, + {"fill", array_fill, 3}, + {"copyWithin", array_copyWithin, 3}, + {"includes", array_includes, 1}, + {"forEach", array_forEach, 1}, + {"map", array_map, 1}, + {"filter", array_filter, 1}, + {"reduce", array_reduce, 1}, + {"reduceRight", array_reduceRight, 1}, + {"some", array_some, 1}, + {"every", array_every, 1}, + {"find", array_find, 1}, + {"findIndex", array_findIndex, 1}, + {"flat", array_flat, 1}, + {"flatMap", array_flatMap, 1}, + {"join", array_join, 1}, + {"toString", array_toString, 0}, + {"toLocaleString", array_toLocaleString, 0}, + {"valueOf", array_valueOf, 0}, + {"entries", array_entries, 0}, + {"keys", array_keys, 0}, + {"values", array_values, 0}, + {NULL, NULL, 0} +}; bool PyListProxyHandler::getOwnPropertyDescriptor( @@ -989,7 +2156,7 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( } } - // item + // item Py_ssize_t index; PyObject *item; if (idToIndex(cx, id, &index) && (item = PyList_GetItem(pyObject, index))) { @@ -1010,6 +2177,8 @@ void PyListProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { // PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); // printf("finalize self=%p\n", self); // Py_DECREF(self); + + // JS::SetReservedSlot(proxy, PyObjectSlot, nullptr)); } bool PyListProxyHandler::defineProperty( @@ -1074,9 +2243,4 @@ bool PyListProxyHandler::isArray(JSContext *cx, JS::HandleObject proxy, JS::IsAr bool PyListProxyHandler::getBuiltinClass(JSContext *cx, JS::Handle obj, js::ESClass *cls) const { *cls = js::ESClass::Array; return true; -} - -const char *PyListProxyHandler::className(JSContext *cx, JS::HandleObject proxy) const { - // TODO untested - return "Array"; } \ No newline at end of file diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 813a92fd..3cbf8985 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -173,7 +173,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { if (PyList_Check(object)) { proxy = js::NewProxyObject(cx, new PyListProxyHandler(object), v, NULL); JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(object)); - //Py_INCREF(object); TODO + // Py_INCREF(object); TODO } else { proxy = js::NewProxyObject(cx, new PyProxyHandler(object), v, NULL); } @@ -200,25 +200,6 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { return returnType; } -JS::Value jsTypeFactoryCopy(JSContext *cx, PyObject *object) { - JS::RootedValue returnType(cx); - if (PyList_Check(object)) { - Py_ssize_t listSize = PyList_Size(object); - JSObject *array = JS::NewArrayObject(cx, listSize); - JS::RootedObject arrayObj(cx, array); - for (Py_ssize_t index = 0; index < listSize; index++) { - JS::RootedValue jsValue(cx, jsTypeFactorySafe(cx, PyList_GetItem(object, index))); - JS_SetElement(cx, arrayObj, index, jsValue); - } - returnType.setObject(*array); - } - else { - returnType.setUndefined(); - } - - return returnType; -} - JS::Value jsTypeFactorySafe(JSContext *cx, PyObject *object) { JS::Value v = jsTypeFactory(cx, object); if (PyErr_Occurred()) { diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index ee41ddc5..5635f973 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -81,7 +81,13 @@ def test_join_no_arg(): items = [1,2,3] result = [None] pm.eval("(result, arr) => {result[0] = arr.join()}")(result, items) - assert result[0] == '1,2,3' + assert result[0] == '1,2,3' + +def test_join_empty_array(): + items = [] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.join()}")(result, items) + assert result[0] == '' def test_join_no_arg_diff_types(): items = [1,False,"END"] @@ -111,7 +117,13 @@ def test_join_null(): items = [pm.null,2,3] result = [None] pm.eval("(result, arr) => {result[0] = arr.join()}")(result, items) - assert result[0] == ',2,3' + assert result[0] == ',2,3' + +def test_join_utf8(): + prices = ["¥7", 500, 8123, 12] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.join()}")(result, prices) + assert result[0] == '¥7,500,8123,12' #toString def test_toString(): @@ -608,7 +620,6 @@ def test_includes_too_few_args(): assert str(type(e)) == "" assert str(e).__contains__("TypeError: includes: At least 1 argument required, but only 0 passed") - #sort def test_sort_empty(): items = [] @@ -669,6 +680,13 @@ def test_sort_with_js_func(): assert result[0] == items assert items == ['Four', 'One', 'Three'] +#def test_sort_numbers_tricky(): +# items = [1, 30, 4, 21, 100000] +# result = [None] +# pm.eval("(result, arr) => {result[0] = arr.sort()}")(result, items) +# assert result[0] is items +# assert items == [1, 100000, 21, 30, 4] + def test_sort_with_js_func_wrong_data_type(): items = [4,2,6,7] myFunc = pm.eval("((a, b) => a.toLocaleUpperCase() < b.toLocaleUpperCase() ? -1 : 1)") @@ -677,7 +695,7 @@ def test_sort_with_js_func_wrong_data_type(): assert (False) except Exception as e: assert str(type(e)) == "" - assert str(e).__contains__("TypeError: a.toLocaleUpperCase is not a function") + assert str(e).__contains__("TypeError: a.toLocaleUpperCase is not a function") #forEach def test_forEach(): @@ -707,6 +725,28 @@ def test_forEach_check_this_arg(): pm.eval("(result, arr) => {class Counter { constructor() { this.count = 0;} add(array) { array.forEach(function countEntry(entry) { ++this.count; }, this);}} const obj = new Counter(); obj.add(arr); result[0] = obj.count;}")(result, items) assert result == [3] +def test_forEach_check_this_arg_wrong_type(): + items = ['Four', 'Three', 'One'] + result = [None] + a = 9 + try: + pm.eval("(result, arr, a) => {class Counter { constructor() { this.count = 0;} add(array) { array.forEach(function countEntry(entry) { ++this.count; }, a);}} const obj = new Counter(); obj.add(arr); result[0] = obj.count;}")(result, items, a) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("TypeError: 'this' argument is not an object or null") + +# TODO should not pass +def test_forEach_check_this_arg_null(): + items = ['Four', 'Three', 'One'] + result = [None] + try: + pm.eval("(result, arr) => {class Counter { constructor() { this.count = 0;} add(array) { array.forEach(function countEntry(entry) { ++this.count; }, null);}} const obj = new Counter(); obj.add(arr); result[0] = obj.count;}")(result, items) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("TypeError: this is null") + def test_forEach_too_few_args(): items = [4,2,6,7] try: @@ -733,17 +773,27 @@ def test_map_too_few_args(): assert str(type(e)) == "" assert str(e).__contains__("TypeError: map: At least 1 argument required, but only 0 passed") +def test_map_arg_wrong_type(): + items = [4,2,6,7] + try: + pm.eval("(arr) => {arr.map(8)}")(items) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("TypeError: map: callback is not a function") + def test_map_check_index(): items = ['Four', 'Three', 'One'] result = [''] pm.eval("(result, arr) => {arr.map((element, index) => result[0] += index)}")(result, items) assert result == ['012'] -def test_map_check_array(): +def test_map_check_array_mutation(): items = ['Four', 'Three', 'One'] result = [''] - pm.eval("(result, arr) => {arr.map((element, index, array) => result[0] = array)}")(result, items) - assert result == [items] + pm.eval("(result, arr) => {arr.map((element, index, array) => {array[0] = 'Ten'; result[0] = array})}")(result, items) + assert result[0] == ['Ten', 'Three', 'One'] + assert items == ['Ten', 'Three', 'One'] #filter def test_filter(): @@ -762,7 +812,7 @@ def test_filter_too_few_args(): assert str(type(e)) == "" assert str(e).__contains__("TypeError: filter: At least 1 argument required, but only 0 passed") -#reduce index, array param, too few args same impl as previous few for all below +#reduce index, array param, wrong arg type, too few args same impl as previous few for all below def test_reduce(): items = [1,2,3,4,5] result = [None] @@ -770,6 +820,15 @@ def test_reduce(): assert items == [1,2,3,4,5] assert result[0] == 15 +def test_reduce_empty_array_no_accumulator(): + items = [] + try: + pm.eval("(arr) => {arr.reduce((accumulator, currentValue) => accumulator + currentValue)}")(items) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("TypeError: reduce of empty array with no initial value") + def test_reduce_float(): items = [1.9, 4.6, 9.3, 16.5] result = [None] @@ -794,7 +853,19 @@ def test_reduce_no_initial_value(): result = [None] pm.eval("(result, arr) => {result[0] = arr.reduce((accumulator, currentValue) => accumulator + currentValue)}")(result, items) assert items == [1,2,3,4,5] - assert result[0] == 15 + assert result[0] == 15 + +def test_reduce_length_one_with_initial_value(): + items = [1] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reduce((accumulator, currentValue) => accumulator + currentValue, 2)}")(result, items) + assert result[0] == 3 + +def test_reduce_length_one_no_initial_value(): + items = [1] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reduce((accumulator, currentValue) => accumulator + currentValue)}")(result, items) + assert result[0] == 1 def test_reduce_list_meaningless(): items = [['Hi', 'There']] @@ -819,7 +890,13 @@ def test_reduceRight(): items = [0,1,2,3,4] result = [None] pm.eval("(result, arr) => {result[0] = arr.reduceRight((accumulator, currentValue, index, array) => accumulator + currentValue)}")(result, items) - assert result[0] == 10 + assert result[0] == 10 + +def test_reduceRight_with_initial_value(): + items = [0,1,2,3,4] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.reduceRight((accumulator, currentValue, index, array) => accumulator + currentValue, 5)}")(result, items) + assert result[0] == 15 def test_reduceRight_float(): items = [1.9, 4.6, 9.3, 16.5] @@ -908,6 +985,13 @@ def test_flat(): assert items == [0, 1, 2, [3, 4]] assert result[0] == [0, 1, 2, 3, 4] +def test_flat_with_js_array(): + items = [0, 1, 2, [3, 4]] + result = [0] + pm.eval("(result, arr) => {arr[1] = [10,11]; result[0] = arr.flat()}")(result, items) + assert items == [0, [10, 11], 2, [3, 4]] + assert result[0] == [0, 10, 11, 2, 3, 4] + def test_flat_depth_zero(): items = [0, 1, [2, [3, [4, 5]]]] result = [0] @@ -921,19 +1005,18 @@ def test_flat_depth_one(): assert items == [0, 1, [2, [3, [4, 5]]]] assert result[0] == [0, 1, 2, [3, [4, 5]]] -########## TODO these two fail as tests but work in the interactive console ########### -#def test_flat_depth_two(): -# items = [0, 1, [2, [3, [4, 5]]]] -# result = [0] -# pm.eval("(result, arr) => {result[0] = arr.flat(2)}")(result, items) -# assert items == [0, 1, [2, [3, [4, 5]]]] -# assert result[0] == [0, 1, 2, 3, [4, 5]] +def test_flat_depth_two(): + items = [0, 1, [2, [3, [4, 5]]]] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.flat(2)}")(result, items) + assert items == [0, 1, [2, [3, [4, 5]]]] + assert result[0] == [0, 1, 2, 3, [4, 5]] -#def test_flat_depth_infinite(): -# items = [0, 1, [2, [3, [4, 5]]]] -# result = [0] -# pm.eval("(result, arr) => {result[0] = arr.flat(Infinity)}")(result, items) -# assert result[0] == [0, 1, 2, 3, 4, 5] +def test_flat_depth_large(): + items = [0, 1, [2, [3, [4, 5]]]] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.flat(10)}")(result, items) + assert result[0] == [0, 1, 2, 3, 4, 5] #flatMap def test_flatMap(): @@ -943,6 +1026,27 @@ def test_flatMap(): assert items == [1,2,1] assert result[0] == [1,2,2,1] +def test_flatMap_with_js_array(): + items = [1,2,2,1] + result = [0] + pm.eval("(result, arr) => {arr[1] = [10,11]; result[0] = arr.flatMap((num) => (num === 2 ? [2, 2] : 1))}")(result, items) + assert items == [1, [10, 11], 2, 1] + assert result[0] == [1, 1, 2, 2, 1] + +def test_flatMap_no_replace(): + items = [1,2,[4,5]] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.flatMap((num) => (num === 2 ? [2, 2] : 1))}")(result, items) + assert items == [1, 2, [4, 5]] + assert result[0] == [1, 2, 2, 1] + +def test_flatMap_no_replace_depth_one(): + items = [1,2,[4,5]] + result = [0] + pm.eval("(result, arr) => {result[0] = arr.flatMap((num) => (num === 2 ? [2, [2, 2]] : 1))}")(result, items) + assert items == [1, 2, [4, 5]] + assert result[0] == [1, 2, [2, 2], 1] + def test_flatMap_equivalence(): items = [1, 2, 1] result = [0] @@ -1018,17 +1122,17 @@ def test_entries_next_next_undefined(): items = ['a'] result = [0] pm.eval("(result, arr) => {result[0] = arr.entries(); result[0].next(); result[0] = result[0].next().value}")(result, items) - assert result[0] == None + assert result[0] == None #keys -def test_keys(): +def test_keys_iterator(): items = ['a', 'b', 'c'] result = [7,8,9] pm.eval("(result, arr) => { index = 0; iterator = arr.keys(); for (const key of iterator) { result[index] = key; index++;} }")(result, items) - assert result == ['0','1','2'] + assert result == [0,1,2] #values -def test_values(): +def test_values_iterator(): items = ['a', 'b', 'c'] result = [7,8,9] pm.eval("(result, arr) => { index = 0; iterator = arr.values(); for (const key of iterator) { result[index] = key; index++;} }")(result, items) @@ -1074,5 +1178,5 @@ def test_iterator_last_next(): items = [1,2] result = [0] pm.eval("(result, arr) => { let iterator = arr[Symbol.iterator](); iterator.next(); iterator.next(); result[0] = iterator.next()}")(result, items) - assert result[0].value == None + assert result[0].value == None assert result[0].done == True \ No newline at end of file From 694c1e60003a7ede41aa40a84574b83349a6d6ea Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 11 Jan 2024 13:59:53 -0500 Subject: [PATCH 0126/1086] improved docs --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index af96b1f9..d69a1ab1 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,9 @@ js_eval("console.log")('hello, world') - Python host environment supplies basic subsets of NodeJS's fs, path, process, etc, modules; as-needed by dcp-client (other project?) - [done] Python TypedArrays coerce to JS TypeArrays - [done] JS TypedArrays coerce to Python TypeArrays -- [done] Python List coerce to JS Arrays -- [done] JS Arrays coerce to Python Lists +- [done] JS Arrays coerce to Python Lists, providing all List methods implemented on Arrays +- [done] Python List coerce to JS Arrays, providing all Array methods implemented on Lists + ## Build Instructions From 3ddc130640de0ce68890decfe5cde28c6744f9e8 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 11 Jan 2024 14:01:52 -0500 Subject: [PATCH 0127/1086] cleanup --- README.md | 1 - include/jsTypeFactory.hh | 1 - 2 files changed, 2 deletions(-) diff --git a/README.md b/README.md index d69a1ab1..1fa5dbfd 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,6 @@ js_eval("console.log")('hello, world') - [done] JS Arrays coerce to Python Lists, providing all List methods implemented on Arrays - [done] Python List coerce to JS Arrays, providing all Array methods implemented on Lists - ## Build Instructions Read this if you want to build a local version. diff --git a/include/jsTypeFactory.hh b/include/jsTypeFactory.hh index 1ae6b131..6ec68412 100644 --- a/include/jsTypeFactory.hh +++ b/include/jsTypeFactory.hh @@ -37,7 +37,6 @@ size_t UCS4ToUTF16(const uint32_t *chars, size_t length, uint16_t *outStr); * @return JS::Value - A JS::Value corresponding to the PyType */ JS::Value jsTypeFactory(JSContext *cx, PyObject *object); - /** * @brief same to jsTypeFactory, but it's guaranteed that no error would be set on the Python error stack, instead * return JS `null` on error, and output a warning in Python-land From c6b82eee72fb7a053d92577ae7264fbff40ed21e Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 11 Jan 2024 14:03:10 -0500 Subject: [PATCH 0128/1086] improved naming --- tests/python/test_lists.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index 01d01b83..0942e8b2 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -729,7 +729,7 @@ def myFunc(e): assert str(type(e)) == "" assert str(e) == "object of type 'float' has no len()" -def test_sort_with_function_two_arg_and_reverse_false(): +def test_sort_with_function_two_args_and_reverse_false(): def myFunc(e,f): return len(e) - len(f) a = pm.eval("(['Ford', 'Mitsubishi', 'BMW', 'VW'])") From 519beab4ee9647f60bc19ab01a5255fa06374b66 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:05:27 -0500 Subject: [PATCH 0129/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 5635f973..963b2447 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -174,7 +174,7 @@ def test_shift_empty(): result = [None] pm.eval("(result, arr) => {result[0] = arr.shift()}")(result, items) assert items == [] - assert result[0] == None + assert result[0] is None #unshift def test_unshift_zero_arg(): From 79c830e6ff87b51b6d9e91f5a9cf8b20df95ef02 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:05:58 -0500 Subject: [PATCH 0130/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 963b2447..9c1bdd28 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -67,7 +67,7 @@ def test_pop_empty(): result = [None] pm.eval("(result, arr) => {result[0] = arr.pop()}")(result, items) assert items == [] - assert result[0] == None + assert result[0] is None def test_pop_ignore_extra_args(): items = [1,2,3] From c541f5a5d4b73ff2b93ccec56b0761faf7825fc9 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:06:40 -0500 Subject: [PATCH 0131/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 9c1bdd28..c6afd02e 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -291,7 +291,7 @@ def test_slice_start_negative(): #indexOf def test_indexOf(): - items = [1,2,3] + items = [1,2,3,1] result = [None] pm.eval("(result, arr) => {result[0] = arr.indexOf(1)}")(result, items) assert result[0] == 0 From b05ae54df04498d1a4da702420f18798a74f266d Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:07:19 -0500 Subject: [PATCH 0132/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index c6afd02e..5bcaa552 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -297,10 +297,10 @@ def test_indexOf(): assert result[0] == 0 def test_indexOf_with_start(): - items = [1,2,3] + items = [1,2,3,4,3] result = [None] - pm.eval("(result, arr) => {result[0] = arr.indexOf(3, 1)}")(result, items) - assert result[0] == 2 + pm.eval("(result, arr) => {result[0] = arr.indexOf(3, 3)}")(result, items) + assert result[0] == 4 def test_indexOf_with_negative_start(): items = [1,2,3] From 5d1bb31ca246816412ac916f98820993ab8f4c44 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:07:49 -0500 Subject: [PATCH 0133/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 5bcaa552..5ea1a147 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -340,7 +340,7 @@ def test_lastIndexOf_dup(): assert result[0] == 3 def test_lastIndexOf_with_from_index(): - items = [1,2,3] + items = [1,2,3,1] result = [None] pm.eval("(result, arr) => {result[0] = arr.lastIndexOf(1, 2)}")(result, items) assert result[0] == 0 From ae2ac52e34e98ae86b2e8051700ab81db37693c3 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:26:12 -0500 Subject: [PATCH 0134/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 5ea1a147..22f156af 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -461,9 +461,7 @@ def test_fill_returns_ref_to_self(): result = [None] pm.eval("(result, arr) => {result[0] = arr.fill(8)}")(result, items) assert items == [8,8,8] - assert result[0] == [8,8,8] - result[0][0] = 9 - assert items == [9,8,8] + assert items is result[0] def test_fill_other_type(): items = [1,2,3] From 558b39bffedcb869e90e67b63c0179d09a146c3f Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:27:24 -0500 Subject: [PATCH 0135/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 22f156af..ced368ff 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -506,14 +506,6 @@ def test_fill_with_stop_too_high(): assert items == [1,8,8] #copyWithin -def test_copyWithin_returns_ref_to_self(): - items = [1,2,3] - result = [None] - pm.eval("(result, arr) => {result[0] = arr.copyWithin(0,1)}")(result, items) - assert items == [2,3,3] - assert result[0] == [2,3,3] - result[0][0] = 9 - assert items == [9,3,3] def test_copyWithin(): items = [1,2,3] From b78d156fb9ff67d895a7dac8c054d3e2621d5540 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:27:50 -0500 Subject: [PATCH 0136/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index ced368ff..85386eaf 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -512,9 +512,7 @@ def test_copyWithin(): result = [None] pm.eval("(result, arr) => {result[0] = arr.copyWithin(0,1)}")(result, items) assert items == [2,3,3] - assert result[0] == [2,3,3] - result[0][0] = 9 - assert items == [9,3,3] + assert items is result[0] def test_copyWithin_no_args(): items = [1,2,3] From 05610a96e74e57f7d43e32a87e8e80f0e1754de6 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:30:17 -0500 Subject: [PATCH 0137/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 85386eaf..c51cdea2 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -553,8 +553,8 @@ def test_copyWithin_target_and_start(): def test_copyWithin_target_and_start_too_large(): items = [1,2,3] result = [None] - pm.eval("(result, arr) => {result[0] = arr.copyWithin(1, 2)}")(result, items) - assert items == [1,3,3] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(1, 10)}")(result, items) + assert items == [1,2,3] def test_copyWithin_target_and_negative_start(): items = [1,2,3] From ff80136726019d722585b1499834c37ed458492e Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:33:47 -0500 Subject: [PATCH 0138/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index c51cdea2..bf0cf310 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -705,7 +705,8 @@ def test_forEach_check_array(): items = ['Four', 'Three', 'One'] result = [''] pm.eval("(result, arr) => {arr.forEach((element, index, array) => result[0] = array)}")(result, items) - assert result == [items] + assert result == [items] + assert result[0] is items def test_forEach_check_this_arg(): items = ['Four', 'Three', 'One'] From 5444f7d5a269bb6548f64132f90d5be974a7b328 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:34:29 -0500 Subject: [PATCH 0139/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index bf0cf310..37fab67b 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -1125,8 +1125,7 @@ def test_values_iterator(): items = ['a', 'b', 'c'] result = [7,8,9] pm.eval("(result, arr) => { index = 0; iterator = arr.values(); for (const key of iterator) { result[index] = key; index++;} }")(result, items) - items[0] = 'd' - assert result == ['a', 'b', 'c'] + assert result is not items #constructor property def test_constructor_creates_array(): From 70227591475cd35a6986de38ca49f24adb66c8f5 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:34:48 -0500 Subject: [PATCH 0140/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 37fab67b..a348322f 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -1124,7 +1124,7 @@ def test_keys_iterator(): def test_values_iterator(): items = ['a', 'b', 'c'] result = [7,8,9] - pm.eval("(result, arr) => { index = 0; iterator = arr.values(); for (const key of iterator) { result[index] = key; index++;} }")(result, items) + pm.eval("(result, arr) => { index = 0; iterator = arr.values(); for (const value of iterator) { result[index] = value; index++;} }")(result, items) assert result is not items #constructor property From 72a5025827bb7edcaab5e76ba7bf84497cf4ceff Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:35:23 -0500 Subject: [PATCH 0141/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index a348322f..f5572f93 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -1049,10 +1049,8 @@ def test_valueOf(): items = [1, 2, 1] result = [0] pm.eval("(result, arr) => {result[0] = arr.valueOf()}")(result, items) - assert result[0] == [1,2,1] - result[0][1] = 5 - assert result[0] == [1,5,1] - assert items == [1,5,1] + assert items == [1,2,1] + assert result[0] is items #toLocaleString def test_toLocaleString(): From 58c736de821558d57c35a4fd1665c0d655336000 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:35:55 -0500 Subject: [PATCH 0142/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index f5572f93..efcd2ea0 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -944,7 +944,7 @@ def test_find_not_found(): items = [5, 12, 8, 130, 44] result = [0] pm.eval("(result, arr) => {result[0] = arr.find((element) => element > 1000)}")(result, items) - assert result[0] == None + assert result[0] is None #findIndex def test_findIndex_found_once(): From 5a6a033d63ef3f25ec8546d509fcd9b6bd4725cc Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:37:10 -0500 Subject: [PATCH 0143/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index efcd2ea0..7a591fa2 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -909,8 +909,20 @@ def test_some_false(): def test_some_truthy_conversion(): result = [None] - pm.eval('(result) => {const TRUTHY_VALUES = [true, "true", 1]; function getBoolean(value) { if (typeof value === "string") { value = value.toLowerCase().trim(); } return TRUTHY_VALUES.some((t) => t === value);} result[0] = getBoolean(1);}')(result) - assert result[0] == True + pm.eval( + """ + (result) => { + const TRUTHY_VALUES = [true, "true", 1, {}]; + function getBoolean(value) { + if (typeof value === "string") { + value = value.toLowerCase().trim(); + } + return TRUTHY_VALUES.some((t) => t === value); + } + result[0] = getBoolean(1); + } + """)(result) + assert result[0] == True #every def test_every_true(): From e088b356143264ea850189f19fc0603b73adcfd2 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:37:52 -0500 Subject: [PATCH 0144/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 7a591fa2..69298f17 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -709,10 +709,27 @@ def test_forEach_check_array(): assert result[0] is items def test_forEach_check_this_arg(): - items = ['Four', 'Three', 'One'] - result = [None] - pm.eval("(result, arr) => {class Counter { constructor() { this.count = 0;} add(array) { array.forEach(function countEntry(entry) { ++this.count; }, this);}} const obj = new Counter(); obj.add(arr); result[0] = obj.count;}")(result, items) - assert result == [3] + items = ['Four', 'Three', 'One'] + result = [None] + pm.eval( + """ + (result, arr) => { + class Counter { + constructor() + { + this.count = 0; + } + add(array) { + array.forEach(function countEntry(entry) { ++this.count; }, this); + } + } + const obj = new Counter(); + obj.add(arr); + result[0] = obj.count; + } + """ + )(result, items) + assert result == [3] def test_forEach_check_this_arg_wrong_type(): items = ['Four', 'Three', 'One'] From 132bba82a798532aefeb61b6ba4b4748d090b0c8 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:38:26 -0500 Subject: [PATCH 0145/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 69298f17..791271f9 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -665,7 +665,7 @@ def test_sort_with_js_func(): result = [None] myFunc = pm.eval("((a, b) => a.toLocaleUpperCase() < b.toLocaleUpperCase() ? -1 : 1)") pm.eval("(result, arr, compareFun) => {result[0] = arr.sort(compareFun)}")(result, items, myFunc) - assert result[0] == items + assert result[0] is items assert items == ['Four', 'One', 'Three'] #def test_sort_numbers_tricky(): From 66a4cc8dcac8e791a6f2c8feb4da997c6416ea4b Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:39:20 -0500 Subject: [PATCH 0146/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 791271f9..11715042 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -613,7 +613,7 @@ def test_sort_empty(): items = [] result = [None] pm.eval("(result, arr) => {result[0] = arr.sort()}")(result, items) - assert result[0] == items + assert result[0] is items assert items == [] def test_sort_numbers(): From 0df2e1f31932d02d3cf22bf30957713e2c06748b Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:39:47 -0500 Subject: [PATCH 0147/1086] Update tests/python/test_arrays.py Co-authored-by: Caleb Aikens --- tests/python/test_arrays.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 11715042..5bcb8782 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -620,7 +620,7 @@ def test_sort_numbers(): items = [4,2,6,7] result = [None] pm.eval("(result, arr) => {result[0] = arr.sort()}")(result, items) - assert result[0] == items + assert result[0] is items assert items == [2,4,6,7] def test_sort_strings(): From 15063d7feab2326c828cc7b17052f95f5c93fac9 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 11 Jan 2024 15:10:02 -0500 Subject: [PATCH 0148/1086] fixes and improved tests --- include/jsTypeFactory.hh | 10 ++++++ src/PyProxyHandler.cc | 25 +++++++------- src/jsTypeFactory.cc | 19 +++++++++++ tests/python/test_arrays.py | 66 +++++++++++++++++++++++++++++++++++-- 4 files changed, 106 insertions(+), 14 deletions(-) diff --git a/include/jsTypeFactory.hh b/include/jsTypeFactory.hh index 6ec68412..23339c54 100644 --- a/include/jsTypeFactory.hh +++ b/include/jsTypeFactory.hh @@ -37,6 +37,16 @@ size_t UCS4ToUTF16(const uint32_t *chars, size_t length, uint16_t *outStr); * @return JS::Value - A JS::Value corresponding to the PyType */ JS::Value jsTypeFactory(JSContext *cx, PyObject *object); + +/** + * @brief Function that takes a PyObject and returns a corresponding JS::Value which is a copy, not a reference + * + * @param cx - Pointer to the JSContext + * @param object - Pointer to the PyListObject + * @return JS::Value - A JS::Value corresponding to the PyType + */ +JS::Value jsTypeFactoryCopy(JSContext *cx, PyObject *object); + /** * @brief same to jsTypeFactory, but it's guaranteed that no error would be set on the Python error stack, instead * return JS `null` on error, and output a warning in Python-land diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index c21d66ae..c69c41c0 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -624,9 +624,10 @@ static bool array_fill(JSContext *cx, unsigned argc, JS::Value *vp) { } JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + JS::RootedValue *fillValue = new JS::RootedValue(cx, args[0].get()); + PyObject *fillValueItem = pyTypeFactory(cx, global, fillValue)->getPyObject(); for (int index = actualStart; index < actualEnd; index++) { - JS::RootedValue *fillValue = new JS::RootedValue(cx, args[0].get()); - if (PyList_SetItem(self, index, pyTypeFactory(cx, global, fillValue)->getPyObject()) < 0) { + if (PyList_SetItem(self, index, fillValueItem) < 0) { return false; } } @@ -645,7 +646,7 @@ static bool array_copyWithin(JSContext *cx, unsigned argc, JS::Value *vp) { } PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - uint64_t selfLength = (uint64_t)PyList_GET_SIZE(self); + int64_t selfLength = (uint64_t)PyList_GET_SIZE(self); unsigned int argsLength = args.length(); @@ -658,11 +659,11 @@ static bool array_copyWithin(JSContext *cx, unsigned argc, JS::Value *vp) { relativeTarget = 0; } - uint64_t actualTarget; + int64_t actualTarget; if (relativeTarget < 0) { - actualTarget = uint64_t(std::max(double(selfLength) + relativeTarget, 0.0)); + actualTarget = int64_t(std::max(double(selfLength) + relativeTarget, 0.0)); } else { - actualTarget = uint64_t(std::min(double(relativeTarget), double(selfLength))); + actualTarget = int64_t(std::min(double(relativeTarget), double(selfLength))); } int64_t relativeStart; @@ -674,11 +675,11 @@ static bool array_copyWithin(JSContext *cx, unsigned argc, JS::Value *vp) { relativeStart = 0; } - uint64_t actualStart; + int64_t actualStart; if (relativeStart < 0) { - actualStart = uint64_t(std::max(double(selfLength) + relativeStart, 0.0)); + actualStart = int64_t(std::max(double(selfLength) + relativeStart, 0.0)); } else { - actualStart = uint64_t(std::min(double(relativeStart), double(selfLength))); + actualStart = int64_t(std::min(double(relativeStart), double(selfLength))); } int64_t relativeEnd; @@ -690,11 +691,11 @@ static bool array_copyWithin(JSContext *cx, unsigned argc, JS::Value *vp) { relativeEnd = selfLength; } - uint64_t actualEnd; + int64_t actualEnd; if (relativeEnd < 0) { - actualEnd = uint64_t(std::max(double(selfLength) + relativeEnd, 0.0)); + actualEnd = int64_t(std::max(double(selfLength) + relativeEnd, 0.0)); } else { - actualEnd = uint64_t(std::min(double(relativeEnd), double(selfLength))); + actualEnd = int64_t(std::min(double(relativeEnd), double(selfLength))); } int64_t count = int64_t(std::min(actualEnd - actualStart, selfLength - actualTarget)); diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 3cbf8985..a5696eca 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -200,6 +200,25 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { return returnType; } +JS::Value jsTypeFactoryCopy(JSContext *cx, PyObject *object) { + JS::RootedValue returnType(cx); + if (PyList_Check(object)) { + Py_ssize_t listSize = PyList_Size(object); + JSObject *array = JS::NewArrayObject(cx, listSize); + JS::RootedObject arrayObj(cx, array); + for (Py_ssize_t index = 0; index < listSize; index++) { + JS::RootedValue jsValue(cx, jsTypeFactorySafe(cx, PyList_GetItem(object, index))); + JS_SetElement(cx, arrayObj, index, jsValue); + } + returnType.setObject(*array); + } + else { + returnType.setUndefined(); + } + + return returnType; +} + JS::Value jsTypeFactorySafe(JSContext *cx, PyObject *object) { JS::Value v = jsTypeFactory(cx, object); if (PyErr_Occurred()) { diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 5bcb8782..4adfb34c 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -324,7 +324,13 @@ def test_indexOf_not_found(): items = [1,2,3] result = [None] pm.eval("(result, arr) => {result[0] = arr.indexOf(10)}")(result, items) - assert result[0] == -1 + assert result[0] == -1 + +def test_indexOf_small_start(): + items = [1,2,3,1] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.indexOf(1, -10)}")(result, items) + assert result[0] == 0 #lastIndexOf def test_lastIndexOf(): @@ -363,6 +369,12 @@ def test_lastIndexOf_not_found(): pm.eval("(result, arr) => {result[0] = arr.lastIndexOf(3, 0)}")(result, items) assert result[0] == -1 +def test_lastIndexOf_small_start(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.lastIndexOf(1, -10)}")(result, items) + assert result[0] == -1 + #splice def test_splice_no_args(): items = [1,2,3] @@ -485,7 +497,13 @@ def test_fill_with_start_too_high(): items = [1,2,3] result = [None] pm.eval("(result, arr) => {result[0] = arr.fill(8,7)}")(result, items) - assert items == [1,2,3] + assert items == [1,2,3] + +def test_fill_with_stop_smaller_than_start(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.fill(8,7,2)}")(result, items) + assert items == [1,2,3] def test_fill_with_stop(): items = [1,2,3] @@ -499,12 +517,26 @@ def test_fill_with_negative_stop(): pm.eval("(result, arr) => {result[0] = arr.fill(8,1,-1)}")(result, items) assert items == [1,8,3] +def test_fill_with_negative_stop_too_low(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.fill(8,1,-10)}")(result, items) + assert items == [1,2,3] + def test_fill_with_stop_too_high(): items = [1,2,3] result = [None] pm.eval("(result, arr) => {result[0] = arr.fill(8,1,10)}")(result, items) assert items == [1,8,8] +def test_fill_object(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {let a = {a:1}; result[0] = arr.fill(a)}")(result, items) + assert items == [{"a":1},{"a":1},{"a":1}] + assert items is result[0] + assert items[0] is items[1] is items[2] + #copyWithin def test_copyWithin(): @@ -574,6 +606,36 @@ def test_copyWithin_target_and_start_and_negative_end(): pm.eval("(result, arr) => {result[0] = arr.copyWithin(1,2,-2)}")(result, items) assert items == [1,3,3,4,5] +def test_copyWithin_target_too_small_and_start(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(-10,2)}")(result, items) + assert items == [3,2,3] + +def test_copyWithin_target_greater_than_start(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => { result[0] = arr.copyWithin(2,1)}")(result, items) + assert items == [1,2,2] + +def test_copyWithin_target_and_start_too_small(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(1, -10)}")(result, items) + assert items == [1,1,2] + +def test_copyWithin_target_and_start_and_end_too_large(): + items = [1,2,3,4,5] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(2,1,10)}")(result, items) + assert items == [1,2,2,3,4] + +def test_copyWithin_target_and_start_greater_than_end(): + items = [1,2,3,4,5] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(2,3,2)}")(result, items) + assert items == [1,2,3,4,5] + #includes def test_includes(): items = [1,2,3] From 2b61ec3bd281ce1729c2390384e7687bec664ffc Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 11 Jan 2024 16:25:01 -0500 Subject: [PATCH 0149/1086] improved tests --- tests/python/test_arrays.py | 323 ++++++++++++++++++++++++++++++++++-- 1 file changed, 313 insertions(+), 10 deletions(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 4adfb34c..12faadee 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -1,4 +1,5 @@ import pythonmonkey as pm +from datetime import datetime def test_assign(): items = [1,2,3] @@ -538,7 +539,6 @@ def test_fill_object(): assert items[0] is items[1] is items[2] #copyWithin - def test_copyWithin(): items = [1,2,3] result = [None] @@ -624,6 +624,12 @@ def test_copyWithin_target_and_start_too_small(): pm.eval("(result, arr) => {result[0] = arr.copyWithin(1, -10)}")(result, items) assert items == [1,1,2] +def test_copyWithin_target_and_start_and_end_too_small(): + items = [1,2,3,4,5] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.copyWithin(1,2,-10)}")(result, items) + assert items == [1,2,3,4,5] + def test_copyWithin_target_and_start_and_end_too_large(): items = [1,2,3,4,5] result = [None] @@ -802,7 +808,20 @@ def test_forEach_check_this_arg_wrong_type(): assert (False) except Exception as e: assert str(type(e)) == "" - assert str(e).__contains__("TypeError: 'this' argument is not an object or null") + assert str(e).__contains__("TypeError: 'this' argument is not an object or null") + +# TODO python function support + +# this one does not get the result into items +#def test_forEach_with_python_function(): +# def func(element, index, array): +# return "to each his own" +# items = ['Four', 'Three', 'One'] +# returnResult = [0] +# pm.eval("(returnResult, arr, func) => {returnResult[0] = arr.forEach(func)}")(returnResult, items, func) +# assert items == ['to each his own', 'to each his own', 'to each his own'] +# assert returnResult == [None] + # TODO should not pass def test_forEach_check_this_arg_null(): @@ -832,6 +851,43 @@ def test_map(): assert items == [4,2,6,7] assert result[0] == [16,4,36,49] +def test_map_check_index(): + items = [4,2,6,7] + result = [''] + pm.eval("(result, arr) => {arr.map((x, index) => result[0] += index)}")(result, items) + assert items == [4,2,6,7] + assert result[0] == '0123' + +def test_map_check_array(): + items = ['Four', 'Three', 'One'] + result = [''] + pm.eval("(result, arr) => {arr.map((element, index, array) => result[0] = array)}")(result, items) + assert result == [items] + assert result[0] is items + +def test_map_check_this_arg(): + items = ['Four', 'Three', 'One'] + result = [None] + pm.eval( + """ + (result, arr) => { + class Counter { + constructor() + { + this.count = 0; + } + add(array) { + array.map(function countEntry(entry) { ++this.count; }, this); + } + } + const obj = new Counter(); + obj.add(arr); + result[0] = obj.count; + } + """ + )(result, items) + assert result == [3] + def test_map_too_few_args(): items = [4,2,6,7] try: @@ -850,12 +906,6 @@ def test_map_arg_wrong_type(): assert str(type(e)) == "" assert str(e).__contains__("TypeError: map: callback is not a function") -def test_map_check_index(): - items = ['Four', 'Three', 'One'] - result = [''] - pm.eval("(result, arr) => {arr.map((element, index) => result[0] += index)}")(result, items) - assert result == ['012'] - def test_map_check_array_mutation(): items = ['Four', 'Three', 'One'] result = [''] @@ -871,6 +921,43 @@ def test_filter(): assert words == ['spray', 'elite', 'exuberant', 'destruction', 'present'] assert result[0] == ['exuberant', 'destruction', 'present'] +def test_filter_check_index(): + items = [4,2,6,7] + result = [''] + pm.eval("(result, arr) => {arr.filter((x, index) => result[0] += index)}")(result, items) + assert items == [4,2,6,7] + assert result[0] == '0123' + +def test_filter_check_array(): + items = ['Four', 'Three', 'One'] + result = [''] + pm.eval("(result, arr) => {arr.filter((element, index, array) => result[0] = array)}")(result, items) + assert result == [items] + assert result[0] is items + +def test_filter_check_this_arg(): + items = ['Four', 'Three', 'One'] + result = [None] + pm.eval( + """ + (result, arr) => { + class Counter { + constructor() + { + this.count = 0; + } + add(array) { + array.filter(function countEntry(entry) { ++this.count; }, this); + } + } + const obj = new Counter(); + obj.add(arr); + result[0] = obj.count; + } + """ + )(result, items) + assert result == [3] + def test_filter_too_few_args(): items = [4,2,6,7] try: @@ -972,6 +1059,19 @@ def test_reduceRight_float(): pm.eval("(result, arr) => {result[0] = arr.reduceRight((accumulator, currentValue, index, array) => accumulator + currentValue)}")(result, items) assert result[0] == 32.3 +def test_reduceRight_check_index(): + items = [1.9, 4.6, 9.3, 16.5] + result = [''] + pm.eval("(result, arr) => {arr.reduceRight((accumulator, currentValue, index, array) => {accumulator + currentValue; result[0] += index})}")(result, items) + assert result[0] == '210' + +def test_reduceRight_check_array(): + items = ['Four', 'Three', 'One'] + result = [None] + pm.eval("(result, arr) => {arr.reduceRight((accumulator, currentValue, index, array) => {accumulator + currentValue; result[0] = array})}")(result, items) + assert result == [items] + assert result[0] is items + #some def test_some_true(): items = [1, 2, 3, 4, 5] @@ -984,7 +1084,44 @@ def test_some_false(): items = [1,3,5] result = [None] pm.eval("(result, arr) => {result[0] = arr.some((element) => element % 2 === 0)}")(result, items) - assert result[0] == False + assert result[0] == False + +def test_some_check_index(): + items = [4,2,6,7] + result = [''] + pm.eval("(result, arr) => {arr.some((x, index) => result[0] += index)}")(result, items) + assert items == [4,2,6,7] + assert result[0] == '0123' + +def test_some_check_array(): + items = ['Four', 'Three', 'One'] + result = [''] + pm.eval("(result, arr) => {arr.some((element, index, array) => result[0] = array)}")(result, items) + assert result == [items] + assert result[0] is items + +def test_some_check_this_arg(): + items = ['Four', 'Three', 'One'] + result = [None] + pm.eval( + """ + (result, arr) => { + class Counter { + constructor() + { + this.count = 0; + } + add(array) { + array.some(function countEntry(entry) { ++this.count; }, this); + } + } + const obj = new Counter(); + obj.add(arr); + result[0] = obj.count; + } + """ + )(result, items) + assert result == [3] def test_some_truthy_conversion(): result = [None] @@ -1017,6 +1154,43 @@ def test_every_false(): pm.eval("(result, arr) => {result[0] = arr.every((element) => element % 2 === 0)}")(result, items) assert result[0] == False +def test_every_check_index(): + items = [4,2,6,7] + result = [''] + pm.eval("(result, arr) => {arr.every((x, index) => result[0] += index)}")(result, items) + assert items == [4,2,6,7] + assert result[0] == '0' + +def test_every_check_array(): + items = ['Four', 'Three', 'One'] + result = [''] + pm.eval("(result, arr) => {arr.every((element, index, array) => result[0] = array)}")(result, items) + assert result == [items] + assert result[0] is items + +def test_every_check_this_arg(): + items = ['Four', 'Three', 'One'] + result = [None] + pm.eval( + """ + (result, arr) => { + class Counter { + constructor() + { + this.count = 0; + } + add(array) { + array.every(function countEntry(entry) { ++this.count; }, this); + } + } + const obj = new Counter(); + obj.add(arr); + result[0] = obj.count; + } + """ + )(result, items) + assert result == [1] + #find def test_find_found_once(): items = [5, 12, 8, 130, 44] @@ -1037,6 +1211,43 @@ def test_find_not_found(): pm.eval("(result, arr) => {result[0] = arr.find((element) => element > 1000)}")(result, items) assert result[0] is None +def test_find_check_index(): + items = [4,2,6,7] + result = [''] + pm.eval("(result, arr) => {arr.find((x, index) => result[0] += index)}")(result, items) + assert items == [4,2,6,7] + assert result[0] == '0123' + +def test_find_check_array(): + items = ['Four', 'Three', 'One'] + result = [''] + pm.eval("(result, arr) => {arr.find((element, index, array) => result[0] = array)}")(result, items) + assert result == [items] + assert result[0] is items + +def test_find_check_this_arg(): + items = ['Four', 'Three', 'One'] + result = [None] + pm.eval( + """ + (result, arr) => { + class Counter { + constructor() + { + this.count = 0; + } + add(array) { + array.find(function countEntry(entry) { ++this.count; }, this); + } + } + const obj = new Counter(); + obj.add(arr); + result[0] = obj.count; + } + """ + )(result, items) + assert result == [3] + #findIndex def test_findIndex_found_once(): items = [5, 12, 8, 130, 44] @@ -1055,7 +1266,44 @@ def test_findIndex_not_found(): items = [5, 12, 8, 130, 4] result = [0] pm.eval("(result, arr) => {result[0] = arr.findIndex((element) => element > 1000)}")(result, items) - assert result[0] == -1 + assert result[0] == -1 + +def test_findIndex_check_index(): + items = [4,2,6,7] + result = [''] + pm.eval("(result, arr) => {arr.findIndex((x, index) => result[0] += index)}")(result, items) + assert items == [4,2,6,7] + assert result[0] == '0123' + +def test_findIndex_check_array(): + items = ['Four', 'Three', 'One'] + result = [''] + pm.eval("(result, arr) => {arr.findIndex((element, index, array) => result[0] = array)}")(result, items) + assert result == [items] + assert result[0] is items + +def test_findIndex_check_this_arg(): + items = ['Four', 'Three', 'One'] + result = [None] + pm.eval( + """ + (result, arr) => { + class Counter { + constructor() + { + this.count = 0; + } + add(array) { + array.findIndex(function countEntry(entry) { ++this.count; }, this); + } + } + const obj = new Counter(); + obj.add(arr); + result[0] = obj.count; + } + """ + )(result, items) + assert result == [3] #flat def test_flat(): @@ -1135,6 +1383,43 @@ def test_flatMap_equivalence(): pm.eval("(result, arr) => {result[0] = arr.map((num) => (num === 2 ? [2, 2] : 1)).flat()}")(result2, items) assert result[0] == result2[0] +def test_flatMap_check_index(): + items = [4,2,6,7] + result = [''] + pm.eval("(result, arr) => {arr.flatMap((x, index) => result[0] += index)}")(result, items) + assert items == [4,2,6,7] + assert result[0] == '0123' + +def test_flatMap_check_array(): + items = ['Four', 'Three', 'One'] + result = [''] + pm.eval("(result, arr) => {arr.flatMap((element, index, array) => result[0] = array)}")(result, items) + assert result == [items] + assert result[0] is items + +def test_flatMap_check_this_arg(): + items = ['Four', 'Three', 'One'] + result = [None] + pm.eval( + """ + (result, arr) => { + class Counter { + constructor() + { + this.count = 0; + } + add(array) { + array.flatMap(function countEntry(entry) { ++this.count; }, this); + } + } + const obj = new Counter(); + obj.add(arr); + result[0] = obj.count; + } + """ + )(result, items) + assert result == [0] + #valueOf def test_valueOf(): items = [1, 2, 1] @@ -1150,6 +1435,18 @@ def test_toLocaleString(): pm.eval("(result, arr) => {result[0] = arr.toLocaleString('ja-JP', { style: 'currency', currency: 'JPY' })}")(result, prices) assert result[0] == '¥7,¥500,¥8,123,¥12' +def test_toLocaleString_with_none(): + prices = ["¥7", 500, 8123, None] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.toLocaleString('ja-JP', { style: 'currency', currency: 'JPY' })}")(result, prices) + assert result[0] == '¥7,¥500,¥8,123,' + +def test_toLocaleString_with_null(): + prices = ["¥7", 500, 8123, pm.null] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.toLocaleString('ja-JP', { style: 'currency', currency: 'JPY' })}")(result, prices) + assert result[0] == '¥7,¥500,¥8,123,' + def test_toLocaleString_no_args(): prices = ["¥7", 500, 8123, 12] result = [None] @@ -1182,6 +1479,12 @@ def test_toLocaleString_two_args_invalid_currency(): assert str(type(e)) == "" assert str(e).__contains__("RangeError: invalid currency code in NumberFormat():") +def test_toLocaleString_with_datetime(): + prices = [500, datetime(year=2020, month=1, day=31, hour=13, minute=14, second=31)] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.toLocaleString('en', {timeZone: 'UTC'})}")(result, prices) + assert result[0] == '500,1/31/2020, 6:14:31 PM' + #entries def test_entries_next(): items = ['a', 'b', 'c'] From 9cf3306fa5245d387e3bfefb458f7da5231fa04a Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 11 Jan 2024 16:29:33 -0500 Subject: [PATCH 0150/1086] use latest spider monkey esr --- setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 71655d2d..c718629f 100755 --- a/setup.sh +++ b/setup.sh @@ -39,9 +39,9 @@ $POETRY_BIN self add 'poetry-dynamic-versioning[plugin]' echo "Done installing dependencies" echo "Downloading spidermonkey source code" -wget -c -q https://ftp.mozilla.org/pub/firefox/releases/115.1.0esr/source/firefox-115.1.0esr.source.tar.xz +wget -c -q https://ftp.mozilla.org/pub/firefox/releases/115.6.0esr/source/firefox-115.6.0esr.source.tar.xz mkdir -p firefox-source -tar xf firefox-115.1.0esr.source.tar.xz -C firefox-source --strip-components=1 # strip the root folder +tar xf firefox-115.6.0esr.source.tar.xz -C firefox-source --strip-components=1 # strip the root folder echo "Done downloading spidermonkey source code" echo "Building spidermonkey" From 72d3e7774b0913bb4893291a58b06544c57259dc Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 11 Jan 2024 16:37:27 -0500 Subject: [PATCH 0151/1086] added node license --- LICENSE | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index e488de74..c4867839 100644 --- a/LICENSE +++ b/LICENSE @@ -72,4 +72,51 @@ products or services of Licensee, or any third party. 8. By copying, installing or otherwise using Python, Licensee agrees to be bound by the terms and conditions of this License -Agreement. \ No newline at end of file +Agreement. + +------------------------------------------------------------------------------- + +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. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node 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. +""" \ No newline at end of file From 390f3da8c098b6a95ebb0715cf905ba632d275e1 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 11 Jan 2024 17:09:28 -0500 Subject: [PATCH 0152/1086] test fix --- tests/python/test_arrays.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 12faadee..7c32674e 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -1482,8 +1482,8 @@ def test_toLocaleString_two_args_invalid_currency(): def test_toLocaleString_with_datetime(): prices = [500, datetime(year=2020, month=1, day=31, hour=13, minute=14, second=31)] result = [None] - pm.eval("(result, arr) => {result[0] = arr.toLocaleString('en', {timeZone: 'UTC'})}")(result, prices) - assert result[0] == '500,1/31/2020, 6:14:31 PM' + pm.eval("(result, arr) => {result[0] = arr.toLocaleString('en-uk')}")(result, prices) + assert result[0] == '500,31/01/2020, 13:14:31' #entries def test_entries_next(): From 0a78d759ba2ee0e29f225becadabcf30c141670f Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 11 Jan 2024 17:14:28 -0500 Subject: [PATCH 0153/1086] restore firefox version --- setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index c718629f..71655d2d 100755 --- a/setup.sh +++ b/setup.sh @@ -39,9 +39,9 @@ $POETRY_BIN self add 'poetry-dynamic-versioning[plugin]' echo "Done installing dependencies" echo "Downloading spidermonkey source code" -wget -c -q https://ftp.mozilla.org/pub/firefox/releases/115.6.0esr/source/firefox-115.6.0esr.source.tar.xz +wget -c -q https://ftp.mozilla.org/pub/firefox/releases/115.1.0esr/source/firefox-115.1.0esr.source.tar.xz mkdir -p firefox-source -tar xf firefox-115.6.0esr.source.tar.xz -C firefox-source --strip-components=1 # strip the root folder +tar xf firefox-115.1.0esr.source.tar.xz -C firefox-source --strip-components=1 # strip the root folder echo "Done downloading spidermonkey source code" echo "Building spidermonkey" From 056419fec8c172ec5818369882bcdb17bf564ea6 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 11 Jan 2024 18:52:47 -0500 Subject: [PATCH 0154/1086] improved mem usage in flatX methods --- src/PyProxyHandler.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index c69c41c0..6f72d906 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -1493,16 +1493,17 @@ static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject global, JS::RootedObject rootedGlobal(cx, global); - JS::RootedValue elementVal(cx); for (uint32_t sourceIndex = 0; sourceIndex < sourceLen; sourceIndex++) { + JS::RootedValue *elementVal = new JS::RootedValue(cx); + if (PyObject_TypeCheck(source, &JSArrayProxyType)) { - JS_GetElement(cx, ((JSArrayProxy *)source)->jsArray, sourceIndex, &elementVal); + JS_GetElement(cx, ((JSArrayProxy *)source)->jsArray, sourceIndex, elementVal); } else if (PyObject_TypeCheck(source, &PyList_Type)) { - elementVal.set(jsTypeFactory(cx, PyList_GetItem(source, sourceIndex))); + elementVal->set(jsTypeFactory(cx, PyList_GetItem(source, sourceIndex))); } - PyObject *element = pyTypeFactory(cx, &rootedGlobal, &elementVal)->getPyObject(); + PyObject *element = pyTypeFactory(cx, &rootedGlobal, elementVal)->getPyObject(); bool shouldFlatten; if (depth > 0) { @@ -1537,7 +1538,7 @@ static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject global, JS::SetArrayLength(cx, rootedRetArray, targetIndex + 1); } - JS_SetElement(cx, rootedRetArray, targetIndex, elementVal); + JS_SetElement(cx, rootedRetArray, targetIndex, *elementVal); targetIndex++; } @@ -1567,14 +1568,16 @@ static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject glo elementVal.set(jsTypeFactory(cx, PyList_GetItem(source, sourceIndex))); } + JS::RootedValue *retVal = new JS::RootedValue(cx); + jArgs[0].set(elementVal); jArgs[1].setInt32(sourceIndex); jArgs[2].set(sourceValue); - if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &retVal)) { + if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, retVal)) { return false; } - PyObject *element = pyTypeFactory(cx, &rootedGlobal, &retVal)->getPyObject(); + PyObject *element = pyTypeFactory(cx, &rootedGlobal, retVal)->getPyObject(); bool shouldFlatten; if (depth > 0) { @@ -1633,7 +1636,7 @@ static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject glo JS::SetArrayLength(cx, rootedRetArray, targetIndex + 1); } - JS_SetElement(cx, rootedRetArray, targetIndex, retVal); + JS_SetElement(cx, rootedRetArray, targetIndex, *retVal); targetIndex++; } From b6963cb466530414ae76efb7611937c5775a8009 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 11 Jan 2024 19:22:50 -0500 Subject: [PATCH 0155/1086] fix memory issue bad rootedobject usage --- src/PyProxyHandler.cc | 53 ++++++++++++++++++++----------------- tests/python/test_arrays.py | 2 +- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index 6f72d906..adeb958f 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -885,7 +885,7 @@ static bool array_forEach(JSContext *cx, unsigned argc, JS::Value *vp) { return false; } - JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue selfValue(cx, jsTypeFactory(cx, self)); JS::RootedValue callBack(cx, callbackfn); JS::Rooted> jArgs(cx); @@ -906,7 +906,7 @@ static bool array_forEach(JSContext *cx, unsigned argc, JS::Value *vp) { } for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { - jArgs[0].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[0].set(jsTypeFactory(cx, PyList_GetItem(self, index))); jArgs[1].setInt32(index); jArgs[2].set(selfValue); @@ -957,7 +957,7 @@ static bool array_map(JSContext *cx, unsigned argc, JS::Value *vp) { JSObject *retArray = JS::NewArrayObject(cx, len); JS::RootedObject rootedRetArray(cx, retArray); - JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue selfValue(cx, jsTypeFactory(cx, self)); JS::RootedValue callBack(cx, callbackfn); JS::Rooted> jArgs(cx); @@ -976,7 +976,7 @@ static bool array_map(JSContext *cx, unsigned argc, JS::Value *vp) { } for (Py_ssize_t index = 0; index < len; index++) { - jArgs[0].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[0].set(jsTypeFactory(cx, PyList_GetItem(self, index))); jArgs[1].setInt32(index); jArgs[2].set(selfValue); @@ -1023,7 +1023,7 @@ static bool array_filter(JSContext *cx, unsigned argc, JS::Value *vp) { return false; } - JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue selfValue(cx, jsTypeFactory(cx, self)); JS::RootedValue callBack(cx, callbackfn); JS::Rooted> jArgs(cx); @@ -1045,7 +1045,7 @@ static bool array_filter(JSContext *cx, unsigned argc, JS::Value *vp) { Py_ssize_t len = PyList_GET_SIZE(self); for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { - JS::Value item = jsTypeFactorySafe(cx, PyList_GetItem(self, index)); + JS::Value item = jsTypeFactory(cx, PyList_GetItem(self, index)); jArgs[0].set(item); jArgs[1].setInt32(index); jArgs[2].set(selfValue); @@ -1100,7 +1100,7 @@ static bool array_reduce(JSContext *cx, unsigned argc, JS::Value *vp) { return false; } - JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue selfValue(cx, jsTypeFactory(cx, self)); JS::RootedValue callBack(cx, callbackfn); JS::Rooted> jArgs(cx); @@ -1121,7 +1121,7 @@ static bool array_reduce(JSContext *cx, unsigned argc, JS::Value *vp) { for (Py_ssize_t index = args.length() > 1 ? 0 : 1; index < len; index++) { jArgs[0].set(*accumulator); - jArgs[1].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[1].set(jsTypeFactory(cx, PyList_GetItem(self, index))); jArgs[2].setInt32(index); jArgs[3].set(selfValue); @@ -1156,7 +1156,7 @@ static bool array_reduceRight(JSContext *cx, unsigned argc, JS::Value *vp) { return false; } - JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue selfValue(cx, jsTypeFactory(cx, self)); JS::RootedValue callBack(cx, callbackfn); JS::Rooted> jArgs(cx); @@ -1177,7 +1177,7 @@ static bool array_reduceRight(JSContext *cx, unsigned argc, JS::Value *vp) { for (int64_t index = args.length() > 1 ? len - 1 : len - 2; index >= 0; index--) { jArgs[0].set(*accumulator); - jArgs[1].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[1].set(jsTypeFactory(cx, PyList_GetItem(self, index))); jArgs[2].setInt32(index); jArgs[3].set(selfValue); @@ -1212,7 +1212,7 @@ static bool array_some(JSContext *cx, unsigned argc, JS::Value *vp) { return false; } - JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue selfValue(cx, jsTypeFactory(cx, self)); JS::RootedValue callBack(cx, callbackfn); JS::Rooted> jArgs(cx); @@ -1232,7 +1232,7 @@ static bool array_some(JSContext *cx, unsigned argc, JS::Value *vp) { Py_ssize_t len = PyList_GET_SIZE(self); for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { - jArgs[0].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[0].set(jsTypeFactory(cx, PyList_GetItem(self, index))); jArgs[1].setInt32(index); jArgs[2].set(selfValue); @@ -1285,7 +1285,7 @@ static bool array_every(JSContext *cx, unsigned argc, JS::Value *vp) { return false; } - JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue selfValue(cx, jsTypeFactory(cx, self)); JS::RootedValue callBack(cx, callbackfn); JS::Rooted> jArgs(cx); @@ -1305,7 +1305,7 @@ static bool array_every(JSContext *cx, unsigned argc, JS::Value *vp) { Py_ssize_t len = PyList_GET_SIZE(self); for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { - jArgs[0].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[0].set(jsTypeFactory(cx, PyList_GetItem(self, index))); jArgs[1].setInt32(index); jArgs[2].set(selfValue); @@ -1358,7 +1358,7 @@ static bool array_find(JSContext *cx, unsigned argc, JS::Value *vp) { return false; } - JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue selfValue(cx, jsTypeFactory(cx, self)); JS::RootedValue callBack(cx, callbackfn); JS::Rooted> jArgs(cx); @@ -1378,7 +1378,7 @@ static bool array_find(JSContext *cx, unsigned argc, JS::Value *vp) { Py_ssize_t len = PyList_GET_SIZE(self); for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { - JS::Value item = jsTypeFactorySafe(cx, PyList_GetItem(self, index)); + JS::Value item = jsTypeFactory(cx, PyList_GetItem(self, index)); jArgs[0].set(item); jArgs[1].setInt32(index); jArgs[2].set(selfValue); @@ -1432,7 +1432,7 @@ static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { return false; } - JS::RootedValue selfValue(cx, jsTypeFactorySafe(cx, self)); + JS::RootedValue selfValue(cx, jsTypeFactory(cx, self)); JS::RootedValue callBack(cx, callbackfn); JS::Rooted> jArgs(cx); @@ -1452,7 +1452,7 @@ static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { Py_ssize_t len = PyList_GET_SIZE(self); for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { - jArgs[0].set(jsTypeFactorySafe(cx, PyList_GetItem(self, index))); + jArgs[0].set(jsTypeFactory(cx, PyList_GetItem(self, index))); jArgs[1].setInt32(index); jArgs[2].set(selfValue); @@ -1489,6 +1489,7 @@ static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject global, JSObject *retArray, PyObject *source, Py_ssize_t sourceLen, uint32_t start, uint32_t depth) { + uint32_t targetIndex = start; JS::RootedObject rootedGlobal(cx, global); @@ -1552,10 +1553,11 @@ static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject glo JSObject *retArray, PyObject *source, Py_ssize_t sourceLen, uint32_t start, uint32_t depth, JS::HandleValue callBack, JS::HandleObject thisArg) { + uint32_t targetIndex = start; JS::RootedObject rootedGlobal(cx, global); - JS::RootedValue sourceValue(cx, jsTypeFactorySafe(cx, source)); + JS::RootedValue sourceValue(cx, jsTypeFactory(cx, source)); JS::Rooted> jArgs(cx); JS::RootedValue elementVal(cx); JS::RootedValue retVal(cx); @@ -1573,7 +1575,7 @@ static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject glo jArgs[0].set(elementVal); jArgs[1].setInt32(sourceIndex); jArgs[2].set(sourceValue); - if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, retVal)) { + if (!JS_CallFunctionValue(cx, thisArg, callBack, jArgs, retVal)) { return false; } @@ -1699,7 +1701,7 @@ static bool array_flatMap(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedValue callBack(cx, callbackfn); - JS::RootedObject *rootedThisArg = nullptr; + JS::RootedObject rootedThisArg(cx); if (args.length() > 1) { JS::Value thisArg = args[1].get(); if (!thisArg.isObjectOrNull()) { @@ -1708,16 +1710,17 @@ static bool array_flatMap(JSContext *cx, unsigned argc, JS::Value *vp) { } // TODO support null, currently gets TypeError - rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + rootedThisArg.set(thisArg.toObjectOrNull()); + } + else { + rootedThisArg.set(nullptr); } JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); JSObject *retArray = JS::NewArrayObject(cx, sourceLen); // min end length - FlattenIntoArrayWithCallBack(cx, *global, retArray, self, sourceLen, 0, 1, callBack, *rootedThisArg); - - delete rootedThisArg; + FlattenIntoArrayWithCallBack(cx, *global, retArray, self, sourceLen, 0, 1, callBack, rootedThisArg); args.rval().setObject(*retArray); return true; diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 7c32674e..3e87f975 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -1418,7 +1418,7 @@ class Counter { } """ )(result, items) - assert result == [0] + assert result == [3] #valueOf def test_valueOf(): From 11dc2d61526ba7c90b67acb241c76a4012455464 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 11 Jan 2024 19:32:26 -0500 Subject: [PATCH 0156/1086] improved test --- tests/python/test_arrays.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 3e87f975..de3279d5 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -1517,8 +1517,9 @@ def test_values_iterator(): items = ['a', 'b', 'c'] result = [7,8,9] pm.eval("(result, arr) => { index = 0; iterator = arr.values(); for (const value of iterator) { result[index] = value; index++;} }")(result, items) + assert result == ['a', 'b', 'c'] assert result is not items - + #constructor property def test_constructor_creates_array(): items = [1,2] From 1015419c8b49a2a6c58843758ef95d7fc9ab7f1c Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 12 Jan 2024 11:49:39 -0500 Subject: [PATCH 0157/1086] fix memory usage, cleanup --- src/PyProxyHandler.cc | 117 +++++++++++++++--------------------- tests/python/test_arrays.py | 2 +- 2 files changed, 51 insertions(+), 68 deletions(-) diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index adeb958f..cd15efab 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -515,6 +515,13 @@ static bool array_sort(JSContext *cx, unsigned argc, JS::Value *vp) { PyList_Sort(self); } else { + JS::Value callbackfn = args[0].get(); + + if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_BAD_SORT_ARG, "sort: callback"); + return false; + } + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); PyObject *pyFunc = pyTypeFactory(cx, global, new JS::RootedValue(cx, args[0].get()))->getPyObject(); @@ -893,7 +900,7 @@ static bool array_forEach(JSContext *cx, unsigned argc, JS::Value *vp) { Py_ssize_t len = PyList_GET_SIZE(self); - JS::RootedObject *rootedThisArg = nullptr; + JS::RootedObject rootedThisArg(cx); if (args.length() > 1) { JS::Value thisArg = args[1].get(); if (!thisArg.isObjectOrNull()) { @@ -902,7 +909,10 @@ static bool array_forEach(JSContext *cx, unsigned argc, JS::Value *vp) { } // TODO support null, currently gets TypeError - rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + rootedThisArg.set(thisArg.toObjectOrNull()); + } + else { + rootedThisArg.set(nullptr); } for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { @@ -911,8 +921,7 @@ static bool array_forEach(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[2].set(selfValue); if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { - delete rootedThisArg; + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { return false; } } @@ -923,10 +932,6 @@ static bool array_forEach(JSContext *cx, unsigned argc, JS::Value *vp) { } } - if (rootedThisArg) { - delete rootedThisArg; - } - args.rval().setUndefined(); return true; } @@ -963,7 +968,7 @@ static bool array_map(JSContext *cx, unsigned argc, JS::Value *vp) { JS::Rooted> jArgs(cx); JS::RootedValue rval(cx); - JS::RootedObject *rootedThisArg = nullptr; + JS::RootedObject rootedThisArg(cx); if (args.length() > 1) { JS::Value thisArg = args[1].get(); if (!thisArg.isObjectOrNull()) { @@ -972,7 +977,10 @@ static bool array_map(JSContext *cx, unsigned argc, JS::Value *vp) { } // TODO support null, currently gets TypeError - rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + rootedThisArg.set(thisArg.toObjectOrNull()); + } + else { + rootedThisArg.set(nullptr); } for (Py_ssize_t index = 0; index < len; index++) { @@ -981,8 +989,7 @@ static bool array_map(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[2].set(selfValue); if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { - delete rootedThisArg; + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { return false; } } @@ -995,10 +1002,6 @@ static bool array_map(JSContext *cx, unsigned argc, JS::Value *vp) { JS_SetElement(cx, rootedRetArray, index, rval); } - if (rootedThisArg) { - delete rootedThisArg; - } - args.rval().setObject(*retArray); return true; } @@ -1031,7 +1034,7 @@ static bool array_filter(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedValueVector retVector(cx); - JS::RootedObject *rootedThisArg = nullptr; + JS::RootedObject rootedThisArg(cx); if (args.length() > 1) { JS::Value thisArg = args[1].get(); if (!thisArg.isObjectOrNull()) { @@ -1040,7 +1043,10 @@ static bool array_filter(JSContext *cx, unsigned argc, JS::Value *vp) { } // TODO support null, currently gets TypeError - rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + rootedThisArg.set(thisArg.toObjectOrNull()); + } + else { + rootedThisArg.set(nullptr); } Py_ssize_t len = PyList_GET_SIZE(self); @@ -1051,8 +1057,7 @@ static bool array_filter(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[2].set(selfValue); if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { - delete rootedThisArg; + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { return false; } } @@ -1069,10 +1074,6 @@ static bool array_filter(JSContext *cx, unsigned argc, JS::Value *vp) { } } - if (rootedThisArg) { - delete rootedThisArg; - } - JS::HandleValueArray jsValueArray(retVector); JSObject *retArray = JS::NewArrayObject(cx, jsValueArray); @@ -1218,7 +1219,7 @@ static bool array_some(JSContext *cx, unsigned argc, JS::Value *vp) { JS::Rooted> jArgs(cx); JS::RootedValue rval(cx); - JS::RootedObject *rootedThisArg = nullptr; + JS::RootedObject rootedThisArg(cx); if (args.length() > 1) { JS::Value thisArg = args[1].get(); if (!thisArg.isObjectOrNull()) { @@ -1227,7 +1228,10 @@ static bool array_some(JSContext *cx, unsigned argc, JS::Value *vp) { } // TODO support null, currently gets TypeError - rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + rootedThisArg.set(thisArg.toObjectOrNull()); + } + else { + rootedThisArg.set(nullptr); } Py_ssize_t len = PyList_GET_SIZE(self); @@ -1237,8 +1241,7 @@ static bool array_some(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[2].set(selfValue); if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { - delete rootedThisArg; + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { return false; } } @@ -1257,10 +1260,6 @@ static bool array_some(JSContext *cx, unsigned argc, JS::Value *vp) { } } - if (rootedThisArg) { - delete rootedThisArg; - } - args.rval().setBoolean(false); return true; } @@ -1291,7 +1290,7 @@ static bool array_every(JSContext *cx, unsigned argc, JS::Value *vp) { JS::Rooted> jArgs(cx); JS::RootedValue rval(cx); - JS::RootedObject *rootedThisArg = nullptr; + JS::RootedObject rootedThisArg(cx); if (args.length() > 1) { JS::Value thisArg = args[1].get(); if (!thisArg.isObjectOrNull()) { @@ -1300,7 +1299,10 @@ static bool array_every(JSContext *cx, unsigned argc, JS::Value *vp) { } // TODO support null, currently gets TypeError - rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + rootedThisArg.set(thisArg.toObjectOrNull()); + } + else { + rootedThisArg.set(nullptr); } Py_ssize_t len = PyList_GET_SIZE(self); @@ -1310,8 +1312,7 @@ static bool array_every(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[2].set(selfValue); if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { - delete rootedThisArg; + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { return false; } } @@ -1322,18 +1323,11 @@ static bool array_every(JSContext *cx, unsigned argc, JS::Value *vp) { } if (!rval.toBoolean()) { - if (rootedThisArg) { - delete rootedThisArg; - } args.rval().setBoolean(false); return true; } } - if (rootedThisArg) { - delete rootedThisArg; - } - args.rval().setBoolean(true); return true; } @@ -1364,7 +1358,7 @@ static bool array_find(JSContext *cx, unsigned argc, JS::Value *vp) { JS::Rooted> jArgs(cx); JS::RootedValue rval(cx); - JS::RootedObject *rootedThisArg = nullptr; + JS::RootedObject rootedThisArg(cx); if (args.length() > 1) { JS::Value thisArg = args[1].get(); if (!thisArg.isObjectOrNull()) { @@ -1373,7 +1367,10 @@ static bool array_find(JSContext *cx, unsigned argc, JS::Value *vp) { } // TODO support null, currently gets TypeError - rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + rootedThisArg.set(thisArg.toObjectOrNull()); + } + else { + rootedThisArg.set(nullptr); } Py_ssize_t len = PyList_GET_SIZE(self); @@ -1384,8 +1381,7 @@ static bool array_find(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[2].set(selfValue); if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { - delete rootedThisArg; + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { return false; } } @@ -1396,18 +1392,11 @@ static bool array_find(JSContext *cx, unsigned argc, JS::Value *vp) { } if (rval.toBoolean()) { - if (rootedThisArg) { - delete rootedThisArg; - } args.rval().set(item); return true; } } - if (rootedThisArg) { - delete rootedThisArg; - } - args.rval().setUndefined(); return true; } @@ -1438,7 +1427,7 @@ static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { JS::Rooted> jArgs(cx); JS::RootedValue rval(cx); - JS::RootedObject *rootedThisArg = nullptr; + JS::RootedObject rootedThisArg(cx); if (args.length() > 1) { JS::Value thisArg = args[1].get(); if (!thisArg.isObjectOrNull()) { @@ -1447,7 +1436,10 @@ static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { } // TODO support null, currently gets TypeError - rootedThisArg = new JS::RootedObject(cx, thisArg.toObjectOrNull()); + rootedThisArg.set(thisArg.toObjectOrNull()); + } + else { + rootedThisArg.set(nullptr); } Py_ssize_t len = PyList_GET_SIZE(self); @@ -1457,8 +1449,7 @@ static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[2].set(selfValue); if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, *rootedThisArg, callBack, jArgs, &rval)) { - delete rootedThisArg; + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { return false; } } @@ -1469,18 +1460,11 @@ static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { } if (rval.toBoolean()) { - if (rootedThisArg) { - delete rootedThisArg; - } args.rval().setInt32(index); return true; } } - if (rootedThisArg) { - delete rootedThisArg; - } - args.rval().setInt32(-1); return true; } @@ -1879,7 +1863,7 @@ static JSClass listIteratorClass = {"ListIterator", JSCLASS_HAS_RESERVED_SLOTS(L static bool iterator_next(JSContext *cx, unsigned argc, JS::Value *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); JS::RootedObject thisObj(cx); - if (!args.computeThis(cx, &thisObj)) return false; // TODO needed ? + if (!args.computeThis(cx, &thisObj)) return false; PyObject *self = JS::GetMaybePtrFromReservedSlot(thisObj, ListIteratorSlotIteratedObject); @@ -1891,7 +1875,6 @@ static bool iterator_next(JSContext *cx, unsigned argc, JS::Value *vp) { if (!JS::ToInt32(cx, rootedNextIndex, &nextIndex) || !JS::ToInt32(cx, rootedItemKind, &itemKind)) return false; JS::RootedObject result(cx, JS_NewPlainObject(cx)); - if (!result) return false; Py_ssize_t len = PyList_GET_SIZE(self); diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index de3279d5..8aea92b1 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -967,7 +967,7 @@ def test_filter_too_few_args(): assert str(type(e)) == "" assert str(e).__contains__("TypeError: filter: At least 1 argument required, but only 0 passed") -#reduce index, array param, wrong arg type, too few args same impl as previous few for all below +#reduce def test_reduce(): items = [1,2,3,4,5] result = [None] From a3efcd8f85fa6777df1112b57dd322a8c5aed8ad Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 12 Jan 2024 17:34:26 -0500 Subject: [PATCH 0158/1086] sort done for lists as arrays --- include/jsTypeFactory.hh | 9 - src/JSArrayProxy.cc | 31 ++-- src/PyProxyHandler.cc | 317 ++++++++++++++++++++++++++---------- src/jsTypeFactory.cc | 19 --- tests/python/test_arrays.py | 58 +++++-- 5 files changed, 294 insertions(+), 140 deletions(-) diff --git a/include/jsTypeFactory.hh b/include/jsTypeFactory.hh index 23339c54..1ae6b131 100644 --- a/include/jsTypeFactory.hh +++ b/include/jsTypeFactory.hh @@ -38,15 +38,6 @@ size_t UCS4ToUTF16(const uint32_t *chars, size_t length, uint16_t *outStr); */ JS::Value jsTypeFactory(JSContext *cx, PyObject *object); -/** - * @brief Function that takes a PyObject and returns a corresponding JS::Value which is a copy, not a reference - * - * @param cx - Pointer to the JSContext - * @param object - Pointer to the PyListObject - * @return JS::Value - A JS::Value corresponding to the PyType - */ -JS::Value jsTypeFactoryCopy(JSContext *cx, PyObject *object); - /** * @brief same to jsTypeFactory, but it's guaranteed that no error would be set on the Python error stack, instead * return JS `null` on error, and output a warning in Python-land diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index f127c165..0d2c3c84 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -1085,17 +1085,17 @@ static bool sort_compare_key_func(JSContext *cx, unsigned argc, JS::Value *vp) { bool reverse = reverseValue.toBoolean(); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(&args.callee())); + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(&args.callee())); - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX, args[0]); - PyObject *args_0 = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + JS::RootedValue *elementVal = new JS::RootedValue(cx, args[0]); + PyObject *args_0 = pyTypeFactory(cx, global, elementVal)->getPyObject(); PyObject *args_0_result = PyObject_CallFunction(keyfunc, "O", args_0); if (!args_0_result) { return false; } - elementVal = new JS::RootedValue(GLOBAL_CX, args[1]); - PyObject *args_1 = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + elementVal = new JS::RootedValue(cx, args[1]); + PyObject *args_1 = pyTypeFactory(cx, global, elementVal)->getPyObject(); PyObject *args_1_result = PyObject_CallFunction(keyfunc, "O", args_1); if (!args_1_result) { return false; @@ -1135,13 +1135,13 @@ static bool sort_compare_default(JSContext *cx, unsigned argc, JS::Value *vp) { } bool reverse = reverseValue.toBoolean(); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(&args.callee())); + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(&args.callee())); - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX, args[0]); - PyObject *args_0 = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + JS::RootedValue *elementVal = new JS::RootedValue(cx, args[0]); + PyObject *args_0 = pyTypeFactory(cx, global, elementVal)->getPyObject(); - elementVal = new JS::RootedValue(GLOBAL_CX, args[1]); - PyObject *args_1 = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + elementVal = new JS::RootedValue(cx, args[1]); + PyObject *args_1 = pyTypeFactory(cx, global, elementVal)->getPyObject(); int cmp = PyObject_RichCompareBool(args_0, args_1, Py_LT); if (cmp > 0) { @@ -1251,6 +1251,17 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P } return NULL; } + + // cleanup + if (!JS_DeleteProperty(GLOBAL_CX, funObj, "_key_func_param")) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } + + if (!JS_DeleteProperty(GLOBAL_CX, funObj, "_reverse_param")) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } } else { // two-arg js-style diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index cd15efab..774e43d8 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -499,88 +499,6 @@ static bool array_splice(JSContext *cx, unsigned argc, JS::Value *vp) { return true; } -static bool array_sort(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); - if (!proxy) { - return false; - } - PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - - uint64_t selfLength = (uint64_t)PyList_GET_SIZE(self); - - if (selfLength > 0) { - if (args.length() < 1) { - PyList_Sort(self); - } - else { - JS::Value callbackfn = args[0].get(); - - if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { - JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_BAD_SORT_ARG, "sort: callback"); - return false; - } - - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - - PyObject *pyFunc = pyTypeFactory(cx, global, new JS::RootedValue(cx, args[0].get()))->getPyObject(); - // check if JS or Python function - if (PyFunction_Check(pyFunc)) { - // it's a user-defined python function, more than 1-arg will get TypeError - PyObject *callable = PyObject_GetAttrString(self, "sort"); - if (callable == NULL) { - return false; - } - PyObject *result = PyObject_Call(callable, PyTuple_New(0), Py_BuildValue("{s:O}", "key", pyFunc)); - if (!result) { - return false; - } - } else { - // it's either a JS function or a builtin python func - int flags = PyCFunction_GetFlags(pyFunc); - - if (flags & METH_VARARGS && !(flags & METH_KEYWORDS)) { - // it's a JS func - - // We don't want to put in all the sort code so we'll tolerate the following slight O(n) inefficiency - - // copy to JS for sorting - JS::RootedObject selfCopy(cx, &jsTypeFactoryCopy(cx, self).toObject()); - - // sort - JS::RootedValue jReturnedArray(cx); - JS::HandleValueArray jArgs(args); - if (!JS_CallFunctionName(cx, selfCopy, "sort", jArgs, &jReturnedArray)) { - return false; - } - - // copy back into Python self - for (int index = 0; index < selfLength; index++) { - JS::RootedValue *elementVal = new JS::RootedValue(cx); - JS_GetElement(cx, selfCopy, index, elementVal); - PyList_SetItem(self, index, pyTypeFactory(cx, global, elementVal)->getPyObject()); - } - } else { - // it's a built-in python function, more than 1-arg will get TypeError - PyObject *callable = PyObject_GetAttrString(self, "sort"); - if (callable == NULL) { - return false; - } - PyObject *result = PyObject_Call(callable, PyTuple_New(0), Py_BuildValue("{s:O}", "key", pyFunc)); - if (!result) { - return false; - } - } - } - } - } - - // return ref to self - args.rval().set(jsTypeFactory(cx, self)); - return true; -} - static bool array_fill(JSContext *cx, unsigned argc, JS::Value *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -1252,9 +1170,6 @@ static bool array_some(JSContext *cx, unsigned argc, JS::Value *vp) { } if (rval.toBoolean()) { - if (rootedThisArg) { - delete rootedThisArg; - } args.rval().setBoolean(true); return true; } @@ -1843,6 +1758,238 @@ static bool array_valueOf(JSContext *cx, unsigned argc, JS::Value *vp) { } +////// Sorting + + +static void swapItems(PyObject *list, int i, int j) { + if (i != j) { + PyObject *list_i = PyList_GetItem(list, i); + PyObject *list_j = PyList_GetItem(list, j); + Py_INCREF(list_i); + Py_INCREF(list_j); + PyList_SetItem(list, i, list_j); + PyList_SetItem(list, j, list_i); + } +} + +static int invokeCallBack(PyObject *list, int index, JS::HandleValue leftValue, JSContext *cx, JS::HandleFunction callBack) { + JS::Rooted> jArgs(cx); + + jArgs[0].set(jsTypeFactory(cx, PyList_GetItem(list, index))); + jArgs[1].set(leftValue); + + JS::RootedValue retVal(cx); + if (!JS_CallFunction(cx, nullptr, callBack, jArgs, &retVal)) { + throw "JS_CallFunction failed"; + } + + return retVal.toInt32(); +} + +static void quickSort(PyObject *list, int left, int right, JSContext *cx, JS::HandleFunction callBack) { + if (left >= right) { + // base case + return; + } + + swapItems(list, left, (left + right) / 2); + + JS::RootedValue leftValue(cx, jsTypeFactory(cx, PyList_GetItem(list, left))); + + int last = left; + for (int index = left + 1; index <= right; index++) { + if (invokeCallBack(list, index, leftValue, cx, callBack) < 0) { + swapItems(list, ++last, index); + } + } + + swapItems(list, left, last); + + quickSort(list, left, last - 1, cx, callBack); + + quickSort(list, last + 1, right, cx, callBack); +} + +// private +static bool js_sort_compare_default(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedValue leftVal(cx, args[0]); + JS::RootedValue rightVal(cx, args[1]); + + // check for undefined + if (leftVal.isNullOrUndefined()) { + if (rightVal.isNullOrUndefined()) { + args.rval().setInt32(0); + } + else { + args.rval().setInt32(1); + } + return true; + } + else if (rightVal.isNullOrUndefined()) { + args.rval().setInt32(-1); + return true; + } + + JS::RootedObject leftObject(cx); + if (!JS_ValueToObject(cx, leftVal, &leftObject)) { + return false; + } + JS::RootedValue leftToStringVal(cx); + if (!JS_CallFunctionName(cx, leftObject, "toString", JS::HandleValueArray::empty(), &leftToStringVal)) { + return false; + } + + JS::RootedObject rightObject(cx); + if (!JS_ValueToObject(cx, rightVal, &rightObject)) { + return false; + } + JS::RootedValue rightToStringVal(cx); + if (!JS_CallFunctionName(cx, rightObject, "toString", JS::HandleValueArray::empty(), &rightToStringVal)) { + return false; + } + + int32_t cmpResult; + if (!JS_CompareStrings(cx, leftToStringVal.toString(), rightToStringVal.toString(), &cmpResult)) { + return false; + } + + args.rval().setInt32(cmpResult); + return true; +} + +// private +static bool js_sort_compare_key_func(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject callee(cx, &args.callee()); + + JS::RootedValue keyFunc(cx); + if (!JS_GetProperty(cx, callee, "_key_func_param", &keyFunc)) { + PyErr_Format(PyExc_SystemError, "JSAPI call failed"); + return false; + } + PyObject *keyfunc = (PyObject *)keyFunc.toPrivate(); + + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(&args.callee())); + + JS::RootedValue *elementVal = new JS::RootedValue(cx, args[0]); + PyObject *args_0 = pyTypeFactory(cx, global, elementVal)->getPyObject(); + + elementVal = new JS::RootedValue(cx, args[1]); + PyObject *args_1 = pyTypeFactory(cx, global, elementVal)->getPyObject(); + + PyObject *result = PyObject_CallFunction(keyfunc, "OO", args_0, args_1); + if (!result) { + return false; + } + + if (PyLong_Check(result)) { + args.rval().setInt32((int32_t)PyLong_AsLongLong(result)); + return true; + } + else { + PyErr_Format(PyExc_TypeError, "incorrect compare function return type"); + return false; + } +} + +static bool array_sort(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + Py_ssize_t len = PyList_GET_SIZE(self); + + if (len > 1) { + if (args.length() < 1) { + JS::RootedFunction funObj(cx, JS_NewFunction(cx, js_sort_compare_default, 2, 0, NULL)); + + try { + quickSort(self, 0, len - 1, cx, funObj); + } catch (const char *message) { + return false; + } + } + else { + JS::Value callbackfn = args[0].get(); + + if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_BAD_SORT_ARG, "sort: callback"); + return false; + } + + JS::RootedValue callBack(cx, callbackfn); + + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + + PyObject *pyFunc = pyTypeFactory(cx, global, new JS::RootedValue(cx, args[0].get()))->getPyObject(); + // check if JS or Python function + if (PyFunction_Check(pyFunc)) { + + // it's a user-defined python function, check has two arguments + PyObject *code = PyFunction_GetCode(pyFunc); + if (((PyCodeObject *)code)->co_argcount == 1) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_BAD_SORT_ARG); + return false; + } + else { + JSFunction *compareFun = JS_NewFunction(cx, js_sort_compare_key_func, 2, 0, NULL); + JS::RootedFunction rootedFun(cx, compareFun); + JS::RootedObject rootedFunObj(cx, JS_GetFunctionObject(compareFun)); + + JS::RootedValue privateValue(cx, JS::PrivateValue(pyFunc)); + if (!JS_SetProperty(cx, rootedFunObj, "_key_func_param", privateValue)) { // JS::SetReservedSlot(functionObj, KeyFuncSlot, JS::PrivateValue(keyfunc)); does not work + PyErr_Format(PyExc_SystemError, "JSAPI call failed"); + return NULL; + } + + try { + quickSort(self, 0, len - 1, cx, rootedFun); + } catch (const char *message) { + return false; + } + + // cleanup + if (!JS_DeleteProperty(cx, rootedFunObj, "_key_func_param")) { + PyErr_Format(PyExc_SystemError, "JSAPI call failed"); + return false; + } + } + } else { + // it's either a JS function or a builtin python func + int flags = PyCFunction_GetFlags(pyFunc); + + if (flags & METH_VARARGS && !(flags & METH_KEYWORDS)) { + // it's a user-defined JS func + JS::RootedFunction funObj(cx, JS_ValueToFunction(cx, callBack)); + + try { + quickSort(self, 0, len - 1, cx, funObj); + } catch (const char *message) { + return false; + } + } + else { + // it's a built-in python function + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_BAD_SORT_ARG); + return false; + } + } + } + } + + // return ref to self + args.rval().set(jsTypeFactory(cx, self)); + return true; +} + + // ListIterator diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index a5696eca..3cbf8985 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -200,25 +200,6 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { return returnType; } -JS::Value jsTypeFactoryCopy(JSContext *cx, PyObject *object) { - JS::RootedValue returnType(cx); - if (PyList_Check(object)) { - Py_ssize_t listSize = PyList_Size(object); - JSObject *array = JS::NewArrayObject(cx, listSize); - JS::RootedObject arrayObj(cx, array); - for (Py_ssize_t index = 0; index < listSize; index++) { - JS::RootedValue jsValue(cx, jsTypeFactorySafe(cx, PyList_GetItem(object, index))); - JS_SetElement(cx, arrayObj, index, jsValue); - } - returnType.setObject(*array); - } - else { - returnType.setUndefined(); - } - - return returnType; -} - JS::Value jsTypeFactorySafe(JSContext *cx, PyObject *object) { JS::Value v = jsTypeFactory(cx, object); if (PyErr_Occurred()) { diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 8aea92b1..e037b307 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -684,6 +684,13 @@ def test_sort_empty(): assert result[0] is items assert items == [] +def test_sort_one(): + items = [5] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.sort()}")(result, items) + assert result[0] is items + assert items == [5] + def test_sort_numbers(): items = [4,2,6,7] result = [None] @@ -694,9 +701,27 @@ def test_sort_numbers(): def test_sort_strings(): items = ['Four', 'Three', 'One'] pm.eval("(arr) => {arr.sort()}")(items) - assert items == ['Four', 'One', 'Three'] + assert items == ['Four', 'One', 'Three'] def test_sort_with_two_args_keyfunc(): + items = ['Four', 'Three', 'One'] + def myFunc(e, f): + return len(e) - len(f) + pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, myFunc) + assert items == ['One', 'Four', 'Three'] + +def test_sort_with_two_args_keyfunc_wrong_return_type(): + items = ['Four', 'Three', 'One'] + def myFunc(e,f): + return e + f + try: + pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, myFunc) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "incorrect compare function return type" + +def test_sort_with_two_args_keyfunc_wrong_data_type(): items = [4,2,6,7] def myFunc(e,f): return len(e) - len(f) @@ -705,28 +730,27 @@ def myFunc(e,f): assert (False) except Exception as e: assert str(type(e)) == "" - assert str(e).__contains__("myFunc() missing 1 required positional argument: 'f'") + assert str(e) == "object of type 'float' has no len()" def test_sort_with_one_arg_keyfunc(): items = ['Four', 'Three', 'One'] def myFunc(e): return len(e) - pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, myFunc) - assert items == ['One', 'Four', 'Three'] + try: + pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, myFunc) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e).__contains__("invalid Array.prototype.sort argument") def test_sort_with_builtin_keyfunc(): items = ['Four', 'Three', 'One'] - pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, len) - assert items == ['One', 'Four', 'Three'] - -def test_sort_with_builtin_keyfunc_wrong_data_type(): - items = [4,2,6,7] try: pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, len) assert (False) except Exception as e: - assert str(type(e)) == "" - assert str(e).__contains__("object of type 'int' has no len()") + assert str(type(e)) == "" + assert str(e).__contains__("invalid Array.prototype.sort argument") def test_sort_with_js_func(): items = ['Four', 'Three', 'One'] @@ -736,12 +760,12 @@ def test_sort_with_js_func(): assert result[0] is items assert items == ['Four', 'One', 'Three'] -#def test_sort_numbers_tricky(): -# items = [1, 30, 4, 21, 100000] -# result = [None] -# pm.eval("(result, arr) => {result[0] = arr.sort()}")(result, items) -# assert result[0] is items -# assert items == [1, 100000, 21, 30, 4] +def test_sort_numbers_tricky(): + items = [1, 30, 4, 21, 100000] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.sort()}")(result, items) + assert result[0] is items + assert items == [1, 100000, 21, 30, 4] def test_sort_with_js_func_wrong_data_type(): items = [4,2,6,7] From d489be8ac8fc476aa0a929788b84b9416109c948 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 12 Jan 2024 17:36:06 -0500 Subject: [PATCH 0159/1086] cleanup --- include/jsTypeFactory.hh | 1 - 1 file changed, 1 deletion(-) diff --git a/include/jsTypeFactory.hh b/include/jsTypeFactory.hh index 1ae6b131..6ec68412 100644 --- a/include/jsTypeFactory.hh +++ b/include/jsTypeFactory.hh @@ -37,7 +37,6 @@ size_t UCS4ToUTF16(const uint32_t *chars, size_t length, uint16_t *outStr); * @return JS::Value - A JS::Value corresponding to the PyType */ JS::Value jsTypeFactory(JSContext *cx, PyObject *object); - /** * @brief same to jsTypeFactory, but it's guaranteed that no error would be set on the Python error stack, instead * return JS `null` on error, and output a warning in Python-land From 931e772d436940b0370bee102a1c22f0247d3de1 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 12 Jan 2024 17:42:45 -0500 Subject: [PATCH 0160/1086] logic cleanup --- src/PyProxyHandler.cc | 78 ++++++++----------------------------------- 1 file changed, 14 insertions(+), 64 deletions(-) diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index 774e43d8..9ec8165f 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -838,15 +838,8 @@ static bool array_forEach(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[1].setInt32(index); jArgs[2].set(selfValue); - if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { - return false; - } - } - else { - if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { - return false; - } + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { + return false; } } @@ -906,15 +899,8 @@ static bool array_map(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[1].setInt32(index); jArgs[2].set(selfValue); - if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { - return false; - } - } - else { - if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { - return false; - } + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { + return false; } JS_SetElement(cx, rootedRetArray, index, rval); @@ -974,15 +960,8 @@ static bool array_filter(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[1].setInt32(index); jArgs[2].set(selfValue); - if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { - return false; - } - } - else { - if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { - return false; - } + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { + return false; } if (rval.toBoolean()) { @@ -1158,15 +1137,8 @@ static bool array_some(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[1].setInt32(index); jArgs[2].set(selfValue); - if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { - return false; - } - } - else { - if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { - return false; - } + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { + return false; } if (rval.toBoolean()) { @@ -1226,15 +1198,8 @@ static bool array_every(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[1].setInt32(index); jArgs[2].set(selfValue); - if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { - return false; - } - } - else { - if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { - return false; - } + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { + return false; } if (!rval.toBoolean()) { @@ -1295,15 +1260,8 @@ static bool array_find(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[1].setInt32(index); jArgs[2].set(selfValue); - if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { - return false; - } - } - else { - if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { - return false; - } + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { + return false; } if (rval.toBoolean()) { @@ -1363,15 +1321,8 @@ static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { jArgs[1].setInt32(index); jArgs[2].set(selfValue); - if (args.length() > 1) { - if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { - return false; - } - } - else { - if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &rval)) { - return false; - } + if (!JS_CallFunctionValue(cx, rootedThisArg, callBack, jArgs, &rval)) { + return false; } if (rval.toBoolean()) { @@ -1931,7 +1882,6 @@ static bool array_sort(JSContext *cx, unsigned argc, JS::Value *vp) { PyObject *pyFunc = pyTypeFactory(cx, global, new JS::RootedValue(cx, args[0].get()))->getPyObject(); // check if JS or Python function if (PyFunction_Check(pyFunc)) { - // it's a user-defined python function, check has two arguments PyObject *code = PyFunction_GetCode(pyFunc); if (((PyCodeObject *)code)->co_argcount == 1) { From e82e3de751af792860b45e6897d7b4bc9de36c18 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 12 Jan 2024 17:46:54 -0500 Subject: [PATCH 0161/1086] cleanup --- src/PyProxyHandler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index 9ec8165f..6cb048ed 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -1871,7 +1871,7 @@ static bool array_sort(JSContext *cx, unsigned argc, JS::Value *vp) { JS::Value callbackfn = args[0].get(); if (!callbackfn.isObject() || !JS::IsCallable(&callbackfn.toObject())) { - JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_BAD_SORT_ARG, "sort: callback"); + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_BAD_SORT_ARG); return false; } From ff84e703b4e1374db3e4bba3bf4b7fcf797f27ac Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 15 Jan 2024 15:11:13 -0500 Subject: [PATCH 0162/1086] improvements: instanceof Array now works on Python Lists, --- src/PyProxyHandler.cc | 14 +++----------- src/jsTypeFactory.cc | 8 ++++++-- tests/python/test_dicts.py | 10 ++++++---- tests/python/test_list_array.py | 20 +++++++++++++++++++- 4 files changed, 34 insertions(+), 18 deletions(-) diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index 6cb048ed..a8de98f2 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -1737,6 +1737,7 @@ static int invokeCallBack(PyObject *list, int index, JS::HandleValue leftValue, return retVal.toInt32(); } +// Adapted from Kernigan&Ritchie's C book static void quickSort(PyObject *list, int left, int right, JSContext *cx, JS::HandleFunction callBack) { if (left >= right) { // base case @@ -2195,20 +2196,11 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( if (id.isString() && JS_StringEqualsLiteral(cx, id.toString(), "constructor", &isConstructorProperty) && isConstructorProperty) { JS::RootedObject global(cx, JS::GetNonCCWObjectGlobal(proxy)); - JS::RootedValue Array(cx); - if (!JS_GetProperty(cx, global, "Array", &Array)) { + JS::RootedObject rootedArrayPrototype(cx); + if (!JS_GetClassPrototype(cx, JSProto_Array, &rootedArrayPrototype)) { return false; } - JS::RootedObject rootedArray(cx, Array.toObjectOrNull()); - - JS::RootedValue Array_Prototype(cx); - if (!JS_GetProperty(cx, rootedArray, "prototype", &Array_Prototype)) { - return false; - } - - JS::RootedObject rootedArrayPrototype(cx, Array_Prototype.toObjectOrNull()); - JS::RootedValue Array_Prototype_Constructor(cx); if (!JS_GetProperty(cx, rootedArrayPrototype, "constructor", &Array_Prototype_Constructor)) { return false; diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 3cbf8985..79b3c424 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -171,11 +171,15 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { JS::RootedValue v(cx); JSObject *proxy; if (PyList_Check(object)) { - proxy = js::NewProxyObject(cx, new PyListProxyHandler(object), v, NULL); + JS::RootedObject arrayPrototype(cx); + JS_GetClassPrototype(cx, JSProto_Array, &arrayPrototype); // so that instanceof will work, not that prototype methods will + proxy = js::NewProxyObject(cx, new PyListProxyHandler(object), v, arrayPrototype.get()); JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(object)); // Py_INCREF(object); TODO } else { - proxy = js::NewProxyObject(cx, new PyProxyHandler(object), v, NULL); + JS::RootedObject objectPrototype(cx); + JS_GetClassPrototype(cx, JSProto_Object, &objectPrototype); // so that instanceof will work, not that prototype methods will + proxy = js::NewProxyObject(cx, new PyProxyHandler(object), v, objectPrototype.get()); } returnType.setObject(*proxy); } diff --git a/tests/python/test_dicts.py b/tests/python/test_dicts.py index 5e8bd4d2..1be75e61 100644 --- a/tests/python/test_dicts.py +++ b/tests/python/test_dicts.py @@ -133,9 +133,11 @@ def test_eval_objects_jsproxy_inplace_or_true_dict_left(): assert b == {'d': 6.0} assert True == pm.eval("(o) => Object.preventExtensions(o) === o")({ "abc": 1 }) -def test_eval_objects_proxy_proto(): - assert pm.null == pm.eval("(o) => Object.getPrototypeOf(o)")({}) - assert pm.null == pm.eval("(o) => Object.getPrototypeOf(o)")({ "abc": 1 }) +def test_instanceof_object(): + a = {'c':5.0} + result = [None] + pm.eval("(result, obj) => {result[0] = obj instanceof Object}")(result, a) + assert result[0] == True def test_eval_objects_proxy_iterate(): obj = pm.eval("({ a: 123, b: 'test' })") @@ -252,4 +254,4 @@ def test_eval_objects_jsproxy_inplace_or_true_dict_left(): b = pm.eval("({'d':6})") a |= b assert a == {'c': 5.0, 'd': 6.0} - assert b == {'d': 6.0} \ No newline at end of file + assert b == {'d': 6.0} \ No newline at end of file diff --git a/tests/python/test_list_array.py b/tests/python/test_list_array.py index 7d8182e8..476c3adf 100644 --- a/tests/python/test_list_array.py +++ b/tests/python/test_list_array.py @@ -18,4 +18,22 @@ def test_typeof_array(): items = [1, 2, 3] result = [None] pm.eval("(result, arr) => {result[0] = typeof arr}")(result, items) - assert result[0] == 'object' \ No newline at end of file + assert result[0] == 'object' + +def test_instanceof_array(): + items = [1, 2, 3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr instanceof Array}")(result, items) + assert result[0] == True + +def test_instanceof_object(): + items = [1, 2, 3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr instanceof Object}")(result, items) + assert result[0] == True + +def test_not_instanceof_string(): + items = [1, 2, 3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr instanceof String}")(result, items) + assert result[0] == False \ No newline at end of file From 46046c9bbb8fc700744fad2bcb3d5a0464ee7656 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 15 Jan 2024 15:53:25 -0500 Subject: [PATCH 0163/1086] added getBuiltInClass for Dirt proxy --- src/JSObjectProxy.cc | 3 ++- src/PyProxyHandler.cc | 15 ++++++++------- src/jsTypeFactory.cc | 1 - 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index a152550f..7e7e7bec 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -5,7 +5,7 @@ * @version 0.1 * @date 2023-06-26 * - * Copyright (c) 2023 Distributive Corp. + * Copyright (c) 2023-2024 Distributive Corp. * */ @@ -44,6 +44,7 @@ void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) { // TODO (Caleb Aikens): intentional override of PyDict_Type's tp_dealloc. Probably results in leaking dict memory self->jsObject.set(nullptr); + PyObject_GC_UnTrack(self); Py_TYPE(self)->tp_free((PyObject *)self); return; } diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index a8de98f2..0bf9e043 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -158,6 +158,12 @@ bool PyProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, return result.failInvalidDescriptor(); } +bool PyProxyHandler::getBuiltinClass(JSContext *cx, JS::HandleObject proxy, + js::ESClass *cls) const { + *cls = js::ESClass::Object; + return true; +} + bool PyBaseProxyHandler::getPrototypeIfOrdinary(JSContext *cx, JS::HandleObject proxy, bool *isOrdinary, JS::MutableHandleObject protop) const { @@ -2252,12 +2258,7 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( } void PyListProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { - // TODO - // PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - // printf("finalize self=%p\n", self); - // Py_DECREF(self); - - // JS::SetReservedSlot(proxy, PyObjectSlot, nullptr)); + JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(nullptr)); } bool PyListProxyHandler::defineProperty( @@ -2319,7 +2320,7 @@ bool PyListProxyHandler::isArray(JSContext *cx, JS::HandleObject proxy, JS::IsAr return true; } -bool PyListProxyHandler::getBuiltinClass(JSContext *cx, JS::Handle obj, js::ESClass *cls) const { +bool PyListProxyHandler::getBuiltinClass(JSContext *cx, JS::HandleObject proxy, js::ESClass *cls) const { *cls = js::ESClass::Array; return true; } \ No newline at end of file diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 79b3c424..fba294d3 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -175,7 +175,6 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { JS_GetClassPrototype(cx, JSProto_Array, &arrayPrototype); // so that instanceof will work, not that prototype methods will proxy = js::NewProxyObject(cx, new PyListProxyHandler(object), v, arrayPrototype.get()); JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(object)); - // Py_INCREF(object); TODO } else { JS::RootedObject objectPrototype(cx); JS_GetClassPrototype(cx, JSProto_Object, &objectPrototype); // so that instanceof will work, not that prototype methods will From 5020a5e1cdc2532743948872b20d11804cb43c3a Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 15 Jan 2024 15:56:19 -0500 Subject: [PATCH 0164/1086] should have been part of previous commit --- include/PyProxyHandler.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/PyProxyHandler.hh b/include/PyProxyHandler.hh index b95c4778..8bb99af8 100644 --- a/include/PyProxyHandler.hh +++ b/include/PyProxyHandler.hh @@ -165,6 +165,8 @@ public: JS::HandleId id, JS::Handle desc, JS::ObjectOpResult &result) const override; + + bool getBuiltinClass(JSContext *cx, JS::HandleObject proxy, js::ESClass *cls) const override; }; /** @@ -197,7 +199,7 @@ public: bool ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override; bool delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const override; bool isArray(JSContext *cx, JS::HandleObject proxy, JS::IsArrayAnswer *answer) const override; - bool getBuiltinClass(JSContext *cx, JS::Handle obj, js::ESClass *cls) const override; + bool getBuiltinClass(JSContext *cx, JS::HandleObject proxy, js::ESClass *cls) const override; }; /** From 6a558d454b6e816331824f4291031b402cbfb28a Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 16 Jan 2024 15:42:28 -0500 Subject: [PATCH 0165/1086] introduced JSArrayIterProxyType so that jsarrayproxy does not make copies for iteration --- src/JSArrayIterProxy.cc | 71 ++++++++++++++++++++++++ src/JSArrayProxy.cc | 21 +++---- src/modules/pythonmonkey/pythonmonkey.cc | 26 +++++++++ tests/python/test_lists.py | 20 ++++++- 4 files changed, 124 insertions(+), 14 deletions(-) create mode 100644 src/JSArrayIterProxy.cc diff --git a/src/JSArrayIterProxy.cc b/src/JSArrayIterProxy.cc new file mode 100644 index 00000000..07cc7798 --- /dev/null +++ b/src/JSArrayIterProxy.cc @@ -0,0 +1,71 @@ +/** + * @file JSArrayIterProxy.cc + * @author Philippe Laporte (philippe@distributive.network) + * @brief JSArrayIterProxy is a custom C-implemented python type that derives from list iterator + * @date 2024-01-15 + * + * Copyright (c) 2024 Distributive Corp. + * + */ + + +#include "include/JSArrayIterProxy.hh" + +#include "include/JSArrayProxy.hh" + +#include "include/modules/pythonmonkey/pythonmonkey.hh" + +#include "include/pyTypeFactory.hh" + +#include + +#include + + +void JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_dealloc(JSArrayIterProxy *self) +{ + Py_XDECREF(self->it.it_seq); + Py_TYPE(self)->tp_free((PyObject *)self); +} + +int JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_traverse(JSArrayIterProxy *self, visitproc visit, void *arg) { + Py_VISIT(self->it.it_seq); + return 0; +} + +PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_iter(JSArrayIterProxy *self) { + Py_INCREF(&self->it); + return (PyObject *)&self->it; +} + +PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_next(JSArrayIterProxy *self) { + PyListObject *seq; + PyObject *item; + + seq = self->it.it_seq; + if (seq == NULL) { + return NULL; + } + + if (self->it.it_index < JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)seq)) { + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index, elementVal); + ++self->it.it_index; + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); + } + + self->it.it_seq = NULL; + Py_DECREF(seq); + return NULL; +} + +PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_len(JSArrayIterProxy *self) { + Py_ssize_t len; + if (self->it.it_seq) { + len = JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)self->it.it_seq) - self->it.it_index; + if (len >= 0) { + return PyLong_FromSsize_t(len); + } + } + return PyLong_FromLong(0); +} \ No newline at end of file diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 0d2c3c84..9f783e2a 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -12,6 +12,8 @@ #include "include/JSArrayProxy.hh" +#include "include/JSArrayIterProxy.hh" + #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/jsTypeFactory.hh" #include "include/pyTypeFactory.hh" @@ -565,19 +567,14 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_iter(JSArrayProxy *self) { - const Py_ssize_t selfLength = JSArrayProxy_length(self); - - PyObject *seq = PyList_New(selfLength); - - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); - for (size_t index = 0; index < selfLength; index++) { - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); - PyList_SET_ITEM(seq, index, pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); + JSArrayIterProxy *iterator = PyObject_GC_New(JSArrayIterProxy, &JSArrayIterProxyType); + if (iterator == NULL) { + return NULL; } - - // Convert to a Python iterator - return PyObject_GetIter(seq); + iterator->it.it_index = 0; + Py_INCREF(self); + iterator->it.it_seq = (PyListObject *)self; + return (PyObject *)iterator; } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_concat(JSArrayProxy *self, PyObject *value) { diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 6bfc106c..9e68c105 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -17,6 +17,7 @@ #include "include/DateType.hh" #include "include/FloatType.hh" #include "include/FuncType.hh" +#include "include/JSArrayIterProxy.hh" #include "include/JSArrayProxy.hh" #include "include/JSObjectProxy.hh" #include "include/PyType.hh" @@ -114,6 +115,22 @@ PyTypeObject JSArrayProxyType = { .tp_new = JSArrayProxyMethodDefinitions::JSArrayProxy_new, }; +PyTypeObject JSArrayIterProxyType = { + .ob_base = PyVarObject_HEAD_INIT(NULL, 0) + .tp_name = "pythonmonkey.JSArrayIterProxy", + .tp_basicsize = sizeof(JSArrayIterProxy), + .tp_itemsize = 0, + .tp_dealloc = (destructor)JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_dealloc, + .tp_getattro = PyObject_GenericGetAttr, + .tp_flags = Py_TPFLAGS_DEFAULT, + .tp_doc = PyDoc_STR("Javascript Array proxy iterator"), + .tp_traverse = (traverseproc)JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_traverse, + .tp_iter = (getiterfunc)JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_iter, + .tp_iternext = (iternextfunc)JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_next, + .tp_methods = JSArrayIterProxy_methods, + .tp_base = &PyListIter_Type +}; + static void cleanup() { delete autoRealm; delete global; @@ -418,6 +435,8 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; if (PyType_Ready(&JSArrayProxyType) < 0) return NULL; + if (PyType_Ready(&JSArrayIterProxyType) < 0) + return NULL; pyModule = PyModule_Create(&pythonmonkey); if (pyModule == NULL) @@ -450,6 +469,13 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; } + Py_INCREF(&JSArrayIterProxyType); + if (PyModule_AddObject(pyModule, "JSArrayIterProxy", (PyObject *)&JSArrayIterProxyType) < 0) { + Py_DECREF(&JSArrayIterProxyType); + Py_DECREF(pyModule); + return NULL; + } + if (PyModule_AddObject(pyModule, "SpiderMonkeyError", SpiderMonkeyError)) { Py_DECREF(pyModule); return NULL; diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index 0942e8b2..674e5e27 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -1,4 +1,5 @@ import pythonmonkey as pm +from functools import reduce def test_eval_lists(): d = [1] @@ -805,10 +806,25 @@ def iter_max(): b = max(a) assert b == 9 -def iter_op(): +def iter_for(): a = pm.eval("(['this is a test', 'another test'])") b = [item.upper() for item in a] - assert b == ['THIS IS A TEST', 'ANOTHER TEST'] + assert b == ['THIS IS A TEST', 'ANOTHER TEST'] + +def test_reduce(): + a = pm.eval("([1, 3, 5, 6, 2])") + result = reduce(lambda a, b: a+b, a) + assert result == 17 + +def test_iter_next(): + a = pm.eval("([1, 3, 5, 6, 2])") + iterator = iter(a) + try: + while True: + element = next(iterator) + assert(False) + except StopIteration: + assert(True) # slice subscript def test_slice_full_array_single_subscript(): From 3e2416d95f62a3236a3a2b866a872107a47a3059 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 16 Jan 2024 15:43:45 -0500 Subject: [PATCH 0166/1086] should have been part of previous commit --- include/JSArrayIterProxy.hh | 101 ++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 include/JSArrayIterProxy.hh diff --git a/include/JSArrayIterProxy.hh b/include/JSArrayIterProxy.hh new file mode 100644 index 00000000..08c237d0 --- /dev/null +++ b/include/JSArrayIterProxy.hh @@ -0,0 +1,101 @@ +/** + * @file JSArrayIterProxy.hh + * @author Philippe Laporte (philippe@distributive.network) + * @brief JSArrayIterProxy is a custom C-implemented python type that derives from PyListIter + * @version 0.1 + * @date 2024-01-15 + * + * Copyright (c) 2024 Distributive Corp. + * + */ + +#ifndef PythonMonkey_JSArrayIterProxy_ +#define PythonMonkey_JSArrayIterProxy_ + + +#include + +#include + + +// redeclare hidden type +typedef struct { + PyObject_HEAD + Py_ssize_t it_index; + PyListObject *it_seq; /* Set to NULL when iterator is exhausted */ +} PyListIterObject; + +/** + * @brief The typedef for the backing store that will be used by JSArrayIterProxy objects. + * + */ +typedef struct { + PyListIterObject it; +} JSArrayIterProxy; + +/** + * @brief This struct is a bundle of methods used by the JSArrayProxy type + * + */ +struct JSArrayIterProxyMethodDefinitions { +public: + /** + * @brief Deallocation method (.tp_dealloc), removes the reference to the underlying JSObject before freeing the JSArrayProxy + * + * @param self - The JSArrayIterProxy to be free'd + */ + static void JSArrayIterProxy_dealloc(JSArrayIterProxy *self); + + /** + * @brief .tp_traverse method + * + * @param self - The JSArrayIterProxy + * @param visitproc - The function to be applied on each element of the list + * @param arg - The argument to the visit function + * @return 0 on success + */ + static int JSArrayIterProxy_traverse(JSArrayIterProxy *self, visitproc visit, void *arg); + + /** + * @brief .tp_iter method + * + * @param self - The JSArrayIterProxy + * @return PyObject* - an interator over the iterator + */ + static PyObject *JSArrayIterProxy_iter(JSArrayIterProxy *self); + + /** + * @brief .tp_next method + * + * @param self - The JSArrayIterProxy + * @return PyObject* - next object in iteration + */ + static PyObject *JSArrayIterProxy_next(JSArrayIterProxy *self); + + /** + * @brief length method + * + * @param self - The JSArrayIterProxy + * @return PyObject* - number of objects left to iterate over in iteration + */ + static PyObject *JSArrayIterProxy_len(JSArrayIterProxy *self); +}; + + +PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it))."); + +/** + * @brief Struct for the other methods + * + */ +static PyMethodDef JSArrayIterProxy_methods[] = { + {"__length_hint__", (PyCFunction)JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_len, METH_NOARGS, length_hint_doc}, + {NULL, NULL} /* sentinel */ +}; + +/** + * @brief Struct for the JSArrayProxyType, used by all JSArrayProxy objects + */ +extern PyTypeObject JSArrayIterProxyType; + +#endif \ No newline at end of file From 694baea0efe308029c7034a03146e28a5a8dbe6d Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 16 Jan 2024 16:26:01 -0500 Subject: [PATCH 0167/1086] test fix --- tests/python/test_lists.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index 674e5e27..d21dbc08 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -1029,6 +1029,12 @@ def test_slice_assign_partial_array_negative_start_negative_stop(): a[-5:-1:2] = [7,8] assert a == [1, 7, 3, 8, 5, 6] +def test_slice_assign_pm_array_step_2(): + a = pm.eval("([1,2,3,4,5,6])") + b = pm.eval("([1,2,3])") + a[0:10:2] = b + assert a == [1, 2, 2, 4, 3, 6] + def test_slice_assign_own_array_no_match(): a = pm.eval("([1,2,3,4,5,6])") try: @@ -1038,8 +1044,4 @@ def test_slice_assign_own_array_no_match(): assert str(type(e)) == "" assert str(e) == "attempt to assign sequence of size 0 to extended slice of size 2" -def test_slice_assign_pm_array_step_2(): - a = pm.eval("([1,2,3,4,5,6])") - b = pm.eval("([1,2,3])") - a[0:10:2] = b - assert a == [1, 2, 2, 4, 3, 6] \ No newline at end of file + \ No newline at end of file From 05e942eddbf19fa7e1e40aaf8e862f8c19e2f169 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 16 Jan 2024 16:32:19 -0500 Subject: [PATCH 0168/1086] cleanup --- src/JSArrayIterProxy.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/JSArrayIterProxy.cc b/src/JSArrayIterProxy.cc index 07cc7798..183edad1 100644 --- a/src/JSArrayIterProxy.cc +++ b/src/JSArrayIterProxy.cc @@ -39,10 +39,7 @@ PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_iter(JSArrayIterPr } PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_next(JSArrayIterProxy *self) { - PyListObject *seq; - PyObject *item; - - seq = self->it.it_seq; + PyListObject *seq = self->it.it_seq; if (seq == NULL) { return NULL; } From e0ad780f1c73017f0b05f926792a1c8818a6ec61 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 16 Jan 2024 16:42:28 -0500 Subject: [PATCH 0169/1086] test experiment --- tests/python/test_lists.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index d21dbc08..8e012ea9 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -917,11 +917,11 @@ def test_slice_assign_own_array(): a[2:4] = a assert a == [1,2,1,2,3,4,5,6,5,6] -def test_slice_assign_pm_array(): - a = pm.eval("([1,2,3,4,5,6])") - b = pm.eval("([7,8])") - a[2:4] = b - assert a == [1,2,7,8,5,6] +#def test_slice_assign_pm_array(): +# a = pm.eval("([1,2,3,4,5,6])") +# b = pm.eval("([7,8])") +# a[2:4] = b +# assert a == [1,2,7,8,5,6] def test_slice_assign_wrong_type(): a = pm.eval('([1,2,3,4])') @@ -1029,11 +1029,11 @@ def test_slice_assign_partial_array_negative_start_negative_stop(): a[-5:-1:2] = [7,8] assert a == [1, 7, 3, 8, 5, 6] -def test_slice_assign_pm_array_step_2(): - a = pm.eval("([1,2,3,4,5,6])") - b = pm.eval("([1,2,3])") - a[0:10:2] = b - assert a == [1, 2, 2, 4, 3, 6] +#def test_slice_assign_pm_array_step_2(): +# a = pm.eval("([1,2,3,4,5,6])") +# b = pm.eval("([1,2,3])") +# a[0:10:2] = b +# assert a == [1, 2, 2, 4, 3, 6] def test_slice_assign_own_array_no_match(): a = pm.eval("([1,2,3,4,5,6])") From 498e917b6ae3cf34af3996f0a7414370b48da0d8 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 16 Jan 2024 17:19:48 -0500 Subject: [PATCH 0170/1086] revert test changes --- tests/python/test_lists.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index 8e012ea9..674e5e27 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -917,11 +917,11 @@ def test_slice_assign_own_array(): a[2:4] = a assert a == [1,2,1,2,3,4,5,6,5,6] -#def test_slice_assign_pm_array(): -# a = pm.eval("([1,2,3,4,5,6])") -# b = pm.eval("([7,8])") -# a[2:4] = b -# assert a == [1,2,7,8,5,6] +def test_slice_assign_pm_array(): + a = pm.eval("([1,2,3,4,5,6])") + b = pm.eval("([7,8])") + a[2:4] = b + assert a == [1,2,7,8,5,6] def test_slice_assign_wrong_type(): a = pm.eval('([1,2,3,4])') @@ -1029,12 +1029,6 @@ def test_slice_assign_partial_array_negative_start_negative_stop(): a[-5:-1:2] = [7,8] assert a == [1, 7, 3, 8, 5, 6] -#def test_slice_assign_pm_array_step_2(): -# a = pm.eval("([1,2,3,4,5,6])") -# b = pm.eval("([1,2,3])") -# a[0:10:2] = b -# assert a == [1, 2, 2, 4, 3, 6] - def test_slice_assign_own_array_no_match(): a = pm.eval("([1,2,3,4,5,6])") try: @@ -1044,4 +1038,8 @@ def test_slice_assign_own_array_no_match(): assert str(type(e)) == "" assert str(e) == "attempt to assign sequence of size 0 to extended slice of size 2" - \ No newline at end of file +def test_slice_assign_pm_array_step_2(): + a = pm.eval("([1,2,3,4,5,6])") + b = pm.eval("([1,2,3])") + a[0:10:2] = b + assert a == [1, 2, 2, 4, 3, 6] \ No newline at end of file From 654ddd935251346235e37b6b17e4402f385d586d Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Wed, 17 Jan 2024 15:14:13 -0500 Subject: [PATCH 0171/1086] feat(JSStringProxy): implement JSStringProxy, as well as replace memoizePyTypeAndGCThing with a FinalizationRegistry --- README.md | 4 +- include/JSFunctionProxy.hh | 7 ++ include/JSMethodProxy.hh | 7 ++ include/JSStringProxy.hh | 33 ++++++ include/PyProxyHandler.hh | 2 + include/modules/pythonmonkey/pythonmonkey.hh | 22 +--- src/JSFunctionProxy.cc | 6 + src/JSMethodProxy.cc | 6 + src/PyProxyHandler.cc | 14 ++- src/StrType.cc | 5 +- src/jsTypeFactory.cc | 35 ++++-- src/modules/pythonmonkey/pythonmonkey.cc | 113 ++++++++---------- src/pyTypeFactory.cc | 3 - tests/python/test_event_loop.py | 2 +- tests/python/test_functions_this.py | 117 +++++++++++++++++++ 15 files changed, 274 insertions(+), 102 deletions(-) create mode 100644 include/JSStringProxy.hh create mode 100644 tests/python/test_functions_this.py diff --git a/README.md b/README.md index 348cceb6..a46b9194 100644 --- a/README.md +++ b/README.md @@ -241,11 +241,11 @@ that if you update an object in JavaScript, the corresponding Dict in Python wil | JavaScript Type | Python Type | |:---------------------|:----------------| -| string | String +| string | pythonmonkey.JSStringProxy (String) | number | Float | bigint | pythonmonkey.bigint (Integer) | boolean | Bool -| function | Function +| function | pythonmonkey.JSFunctionProxy || pythonmonkey.JSMethodProxy (Function || Method) | object - most | pythonmonkey.JSObjectProxy (Dict) | object - Date | datetime | object - Array | List diff --git a/include/JSFunctionProxy.hh b/include/JSFunctionProxy.hh index 732ddad2..a73ae6ea 100644 --- a/include/JSFunctionProxy.hh +++ b/include/JSFunctionProxy.hh @@ -30,6 +30,13 @@ typedef struct { */ struct JSFunctionProxyMethodDefinitions { public: +/** + * @brief Deallocation method (.tp_dealloc), removes the reference to the underlying JSFunction before freeing the JSFunctionProxy + * + * @param self - The JSFunctionProxy to be free'd + */ + static void JSFunctionProxy_dealloc(JSFunctionProxy *self); + /** * @brief New method (.tp_new), creates a new instance of the JSFunctionProxy type, exposed as the __new()__ method in python * diff --git a/include/JSMethodProxy.hh b/include/JSMethodProxy.hh index a364027e..f08bd81b 100644 --- a/include/JSMethodProxy.hh +++ b/include/JSMethodProxy.hh @@ -33,6 +33,13 @@ typedef struct { */ struct JSMethodProxyMethodDefinitions { public: +/** + * @brief Deallocation method (.tp_dealloc), removes the reference to the underlying JSFunction before freeing the JSMethodProxy + * + * @param self - The JSMethodProxy to be free'd + */ + static void JSMethodProxy_dealloc(JSMethodProxy *self); + /** * @brief New method (.tp_new), creates a new instance of the JSMethodProxy type, exposed as the __new()__ method in python * diff --git a/include/JSStringProxy.hh b/include/JSStringProxy.hh new file mode 100644 index 00000000..135eac6f --- /dev/null +++ b/include/JSStringProxy.hh @@ -0,0 +1,33 @@ +/** + * @file JSStringProxy.hh + * @author Caleb Aikens (caleb@distributive.network) + * @brief JSStringProxy is a custom C-implemented python type that derives from str. It acts as a proxy for JSStrings from Spidermonkey, and behaves like a str would. + * @version 0.1 + * @date 2024-01-03 + * + * Copyright (c) 2024 Distributive Corp. + * + */ + +#ifndef PythonMonkey_JSStringProxy_ +#define PythonMonkey_JSStringProxy_ + +#include + +#include + +/** + * @brief The typedef for the backing store that will be used by JSStringProxy objects. All it contains is a pointer to the JSString + * + */ +typedef struct { + PyUnicodeObject str; + JS::PersistentRootedValue jsString; +} JSStringProxy; + +/** + * @brief Struct for the JSStringProxyType, used by all JSStringProxy objects + */ +extern PyTypeObject JSStringProxyType; + +#endif \ No newline at end of file diff --git a/include/PyProxyHandler.hh b/include/PyProxyHandler.hh index f3480224..19976f41 100644 --- a/include/PyProxyHandler.hh +++ b/include/PyProxyHandler.hh @@ -293,6 +293,8 @@ public: PyListProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; static const char family; + void finalize(JS::GCContext *gcx, JSObject *proxy) const override; + bool getOwnPropertyDescriptor( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::MutableHandle> desc diff --git a/include/modules/pythonmonkey/pythonmonkey.hh b/include/modules/pythonmonkey/pythonmonkey.hh index 22e08e5d..7f964bce 100644 --- a/include/modules/pythonmonkey/pythonmonkey.hh +++ b/include/modules/pythonmonkey/pythonmonkey.hh @@ -24,6 +24,7 @@ #define PythonMonkey_BigInt PyObject_GetAttrString(PyState_FindModule(&pythonmonkey), "bigint") /**< macro for pythonmonkey.bigint class object */ extern JSContext *GLOBAL_CX; /**< pointer to PythonMonkey's JSContext */ +extern JS::PersistentRootedObject *jsFunctionRegistry; /** *global; /**< pointer to the global object of PythonMonkey's JSContext */ static JSAutoRealm *autoRealm; /**< pointer to PythonMonkey's AutoRealm */ static JobQueue *JOB_QUEUE; /**< pointer to PythonMonkey's event-loop job queue */ @@ -34,27 +35,6 @@ static JobQueue *JOB_QUEUE; /**< pointer to PythonMonkey's event-loop job queue */ static void cleanup(); -/** - * @brief This function is used to memoize PyTypes and GCThings that use the same backing store for their data, - * so that the JS garbage collector doesn't collect memory still in use by Python. It does this by storing the - * pointers in an unordered_map, with the key being the PyType pointer, and the value being a vector of GCThing - * pointers. - * - * @param pyType - Pointer to the PyType to be memoized - * @param GCThing - Pointer to the GCThing to be memoized - */ -void memoizePyTypeAndGCThing(PyType *pyType, JS::Handle GCThing); - -/** - * @brief Callback function passed to JS_SetGCCallback to handle PythonMonkey shared memory - * - * @param cx - Pointer to the JS Context (not used) - * @param status - enum specifying whether the Callback triggered at the beginning or end of the GC Cycle - * @param reason - reason for the GC Cycle - * @param data - - */ -void handleSharedPythonMonkeyMemory(JSContext *cx, JSGCStatus status, JS::GCReason reason, void *data); - /** * @brief Function exposed by the python module that calls the spidermonkey garbage collector * diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc index 7ed8c061..ce2cb93e 100644 --- a/src/JSFunctionProxy.cc +++ b/src/JSFunctionProxy.cc @@ -20,6 +20,12 @@ #include +void JSFunctionProxyMethodDefinitions::JSFunctionProxy_dealloc(JSFunctionProxy *self) +{ + delete self->jsFunc; + return; +} + PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { JSFunctionProxy *self = (JSFunctionProxy *)subtype->tp_alloc(subtype, 0); if (self) { diff --git a/src/JSMethodProxy.cc b/src/JSMethodProxy.cc index 939f0451..f20041dc 100644 --- a/src/JSMethodProxy.cc +++ b/src/JSMethodProxy.cc @@ -20,6 +20,12 @@ #include +void JSMethodProxyMethodDefinitions::JSMethodProxy_dealloc(JSMethodProxy *self) +{ + delete self->jsFunc; + return; +} + PyObject *JSMethodProxyMethodDefinitions::JSMethodProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { JSFunctionProxy *jsFunctionProxy; PyObject *im_self; diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index d1f7cbad..e20a5339 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -144,8 +144,9 @@ bool PyDictProxyHandler::getOwnEnumerablePropertyKeys( return this->ownPropertyKeys(cx, proxy, props); } -// @TODO (Caleb Aikens) implement this -void PyDictProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const {} +void PyDictProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { + Py_DECREF(pyObject); +} bool PyDictProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, @@ -210,6 +211,10 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( return true; } +void PyListProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { + Py_DECREF(pyObject); +} + bool PyListProxyHandler::defineProperty( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::Handle desc, JS::ObjectOpResult &result @@ -374,8 +379,9 @@ bool PyObjectProxyHandler::getOwnEnumerablePropertyKeys( return this->ownPropertyKeys(cx, proxy, props); } -// @TODO (Caleb Aikens) implement this -void PyObjectProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const {} +void PyObjectProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { + Py_DECREF(pyObject); +} bool PyObjectProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, diff --git a/src/StrType.cc b/src/StrType.cc index 44cf0491..dbb43ae4 100644 --- a/src/StrType.cc +++ b/src/StrType.cc @@ -1,6 +1,7 @@ #include "include/StrType.hh" #include "include/PyType.hh" +#include "include/JSStringProxy.hh" #include @@ -56,9 +57,11 @@ StrType::StrType(JSContext *cx, JSString *str) { size_t length = JS::GetLinearStringLength(lstr); - pyObject = (PyObject *)PyObject_New(PyUnicodeObject, &PyUnicode_Type); // new reference + pyObject = (PyObject *)PyObject_New(JSStringProxy, &JSStringProxyType); // new reference Py_INCREF(pyObject); // XXX: Why? + ((JSStringProxy *)pyObject)->jsString.setString((JSString *)lstr); + // Initialize as legacy string (https://github.com/python/cpython/blob/v3.12.0b1/Include/cpython/unicodeobject.h#L78-L93) // see https://github.com/python/cpython/blob/v3.11.3/Objects/unicodeobject.c#L1230-L1245 PY_UNICODE_OBJECT_HASH(pyObject) = -1; diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index f5d50052..63f3c971 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -39,8 +39,18 @@ #define LOW_SURROGATE_END 0xDFFF #define BMP_END 0x10000 +#include +#include +#include + +#include + +std::unordered_map charToPyObjectMap; // a map of char16_t buffers to their corresponding PyObjects, used when finalizing JSExternalStrings + struct PythonExternalString : public JSExternalStringCallbacks { - void finalize(char16_t *chars) const override {} + void finalize(char16_t *chars) const override { + Py_DECREF(charToPyObjectMap[chars]); + } size_t sizeOfBuffer(const char16_t *chars, mozilla::MallocSizeOf mallocSizeOf) const override { return 0; } @@ -103,12 +113,13 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { break; } case (PyUnicode_2BYTE_KIND): { + charToPyObjectMap[(char16_t *)PyUnicode_2BYTE_DATA(object)] = object; JSString *str = JS_NewExternalString(cx, (char16_t *)PyUnicode_2BYTE_DATA(object), PyUnicode_GET_LENGTH(object), &PythonExternalStringCallbacks); returnType.setString(str); break; } case (PyUnicode_1BYTE_KIND): { - + charToPyObjectMap[(char16_t *)PyUnicode_2BYTE_DATA(object)] = object; JSString *str = JS_NewExternalString(cx, (char16_t *)PyUnicode_1BYTE_DATA(object), PyUnicode_GET_LENGTH(object), &PythonExternalStringCallbacks); /* TODO (Caleb Aikens): this is a hack to set the JSString::LATIN1_CHARS_BIT, because there isnt an API for latin1 JSExternalStrings. * Ideally we submit a patch to Spidermonkey to make this part of their API with the following signature: @@ -122,7 +133,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { break; } } - memoizePyTypeAndGCThing(new StrType(object), returnType); + Py_INCREF(object); } else if (PyMethod_Check(object) || PyFunction_Check(object) || PyCFunction_Check(object)) { // can't determine number of arguments for PyCFunctions, so just assume potentially unbounded @@ -135,12 +146,17 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { JSFunction *jsFunc = js::NewFunctionWithReserved(cx, callPyFunc, nargs, 0, NULL); JS::RootedObject jsFuncObject(cx, JS_GetFunctionObject(jsFunc)); - // We put the address of the PyObject in the JSFunction's 0th private slot so we can access it later js::SetFunctionNativeReserved(jsFuncObject, 0, JS::PrivateValue((void *)object)); returnType.setObject(*jsFuncObject); - memoizePyTypeAndGCThing(new FuncType(object), returnType); Py_INCREF(object); // otherwise the python function object would be double-freed on GC in Python 3.11+ + + // add function to jsFunctionRegistry, to DECREF the PyObject when the JSFunction is finalized + JS::RootedValueArray<2> registerArgs(GLOBAL_CX); + registerArgs[0].setObject(*jsFuncObject); + registerArgs[1].setPrivate(object); + JS::RootedValue ignoredOutVal(GLOBAL_CX); + JS_CallFunctionName(GLOBAL_CX, *jsFunctionRegistry, "register", registerArgs, &ignoredOutVal); } else if (PyExceptionInstance_Check(object)) { JSObject *error = ExceptionType(object).toJsError(cx); @@ -154,7 +170,6 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { BufferType *pmBuffer = new BufferType(object); JSObject *typedArray = pmBuffer->toJsTypedArray(cx); // may return null returnType.setObjectOrNull(typedArray); - memoizePyTypeAndGCThing(pmBuffer, returnType); } else if (PyObject_TypeCheck(object, &JSObjectProxyType)) { returnType.setObject(*((JSObjectProxy *)object)->jsObject); @@ -168,6 +183,12 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { JS::Rooted boundFunction(cx); JS_CallFunctionName(cx, func, "bind", args, &boundFunction); returnType.set(boundFunction); + // add function to jsFunctionRegistry, to DECREF the PyObject when the JSFunction is finalized + JS::RootedValueArray<2> registerArgs(GLOBAL_CX); + registerArgs[0].set(boundFunction); + registerArgs[1].setPrivate(object); + JS::RootedValue ignoredOutVal(GLOBAL_CX); + JS_CallFunctionName(GLOBAL_CX, *jsFunctionRegistry, "register", registerArgs, &ignoredOutVal); } else if (PyObject_TypeCheck(object, &JSFunctionProxyType)) { returnType.setObject(**((JSFunctionProxy *)object)->jsFunc); @@ -192,8 +213,6 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { PromiseType *p = new PromiseType(object); JSObject *promise = p->toJsPromise(cx); // may return null returnType.setObjectOrNull(promise); - // nested awaitables would have already been GCed if finished - // memoizePyTypeAndGCThing(p, returnType); } else { JS::RootedValue v(cx); diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 5b03fc5f..3569451f 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -19,6 +19,7 @@ #include "include/JSFunctionProxy.hh" #include "include/JSMethodProxy.hh" #include "include/JSObjectProxy.hh" +#include "include/JSStringProxy.hh" #include "include/PyType.hh" #include "include/pyTypeFactory.hh" #include "include/StrType.hh" @@ -42,18 +43,20 @@ #include #include -#include -#include - JSContext *GLOBAL_CX; -typedef std::unordered_map *>>::iterator PyToGCIterator; +JS::PersistentRootedObject *jsFunctionRegistry; + +bool functionRegistryCallback(JSContext *cx, unsigned int argc, JS::Value *vp) { + JS::CallArgs callargs = JS::CallArgsFromVp(argc, vp); + Py_DECREF((PyObject *)callargs[0].toPrivate()); + return true; +} + typedef struct { PyObject_HEAD } NullObject; -std::unordered_map *>> PyTypeToGCThing; /**< data structure to hold memoized PyObject & GCThing data for handling GC*/ - static PyTypeObject NullType = { .ob_base = PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "pythonmonkey.null", @@ -90,18 +93,24 @@ PyTypeObject JSObjectProxyType = { .tp_new = JSObjectProxyMethodDefinitions::JSObjectProxy_new, }; +PyTypeObject JSStringProxyType = { + .tp_name = "pythonmonkey.JSStringProxy", + .tp_basicsize = sizeof(JSStringProxy), + .tp_flags = Py_TPFLAGS_DEFAULT + | Py_TPFLAGS_UNICODE_SUBCLASS // https://docs.python.org/3/c-api/typeobj.html#Py_TPFLAGS_LONG_SUBCLASS + | Py_TPFLAGS_BASETYPE, // can be subclassed + .tp_doc = PyDoc_STR("Javascript String value"), + .tp_base = &PyUnicode_Type, // extending the builtin int type +}; + PyTypeObject JSFunctionProxyType = { .ob_base = PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "pythonmonkey.JSFunctionProxy", .tp_basicsize = sizeof(JSFunctionProxy), - // .tp_dealloc = (destructor)JSFunctionProxyMethodDefinitions::JSFunctionProxy_dealloc, - // .tp_repr = (reprfunc)JSFunctionProxyMethodDefinitions::JSFunctionProxy_repr, + .tp_dealloc = (destructor)JSFunctionProxyMethodDefinitions::JSFunctionProxy_dealloc, .tp_call = JSFunctionProxyMethodDefinitions::JSFunctionProxy_call, - // .tp_getattro = (getattrofunc)JSFunctionProxyMethodDefinitions::JSFunctionProxy_get, - // .tp_setattro = (setattrofunc)JSFunctionProxyMethodDefinitions::JSFunctionProxy_assign, .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = PyDoc_STR("Javascript Function proxy object"), - // .tp_iter = (getiterfunc)JSFunctionProxyMethodDefinitions::JSFunctionProxy_iter, .tp_new = JSFunctionProxyMethodDefinitions::JSFunctionProxy_new, }; @@ -109,18 +118,15 @@ PyTypeObject JSMethodProxyType = { .ob_base = PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "pythonmonkey.JSMethodProxy", .tp_basicsize = sizeof(JSMethodProxy), - // .tp_dealloc = (destructor)JSMethodProxyMethodDefinitions::JSMethodProxy_dealloc, - // .tp_repr = (reprfunc)JSMethodProxyMethodDefinitions::JSMethodProxy_repr, + .tp_dealloc = (destructor)JSMethodProxyMethodDefinitions::JSMethodProxy_dealloc, .tp_call = JSMethodProxyMethodDefinitions::JSMethodProxy_call, - // .tp_getattro = (getattrofunc)JSMethodProxyMethodDefinitions::JSMethodProxy_get, - // .tp_setattro = (setattrofunc)JSMethodProxyMethodDefinitions::JSMethodProxy_assign, .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = PyDoc_STR("Javascript Method proxy object"), - // .tp_iter = (getiterfunc)JSMethodProxyMethodDefinitions::JSMethodProxy_iter, .tp_new = JSMethodProxyMethodDefinitions::JSMethodProxy_new, }; static void cleanup() { + delete jsFunctionRegistry; delete autoRealm; delete global; delete JOB_QUEUE; @@ -128,50 +134,6 @@ static void cleanup() { JS_ShutDown(); } -void memoizePyTypeAndGCThing(PyType *pyType, JS::Handle GCThing) { - JS::PersistentRooted *RootedGCThing = new JS::PersistentRooted(GLOBAL_CX, GCThing); - PyToGCIterator pyIt = PyTypeToGCThing.find(pyType); - - if (pyIt == PyTypeToGCThing.end()) { // if the PythonObject is not memoized - std::vector *> gcVector( - {{RootedGCThing}}); - PyTypeToGCThing.insert({{pyType, gcVector}}); - } - else { - pyIt->second.push_back(RootedGCThing); - } -} - -void handleSharedPythonMonkeyMemory(JSContext *cx, JSGCStatus status, JS::GCReason reason, void *data) { - if (status == JSGCStatus::JSGC_BEGIN) { - PyToGCIterator pyIt = PyTypeToGCThing.begin(); - while (pyIt != PyTypeToGCThing.end()) { - PyObject *pyObj = pyIt->first->getPyObject(); - // If the PyObject reference count is exactly 1, then the only reference to the object is the one - // we are holding, which means the object is ready to be free'd. - if (_PyGC_FINALIZED(pyObj) || pyObj->ob_refcnt == 1) { // PyObject_GC_IsFinalized is only available in Python 3.9+ - for (JS::PersistentRooted *rval: pyIt->second) { // for each related GCThing - bool found = false; - for (PyToGCIterator innerPyIt = PyTypeToGCThing.begin(); innerPyIt != PyTypeToGCThing.end(); innerPyIt++) { // for each other PyType pointer - if (innerPyIt != pyIt && std::find(innerPyIt->second.begin(), innerPyIt->second.end(), rval) != innerPyIt->second.end()) { // if the PyType is also related to the GCThing - found = true; - break; - } - } - // if this PyObject is the last PyObject that references this GCThing, then the GCThing can also be free'd - if (!found) { - delete rval; - } - } - pyIt = PyTypeToGCThing.erase(pyIt); - } - else { - pyIt++; - } - } - } -}; - static PyObject *collect(PyObject *self, PyObject *args) { JS_GC(GLOBAL_CX); Py_RETURN_NONE; @@ -387,7 +349,10 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; } - JS::RealmOptions options; + JS::RealmCreationOptions creationOptions = JS::RealmCreationOptions(); + JS::RealmBehaviors behaviours = JS::RealmBehaviors(); + creationOptions.setWeakRefsEnabled(JS::WeakRefSpecifier::EnabledWithCleanupSome); // enable FinalizationRegistry + JS::RealmOptions options = JS::RealmOptions(creationOptions, behaviours); static JSClass globalClass = {"global", JSCLASS_GLOBAL_FLAGS, &JS::DefaultGlobalClassOps}; global = new JS::RootedObject(GLOBAL_CX, JS_NewGlobalObject(GLOBAL_CX, &globalClass, nullptr, JS::FireOnNewGlobalHook, options)); if (!global) { @@ -404,7 +369,6 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) autoRealm = new JSAutoRealm(GLOBAL_CX, *global); - JS_SetGCCallback(GLOBAL_CX, handleSharedPythonMonkeyMemory, NULL); JS_DefineProperty(GLOBAL_CX, *global, "debuggerGlobal", debuggerGlobal, JSPROP_READONLY); // XXX: SpiderMonkey bug??? @@ -422,6 +386,8 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; if (PyType_Ready(&JSObjectProxyType) < 0) return NULL; + if (PyType_Ready(&JSStringProxyType) < 0) + return NULL; if (PyType_Ready(&JSFunctionProxyType) < 0) return NULL; if (PyType_Ready(&JSMethodProxyType) < 0) @@ -451,6 +417,13 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; } + Py_INCREF(&JSStringProxyType); + if (PyModule_AddObject(pyModule, "JSStringProxy", (PyObject *)&JSStringProxyType) < 0) { + Py_DECREF(&JSStringProxyType); + Py_DECREF(pyModule); + return NULL; + } + Py_INCREF(&JSFunctionProxyType); if (PyModule_AddObject(pyModule, "JSFunctionProxy", (PyObject *)&JSFunctionProxyType) < 0) { Py_DECREF(&JSFunctionProxyType); @@ -480,5 +453,21 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; } + // initialize FinalizationRegistry of JSFunctions to Python Functions + JS::RootedValue FinalizationRegistry(GLOBAL_CX); + JS::RootedObject registryObject(GLOBAL_CX); + + JS_GetProperty(GLOBAL_CX, *global, "FinalizationRegistry", &FinalizationRegistry); + JS::Rooted> args(GLOBAL_CX); + JSFunction *registryCallback = JS_NewFunction(GLOBAL_CX, functionRegistryCallback, 1, 0, NULL); + JS::RootedObject registryCallbackObject(GLOBAL_CX, JS_GetFunctionObject(registryCallback)); + args[0].setObject(*registryCallbackObject); + if (!JS::Construct(GLOBAL_CX, FinalizationRegistry, args, ®istryObject)) { + setSpiderMonkeyException(GLOBAL_CX); + return NULL; + } + jsFunctionRegistry = new JS::PersistentRootedObject(GLOBAL_CX); + jsFunctionRegistry->set(registryObject); + return pyModule; } diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index fd07793c..78232474 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -81,7 +81,6 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted } else if (rval->isString()) { StrType *s = new StrType(cx, rval->toString()); - memoizePyTypeAndGCThing(s, *rval); // TODO (Caleb Aikens) consider putting this in the StrType constructor return s; } else if (rval->isSymbol()) { @@ -138,7 +137,6 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted } else { f = new FuncType(cx, *rval); } - memoizePyTypeAndGCThing(f, *rval); // TODO (Caleb Aikens) consider putting this in the FuncType constructor return f; } case js::ESClass::Number: { @@ -155,7 +153,6 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted JS::RootedValue unboxed(cx); js::Unbox(cx, obj, &unboxed); StrType *s = new StrType(cx, unboxed.toString()); - memoizePyTypeAndGCThing(s, *rval); // TODO (Caleb Aikens) consider putting this in the StrType constructor return s; } default: { diff --git a/tests/python/test_event_loop.py b/tests/python/test_event_loop.py index 1377f400..a5d3cc83 100644 --- a/tests/python/test_event_loop.py +++ b/tests/python/test_event_loop.py @@ -167,7 +167,7 @@ async def c(): assert "nested" == await pm.eval("(promise) => promise")(c()) assert "nested" == await pm.eval("(promise) => promise")(await c()) assert "nested" == await pm.eval("(promise) => promise")(await (await c())) - with pytest.raises(TypeError, match="object str can't be used in 'await' expression"): + with pytest.raises(TypeError, match="object pythonmonkey.JSStringProxy can't be used in 'await' expression"): await pm.eval("(promise) => promise")(await (await (await c()))) # Python awaitable throwing exceptions diff --git a/tests/python/test_functions_this.py b/tests/python/test_functions_this.py new file mode 100644 index 00000000..4018470f --- /dev/null +++ b/tests/python/test_functions_this.py @@ -0,0 +1,117 @@ +import pythonmonkey as pm + +def test_python_functions_self(): + def pyFunc(param): + return param + + assert 1 == pyFunc(1) + assert 2 == pm.eval("""(pyFunc) => { + return pyFunc(2); + } + """)(pyFunc) + assert 3 == pm.eval("""(pyFunc) => { + let jsObj = {}; + jsObj.pyFunc = pyFunc; + return pyFunc(3); + } + """)(pyFunc) + +def test_python_methods_self(): + def pyFunc(self, param): + return [self, param] + + class Class: + pass + Class.pyMethod = pyFunc + + pyObj = Class() + result = pyObj.pyMethod(1) + assert pyObj == result[0] and 1 == result[1] + pyMethod = pyObj.pyMethod + result = pyMethod(2) + assert pyObj == result[0] and 2 == result[1] + result = pm.eval("""(pyObj) => { + return pyObj.pyMethod(3); + } + """)(pyObj) + assert pyObj == result[0] and 3 == result[1] + result = pm.eval("""(pyObj) => { + let jsObj = {}; + jsObj.pyMethod = pyObj.pyMethod; + return jsObj.pyMethod(4); + } + """)(pyObj) + assert pyObj == result[0] and 4 == result[1] #pyMethod is bound to pyObj, so `self` is not `jsObj` + result = pm.eval("""(pyObj) => { + let pyMethod = pyObj.pyMethod; + return pyMethod(5); + } + """)(pyObj) + assert pyObj == result[0] and 5 == result[1] #pyMethod is bound to pyObj, so `self` is not `globalThis` + +def test_javascript_functions_this(): + jsFunc = pm.eval(""" + (function(param) { + return [this, param]; + }) + """) + + class Class: + pass + Class.jsFunc = jsFunc # jsFunc is not bound to Class, so `this` will be `globalThis`, not the object + + pyObj = Class() + jsObj = pm.eval("({})") + jsObj.jsFunc = jsFunc + globalThis = pm.eval("globalThis") + result = jsFunc(1) + assert globalThis == result[0] and 1 == result[1] + result = pyObj.jsFunc(2) + assert globalThis == result[0] and 2 == result[1] + result = jsObj.jsFunc(3) + assert globalThis == result[0] and 3 == result[1] # TODO (Caleb Aikens) should `this` be `globalThis` or `jsObj` here? + result = pm.eval("""(jsFunc) => { + return jsFunc(4); + } + """)(jsFunc) + assert globalThis == result[0] and 4 == result[1] + result = pm.eval("""(pyObj) => { + return pyObj.jsFunc(5); + } + """)(pyObj) + assert pyObj == result[0] and 5 == result[1] + result = pm.eval("""(jsObj) => { + return jsObj.jsFunc(6); + } + """)(jsObj) + assert jsObj == result[0] and 6 == result[1] + +def test_JSMethodProxy_this(): + jsFunc = pm.eval(""" + (function(param) { + return [this, param]; + }) + """) + + class Class: + pass + + pyObj = Class() + pyObj.jsMethod = pm.JSMethodProxy(jsFunc, pyObj) # jsMethod is bound to pyObj, so `this` will always be `pyObj` + jsObj = pm.eval("({})") + jsObj.jsMethod = pyObj.jsMethod + globalThis = pm.eval("globalThis") + result = pyObj.jsMethod(1) + assert pyObj == result[0] and 1 == result[1] + result = jsObj.jsMethod(2) + assert pyObj == result[0] and 2 == result[1] + result = pm.eval("""(pyObj) => { + return pyObj.jsMethod(3); + } + """)(pyObj) + assert pyObj == result[0] and 3 == result[1] + result = pm.eval("""(jsObj) => { + return jsObj.jsMethod(4); + } + """)(jsObj) + assert pyObj == result[0] and 4 == result[1] #TODO (Caleb Aikens) should `this` be `pyObj` or `jsObj` here? \ No newline at end of file From 3bcf5b09eaab27e0b16b890d452f3b713bdfffc3 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Fri, 19 Jan 2024 17:37:24 -0500 Subject: [PATCH 0172/1086] support array/list reverse iteration --- include/JSArrayIterProxy.hh | 5 +++-- include/JSArrayProxy.hh | 15 ++++++++++++++- src/JSArrayIterProxy.cc | 23 +++++++++++++++++------ src/JSArrayProxy.cc | 25 +++++++++++++++++++++---- tests/python/test_lists.py | 18 +++++++++++++----- 5 files changed, 68 insertions(+), 18 deletions(-) diff --git a/include/JSArrayIterProxy.hh b/include/JSArrayIterProxy.hh index 08c237d0..a4a9e660 100644 --- a/include/JSArrayIterProxy.hh +++ b/include/JSArrayIterProxy.hh @@ -21,7 +21,8 @@ // redeclare hidden type typedef struct { PyObject_HEAD - Py_ssize_t it_index; + int it_index; + bool reversed; PyListObject *it_seq; /* Set to NULL when iterator is exhausted */ } PyListIterObject; @@ -72,7 +73,7 @@ public: */ static PyObject *JSArrayIterProxy_next(JSArrayIterProxy *self); - /** + /** * @brief length method * * @param self - The JSArrayIterProxy diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh index 0e04b760..911e5edf 100644 --- a/include/JSArrayProxy.hh +++ b/include/JSArrayProxy.hh @@ -115,6 +115,14 @@ public: */ static PyObject *JSArrayProxy_iter(JSArrayProxy *self); + /** + * @brief Return a reverse iterator object to make JSArrayProxy backwards iterable + * + * @param self - The JSArrayProxy + * @return PyObject* - iterator object + */ + static PyObject *JSArrayProxy_iter_reverse(JSArrayProxy *self); + /** * @brief Compute a string representation of the JSArrayProxy * @@ -393,13 +401,18 @@ PyDoc_STRVAR(list_sort__doc__, "\n" "The reverse flag can be set to sort in descending order."); - +PyDoc_STRVAR(list___reversed____doc__, + "__reversed__($self, /)\n" + "--\n" + "\n" + "Return a reverse iterator over the list."); /** * @brief Struct for the other methods * */ static PyMethodDef JSArrayProxy_methods[] = { + {"__reversed__", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_iter_reverse, METH_NOARGS, list___reversed____doc__}, {"clear", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_clear, METH_NOARGS, py_list_clear__doc__}, {"copy", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_copy, METH_NOARGS, list_copy__doc__}, {"append", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_append, METH_O, list_append__doc__}, diff --git a/src/JSArrayIterProxy.cc b/src/JSArrayIterProxy.cc index 183edad1..11e79c68 100644 --- a/src/JSArrayIterProxy.cc +++ b/src/JSArrayIterProxy.cc @@ -24,8 +24,11 @@ void JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_dealloc(JSArrayIterProxy *self) { + // Py_XDECREF(self->it.it_seq); + // Py_TYPE(self)->tp_free((PyObject *)self); + PyObject_GC_UnTrack(self); Py_XDECREF(self->it.it_seq); - Py_TYPE(self)->tp_free((PyObject *)self); + PyObject_GC_Del(self); } int JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_traverse(JSArrayIterProxy *self, visitproc visit, void *arg) { @@ -44,11 +47,19 @@ PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_next(JSArrayIterPr return NULL; } - if (self->it.it_index < JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)seq)) { - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index, elementVal); - ++self->it.it_index; - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); + if (self->it.reversed) { + if (self->it.it_index >= 0) { + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index--, elementVal); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); + } + } + else { + if (self->it.it_index < JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)seq)) { + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index++, elementVal); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); + } } self->it.it_seq = NULL; diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 9f783e2a..65ecf57a 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -57,14 +57,13 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py return NULL; // key is not a str or int } - JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, value); - - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); // look through the methods for dispatch and return key if no method found for (size_t index = 0;; index++) { const char *methodName = JSArrayProxyType.tp_methods[index].ml_name; if (methodName == NULL) { // reached end of list + JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, value); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); } else if (PyUnicode_Check(key)) { @@ -73,6 +72,9 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py } } else { + JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, value); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); } } @@ -571,9 +573,24 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_iter(JSArrayProxy *self) { if (iterator == NULL) { return NULL; } + iterator->it.reversed = false; iterator->it.it_index = 0; Py_INCREF(self); iterator->it.it_seq = (PyListObject *)self; + PyObject_GC_Track(iterator); + return (PyObject *)iterator; +} + +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_iter_reverse(JSArrayProxy *self) { + JSArrayIterProxy *iterator = PyObject_GC_New(JSArrayIterProxy, &JSArrayIterProxyType); + if (iterator == NULL) { + return NULL; + } + iterator->it.reversed = true; + iterator->it.it_index = JSArrayProxyMethodDefinitions::JSArrayProxy_length(self) - 1; + Py_INCREF(self); + iterator->it.it_seq = (PyListObject *)self; + PyObject_GC_Track(iterator); return (PyObject *)iterator; } diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index 674e5e27..6cf817b7 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -472,11 +472,11 @@ def test_extend_with_pm_list(): assert a == [1,2,3,4] # TODO iterable dict -#def test_extend_with_own_dict(): -# a = pm.eval("[1,2]") -# b = pm.eval("{'key':5}") -# a.extend(b) -# assert a == [1,2,"key"] +def test_extend_with_own_dict(): + a = pm.eval("[1,2]") + b = pm.eval("({'key':5, 'key2':6})") + a.extend(b) + assert a == [1,2,"key","key2"] #pop def test_pop_no_arg(): @@ -826,6 +826,14 @@ def test_iter_next(): except StopIteration: assert(True) +#reverse_iter +def iter_reverse(): + a = pm.eval("(['7','9','1','2','3','4','5','6'])") + b = "" + for i in reversed(a): + b += i + assert b == '65432197' + # slice subscript def test_slice_full_array_single_subscript(): a = pm.eval("([1,2,3,4,5,6])") From 73ef136863c167e0a6158c9a96a0e7d4ffbe9a98 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Mon, 22 Jan 2024 12:28:32 -0500 Subject: [PATCH 0173/1086] Iterators do not copy and their methods added --- include/JSObjectItemsProxy.hh | 124 ++++++++ include/JSObjectIterProxy.hh | 109 +++++++ include/JSObjectKeysProxy.hh | 172 ++++++++++ include/JSObjectProxy.hh | 61 ++++ include/JSObjectValuesProxy.hh | 132 ++++++++ src/JSObjectItemsProxy.cc | 113 +++++++ src/JSObjectIterProxy.cc | 122 ++++++++ src/JSObjectKeysProxy.cc | 383 +++++++++++++++++++++++ src/JSObjectProxy.cc | 326 +++++++++++++++---- src/JSObjectValuesProxy.cc | 151 +++++++++ src/modules/pythonmonkey/pythonmonkey.cc | 117 ++++++- tests/python/test_dict_methods.py | 328 +++++++++++++++++++ tests/python/test_dicts.py | 36 ++- 13 files changed, 2102 insertions(+), 72 deletions(-) create mode 100644 include/JSObjectItemsProxy.hh create mode 100644 include/JSObjectIterProxy.hh create mode 100644 include/JSObjectKeysProxy.hh create mode 100644 include/JSObjectValuesProxy.hh create mode 100644 src/JSObjectItemsProxy.cc create mode 100644 src/JSObjectIterProxy.cc create mode 100644 src/JSObjectKeysProxy.cc create mode 100644 src/JSObjectValuesProxy.cc diff --git a/include/JSObjectItemsProxy.hh b/include/JSObjectItemsProxy.hh new file mode 100644 index 00000000..91c8bc72 --- /dev/null +++ b/include/JSObjectItemsProxy.hh @@ -0,0 +1,124 @@ +/** + * @file JSObjectItemsProxy.hh + * @author Philippe Laporte (philippe@distributive.network) + * @brief JSObjectItemsProxy is a custom C-implemented python type that derives from dict items + * @version 0.1 + * @date 2024-01-19 + * + * Copyright (c) 2024 Distributive Corp. + * + */ + +#ifndef PythonMonkey_JSObjectItemsProxy_ +#define PythonMonkey_JSObjectItemsProxy_ + +#include + +#include + + +/** + * @brief The typedef for the backing store that will be used by JSObjectItemsProxy objects + * + */ +typedef struct { + _PyDictViewObject dv; +} JSObjectItemsProxy; + +/** + * @brief This struct is a bundle of methods used by the JSObjectItemsProxy type + * + */ +struct JSObjectItemsProxyMethodDefinitions { +public: + /** + * @brief Deallocation method (.tp_dealloc), removes the reference to the underlying JSObject before freeing the JSObjectItemsProxy + * + * @param self - The JSObjectItemsProxy to be free'd + */ + static void JSObjectItemsProxy_dealloc(JSObjectItemsProxy *self); + + /** + * @brief .tp_traverse method + * + * @param self - The JSObjectItemsProxy + * @param visitproc - The function to be applied on each element of the list + * @param arg - The argument to the visit function + * @return 0 on success + */ + static int JSObjectItemsProxy_traverse(JSObjectItemsProxy *self, visitproc visit, void *arg); + + /** + * @brief Length method (.sq_length), returns the number of key-value pairs in the JSObject, used by the python len() method + * + * @param self - The JSObjectProxy + * @return Py_ssize_t The length of the JSObjectProxy + */ + static Py_ssize_t JSObjectItemsProxy_length(JSObjectItemsProxy *self); + + /** + * @brief Return an iterator object to make JSObjectItemsProxy iterable, emitting (key, value) tuples + * + * @param self - The JSObjectItemsProxy + * @return PyObject* - iterator object + */ + static PyObject *JSObjectItemsProxy_iter(JSObjectItemsProxy *self); + + /** + * @brief Compute a string representation of the JSObjectItemsProxy + * + * @param self - The JSObjectItemsProxy + * @return the string representation (a PyUnicodeObject) on success, NULL on failure + */ + static PyObject *JSObjectItemsProxy_repr(JSObjectItemsProxy *self); + + /** + * @brief reverse iterator method + * + * @param self - The JSObjectItemsProxy + * @return PyObject* The resulting new dict + */ + static PyObject *JSObjectItemsProxy_iter_reverse(JSObjectItemsProxy *self); + + /** + * @brief mapping method + * + * @param self - The JSObjectItemsProxy + * @return PyObject* The resulting new dict + */ + static PyObject *JSObjectItemsProxy_mapping(PyObject *self, void *Py_UNUSED(ignored)); +}; + +/** + * @brief Struct for the methods that define the Sequence protocol + * + */ +static PySequenceMethods JSObjectItemsProxy_sequence_methods = { + .sq_length = (lenfunc)JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_length, + // .sq_contains = TODO tuple support +}; + +PyDoc_STRVAR(items_reversed_keys_doc, + "Return a reverse iterator over the dict keys."); + +/** + * @brief Struct for the other methods + * + */ +static PyMethodDef JSObjectItemsProxy_methods[] = { + // {"isdisjoint"}, // TODO tuple support + {"__reversed__", (PyCFunction)JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_iter_reverse, METH_NOARGS, items_reversed_keys_doc}, + {NULL, NULL} /* sentinel */ +}; + +static PyGetSetDef JSObjectItemsProxy_getset[] = { + {"mapping", JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_mapping, (setter)NULL, "dictionary that this view refers to", NULL}, + {0} +}; + +/** + * @brief Struct for the JSObjectItemsProxyType, used by all JSObjectItemsProxy objects + */ +extern PyTypeObject JSObjectItemsProxyType; + +#endif \ No newline at end of file diff --git a/include/JSObjectIterProxy.hh b/include/JSObjectIterProxy.hh new file mode 100644 index 00000000..6182320f --- /dev/null +++ b/include/JSObjectIterProxy.hh @@ -0,0 +1,109 @@ +/** + * @file JSObjectIterProxy.hh + * @author Philippe Laporte (philippe@distributive.network) + * @brief JSObjectIterProxy is a custom C-implemented python type that derives from PyDictIterKey + * @version 0.1 + * @date 2024-01-17 + * + * Copyright (c) 2024 Distributive Corp. + * + */ + +#ifndef PythonMonkey_JSObjectIterProxy_ +#define PythonMonkey_JSObjectIterProxy_ + + +#include + +#include + +#define KIND_KEYS 0 +#define KIND_VALUES 1 +#define KIND_ITEMS 2 + + +/** + * @brief The typedef for the backing store that will be used by JSObjectIterProxy objects. + * + */ + +typedef struct { + PyObject_HEAD + JS::RootedIdVector *props; + int it_index; + bool reversed; + int kind; + PyDictObject *di_dict; /* Set to NULL when iterator is exhausted */ +} dictiterobject; + + +typedef struct { + dictiterobject it; +} JSObjectIterProxy; + +/** + * @brief This struct is a bundle of methods used by the JSArrayProxy type + * + */ +struct JSObjectIterProxyMethodDefinitions { +public: + /** + * @brief Deallocation method (.tp_dealloc), removes the reference to the underlying JSObject before freeing the JSArrayProxy + * + * @param self - The JSObjectIterProxy to be free'd + */ + static void JSObjectIterProxy_dealloc(JSObjectIterProxy *self); + + /** + * @brief .tp_traverse method + * + * @param self - The JSObjectIterProxy + * @param visitproc - The function to be applied on each element of the list + * @param arg - The argument to the visit function + * @return 0 on success + */ + static int JSObjectIterProxy_traverse(JSObjectIterProxy *self, visitproc visit, void *arg); + + /** + * @brief .tp_iter method + * + * @param self - The JSObjectIterProxy + * @return PyObject* - an interator over the iterator + */ + static PyObject *JSObjectIterProxy_iter(JSObjectIterProxy *self); + + /** + * @brief .tp_next method + * + * @param self - The JSObjectIterProxy + * @return PyObject* - next object in iteration + */ + static PyObject *JSObjectIterProxy_nextkey(JSObjectIterProxy *self); + + /** + * @brief length method + * + * @param self - The JSObjectIterProxy + * @return PyObject* - number of objects left to iterate over in iteration + */ + static PyObject *JSObjectIterProxy_len(JSObjectIterProxy *self); +}; + + +PyDoc_STRVAR(dict_length_hint_doc, "Private method returning an estimate of len(list(it))."); + +/** + * @brief Struct for the other methods + * + */ +static PyMethodDef JSObjectIterProxy_methods[] = { + {"__length_hint__", (PyCFunction)JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_len, METH_NOARGS, dict_length_hint_doc}, + {NULL, NULL} /* sentinel */ +}; + +/** + * @brief Struct for the JSArrayProxyType, used by all JSArrayProxy objects + */ +extern PyTypeObject JSObjectIterProxyType; + +#endif \ No newline at end of file diff --git a/include/JSObjectKeysProxy.hh b/include/JSObjectKeysProxy.hh new file mode 100644 index 00000000..1dea37be --- /dev/null +++ b/include/JSObjectKeysProxy.hh @@ -0,0 +1,172 @@ +/** + * @file JSObjectKeysProxy.hh + * @author Philippe Laporte (philippe@distributive.network) + * @brief JSObjectKeysProxy is a custom C-implemented python type that derives from dict keys + * @version 0.1 + * @date 2024-01-16 + * + * Copyright (c) 2024 Distributive Corp. + * + */ + +#ifndef PythonMonkey_JSObjectKeysProxy_ +#define PythonMonkey_JSObjectKeysProxy_ + +#include + +#include + + +/** + * @brief The typedef for the backing store that will be used by JSObjectKeysProxy objects + * + */ +typedef struct { + _PyDictViewObject dv; +} JSObjectKeysProxy; + +/** + * @brief This struct is a bundle of methods used by the JSObjectKeysProxy type + * + */ +struct JSObjectKeysProxyMethodDefinitions { +public: + /** + * @brief Deallocation method (.tp_dealloc), removes the reference to the underlying JSObject before freeing the JSObjectKeysProxy + * + * @param self - The JSObjectKeysProxy to be free'd + */ + static void JSObjectKeysProxy_dealloc(JSObjectKeysProxy *self); + + /** + * @brief .tp_traverse method + * + * @param self - The JSObjectKeysProxy + * @param visitproc - The function to be applied on each element of the list + * @param arg - The argument to the visit function + * @return 0 on success + */ + static int JSObjectKeysProxy_traverse(JSObjectKeysProxy *self, visitproc visit, void *arg); + + /** + * @brief Length method (.sq_length), returns the number of key-value pairs in the JSObject, used by the python len() method + * + * @param self - The JSObjectProxy + * @return Py_ssize_t The length of the JSObjectProxy + */ + static Py_ssize_t JSObjectKeysProxy_length(JSObjectKeysProxy *self); + + /** + * @brief Test method (.sq_contains), returns whether a key exists, used by the in operator + * + * @param self - The JSObjectKeysProxy + * @param key - The key for the value in the JSObjectKeysProxy + * @return int 1 if `key` is in dict, 0 if not, and -1 on error + */ + static int JSObjectKeysProxy_contains(JSObjectKeysProxy *self, PyObject *key); + + /** + * @brief Comparison method (.tp_richcompare), returns appropriate boolean given a comparison operator and other pyobject + * + * @param self - The JSObjectKeysProxy + * @param other - Any other PyObject + * @param op - Which boolean operator is being performed (Py_EQ for equality, Py_NE for inequality, all other operators are not implemented) + * @return PyObject* - True or false depending on result of comparison + */ + static PyObject *JSObjectKeysProxy_richcompare(JSObjectKeysProxy *self, PyObject *other, int op); + + /** + * @brief Return an iterator object to make JSObjectKeysProxy iterable, emitting (key, value) tuples + * + * @param self - The JSObjectKeysProxy + * @return PyObject* - iterator object + */ + static PyObject *JSObjectKeysProxy_iter(JSObjectKeysProxy *self); + + /** + * @brief Compute a string representation of the JSObjectKeysProxy + * + * @param self - The JSObjectKeysProxy + * @return the string representation (a PyUnicodeObject) on success, NULL on failure + */ + static PyObject *JSObjectKeysProxy_repr(JSObjectKeysProxy *self); + + /** + * @brief Set intersect operation + * + * @param self - The JSObjectKeysProxy + * @param other - The other PyObject to be and'd, expected to be dict or JSObjectKeysProxy + * @return PyObject* The resulting new dict + */ + static PyObject *JSObjectKeysProxy_intersect(JSObjectKeysProxy *self, PyObject *other); + + /** + * @brief Set disjoint method + * + * @param self - The JSObjectKeysProxy + * @param other - The other PyObject to be and'd, expected to be dict or JSObjectKeysProxy + * @return PyObject* The resulting new dict + */ + static PyObject *JSObjectKeysProxy_isDisjoint(JSObjectKeysProxy *self, PyObject *other); + + /** + * @brief reverse iterator method + * + * @param self - The JSObjectKeysProxy + * @param other - The other PyObject to be and'd, expected to be dict or JSObjectKeysProxy + * @return PyObject* The resulting new dict + */ + static PyObject *JSObjectKeysProxy_iter_reverse(JSObjectKeysProxy *self); + + /** + * @brief mapping method + * + * @param self - The JSObjectKeysProxy + * @return PyObject* The resulting new dict + */ + static PyObject *JSObjectKeysProxy_mapping(PyObject *self, void *Py_UNUSED(ignored)); +}; + +/** + * @brief Struct for the methods that define the Sequence protocol + * + */ +static PySequenceMethods JSObjectKeysProxy_sequence_methods = { + .sq_length = (lenfunc)JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_length, + .sq_contains = (objobjproc)JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_contains +}; + +static PyNumberMethods JSObjectKeysProxy_number_methods = { + // .nb_subtract = default is fine + .nb_and = (binaryfunc)JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_intersect, + // .nb_xor = default is fine + // .nb_or = default is fine +}; + +PyDoc_STRVAR(isdisjoint_doc, + "Return True if the view and the given iterable have a null intersection."); + +PyDoc_STRVAR(reversed_keys_doc, + "Return a reverse iterator over the dict keys."); + +/** + * @brief Struct for the other methods + * + */ +static PyMethodDef JSObjectKeysProxy_methods[] = { + {"isdisjoint", (PyCFunction)JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_isDisjoint, METH_O, isdisjoint_doc}, + {"__reversed__", (PyCFunction)JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_iter_reverse, METH_NOARGS, reversed_keys_doc}, + {NULL, NULL} /* sentinel */ +}; + +static PyGetSetDef JSObjectKeysProxy_getset[] = { + {"mapping", JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_mapping, (setter)NULL, "dictionary that this view refers to", NULL}, + {0} +}; + +/** + * @brief Struct for the JSObjectKeysProxyType, used by all JSObjectKeysProxy objects + */ +extern PyTypeObject JSObjectKeysProxyType; + +#endif \ No newline at end of file diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index fe8fe8ce..920a03d5 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -196,10 +196,47 @@ public: * @return PyObject* copy of the dict */ static PyObject *JSObjectProxy_copy_method(JSObjectProxy *self); + + /** + * @brief update method update the dict with another dict or iterable + * + * @param self - The JSObjectProxy + * @param args - arguments to the sort method + * @param nargs - number of arguments to the sort method + * @return None + */ + static PyObject *JSObjectProxy_update_method(JSObjectProxy *self, PyObject *args, PyObject *kwds); + + /** + * @brief keys method + * + * @param self - The JSObjectProxy + * @return PyObject* keys of the dict + */ + static PyObject *JSObjectProxy_keys_method(JSObjectProxy *self); + + /** + * @brief values method + * + * @param self - The JSObjectProxy + * @return PyObject* values view of the dict + */ + static PyObject *JSObjectProxy_values_method(JSObjectProxy *self); + + /** + * @brief items method + * + * @param self - The JSObjectProxy + * @return PyObject* items view of the dict + */ + static PyObject *JSObjectProxy_items_method(JSObjectProxy *self); }; // docs for methods, copied from cpython +PyDoc_STRVAR(getitem__doc__, + "__getitem__($self, key, /)\n--\n\nReturn self[key]."); + PyDoc_STRVAR(dict_get__doc__, "get($self, key, default=None, /)\n" "--\n" @@ -229,6 +266,25 @@ PyDoc_STRVAR(clear__doc__, PyDoc_STRVAR(copy__doc__, "D.copy() -> a shallow copy of D"); +PyDoc_STRVAR(keys__doc__, + "D.keys() -> a set-like object providing a view on D's keys"); +PyDoc_STRVAR(items__doc__, + "D.items() -> a set-like object providing a view on D's items"); +PyDoc_STRVAR(values__doc__, + "D.values() -> an object providing a view on D's values"); + +PyDoc_STRVAR(update__doc__, + "D.update([E, ]**F) -> None. Update D from dict/iterable E and F.\n\ +If E is present and has a .keys() method, then does: for k in E: D[k] = E[k]\n\ +If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v\n\ +In either case, this is followed by: for k in F: D[k] = F[k]"); + +PyDoc_STRVAR(dict_keys__doc__, + "D.keys() -> a set-like object providing a view on D's keys"); +PyDoc_STRVAR(dict_items__doc__, + "D.items() -> a set-like object providing a view on D's items"); +PyDoc_STRVAR(dict_values__doc__, + "D.values() -> an object providing a view on D's values"); /** * @brief Struct for the methods that define the Mapping protocol @@ -258,12 +314,17 @@ static PyNumberMethods JSObjectProxy_number_methods = { * */ static PyMethodDef JSObjectProxy_methods[] = { + {"__getitem__", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_get, METH_O | METH_COEXIST, getitem__doc__}, {"get", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_get_method, METH_FASTCALL, dict_get__doc__}, {"setdefault", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method, METH_FASTCALL, dict_setdefault__doc__}, {"pop", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method, METH_FASTCALL, dict_pop__doc__}, // {"popitem", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_popitem_method, METH_NOARGS, ""}, TODO not popular and quite a bit strange {"clear", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method, METH_NOARGS, clear__doc__}, {"copy", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method, METH_NOARGS, copy__doc__}, + {"update", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_update_method, METH_VARARGS | METH_KEYWORDS, update__doc__}, + {"keys", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_keys_method, METH_NOARGS, dict_keys__doc__}, + {"items", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_items_method, METH_NOARGS, dict_items__doc__}, + {"values", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_values_method, METH_NOARGS, dict_values__doc__}, {NULL, NULL} /* sentinel */ }; diff --git a/include/JSObjectValuesProxy.hh b/include/JSObjectValuesProxy.hh new file mode 100644 index 00000000..238d3066 --- /dev/null +++ b/include/JSObjectValuesProxy.hh @@ -0,0 +1,132 @@ +/** + * @file JSObjectValuesProxy.hh + * @author Philippe Laporte (philippe@distributive.network) + * @brief JSObjectValuesProxy is a custom C-implemented python type that derives from dict values + * @version 0.1 + * @date 2023-06-26 + * + * Copyright (c) 2023 Distributive Corp. + * + */ + +#ifndef PythonMonkey_JSObjectValuesProxy_ +#define PythonMonkey_JSObjectValuesProxy_ + +#include + +#include + + +/** + * @brief The typedef for the backing store that will be used by JSObjectValuesProxy objects + * + */ +typedef struct { + _PyDictViewObject dv; +} JSObjectValuesProxy; + +/** + * @brief This struct is a bundle of methods used by the JSObjectValuesProxy type + * + */ +struct JSObjectValuesProxyMethodDefinitions { +public: + /** + * @brief Deallocation method (.tp_dealloc), removes the reference to the underlying JSObject before freeing the JSObjectValuesProxy + * + * @param self - The JSObjectValuesProxy to be free'd + */ + static void JSObjectValuesProxy_dealloc(JSObjectValuesProxy *self); + + /** + * @brief .tp_traverse method + * + * @param self - The JSObjectValuesProxy + * @param visitproc - The function to be applied on each element of the list + * @param arg - The argument to the visit function + * @return 0 on success + */ + static int JSObjectValuesProxy_traverse(JSObjectValuesProxy *self, visitproc visit, void *arg); + + /** + * @brief Length method (.sq_length), returns the number of key-value pairs in the JSObject, used by the python len() method + * + * @param self - The JSObjectProxy + * @return Py_ssize_t The length of the JSObjectProxy + */ + static Py_ssize_t JSObjectValuesProxy_length(JSObjectValuesProxy *self); + + /** + * @brief Test method (.sq_contains), returns whether a key exists, used by the in operator + * + * @param self - The JSObjectValuesProxy + * @param key - The key for the value in the JSObjectValuesProxy + * @return int 1 if `key` is in dict, 0 if not, and -1 on error + */ + static int JSObjectValuesProxy_contains(JSObjectValuesProxy *self, PyObject *key); + + /** + * @brief Return an iterator object to make JSObjectValuesProxy iterable, emitting (key, value) tuples + * + * @param self - The JSObjectValuesProxy + * @return PyObject* - iterator object + */ + static PyObject *JSObjectValuesProxy_iter(JSObjectValuesProxy *self); + + /** + * @brief Compute a string representation of the JSObjectValuesProxy + * + * @param self - The JSObjectValuesProxy + * @return the string representation (a PyUnicodeObject) on success, NULL on failure + */ + static PyObject *JSObjectValuesProxy_repr(JSObjectValuesProxy *self); + + /** + * @brief reverse iterator method + * + * @param self - The JSObjectValuesProxy + * @return PyObject* The resulting new dict + */ + static PyObject *JSObjectValuesProxy_iter_reverse(JSObjectValuesProxy *self); + + /** + * @brief mapping method + * + * @param self - The JSObjectValuesProxy + * @return PyObject* The resulting new dict + */ + static PyObject *JSObjectValuesProxy_mapping(PyObject *self, void *Py_UNUSED(ignored)); +}; + +/** + * @brief Struct for the methods that define the Sequence protocol + * + */ +static PySequenceMethods JSObjectValuesProxy_sequence_methods = { + .sq_length = (lenfunc)JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_length, + .sq_contains = (objobjproc)JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_contains +}; + +PyDoc_STRVAR(reversed_values_doc, + "Return a reverse iterator over the dict values."); + +/** + * @brief Struct for the other methods + * + */ +static PyMethodDef JSObjectValuesProxy_methods[] = { + {"__reversed__", (PyCFunction)JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_iter_reverse, METH_NOARGS, reversed_values_doc}, + {NULL, NULL} /* sentinel */ +}; + +static PyGetSetDef JSObjectValuesProxy_getset[] = { + {"mapping", JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_mapping, (setter)NULL, "dictionary that this view refers to", NULL}, + {0} +}; + +/** + * @brief Struct for the JSObjectValuesProxyType, used by all JSObjectValuesProxy objects + */ +extern PyTypeObject JSObjectValuesProxyType; + +#endif \ No newline at end of file diff --git a/src/JSObjectItemsProxy.cc b/src/JSObjectItemsProxy.cc new file mode 100644 index 00000000..e75d1980 --- /dev/null +++ b/src/JSObjectItemsProxy.cc @@ -0,0 +1,113 @@ +/** + * @file JSObjectItemsProxy.cc + * @author Philippe Laporte (philippe@distributive.network) + * @brief JSObjectItemsProxy is a custom C-implemented python type that derives from dict keys + * @version 0.1 + * @date 2024-01-19 + * + * Copyright (c) 2024 Distributive Corp. + * + */ + +#include "include/JSObjectItemsProxy.hh" + +#include "include/JSObjectIterProxy.hh" +#include "include/JSObjectProxy.hh" +#include "include/JSArrayProxy.hh" + +#include "include/modules/pythonmonkey/pythonmonkey.hh" +#include "include/jsTypeFactory.hh" +#include "include/pyTypeFactory.hh" +#include "include/PyProxyHandler.hh" + +#include +#include + +#include + +#include + + +void JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_dealloc(JSObjectItemsProxy *self) +{ + PyObject_GC_UnTrack(self); + Py_XDECREF(self->dv.dv_dict); + PyObject_GC_Del(self); +} + +Py_ssize_t JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_length(JSObjectItemsProxy *self) +{ + if (self->dv.dv_dict == NULL) { + return 0; + } + return JSObjectProxyMethodDefinitions::JSObjectProxy_length((JSObjectProxy *)self->dv.dv_dict); +} + +int JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_traverse(JSObjectItemsProxy *self, visitproc visit, void *arg) { + Py_VISIT(self->dv.dv_dict); + return 0; +} + +PyObject *JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_iter(JSObjectItemsProxy *self) { + JSObjectIterProxy *iterator = PyObject_GC_New(JSObjectIterProxy, &JSObjectIterProxyType); + if (iterator == NULL) { + return NULL; + } + iterator->it.reversed = false; + iterator->it.it_index = 0; + iterator->it.kind = KIND_ITEMS; + Py_INCREF(self->dv.dv_dict); + iterator->it.di_dict = self->dv.dv_dict; + iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + // Get **enumerable** own properties + if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { + return NULL; + } + PyObject_GC_Track(iterator); + return (PyObject *)iterator; +} + +PyObject *JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_iter_reverse(JSObjectItemsProxy *self) { + JSObjectIterProxy *iterator = PyObject_GC_New(JSObjectIterProxy, &JSObjectIterProxyType); + if (iterator == NULL) { + return NULL; + } + iterator->it.reversed = true; + iterator->it.it_index = JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_length(self) - 1; + iterator->it.kind = KIND_ITEMS; + Py_INCREF(self->dv.dv_dict); + iterator->it.di_dict = self->dv.dv_dict; + iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + // Get **enumerable** own properties + if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { + return NULL; + } + PyObject_GC_Track(iterator); + return (PyObject *)iterator; +} + +PyObject *JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_repr(JSObjectItemsProxy *self) { + PyObject *seq; + PyObject *result = NULL; + + Py_ssize_t rc = Py_ReprEnter((PyObject *)self); + if (rc != 0) { + return rc > 0 ? PyUnicode_FromString("...") : NULL; + } + + seq = PySequence_List((PyObject *)self); + if (seq == NULL) { + goto Done; + } + + result = PyUnicode_FromFormat("%s(%R)", PyDictItems_Type.tp_name, seq); + Py_DECREF(seq); + +Done: + Py_ReprLeave((PyObject *)self); + return result; +} + +PyObject *JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_mapping(PyObject *self, void *Py_UNUSED(ignored)) { + return PyDictProxy_New((PyObject *)((_PyDictViewObject *)self)->dv_dict); +} \ No newline at end of file diff --git a/src/JSObjectIterProxy.cc b/src/JSObjectIterProxy.cc new file mode 100644 index 00000000..a3604946 --- /dev/null +++ b/src/JSObjectIterProxy.cc @@ -0,0 +1,122 @@ +/** + * @file JSObjectIterProxy.cc + * @author Philippe Laporte (philippe@distributive.network) + * @brief JSObjectIterProxy is a custom C-implemented python type that derives from list iterator + * @date 2024-01-17 + * + * Copyright (c) 2024 Distributive Corp. + * + */ + + +#include "include/JSObjectIterProxy.hh" + +#include "include/JSObjectProxy.hh" + +#include "include/modules/pythonmonkey/pythonmonkey.hh" + +#include "include/pyTypeFactory.hh" + +#include "include/PyProxyHandler.hh" + +#include + +#include + +#include + + +void JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_dealloc(JSObjectIterProxy *self) +{ + delete self->it.props; + PyObject_GC_UnTrack(self); + Py_XDECREF(self->it.di_dict); + PyObject_GC_Del(self); +} + +int JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_traverse(JSObjectIterProxy *self, visitproc visit, void *arg) { + Py_VISIT(self->it.di_dict); + return 0; +} + +PyObject *JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_iter(JSObjectIterProxy *self) { + Py_INCREF(&self->it); + return (PyObject *)&self->it; +} + +PyObject *JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_nextkey(JSObjectIterProxy *self) { + PyDictObject *dict = self->it.di_dict; + if (dict == NULL) { + return NULL; + } + + if (self->it.reversed) { + if (self->it.it_index >= 0) { + JS::HandleId id = (*(self->it.props))[(self->it.it_index)--]; + PyObject *key = idToKey(GLOBAL_CX, id); + PyObject *value; + + if (self->it.kind != KIND_KEYS) { + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSObjectProxy *)(self->it.di_dict))->jsObject)); + JS::RootedValue *jsVal = new JS::RootedValue(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, jsVal); + value = pyTypeFactory(GLOBAL_CX, global, jsVal)->getPyObject(); + } + + PyObject *ret; + if (self->it.kind == KIND_ITEMS) { + ret = PyTuple_Pack(2, key, value); + } + else if (self->it.kind == KIND_VALUES) { + ret = value; + } + else { + ret = key; + } + + Py_INCREF(ret); + return ret; + } + } else { + if (self->it.it_index < JSObjectProxyMethodDefinitions::JSObjectProxy_length((JSObjectProxy *)dict)) { + JS::HandleId id = (*(self->it.props))[(self->it.it_index)++]; + PyObject *key = idToKey(GLOBAL_CX, id); + PyObject *value; + + if (self->it.kind != KIND_KEYS) { + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSObjectProxy *)(self->it.di_dict))->jsObject)); + JS::RootedValue *jsVal = new JS::RootedValue(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, jsVal); + value = pyTypeFactory(GLOBAL_CX, global, jsVal)->getPyObject(); + } + + PyObject *ret; + if (self->it.kind == KIND_ITEMS) { + ret = PyTuple_Pack(2, key, value); + } + else if (self->it.kind == KIND_VALUES) { + ret = value; + } + else { + ret = key; + } + Py_INCREF(ret); + return ret; + } + } + + self->it.di_dict = NULL; + Py_DECREF(dict); + return NULL; +} + +PyObject *JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_len(JSObjectIterProxy *self) { + Py_ssize_t len; + if (self->it.di_dict) { + len = JSObjectProxyMethodDefinitions::JSObjectProxy_length((JSObjectProxy *)self->it.di_dict) - self->it.it_index; + if (len >= 0) { + return PyLong_FromSsize_t(len); + } + } + return PyLong_FromLong(0); +} \ No newline at end of file diff --git a/src/JSObjectKeysProxy.cc b/src/JSObjectKeysProxy.cc new file mode 100644 index 00000000..92dfdb2d --- /dev/null +++ b/src/JSObjectKeysProxy.cc @@ -0,0 +1,383 @@ +/** + * @file JSObjectKeysProxy.cc + * @author Philippe Laporte (philippe@distributive.network) + * @brief JSObjectKeysProxy is a custom C-implemented python type that derives from dict keys + * @version 0.1 + * @date 2024-01-18 + * + * Copyright (c) 2024 Distributive Corp. + * + */ + +#include "include/JSObjectKeysProxy.hh" + +#include "include/JSObjectIterProxy.hh" +#include "include/JSObjectProxy.hh" +#include "include/JSArrayProxy.hh" + +#include "include/modules/pythonmonkey/pythonmonkey.hh" +#include "include/jsTypeFactory.hh" +#include "include/pyTypeFactory.hh" +#include "include/PyProxyHandler.hh" + +#include +#include + +#include + +#include + + +void JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_dealloc(JSObjectKeysProxy *self) +{ + PyObject_GC_UnTrack(self); + Py_XDECREF(self->dv.dv_dict); + PyObject_GC_Del(self); +} + +Py_ssize_t JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_length(JSObjectKeysProxy *self) +{ + if (self->dv.dv_dict == NULL) { + return 0; + } + return JSObjectProxyMethodDefinitions::JSObjectProxy_length((JSObjectProxy *)self->dv.dv_dict); +} + +int JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_contains(JSObjectKeysProxy *self, PyObject *key) +{ + if (self->dv.dv_dict == NULL) { + return 0; + } + return JSObjectProxyMethodDefinitions::JSObjectProxy_contains((JSObjectProxy *)self->dv.dv_dict, key); +} + +int JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_traverse(JSObjectKeysProxy *self, visitproc visit, void *arg) { + Py_VISIT(self->dv.dv_dict); + return 0; +} + +// private +static int all_contained_in(PyObject *self, PyObject *other) { + PyObject *iter = PyObject_GetIter(self); + int ok = 1; + + if (iter == NULL) { + return -1; + } + + for (;; ) { + PyObject *next = PyIter_Next(iter); + if (next == NULL) { + if (PyErr_Occurred()) + ok = -1; + break; + } + if (PyObject_TypeCheck(other, &JSObjectKeysProxyType)) { + JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_contains((JSObjectKeysProxy *)other, next); + } + else { + ok = PySequence_Contains(other, next); + } + Py_DECREF(next); + if (ok <= 0) + break; + } + + Py_DECREF(iter); + return ok; +} + +PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_richcompare(JSObjectKeysProxy *self, PyObject *other, int op) { + Py_ssize_t len_self, len_other; + int ok; + PyObject *result; + + if (!PyAnySet_Check(other) && !PyDictViewSet_Check(other)) { + Py_RETURN_NOTIMPLEMENTED; + } + + len_self = JSObjectProxyMethodDefinitions::JSObjectProxy_length((JSObjectProxy *)self->dv.dv_dict); + if (len_self < 0) { + return NULL; + } + + if (PyObject_TypeCheck(other, &JSObjectKeysProxyType)) { + len_other = JSObjectProxyMethodDefinitions::JSObjectProxy_length((JSObjectProxy *)self->dv.dv_dict); + } + else { + len_other = PyObject_Size(other); + } + if (len_other < 0) { + return NULL; + } + + ok = 0; + switch (op) { + case Py_NE: + case Py_EQ: + if (len_self == len_other) { + + ok = all_contained_in((PyObject *)self, other); + } + if (op == Py_NE && ok >= 0) { + ok = !ok; + } + break; + + case Py_LT: + if (len_self < len_other) { + ok = all_contained_in((PyObject *)self, other); + } + break; + + case Py_LE: + if (len_self <= len_other) { + ok = all_contained_in((PyObject *)self, other); + } + break; + + case Py_GT: + if (len_self > len_other) { + ok = all_contained_in(other, (PyObject *)self); + } + break; + + case Py_GE: + if (len_self >= len_other) { + ok = all_contained_in(other, (PyObject *)self); + } + break; + } + + if (ok < 0) { + return NULL; + } + + result = ok ? Py_True : Py_False; + + Py_INCREF(result); + return result; +} + +PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_iter(JSObjectKeysProxy *self) { + JSObjectIterProxy *iterator = PyObject_GC_New(JSObjectIterProxy, &JSObjectIterProxyType); + if (iterator == NULL) { + return NULL; + } + iterator->it.reversed = false; + iterator->it.it_index = 0; + iterator->it.kind = KIND_KEYS; + Py_INCREF(self->dv.dv_dict); + iterator->it.di_dict = self->dv.dv_dict; + iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + // Get **enumerable** own properties + if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { + return NULL; + } + PyObject_GC_Track(iterator); + return (PyObject *)iterator; +} + +PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_iter_reverse(JSObjectKeysProxy *self) { + JSObjectIterProxy *iterator = PyObject_GC_New(JSObjectIterProxy, &JSObjectIterProxyType); + if (iterator == NULL) { + return NULL; + } + iterator->it.reversed = true; + iterator->it.it_index = JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_length(self) - 1; + iterator->it.kind = KIND_KEYS; + Py_INCREF(self->dv.dv_dict); + iterator->it.di_dict = self->dv.dv_dict; + iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + // Get **enumerable** own properties + if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { + return NULL; + } + PyObject_GC_Track(iterator); + return (PyObject *)iterator; +} + +PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_repr(JSObjectKeysProxy *self) { + PyObject *seq; + PyObject *result = NULL; + + Py_ssize_t rc = Py_ReprEnter((PyObject *)self); + if (rc != 0) { + return rc > 0 ? PyUnicode_FromString("...") : NULL; + } + + seq = PySequence_List((PyObject *)self); + if (seq == NULL) { + goto Done; + } + + result = PyUnicode_FromFormat("%s(%R)", PyDictKeys_Type.tp_name, seq); + Py_DECREF(seq); + +Done: + Py_ReprLeave((PyObject *)self); + return result; +} + +// private +static Py_ssize_t dictview_len(_PyDictViewObject *dv) { + Py_ssize_t len = 0; + if (dv->dv_dict != NULL) { + len = dv->dv_dict->ma_used; + } + return len; +} + +PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_intersect(JSObjectKeysProxy *self, PyObject *other) { + PyObject *result; + PyObject *it; + PyObject *key; + Py_ssize_t len_self; + int rv; + + // Python interpreter swaps parameters when dict view is on right side of & + if (!PyDictViewSet_Check(self)) { + PyObject *tmp = other; + other = (PyObject *)self; + self = (JSObjectKeysProxy *)tmp; + } + + if (PyObject_TypeCheck(self, &JSObjectKeysProxyType)) { + len_self = JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_length(self); + } + else { + len_self = dictview_len((_PyDictViewObject *)self); + } + + // if other is a set and self is smaller than other, reuse set intersection logic + if (PySet_CheckExact(other) && len_self <= PyObject_Size(other)) { + return PyObject_CallMethod(other, "intersection", "O", self); + } + + // if other is another dict view, and it is bigger than self, swap them + if (PyDictViewSet_Check(other)) { + Py_ssize_t len_other = dictview_len((_PyDictViewObject *)other); + if (len_other > len_self) { + PyObject *tmp = other; + other = (PyObject *)self; + self = (JSObjectKeysProxy *)tmp; + } + } + + /* at this point, two things should be true + 1. self is a dictview + 2. if other is a dictview then it is smaller than self */ + result = PySet_New(NULL); + if (result == NULL) { + return NULL; + } + + it = PyObject_GetIter(other); + if (it == NULL) { + Py_DECREF(result); + return NULL; + } + + while ((key = PyIter_Next(it)) != NULL) { + if (PyObject_TypeCheck(self, &JSObjectKeysProxyType)) { + rv = JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_contains(self, key); + } + else { + if (((_PyDictViewObject *)self)->dv_dict == NULL) { + rv = 0; + } else { + rv = PyDict_Contains((PyObject *)((_PyDictViewObject *)self)->dv_dict, key); + } + } + if (rv < 0) { + goto error; + } + if (rv) { + if (PySet_Add(result, key)) { + goto error; + } + } + Py_DECREF(key); + } + + Py_DECREF(it); + if (PyErr_Occurred()) { + Py_DECREF(result); + return NULL; + } + return result; + +error: + Py_DECREF(it); + Py_DECREF(result); + Py_DECREF(key); + return NULL; +} + +PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_isDisjoint(JSObjectKeysProxy *self, PyObject *other) { + PyObject *it; + PyObject *item = NULL; + + Py_ssize_t selfLen = JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_length(self); + + if ((PyObject *)self == other) { + if (selfLen == 0) { + Py_RETURN_TRUE; + } + else { + Py_RETURN_FALSE; + } + } + + /* Iterate over the shorter object (only if other is a set, + * because PySequence_Contains may be expensive otherwise): */ + if (PyAnySet_Check(other) || PyDictViewSet_Check(other)) { + Py_ssize_t len_self = selfLen; + Py_ssize_t len_other = PyObject_Size(other); + if (len_other == -1) { + return NULL; + } + + if ((len_other > len_self)) { + PyObject *tmp = other; + other = (PyObject *)self; + self = (JSObjectKeysProxy *)tmp; + } + } + + it = PyObject_GetIter(other); + if (it == NULL) { + return NULL; + } + + while ((item = PyIter_Next(it)) != NULL) { + int contains; + if (PyObject_TypeCheck(self, &JSObjectKeysProxyType)) { + contains = JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_contains(self, item); + } + else { + contains = PySequence_Contains((PyObject *)self, item); + } + Py_DECREF(item); + if (contains == -1) { + Py_DECREF(it); + return NULL; + } + + if (contains) { + Py_DECREF(it); + Py_RETURN_FALSE; + } + } + + Py_DECREF(it); + if (PyErr_Occurred()) { + return NULL; /* PyIter_Next raised an exception. */ + } + + Py_RETURN_TRUE; +} + +PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_mapping(PyObject *self, void *Py_UNUSED(ignored)) { + return PyDictProxy_New((PyObject *)((_PyDictViewObject *)self)->dv_dict); +} \ No newline at end of file diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 7e7e7bec..e378463c 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -11,6 +11,12 @@ #include "include/JSObjectProxy.hh" +#include "include/JSObjectIterProxy.hh" + +#include "include/JSObjectKeysProxy.hh" +#include "include/JSObjectValuesProxy.hh" +#include "include/JSObjectItemsProxy.hh" + #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/jsTypeFactory.hh" #include "include/pyTypeFactory.hh" @@ -46,7 +52,6 @@ void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) self->jsObject.set(nullptr); PyObject_GC_UnTrack(self); Py_TYPE(self)->tp_free((PyObject *)self); - return; } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) @@ -70,7 +75,6 @@ Py_ssize_t JSObjectProxyMethodDefinitions::JSObjectProxy_length(JSObjectProxy *s // @TODO (Caleb Aikens) raise exception here return -1; } - return props.length(); } @@ -82,15 +86,13 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, return NULL; // key is not a str or int } - JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); - - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - // look through the methods for dispatch for (size_t index = 0;; index++) { const char *methodName = JSObjectProxyType.tp_methods[index].ml_name; if (methodName == NULL) { // reached end of list + JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); } else if (PyUnicode_Check(key)) { @@ -99,6 +101,10 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, } } else { + JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); } } @@ -111,7 +117,6 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, // TODO (Caleb Aikens): raise exception here return -1; // key is not a str or int } - JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); return value->isUndefined() ? 0 : 1; @@ -223,57 +228,205 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_iter(JSObjectProxy *self) { + // key iteration + JSObjectIterProxy *iterator = PyObject_GC_New(JSObjectIterProxy, &JSObjectIterProxyType); + if (iterator == NULL) { + return NULL; + } + iterator->it.it_index = 0; + iterator->it.reversed = false; + iterator->it.kind = KIND_KEYS; + Py_INCREF(self); + iterator->it.di_dict = (PyDictObject *)self; + iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + // Get **enumerable** own properties + if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, iterator->it.props)) { + return NULL; + } + PyObject_GC_Track(iterator); + return (PyObject *)iterator; +} + +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self) { + Py_ssize_t i = Py_ReprEnter((PyObject *)self); + if (i != 0) { + return i > 0 ? PyUnicode_FromString("{...}") : NULL; + } + + Py_ssize_t selfLength = JSObjectProxy_length(self); + + if (selfLength == 0) { + Py_ReprLeave((PyObject *)self); + return PyUnicode_FromString("{}"); + } + + _PyUnicodeWriter writer; + + _PyUnicodeWriter_Init(&writer); + + writer.overallocate = 1; + /* "{" + "1: 2" + ", 3: 4" * (len - 1) + "}" */ + writer.min_length = 1 + 4 + (2 + 4) * (selfLength - 1) + 1; + + PyObject *key = NULL, *value = NULL; + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - // Get **enumerable** own properties JS::RootedIdVector props(GLOBAL_CX); + + if (_PyUnicodeWriter_WriteChar(&writer, '{') < 0) { + goto error; + } + + /* Do repr() on each key+value pair, and insert ": " between them. Note that repr may mutate the dict. */ + + // Get **enumerable** own properties if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { return NULL; } - // Populate a Python tuple with (propertyKey, value) pairs from the JS object - // Similar to `Object.entries()` - size_t length = props.length(); - PyObject *seq = PyTuple_New(length); - for (size_t i = 0; i < length; i++) { - JS::HandleId id = props[i]; - PyObject *key = idToKey(GLOBAL_CX, id); + for (Py_ssize_t index = 0; index < selfLength; index++) { + if (index > 0) { + if (_PyUnicodeWriter_WriteASCIIString(&writer, ", ", 2) < 0) { + goto error; + } + } + + JS::HandleId id = props[index]; + key = idToKey(GLOBAL_CX, id); + + // Prevent repr from deleting key or value during key format. + Py_INCREF(key); + + PyObject *s = PyObject_Repr(key); + + if (s == NULL) { + Py_DECREF(s); + goto error; + } + + int res = _PyUnicodeWriter_WriteStr(&writer, s); + + if (res < 0) { + goto error; + } + + if (_PyUnicodeWriter_WriteASCIIString(&writer, ": ", 2) < 0) { + goto error; + } + + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, elementVal); - JS::RootedValue *jsVal = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, jsVal); - PyObject *value = pyTypeFactory(GLOBAL_CX, global, jsVal)->getPyObject(); + if (&elementVal->toObject() == self->jsObject.get()) { + value = (PyObject *)self; + } else { + value = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + } + + Py_INCREF(value); + s = PyObject_Repr(value); + + if (s == NULL) { + Py_DECREF(s); + goto error; + } - PyTuple_SetItem(seq, i, PyTuple_Pack(2, key, value)); + res = _PyUnicodeWriter_WriteStr(&writer, s); + Py_DECREF(s); + if (res < 0) { + goto error; + } + + Py_CLEAR(key); + Py_CLEAR(value); + } + + writer.overallocate = 0; + if (_PyUnicodeWriter_WriteChar(&writer, '}') < 0) { + goto error; } - // Convert to a Python iterator - return PyObject_GetIter(seq); + Py_ReprLeave((PyObject *)self); + return _PyUnicodeWriter_Finish(&writer); + +error: + Py_ReprLeave((PyObject *)self); + _PyUnicodeWriter_Dealloc(&writer); + Py_XDECREF(key); + Py_XDECREF(value); + return NULL; } -PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self) { - // Detect cyclic objects - PyObject *objPtr = PyLong_FromVoidPtr(self->jsObject.get()); - // For `Py_ReprEnter`, we must get a same PyObject when visiting the same JSObject. - // We cannot simply use the object returned by `PyLong_FromVoidPtr` because it won't reuse the PyLongObjects for ints not between -5 and 256. - // Instead, we store this PyLongObject in a global dict, using itself as the hashable key, effectively interning the PyLongObject. - PyObject *tsDict = PyThreadState_GetDict(); - PyObject *cyclicKey = PyDict_SetDefault(tsDict, /*key*/ objPtr, /*value*/ objPtr); // cyclicKey = (tsDict[objPtr] ??= objPtr) - int status = Py_ReprEnter(cyclicKey); - if (status != 0) { // the object has already been processed - return status > 0 ? PyUnicode_FromString("[Circular]") : NULL; - } - - // Convert JSObjectProxy to a dict - PyObject *dict = PyDict_New(); - // Update from the iterator emitting key-value pairs - // see https://docs.python.org/3/c-api/dict.html#c.PyDict_MergeFromSeq2 - PyDict_MergeFromSeq2(dict, JSObjectProxy_iter(self), /*override*/ false); - // Get the string representation of this dict - PyObject *str = PyObject_Repr(dict); - - Py_ReprLeave(cyclicKey); - PyDict_DelItem(tsDict, cyclicKey); - return str; +// private +static int mergeFromSeq2(JSObjectProxy *self, PyObject *seq2) { + PyObject *it; /* iter(seq2) */ + Py_ssize_t i; /* index into seq2 of current element */ + PyObject *item; /* seq2[i] */ + PyObject *fast; /* item as a 2-tuple or 2-list */ + + it = PyObject_GetIter(seq2); + if (it == NULL) + return -1; + + for (i = 0;; ++i) { + PyObject *key, *value; + Py_ssize_t n; + + fast = NULL; + item = PyIter_Next(it); + if (item == NULL) { + if (PyErr_Occurred()) + goto Fail; + break; + } + + /* Convert item to sequence, and verify length 2. */ + fast = PySequence_Fast(item, ""); + if (fast == NULL) { + if (PyErr_ExceptionMatches(PyExc_TypeError)) + PyErr_Format(PyExc_TypeError, + "cannot convert dictionary update " + "sequence element #%zd to a sequence", + i); + goto Fail; + } + n = PySequence_Fast_GET_SIZE(fast); + if (n != 2) { + PyErr_Format(PyExc_ValueError, + "dictionary update sequence element #%zd " + "has length %zd; 2 is required", + i, n); + goto Fail; + } + + /* Update/merge with this (key, value) pair. */ + key = PySequence_Fast_GET_ITEM(fast, 0); + value = PySequence_Fast_GET_ITEM(fast, 1); + Py_INCREF(key); + Py_INCREF(value); + + if (JSObjectProxyMethodDefinitions::JSObjectProxy_assign(self, key, value) < 0) { + Py_DECREF(key); + Py_DECREF(value); + goto Fail; + } + + Py_DECREF(key); + Py_DECREF(value); + Py_DECREF(fast); + Py_DECREF(item); + } + + i = 0; + goto Return; +Fail: + Py_XDECREF(item); + Py_XDECREF(fast); + i = -1; +Return: + Py_DECREF(it); + return Py_SAFE_DOWNCAST(i, Py_ssize_t, int); } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, PyObject *other) { @@ -319,30 +472,34 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_ior(JSObjectProxy *self, PyObject *other) { - if (!PyDict_Check(self) || !PyDict_Check(other)) { - Py_RETURN_NOTIMPLEMENTED; - } + if (PyDict_Check(other)) { + JS::Rooted> args(GLOBAL_CX); + args[0].setObjectOrNull(self->jsObject); + JS::RootedValue jValueOther(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, other)); + args[1].setObject(jValueOther.toObject()); - JS::Rooted> args(GLOBAL_CX); - args[0].setObjectOrNull(self->jsObject); - JS::RootedValue jValueOther(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, other)); - args[1].setObject(jValueOther.toObject()); + JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + // call Object.assign + JS::RootedValue Object(GLOBAL_CX); + if (!JS_GetProperty(GLOBAL_CX, *global, "Object", &Object)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); + return NULL; + } - // call Object.assign - JS::RootedValue Object(GLOBAL_CX); - if (!JS_GetProperty(GLOBAL_CX, *global, "Object", &Object)) { - PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); - return NULL; + JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); + JS::RootedValue ret(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); + return NULL; + } } - - JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); - JS::RootedValue ret(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) { - PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); - return NULL; + else { + if (mergeFromSeq2(self, other) < 0) { + return NULL; + } } + Py_INCREF(self); return (PyObject *)self; } @@ -475,4 +632,43 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProx return NULL; } return pyTypeFactory(GLOBAL_CX, global, ret)->getPyObject(); +} + +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_update_method(JSObjectProxy *self, PyObject *args, PyObject *kwds) { + PyObject *arg = NULL; + int result = 0; + + if (!PyArg_UnpackTuple(args, "update", 0, 1, &arg)) { + return NULL; + } + else if (arg != NULL) { + if (PyDict_CheckExact(arg) || PyObject_TypeCheck(arg, &JSObjectProxyType)) { + JSObjectProxyMethodDefinitions::JSObjectProxy_ior((JSObjectProxy *)self, arg); + result = 0; + } else { // iterable + result = mergeFromSeq2((JSObjectProxy *)self, arg); + if (result < 0) { + return NULL; + } + } + } + + if (result == 0 && kwds != NULL) { + if (PyArg_ValidateKeywordArguments(kwds)) { + JSObjectProxyMethodDefinitions::JSObjectProxy_ior((JSObjectProxy *)self, kwds); + } + } + Py_RETURN_NONE; +} + +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_keys_method(JSObjectProxy *self) { + return _PyDictView_New((PyObject *)self, &JSObjectKeysProxyType); +} + +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_values_method(JSObjectProxy *self) { + return _PyDictView_New((PyObject *)self, &JSObjectValuesProxyType); +} + +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_items_method(JSObjectProxy *self) { + return _PyDictView_New((PyObject *)self, &JSObjectItemsProxyType); } \ No newline at end of file diff --git a/src/JSObjectValuesProxy.cc b/src/JSObjectValuesProxy.cc new file mode 100644 index 00000000..e85e7661 --- /dev/null +++ b/src/JSObjectValuesProxy.cc @@ -0,0 +1,151 @@ +/** + * @file JSObjectValuesProxy.cc + * @author Philippe Laporte (philippe@distributive.network) + * @brief JSObjectValuesProxy is a custom C-implemented python type that derives from dict values + * @version 0.1 + * @date 2024-01-19 + * + * Copyright (c) 2024 Distributive Corp. + * + */ + +#include "include/JSObjectValuesProxy.hh" + +#include "include/JSObjectIterProxy.hh" +#include "include/JSObjectProxy.hh" +#include "include/JSArrayProxy.hh" + +#include "include/modules/pythonmonkey/pythonmonkey.hh" +#include "include/jsTypeFactory.hh" +#include "include/pyTypeFactory.hh" +#include "include/PyProxyHandler.hh" + +#include +#include + +#include + +#include + + +void JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_dealloc(JSObjectValuesProxy *self) +{ + PyObject_GC_UnTrack(self); + Py_XDECREF(self->dv.dv_dict); + PyObject_GC_Del(self); +} + +Py_ssize_t JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_length(JSObjectValuesProxy *self) +{ + if (self->dv.dv_dict == NULL) { + return 0; + } + return JSObjectProxyMethodDefinitions::JSObjectProxy_length((JSObjectProxy *)self->dv.dv_dict); +} + +int JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_contains(JSObjectValuesProxy *self, PyObject *key) +{ + if (self->dv.dv_dict == NULL) { + return 0; + } + return JSObjectProxyMethodDefinitions::JSObjectProxy_contains((JSObjectProxy *)self->dv.dv_dict, key); +} + +int JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_traverse(JSObjectValuesProxy *self, visitproc visit, void *arg) { + Py_VISIT(self->dv.dv_dict); + return 0; +} + +// private +static int all_contained_in(PyObject *self, PyObject *other) { + PyObject *iter = PyObject_GetIter(self); + int ok = 1; + + if (iter == NULL) { + return -1; + } + + for (;; ) { + PyObject *next = PyIter_Next(iter); + if (next == NULL) { + if (PyErr_Occurred()) + ok = -1; + break; + } + if (PyObject_TypeCheck(other, &JSObjectValuesProxyType)) { + JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_contains((JSObjectValuesProxy *)other, next); + } + else { + ok = PySequence_Contains(other, next); + } + Py_DECREF(next); + if (ok <= 0) + break; + } + + Py_DECREF(iter); + return ok; +} + +PyObject *JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_iter(JSObjectValuesProxy *self) { + JSObjectIterProxy *iterator = PyObject_GC_New(JSObjectIterProxy, &JSObjectIterProxyType); + if (iterator == NULL) { + return NULL; + } + iterator->it.reversed = false; + iterator->it.it_index = 0; + iterator->it.kind = KIND_VALUES; + Py_INCREF(self->dv.dv_dict); + iterator->it.di_dict = self->dv.dv_dict; + iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + // Get **enumerable** own properties + if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { + return NULL; + } + PyObject_GC_Track(iterator); + return (PyObject *)iterator; +} + +PyObject *JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_iter_reverse(JSObjectValuesProxy *self) { + JSObjectIterProxy *iterator = PyObject_GC_New(JSObjectIterProxy, &JSObjectIterProxyType); + if (iterator == NULL) { + return NULL; + } + iterator->it.reversed = true; + iterator->it.it_index = JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_length(self) - 1; + iterator->it.kind = KIND_VALUES; + Py_INCREF(self->dv.dv_dict); + iterator->it.di_dict = self->dv.dv_dict; + iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + // Get **enumerable** own properties + if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { + return NULL; + } + PyObject_GC_Track(iterator); + return (PyObject *)iterator; +} + +PyObject *JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_repr(JSObjectValuesProxy *self) { + PyObject *seq; + PyObject *result = NULL; + + Py_ssize_t rc = Py_ReprEnter((PyObject *)self); + if (rc != 0) { + return rc > 0 ? PyUnicode_FromString("...") : NULL; + } + + seq = PySequence_List((PyObject *)self); + if (seq == NULL) { + goto Done; + } + + result = PyUnicode_FromFormat("%s(%R)", PyDictValues_Type.tp_name, seq); + Py_DECREF(seq); +Done: + Py_ReprLeave((PyObject *)self); + return result; +} + +PyObject *JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_mapping(PyObject *self, void *Py_UNUSED(ignored)) { + return PyDictProxy_New((PyObject *)((_PyDictViewObject *)self)->dv_dict); +} \ No newline at end of file diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 9e68c105..4313d666 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -19,6 +19,10 @@ #include "include/FuncType.hh" #include "include/JSArrayIterProxy.hh" #include "include/JSArrayProxy.hh" +#include "include/JSObjectIterProxy.hh" +#include "include/JSObjectKeysProxy.hh" +#include "include/JSObjectValuesProxy.hh" +#include "include/JSObjectItemsProxy.hh" #include "include/JSObjectProxy.hh" #include "include/PyType.hh" #include "include/pyTypeFactory.hh" @@ -80,6 +84,7 @@ PyTypeObject JSObjectProxyType = { .tp_as_number = &JSObjectProxy_number_methods, .tp_as_sequence = &JSObjectProxy_sequence_methods, .tp_as_mapping = &JSObjectProxy_mapping_methods, + .tp_hash = PyObject_HashNotImplemented, .tp_getattro = (getattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_get, .tp_setattro = (setattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_assign, .tp_flags = Py_TPFLAGS_DEFAULT @@ -122,7 +127,7 @@ PyTypeObject JSArrayIterProxyType = { .tp_itemsize = 0, .tp_dealloc = (destructor)JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_dealloc, .tp_getattro = PyObject_GenericGetAttr, - .tp_flags = Py_TPFLAGS_DEFAULT, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, .tp_doc = PyDoc_STR("Javascript Array proxy iterator"), .tp_traverse = (traverseproc)JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_traverse, .tp_iter = (getiterfunc)JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_iter, @@ -131,6 +136,80 @@ PyTypeObject JSArrayIterProxyType = { .tp_base = &PyListIter_Type }; +PyTypeObject JSObjectIterProxyType = { + .ob_base = PyVarObject_HEAD_INIT(NULL, 0) + .tp_name = "pythonmonkey.JSObjectIterProxy", + .tp_basicsize = sizeof(JSObjectIterProxy), + .tp_itemsize = 0, + .tp_dealloc = (destructor)JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_dealloc, + .tp_getattro = PyObject_GenericGetAttr, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + .tp_doc = PyDoc_STR("Javascript Object proxy key iterator"), + .tp_traverse = (traverseproc)JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_traverse, + .tp_iter = (getiterfunc)JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_iter, + .tp_iternext = (iternextfunc)JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_nextkey, + .tp_methods = JSObjectIterProxy_methods, + .tp_base = &PyDictIterKey_Type +}; + +PyTypeObject JSObjectKeysProxyType = { + .ob_base = PyVarObject_HEAD_INIT(NULL, 0) + .tp_name = "pythonmonkey.JSObjectKeysProxy", + .tp_basicsize = sizeof(JSObjectKeysProxy), + .tp_itemsize = 0, + .tp_dealloc = (destructor)JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_dealloc, + .tp_repr = (reprfunc)JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_repr, + .tp_as_number = &JSObjectKeysProxy_number_methods, + .tp_as_sequence = &JSObjectKeysProxy_sequence_methods, + .tp_getattro = PyObject_GenericGetAttr, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + .tp_doc = PyDoc_STR("Javascript Object Keys proxy"), + .tp_traverse = (traverseproc)JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_traverse, + .tp_richcompare = (richcmpfunc)JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_richcompare, + .tp_iter = (getiterfunc)JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_iter, + .tp_methods = JSObjectKeysProxy_methods, + .tp_getset = JSObjectKeysProxy_getset, + .tp_base = &PyDictKeys_Type +}; + +PyTypeObject JSObjectValuesProxyType = { + .ob_base = PyVarObject_HEAD_INIT(NULL, 0) + .tp_name = "pythonmonkey.JSObjectValuesProxy", + .tp_basicsize = sizeof(JSObjectValuesProxy), + .tp_itemsize = 0, + .tp_dealloc = (destructor)JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_dealloc, + .tp_repr = (reprfunc)JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_repr, + .tp_as_sequence = &JSObjectValuesProxy_sequence_methods, + .tp_getattro = PyObject_GenericGetAttr, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + .tp_doc = PyDoc_STR("Javascript Object Values proxy"), + .tp_traverse = (traverseproc)JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_traverse, + .tp_iter = (getiterfunc)JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_iter, + .tp_methods = JSObjectValuesProxy_methods, + .tp_getset = JSObjectValuesProxy_getset, + .tp_base = &PyDictValues_Type +}; + +PyTypeObject JSObjectItemsProxyType = { + .ob_base = PyVarObject_HEAD_INIT(NULL, 0) + .tp_name = "pythonmonkey.JSObjectItemsProxy", + .tp_basicsize = sizeof(JSObjectItemsProxy), + .tp_itemsize = 0, + .tp_dealloc = (destructor)JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_dealloc, + .tp_repr = (reprfunc)JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_repr, + // .tp_as_number = defaults are fine + .tp_as_sequence = &JSObjectItemsProxy_sequence_methods, + .tp_getattro = PyObject_GenericGetAttr, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + .tp_doc = PyDoc_STR("Javascript Object Items proxy"), + .tp_traverse = (traverseproc)JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_traverse, + // .tp_richcompare = TODO tuple support + .tp_iter = (getiterfunc)JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_iter, + .tp_methods = JSObjectItemsProxy_methods, + .tp_getset = JSObjectItemsProxy_getset, + .tp_base = &PyDictKeys_Type +}; + static void cleanup() { delete autoRealm; delete global; @@ -437,6 +516,14 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; if (PyType_Ready(&JSArrayIterProxyType) < 0) return NULL; + if (PyType_Ready(&JSObjectIterProxyType) < 0) + return NULL; + if (PyType_Ready(&JSObjectKeysProxyType) < 0) + return NULL; + if (PyType_Ready(&JSObjectValuesProxyType) < 0) + return NULL; + if (PyType_Ready(&JSObjectItemsProxyType) < 0) + return NULL; pyModule = PyModule_Create(&pythonmonkey); if (pyModule == NULL) @@ -476,6 +563,34 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; } + Py_INCREF(&JSObjectIterProxyType); + if (PyModule_AddObject(pyModule, "JSObjectIterProxy", (PyObject *)&JSObjectIterProxyType) < 0) { + Py_DECREF(&JSObjectIterProxyType); + Py_DECREF(pyModule); + return NULL; + } + + Py_INCREF(&JSObjectKeysProxyType); + if (PyModule_AddObject(pyModule, "JSObjectKeysProxy", (PyObject *)&JSObjectKeysProxyType) < 0) { + Py_DECREF(&JSObjectKeysProxyType); + Py_DECREF(pyModule); + return NULL; + } + + Py_INCREF(&JSObjectValuesProxyType); + if (PyModule_AddObject(pyModule, "JSObjectValuesProxy", (PyObject *)&JSObjectValuesProxyType) < 0) { + Py_DECREF(&JSObjectValuesProxyType); + Py_DECREF(pyModule); + return NULL; + } + + Py_INCREF(&JSObjectItemsProxyType); + if (PyModule_AddObject(pyModule, "JSObjectItemsProxy", (PyObject *)&JSObjectItemsProxyType) < 0) { + Py_DECREF(&JSObjectItemsProxyType); + Py_DECREF(pyModule); + return NULL; + } + if (PyModule_AddObject(pyModule, "SpiderMonkeyError", SpiderMonkeyError)) { Py_DECREF(pyModule); return NULL; diff --git a/tests/python/test_dict_methods.py b/tests/python/test_dict_methods.py index b6d0919e..866ba9c9 100644 --- a/tests/python/test_dict_methods.py +++ b/tests/python/test_dict_methods.py @@ -125,3 +125,331 @@ def test_copy(): assert likes == {"color": "blue", "fruit": "apple", "pet": "dog"} assert otherLikes == {"color": "yellow", "fruit": "apple", "pet": "dog"} + +#update +def test_update_true_dict_right(): + a = pm.eval("({'c':5})") + b = {'d':6.0} + a.update(b) + assert a == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} + +def test_update_true_dict_left(): + a = {'d':6.0} + b = pm.eval("({'c':5})") + a.update(b) + assert a == {'c': 5.0, 'd': 6.0} + assert b == {'c': 5.0} + +def test_update_true_two_pm_dicts(): + a = pm.eval("({'c':5})") + b = pm.eval("({'d':6})") + a.update(b) + assert a == {'c': 5.0, 'd': 6.0} + assert b == {'d': 6.0} + +def test_update_two_args(): + a = pm.eval("({'c':5})") + a.update(B='For', C='Geeks') + assert a == {'c': 5.0, 'B': 'For', 'C': 'Geeks'} + +def test_update_iterable(): + car = pm.eval('({"brand": "Ford","model": "Mustang","year": 1964})') + car.update([('y', 3), ('z', 0)]) + assert car == {'brand': 'Ford', 'model': 'Mustang', 'year': 1964, 'y': 3, 'z': 0} + +def test_update_iterable_wrong_type(): + car = pm.eval('({"brand": "Ford","model": "Mustang","year": 1964})') + a = [1,2] + try: + car.update(a) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "cannot convert dictionary update sequence element #0 to a sequence" + +#keys +def test_keys_iter(): + obj = pm.eval("({ a: 123, b: 'test' })") + result = [] + for i in obj.keys(): + result.append(i) + assert result == ['a', 'b'] + +# TODO causes crash +def test_keys_iter_reverse(): + obj = pm.eval("({ a: 123, b: 'test' })") + result = [] + for i in reversed(obj.keys()): + result.append(i) + assert result == ['b', 'a'] + +def test_keys_list(): + obj = pm.eval("({ a: 123, b: 'test' })") + assert list(obj.keys()) == ['a', 'b'] + +def test_keys_repr(): + car = pm.eval('({"brand": "Ford","model": "Mustang","year": 1964})') + a = car.keys() + assert str(a) == "dict_keys(['brand', 'model', 'year'])" + +def test_keys_substract(): + car = pm.eval('({"brand": "Ford","model": "Mustang","year": 1964})') + a = car.keys() + b = a - ['brand'] + assert b == {'model', 'year'} + +def test_keys_richcompare_two_own(): + car = pm.eval('({"brand": "Ford","model": "Mustang","year": 1964})') + a = car.keys() + b = car.keys() + assert a == b + assert a is not b + assert a <= b + assert not(a < b) + assert a >= b + assert not(a > b) + +def test_keys_richcompare_one_own(): + car = pm.eval('({"brand": "Ford","model": "Mustang","year": 1964})') + a = car.keys() + care = {"brand": "Ford","model": "Mustang","year": 1964} + b = care.keys() + assert a == b + assert b == a + assert a <= b + assert not(a < b) + assert a >= b + assert not(a > b) + assert b <= a + assert not(b > a) + assert b >= a + assert not(b > a) + +def test_keys_intersect_one_own_smaller(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + b = keys & {'eggs', 'bacon', 'salad', 'jam'} + c = {'eggs', 'bacon', 'salad', 'jam'} & keys + assert b == {'bacon', 'eggs'} == c + +def test_keys_intersect_two_own_smaller(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + dishes1 = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1})") + keys1 = dishes1.keys() + b = keys & keys1 + c = keys1 & keys + assert b == {'bacon', 'eggs', 'sausage'} == c + +def test_keys_intersect_one_own(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + dishes1 = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'peas':6} + keys1 = dishes1.keys() + b = keys & keys1 + c = keys1 & keys + assert b == {'bacon', 'eggs', 'sausage'} == c + +def test_keys_or(): + dishes =pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + others = keys | ['juice', 'juice', 'juice'] + assert others == {'bacon', 'spam', 'juice', 'sausage', 'eggs'} + others = ['apple'] | keys + assert others == {'bacon', 'spam', 'sausage', 'apple', 'eggs'} + +def test_keys_xor(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + others = keys ^ {'sausage', 'juice'} + assert others == {'bacon', 'spam', 'juice', 'eggs'} + +def test_keys_len(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + assert len(keys) == 4 + +def test_keys_contains(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + assert 'eggs' in keys + assert 'egg' not in keys + +def test_keys_isdisjoint_self(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + assert not keys.isdisjoint(keys) + +def test_keys_isdisjoint_true_keys(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + assert keys.isdisjoint({ "egg": 4, "e": 5, "f": 6}.keys()) + +def test_keys_isnotdisjoint_true_keys(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + assert not keys.isdisjoint({ "eggs": 4, "e": 5, "f": 6}.keys()) + +def test_keys_isnotdisjoint_own_keys(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + dishese = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys1 = dishese.keys() + assert not keys.isdisjoint(keys1) + +def test_keys_isnotdisjoint_own_keys_longer(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + dishese = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500, 'juice':6467})") + keys1 = dishese.keys() + assert not keys.isdisjoint(keys1) + +def test_keys_isnotdisjoint_true_keys_longer(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + dishese = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500, 'juice':6467} + keys1 = dishese.keys() + assert not keys.isdisjoint(keys1) + +def test_keys_update_object_updates_the_keys(): + employee = pm.eval("({'name': 'Phil', 'age': 22})") + dictionaryKeys = employee.keys() + employee.update({'salary': 3500.0}) + assert str(dictionaryKeys) == "dict_keys(['name', 'age', 'salary'])" + +def test_keys_mapping(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + keys = dishes.keys() + assert str(keys.mapping) == "{'eggs': 2.0, 'sausage': 1.0, 'bacon': 1.0, 'spam': 500.0}" + assert keys.mapping['spam'] == 500 + +#values +def test_values_iter(): + obj = pm.eval("({ a: 123, b: 'test' })") + result = [] + for i in obj.values(): + result.append(i) + assert result == [123, 'test'] + +def test_values_iter_reversed(): + obj = pm.eval("({ a: 123, b: 'test' })") + result = [] + for i in reversed(obj.values()): + result.append(i) + assert result == ['test', 123] + +def test_values_list(): + obj = pm.eval("({ a: 123, b: 'test' })") + assert list(obj.values()) == [123, 'test'] + +def test_values_repr(): + car = pm.eval('({"brand": "Ford","model": "Mustang","year": 1964})') + a = car.values() + assert str(a) == "dict_values(['Ford', 'Mustang', 1964.0])" + +def test_values_update_object_updates_the_values(): + employee = pm.eval("({'name': 'Phil', 'age': 22})") + dictionaryValues = employee.values() + employee.update({'salary': 3500.0}) + assert str(dictionaryValues) == "dict_values(['Phil', 22.0, 3500.0])" + +def test_values_mapping(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + values = dishes.values() + assert str(values.mapping) == "{'eggs': 2.0, 'sausage': 1.0, 'bacon': 1.0, 'spam': 500.0}" + assert values.mapping['spam'] == 500 + +#items +def test_items_iter(): + obj = pm.eval("({ a: 123, b: 'test' })") + result = [] + for i in obj.items(): + result.append(i) + assert result == [('a', 123.0), ('b', 'test')] + +def test_items_iter_reversed(): + obj = pm.eval("({ a: 123, b: 'test' })") + result = [] + for i in reversed(obj.items()): + result.append(i) + assert result == [ ('b', 'test'), ('a', 123.0)] + +def test_items_list(): + obj = pm.eval("({ a: 123, b: 'test' })") + assert list(obj.items()) == [('a', 123.0), ('b', 'test')] + +def test_items_repr(): + car = pm.eval('({"brand": "Ford","model": "Mustang","year": 1964})') + a = car.items() + assert str(a) == "dict_items([('brand', 'Ford'), ('model', 'Mustang'), ('year', 1964.0)])" + +def test_items_substract(): + car = pm.eval('({"brand": "Ford","model": "Mustang","year": 1964})') + a = car.items() + b = a - [('brand', 'Ford')] + assert b == {('model', 'Mustang'), ('year', 1964.0)} + +def test_items_or(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + items = dishes.items() + others = items | [('juice', 'apple')] + assert others == {('spam', 500.0), ('juice', 'apple'), ('eggs', 2.0), ('sausage', 1.0), ('bacon', 1.0)} + others = [('juice', 'raisin')] | items + assert others == {('spam', 500.0), ('juice', 'raisin'), ('eggs', 2.0), ('sausage', 1.0), ('bacon', 1.0)} + +def test_items_xor(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + items = dishes.items() + others = items ^ {('eggs', 2)} + assert others == {('spam', 500), ('bacon', 1), ('sausage', 1)} + +def test_items_intersect_one_own_smaller(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + items = dishes.items()# TODO causes crash + b = items & {('eggs', 2), ('bacon', 1), ('salad', 12), ('jam', 34)} + c = {('eggs', 2), ('bacon', 1), ('salad', 12), ('jam', 34)} & items + assert b == {('bacon', 1), ('eggs', 2)} == c + +def test_items_intersect_one(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + items = dishes.items() + b = items & {('eggs', 2)} + assert b == {('eggs', 2)} + +def test_items_intersect_none(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + items = dishes.items() + b = items & {('ketchup', 12)} + assert str(b) == "set()" + +def test_items_len(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + items = dishes.items() + assert len(items) == 4 +# TODO causes crash +# TODO tuple support +#def test_items_contains(): +# dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") +# items = dishes.items() +# assert {('eggs', 2)} in items + +def test_values_update_object_updates_the_items(): + employee = pm.eval("({'name': 'Phil', 'age': 22})") + dictionaryItems = employee.items() + employee.update({('salary', 3500.0)}) + assert str(dictionaryItems) == "dict_items([('name', 'Phil'), ('age', 22.0), ('salary', 3500.0)])" + +def test_items_mapping(): + dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") + items = dishes.items() + assert str(items.mapping) == "{'eggs': 2.0, 'sausage': 1.0, 'bacon': 1.0, 'spam': 500.0}" + assert items.mapping['spam'] == 500 + + + + + + + + diff --git a/tests/python/test_dicts.py b/tests/python/test_dicts.py index 1be75e61..9415d79d 100644 --- a/tests/python/test_dicts.py +++ b/tests/python/test_dicts.py @@ -137,19 +137,28 @@ def test_instanceof_object(): a = {'c':5.0} result = [None] pm.eval("(result, obj) => {result[0] = obj instanceof Object}")(result, a) - assert result[0] == True + assert result[0] == True +#iter def test_eval_objects_proxy_iterate(): obj = pm.eval("({ a: 123, b: 'test' })") result = [] for i in obj: result.append(i) - assert result == [('a', 123.0), ('b', 'test')] + assert result == ['a', 'b'] + +def test_eval_objects_proxy_min(): + obj = pm.eval("({ a: 123, b: 'test' })") + assert min(obj) == 'a' + +def test_eval_objects_proxy_max(): + obj = pm.eval("({ a: 123, b: 'test' })") + assert max(obj) == 'b' def test_eval_objects_proxy_repr(): obj = pm.eval("({ a: 123, b: 'test' , c: { d: 1 }})") obj.e = obj # supporting circular references - expected = "{'a': 123.0, 'b': 'test', 'c': {'d': 1.0}, 'e': [Circular]}" + expected = "{'a': 123.0, 'b': 'test', 'c': {'d': 1.0}, 'e': {...}}" assert repr(obj) == expected assert str(obj) == expected @@ -159,8 +168,7 @@ def test_eval_objects_proxy_dict_conversion(): assert type(obj) is not dict # dict subclass assert type(d) is dict # strict dict assert repr(d) == "{'a': 123.0, 'b': 'test', 'c': {'d': 1.0}}" - assert obj.keys() == ['a', 'b', 'c'] # Conversion from a dict-subclass to a strict dict internally calls the .keys() method - assert list(d.keys()) == obj.keys() + assert str(obj.keys()) == "dict_keys(['a', 'b', 'c'])" assert obj == d def test_eval_objects_jsproxy_get(): @@ -254,4 +262,20 @@ def test_eval_objects_jsproxy_inplace_or_true_dict_left(): b = pm.eval("({'d':6})") a |= b assert a == {'c': 5.0, 'd': 6.0} - assert b == {'d': 6.0} \ No newline at end of file + assert b == {'d': 6.0} + +def test_eval_objects_jsproxy_inplace_or_true_dict_left_iterable_right(): + if sys.version_info[0] >= 3 and sys.version_info[1] >= 9: # | is not implemented for dicts in 3.8 or less + a = {'c': 5} + a |= [('y', 3), ('z', 0)] + assert a == {'c': 5, 'y': 3, 'z':0} + +def test_update_inplace_or_iterable_wrong_type(): + car = pm.eval('({"brand": "Ford","model": "Mustang","year": 1964})') + a = [1,2] + try: + car |= a + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "cannot convert dictionary update sequence element #0 to a sequence" From d624de51c1f52416961e60484f098a3fa23920e5 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Mon, 22 Jan 2024 13:23:44 -0500 Subject: [PATCH 0174/1086] PySet_Check instead of PySet_CheckExact for earlier cpython versions --- src/JSObjectKeysProxy.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JSObjectKeysProxy.cc b/src/JSObjectKeysProxy.cc index 92dfdb2d..189b8652 100644 --- a/src/JSObjectKeysProxy.cc +++ b/src/JSObjectKeysProxy.cc @@ -250,7 +250,7 @@ PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_intersect(JSObje } // if other is a set and self is smaller than other, reuse set intersection logic - if (PySet_CheckExact(other) && len_self <= PyObject_Size(other)) { + if (PySet_Check(other) && len_self <= PyObject_Size(other)) { return PyObject_CallMethod(other, "intersection", "O", self); } From 01223a97188bfe4aabaa469a7c68dc2bd49af607 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Mon, 22 Jan 2024 13:51:37 -0500 Subject: [PATCH 0175/1086] cleanup --- tests/python/test_dict_methods.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tests/python/test_dict_methods.py b/tests/python/test_dict_methods.py index 866ba9c9..5239d4b5 100644 --- a/tests/python/test_dict_methods.py +++ b/tests/python/test_dict_methods.py @@ -444,12 +444,4 @@ def test_items_mapping(): dishes = pm.eval("({'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500})") items = dishes.items() assert str(items.mapping) == "{'eggs': 2.0, 'sausage': 1.0, 'bacon': 1.0, 'spam': 500.0}" - assert items.mapping['spam'] == 500 - - - - - - - - + assert items.mapping['spam'] == 500 \ No newline at end of file From f063407d213b72338f85cd048b58905c736371ac Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 22 Jan 2024 16:29:31 -0500 Subject: [PATCH 0176/1086] proper class structure for proxies: refactoring. Missing Dict-Object methods --- include/PyBaseProxyHandler.hh | 55 ++++++ ...yProxyHandler.hh => PyDictProxyHandler.hh} | 109 ++--------- include/PyListProxyHandler.hh | 51 +++++ src/JSArrayProxy.cc | 2 +- src/JSObjectItemsProxy.cc | 2 +- src/JSObjectIterProxy.cc | 2 +- src/JSObjectKeysProxy.cc | 2 +- src/JSObjectProxy.cc | 2 +- src/JSObjectValuesProxy.cc | 2 +- src/PyBaseProxyHandler.cc | 61 ++++++ src/PyDictProxyHandler.cc | 185 ++++++++++++++++++ ...yProxyHandler.cc => PyListProxyHandler.cc} | 175 +---------------- src/jsTypeFactory.cc | 7 +- src/pyTypeFactory.cc | 7 +- tests/python/test_dicts.py | 36 +++- 15 files changed, 426 insertions(+), 272 deletions(-) create mode 100644 include/PyBaseProxyHandler.hh rename include/{PyProxyHandler.hh => PyDictProxyHandler.hh} (56%) create mode 100644 include/PyListProxyHandler.hh create mode 100644 src/PyBaseProxyHandler.cc create mode 100644 src/PyDictProxyHandler.cc rename src/{PyProxyHandler.cc => PyListProxyHandler.cc} (91%) diff --git a/include/PyBaseProxyHandler.hh b/include/PyBaseProxyHandler.hh new file mode 100644 index 00000000..793f6b2a --- /dev/null +++ b/include/PyBaseProxyHandler.hh @@ -0,0 +1,55 @@ +/** + * @file PyBaseProxyHandler.hh + * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) + * @brief Structs for creating JS proxy objects. + * @version 0.1 + * @date 2023-04-20 + * + * Copyright (c) 2023-2024 Distributive Corp. + * + */ + +#ifndef PythonMonkey_PyBaseProxy_ +#define PythonMonkey_PyBaseProxy_ + +#include +#include +#include +#include + +#include + +/** + * @brief base class for PyDictProxyHandler and PyListProxyHandler + */ +struct PyBaseProxyHandler : public js::BaseProxyHandler { +public: + PyBaseProxyHandler(PyObject *pyObj, const void *family) : js::BaseProxyHandler(family), pyObject(pyObj) {}; + PyObject *pyObject; // @TODO (Caleb Aikens) Consider putting this in a private slot + + bool getPrototypeIfOrdinary(JSContext *cx, JS::HandleObject proxy, bool *isOrdinary, JS::MutableHandleObject protop) const override final; + bool preventExtensions(JSContext *cx, JS::HandleObject proxy, JS::ObjectOpResult &result) const override final; + bool isExtensible(JSContext *cx, JS::HandleObject proxy, bool *extensible) const override final; +}; + +enum ProxySlots {PyObjectSlot}; + +typedef struct { + const char *name; /* The name of the method */ + JSNative call; /* The C function that implements it */ + uint16_t nargs; /* The argument count for the method */ +} JSMethodDef; + +/** + * @brief Convert jsid to a PyObject to be used as dict keys + */ +PyObject *idToKey(JSContext *cx, JS::HandleId id); + +/** + * @brief Convert Python dict key to jsid + */ +bool keyToId(PyObject *key, JS::MutableHandleId idp); + +bool idToIndex(JSContext *cx, JS::HandleId id, Py_ssize_t *index); + +#endif \ No newline at end of file diff --git a/include/PyProxyHandler.hh b/include/PyDictProxyHandler.hh similarity index 56% rename from include/PyProxyHandler.hh rename to include/PyDictProxyHandler.hh index 8bb99af8..6fd6680c 100644 --- a/include/PyProxyHandler.hh +++ b/include/PyDictProxyHandler.hh @@ -1,50 +1,26 @@ /** - * @file PyProxyHandler.hh + * @file PyDictProxyHandler.hh * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) - * @brief Structs for creating JS proxy objects. Used by DictType for object coercion and by ListType for List coercion - * @version 0.1 + * @brief Structs for creating JS proxy objects. Used by DictType for object coercion * @date 2023-04-20 * * Copyright (c) 2023-2024 Distributive Corp. * */ -#ifndef PythonMonkey_PyProxy_ -#define PythonMonkey_PyProxy_ +#ifndef PythonMonkey_PyDictProxy_ +#define PythonMonkey_PyDictProxy_ -#include -#include +#include "PyBaseProxyHandler.hh" -#include - -/** - * @brief base class for PyProxyHandler and PyListProxyHandler - */ -struct PyBaseProxyHandler : public js::BaseProxyHandler { -public: - PyBaseProxyHandler(PyObject *pyObj, const void *family) : js::BaseProxyHandler(family), pyObject(pyObj) {}; - PyObject *pyObject; // @TODO (Caleb Aikens) Consider putting this in a private slot - - bool getPrototypeIfOrdinary(JSContext *cx, JS::HandleObject proxy, bool *isOrdinary, JS::MutableHandleObject protop) const override final; - bool preventExtensions(JSContext *cx, JS::HandleObject proxy, JS::ObjectOpResult &result) const override final; - bool isExtensible(JSContext *cx, JS::HandleObject proxy, bool *extensible) const override final; -}; - -enum ProxySlots {PyObjectSlot}; - -typedef struct { - const char *name; /* The name of the method */ - JSNative call; /* The C function that implements it */ - uint16_t nargs; /* The argument count for the method */ -} JSMethodDef; /** * @brief This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates to handle coercion from python dicts to JS Objects * */ -struct PyProxyHandler : public PyBaseProxyHandler { +struct PyDictProxyHandler : public PyBaseProxyHandler { public: - PyProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; + PyDictProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; static const char family; /** @@ -72,7 +48,7 @@ public: JS::ObjectOpResult &result) const override; /** * @brief [[HasProperty]] - * + * // printf("copy\n"); * @param cx - pointer to JSContext * @param proxy - The proxy object who's propery we wish to check * @param id - key value of the property to check @@ -82,20 +58,6 @@ public: */ bool has(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp) const override; - /** - * @brief [[Get]] - * - * @param cx pointer to JSContext - * @param proxy - The proxy object who's property we wish to check - * @param receiver @TODO (Caleb Aikens) read ECMAScript docs about this - * @param id - Key of the property we wish to get - * @param vp - out-paramter for the gotten property - * @return true - call succeeded - * @return false - call failed and an exception has been raised - */ - bool get(JSContext *cx, JS::HandleObject proxy, - JS::HandleValue receiver, JS::HandleId id, - JS::MutableHandleValue vp) const override; /** * @brief [[Set]] * @@ -116,7 +78,10 @@ public: * * @param cx - pointer to JSContext * @param proxy - The proxy object who's keys we output - * @param props - out-parameter of object IDs + * @param props - out-parameter of object IDsoverride; + + // @TODO (Caleb Aikens) The following are Spidermonkey-unique extensions, need to read into them more + /** * @return true - call succeeded * @return false - call failed and an exception has been raised */ @@ -140,7 +105,10 @@ public: * @brief @TODO (Caleb Aikens) read up on what this trap does exactly * * @param cx - pointer to JSContext - * @param proxy - The proxy object who's keys we output + * @param proxy - The proxy object who's keys we outputoverride; + + // @TODO (Caleb Aikens) The following are Spidermonkey-unique extensions, need to read into them more + /** * @param props - out-parameter of object IDs * @return true - call succeeded * @return false - call failed and an exception has been raised @@ -169,47 +137,4 @@ public: bool getBuiltinClass(JSContext *cx, JS::HandleObject proxy, js::ESClass *cls) const override; }; -/** - * @brief This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates - * to handle coercion from python lists to JS Array objects - */ -struct PyListProxyHandler : public PyBaseProxyHandler { -public: - PyListProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; - static const char family; - - /** - * @brief Handles python object reference count when JS Proxy object is finalized - * - * @param gcx pointer to JS::GCContext - * @param proxy the proxy object being finalized - */ - void finalize(JS::GCContext *gcx, JSObject *proxy) const override; - - bool getOwnPropertyDescriptor( - JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - JS::MutableHandle> desc - ) const override; - - bool defineProperty( - JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - JS::Handle desc, JS::ObjectOpResult &result - ) const override; - - bool ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override; - bool delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const override; - bool isArray(JSContext *cx, JS::HandleObject proxy, JS::IsArrayAnswer *answer) const override; - bool getBuiltinClass(JSContext *cx, JS::HandleObject proxy, js::ESClass *cls) const override; -}; - -/** - * @brief Convert jsid to a PyObject to be used as dict keys - */ -PyObject *idToKey(JSContext *cx, JS::HandleId id); - -/** - * @brief Convert Python dict key to jsid - */ -bool keyToId(PyObject *key, JS::MutableHandleId idp); - -#endif +#endif \ No newline at end of file diff --git a/include/PyListProxyHandler.hh b/include/PyListProxyHandler.hh new file mode 100644 index 00000000..3ef206dc --- /dev/null +++ b/include/PyListProxyHandler.hh @@ -0,0 +1,51 @@ +/** + * @file PyListProxyHandler.hh + * @author Philippe Laporte (philippe@distributive.network) + * @brief Structs for creating JS proxy objects. Used by ListType for List coercion + * @version 0.1 + * @date 2023-12-01 + * + * Copyright (c) 2023-2024 Distributive Corp. + * + */ + +#ifndef PythonMonkey_PyListProxy_ +#define PythonMonkey_PyListProxy_ + +#include "PyBaseProxyHandler.hh" + + +/** + * @brief This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates + * to handle coercion from python lists to JS Array objects + */ +struct PyListProxyHandler : public PyBaseProxyHandler { +public: + PyListProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; + static const char family; + + /** + * @brief Handles python object reference count when JS Proxy object is finalized + * + * @param gcx pointer to JS::GCContext + * @param proxy the proxy object being finalized + */ + void finalize(JS::GCContext *gcx, JSObject *proxy) const override; + + bool getOwnPropertyDescriptor( + JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::MutableHandle> desc + ) const override; + + bool defineProperty( + JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::Handle desc, JS::ObjectOpResult &result + ) const override; + + bool ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override; + bool delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const override; + bool isArray(JSContext *cx, JS::HandleObject proxy, JS::IsArrayAnswer *answer) const override; + bool getBuiltinClass(JSContext *cx, JS::HandleObject proxy, js::ESClass *cls) const override; +}; + +#endif diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 65ecf57a..2a224553 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -17,7 +17,7 @@ #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/jsTypeFactory.hh" #include "include/pyTypeFactory.hh" -#include "include/PyProxyHandler.hh" +#include "include/PyBaseProxyHandler.hh" #include #include diff --git a/src/JSObjectItemsProxy.cc b/src/JSObjectItemsProxy.cc index e75d1980..91f593d2 100644 --- a/src/JSObjectItemsProxy.cc +++ b/src/JSObjectItemsProxy.cc @@ -18,7 +18,7 @@ #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/jsTypeFactory.hh" #include "include/pyTypeFactory.hh" -#include "include/PyProxyHandler.hh" +#include "include/PyBaseProxyHandler.hh" #include #include diff --git a/src/JSObjectIterProxy.cc b/src/JSObjectIterProxy.cc index a3604946..1a20dac1 100644 --- a/src/JSObjectIterProxy.cc +++ b/src/JSObjectIterProxy.cc @@ -17,7 +17,7 @@ #include "include/pyTypeFactory.hh" -#include "include/PyProxyHandler.hh" +#include "include/PyDictProxyHandler.hh" #include diff --git a/src/JSObjectKeysProxy.cc b/src/JSObjectKeysProxy.cc index 189b8652..81adbe59 100644 --- a/src/JSObjectKeysProxy.cc +++ b/src/JSObjectKeysProxy.cc @@ -18,7 +18,7 @@ #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/jsTypeFactory.hh" #include "include/pyTypeFactory.hh" -#include "include/PyProxyHandler.hh" +#include "include/PyDictProxyHandler.hh" #include #include diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index e378463c..9739f4ae 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -20,7 +20,7 @@ #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/jsTypeFactory.hh" #include "include/pyTypeFactory.hh" -#include "include/PyProxyHandler.hh" +#include "include/PyBaseProxyHandler.hh" #include #include diff --git a/src/JSObjectValuesProxy.cc b/src/JSObjectValuesProxy.cc index e85e7661..d6a7a9b5 100644 --- a/src/JSObjectValuesProxy.cc +++ b/src/JSObjectValuesProxy.cc @@ -18,7 +18,7 @@ #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/jsTypeFactory.hh" #include "include/pyTypeFactory.hh" -#include "include/PyProxyHandler.hh" +#include "include/PyDictProxyHandler.hh" #include #include diff --git a/src/PyBaseProxyHandler.cc b/src/PyBaseProxyHandler.cc new file mode 100644 index 00000000..dc50d095 --- /dev/null +++ b/src/PyBaseProxyHandler.cc @@ -0,0 +1,61 @@ +/** + * @file PyBaseProxyHandler.cc + * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) + * @brief Struct for creating JS proxy objects + * @date 2023-04-20 + * + * Copyright (c) 2023-2024 Distributive Corp. + * + */ + + +#include "include/PyBaseProxyHandler.hh" +#include +#include + + +PyObject *idToKey(JSContext *cx, JS::HandleId id) { + JS::RootedValue idv(cx, js::IdToValue(id)); + JS::RootedString idStr(cx); + if (!id.isSymbol()) { // `JS::ToString` returns `nullptr` for JS symbols + idStr = JS::ToString(cx, idv); + } else { + // TODO (Tom Tang): Revisit this once we have Symbol coercion support + // FIXME (Tom Tang): key collision for symbols without a description string, or pure strings look like "Symbol(xxx)" + idStr = JS_ValueToSource(cx, idv); + } + + // We convert all types of property keys to string + auto chars = JS_EncodeStringToUTF8(cx, idStr); + return PyUnicode_FromString(chars.get()); +} + +bool idToIndex(JSContext *cx, JS::HandleId id, Py_ssize_t *index) { + if (id.isInt()) { // int-like strings have already been automatically converted to ints + *index = id.toInt(); + return true; + } else { + return false; // fail + } +} + +bool PyBaseProxyHandler::getPrototypeIfOrdinary(JSContext *cx, JS::HandleObject proxy, + bool *isOrdinary, + JS::MutableHandleObject protop) const { + // We don't have a custom [[GetPrototypeOf]] + *isOrdinary = true; + protop.set(js::GetStaticPrototype(proxy)); + return true; +} + +bool PyBaseProxyHandler::preventExtensions(JSContext *cx, JS::HandleObject proxy, + JS::ObjectOpResult &result) const { + result.succeed(); + return true; +} + +bool PyBaseProxyHandler::isExtensible(JSContext *cx, JS::HandleObject proxy, + bool *extensible) const { + *extensible = false; + return true; +} \ No newline at end of file diff --git a/src/PyDictProxyHandler.cc b/src/PyDictProxyHandler.cc new file mode 100644 index 00000000..c48b2854 --- /dev/null +++ b/src/PyDictProxyHandler.cc @@ -0,0 +1,185 @@ +/** + * @file PyDictProxyHandler.cc + * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) + * @brief Struct for creating JS proxy objects. Used by DictType for object coercion TODO + * @date 2023-04-20 + * + * Copyright (c) 2023-2024 Distributive Corp. + * + */ + +#include "include/PyDictProxyHandler.hh" + +#include "include/jsTypeFactory.hh" +#include "include/pyTypeFactory.hh" +#include "include/StrType.hh" + +#include +#include +#include +#include +#include +#include + +#include + + + +const char PyDictProxyHandler::family = 0; + + +static bool object_toString(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + args.rval().setString(JS_NewStringCopyZ(cx, "[object Object]")); + return true; +} + +static bool object_toLocaleString(JSContext *cx, unsigned argc, JS::Value *vp) { + return object_toString(cx, argc, vp); +} + +static bool object_valueOf(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + // return ref to self + args.rval().set(jsTypeFactory(cx, self)); + return true; +} + + +static JSMethodDef object_methods[] = { + {"toString", object_toString, 0}, + {"toLocaleString", object_toLocaleString, 0}, + {"valueOf", object_valueOf, 0}, + {NULL, NULL, 0} +}; + + +bool PyDictProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { + PyObject *keys = PyDict_Keys(pyObject); + size_t length = PyList_Size(keys); + if (!props.reserve(length)) { + return false; // out of memory + } + + for (size_t i = 0; i < length; i++) { + PyObject *key = PyList_GetItem(keys, i); + JS::RootedId jsId(cx); + if (!keyToId(key, &jsId)) { + // TODO (Caleb Aikens): raise exception here + return false; // key is not a str or int + } + props.infallibleAppend(jsId); + } + return true; +} + +bool PyDictProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::ObjectOpResult &result) const { + PyObject *attrName = idToKey(cx, id); + if (PyDict_DelItem(pyObject, attrName) < 0) { + return result.failCantDelete(); // raises JS exception + } + return result.succeed(); +} + +bool PyDictProxyHandler::has(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + bool *bp) const { + return hasOwn(cx, proxy, id, bp); +} + +bool PyDictProxyHandler::getOwnPropertyDescriptor( + JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::MutableHandle> desc +) const { + // see if we're calling a function + if (id.isString()) { + for (size_t index = 0;; index++) { + bool isThatFunction; + const char *methodName = object_methods[index].name; + if (methodName == NULL) { // reached end of list + break; + } + else if (JS_StringEqualsAscii(cx, id.toString(), methodName, &isThatFunction) && isThatFunction) { + JSFunction *newFunction = JS_NewFunction(cx, object_methods[index].call, object_methods[index].nargs, 0, NULL); + if (!newFunction) return false; + JS::RootedObject funObj(cx, JS_GetFunctionObject(newFunction)); + desc.set(mozilla::Some( + JS::PropertyDescriptor::Data( + JS::ObjectValue(*funObj), + {JS::PropertyAttribute::Enumerable} + ) + )); + return true; + } + } + } + + PyObject *attrName = idToKey(cx, id); + PyObject *item = PyDict_GetItemWithError(pyObject, attrName); + if (!item) { // NULL if the key is not present + desc.set(mozilla::Nothing()); // JS objects return undefined for nonpresent keys + } else { + desc.set(mozilla::Some( + JS::PropertyDescriptor::Data( + jsTypeFactory(cx, item), + {JS::PropertyAttribute::Writable, JS::PropertyAttribute::Enumerable} + ) + )); + } + return true; +} + +bool PyDictProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + JS::HandleValue v, JS::HandleValue receiver, + JS::ObjectOpResult &result) const { + JS::RootedValue *rootedV = new JS::RootedValue(cx, v); + PyObject *attrName = idToKey(cx, id); + JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + if (PyDict_SetItem(pyObject, attrName, pyTypeFactory(cx, global, rootedV)->getPyObject())) { + return result.failCantSetInterposed(); // raises JS exception + } + return result.succeed(); +} + +bool PyDictProxyHandler::enumerate(JSContext *cx, JS::HandleObject proxy, + JS::MutableHandleIdVector props) const { + return this->ownPropertyKeys(cx, proxy, props); +} + +bool PyDictProxyHandler::hasOwn(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, + bool *bp) const { + PyObject *attrName = idToKey(cx, id); + *bp = PyDict_Contains(pyObject, attrName) == 1; + return true; +} + +bool PyDictProxyHandler::getOwnEnumerablePropertyKeys( + JSContext *cx, JS::HandleObject proxy, + JS::MutableHandleIdVector props) const { + return this->ownPropertyKeys(cx, proxy, props); +} + +// @TODO (Caleb Aikens) implement this +void PyDictProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const {} + +bool PyDictProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, + JS::HandleId id, + JS::Handle desc, + JS::ObjectOpResult &result) const { + // Block direct `Object.defineProperty` since we already have the `set` method + return result.failInvalidDescriptor(); +} + +bool PyDictProxyHandler::getBuiltinClass(JSContext *cx, JS::HandleObject proxy, + js::ESClass *cls) const { + *cls = js::ESClass::Object; + return true; +} \ No newline at end of file diff --git a/src/PyProxyHandler.cc b/src/PyListProxyHandler.cc similarity index 91% rename from src/PyProxyHandler.cc rename to src/PyListProxyHandler.cc index 0bf9e043..2c819436 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -1,18 +1,18 @@ /** - * @file PyProxyHandler.cc - * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) - * @brief Struct for creating JS proxy objects. Used by DictType for object coercion TODO - * @version 0.1 - * @date 2023-04-20 + * @file PyListProxyHandler.cc + * @author Philippe Laporte (philippe@distributive.network) + * @brief Struct for creating JS proxy objects. Used by ListType for List coercion + * @date 2023-12-01 * * Copyright (c) 2023-2024 Distributive Corp. * */ -#include "include/PyProxyHandler.hh" +#include "include/PyListProxyHandler.hh" +#include "include/PyBaseProxyHandler.hh" -#include "include/JSArrayProxy.hh" #include "include/jsTypeFactory.hh" +#include "include/JSArrayProxy.hh" #include "include/pyTypeFactory.hh" #include "include/StrType.hh" @@ -25,170 +25,11 @@ #include -PyObject *idToKey(JSContext *cx, JS::HandleId id) { - JS::RootedValue idv(cx, js::IdToValue(id)); - JS::RootedString idStr(cx); - if (!id.isSymbol()) { // `JS::ToString` returns `nullptr` for JS symbols - idStr = JS::ToString(cx, idv); - } else { - // TODO (Tom Tang): Revisit this once we have Symbol coercion support - // FIXME (Tom Tang): key collision for symbols without a description string, or pure strings look like "Symbol(xxx)" - idStr = JS_ValueToSource(cx, idv); - } - - // We convert all types of property keys to string - auto chars = JS_EncodeStringToUTF8(cx, idStr); - return PyUnicode_FromString(chars.get()); -} - -bool idToIndex(JSContext *cx, JS::HandleId id, Py_ssize_t *index) { - if (id.isInt()) { // int-like strings have already been automatically converted to ints - *index = id.toInt(); - return true; - } else { - return false; // fail - } -} - -const char PyProxyHandler::family = 0; - -bool PyProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { - PyObject *keys = PyDict_Keys(pyObject); - size_t length = PyList_Size(keys); - if (!props.reserve(length)) { - return false; // out of memory - } - - for (size_t i = 0; i < length; i++) { - PyObject *key = PyList_GetItem(keys, i); - JS::RootedId jsId(cx); - if (!keyToId(key, &jsId)) { - // TODO (Caleb Aikens): raise exception here - return false; // key is not a str or int - } - props.infallibleAppend(jsId); - } - return true; -} - -bool PyProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - JS::ObjectOpResult &result) const { - PyObject *attrName = idToKey(cx, id); - if (PyDict_DelItem(pyObject, attrName) < 0) { - return result.failCantDelete(); // raises JS exception - } - return result.succeed(); -} - -bool PyProxyHandler::has(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - bool *bp) const { - return hasOwn(cx, proxy, id, bp); -} - -bool PyProxyHandler::get(JSContext *cx, JS::HandleObject proxy, - JS::HandleValue receiver, JS::HandleId id, - JS::MutableHandleValue vp) const { - PyObject *attrName = idToKey(cx, id); - PyObject *p = PyDict_GetItemWithError(pyObject, attrName); - if (!p) { // NULL if the key is not present - vp.setUndefined(); // JS objects return undefined for nonpresent keys - } else { - vp.set(jsTypeFactory(cx, p)); - } - return true; -} - -bool PyProxyHandler::getOwnPropertyDescriptor( - JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - JS::MutableHandle> desc -) const { - PyObject *attrName = idToKey(cx, id); - PyObject *item = PyDict_GetItemWithError(pyObject, attrName); - if (!item) { // NULL if the key is not present - desc.set(mozilla::Nothing()); // JS objects return undefined for nonpresent keys - } else { - desc.set(mozilla::Some( - JS::PropertyDescriptor::Data( - jsTypeFactory(cx, item), - {JS::PropertyAttribute::Writable, JS::PropertyAttribute::Enumerable} - ) - )); - } - return true; -} - -bool PyProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - JS::HandleValue v, JS::HandleValue receiver, - JS::ObjectOpResult &result) const { - JS::RootedValue *rootedV = new JS::RootedValue(cx, v); - PyObject *attrName = idToKey(cx, id); - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - if (PyDict_SetItem(pyObject, attrName, pyTypeFactory(cx, global, rootedV)->getPyObject())) { - return result.failCantSetInterposed(); // raises JS exception - } - return result.succeed(); -} - -bool PyProxyHandler::enumerate(JSContext *cx, JS::HandleObject proxy, - JS::MutableHandleIdVector props) const { - return this->ownPropertyKeys(cx, proxy, props); -} - -bool PyProxyHandler::hasOwn(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - bool *bp) const { - PyObject *attrName = idToKey(cx, id); - *bp = PyDict_Contains(pyObject, attrName) == 1; - return true; -} - -bool PyProxyHandler::getOwnEnumerablePropertyKeys( - JSContext *cx, JS::HandleObject proxy, - JS::MutableHandleIdVector props) const { - return this->ownPropertyKeys(cx, proxy, props); -} - -// @TODO (Caleb Aikens) implement this -void PyProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const {} - -bool PyProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, - JS::HandleId id, - JS::Handle desc, - JS::ObjectOpResult &result) const { - // Block direct `Object.defineProperty` since we already have the `set` method - return result.failInvalidDescriptor(); -} - -bool PyProxyHandler::getBuiltinClass(JSContext *cx, JS::HandleObject proxy, - js::ESClass *cls) const { - *cls = js::ESClass::Object; - return true; -} - -bool PyBaseProxyHandler::getPrototypeIfOrdinary(JSContext *cx, JS::HandleObject proxy, - bool *isOrdinary, - JS::MutableHandleObject protop) const { - // We don't have a custom [[GetPrototypeOf]] - *isOrdinary = true; - protop.set(js::GetStaticPrototype(proxy)); - return true; -} -bool PyBaseProxyHandler::preventExtensions(JSContext *cx, JS::HandleObject proxy, - JS::ObjectOpResult &result) const { - result.succeed(); - return true; -} - -bool PyBaseProxyHandler::isExtensible(JSContext *cx, JS::HandleObject proxy, - bool *extensible) const { - *extensible = false; - return true; -} +const char PyListProxyHandler::family = 0; -// PyList ---------------------------------------------------------------------- -const char PyListProxyHandler::family = 0; static bool array_reverse(JSContext *cx, unsigned argc, JS::Value *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index fba294d3..459bf35e 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -16,7 +16,8 @@ #include "include/FuncType.hh" #include "include/JSObjectProxy.hh" #include "include/JSArrayProxy.hh" -#include "include/PyProxyHandler.hh" +#include "include/PyDictProxyHandler.hh" +#include "include/PyListProxyHandler.hh" #include "include/pyTypeFactory.hh" #include "include/StrType.hh" #include "include/IntType.hh" @@ -174,12 +175,12 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { JS::RootedObject arrayPrototype(cx); JS_GetClassPrototype(cx, JSProto_Array, &arrayPrototype); // so that instanceof will work, not that prototype methods will proxy = js::NewProxyObject(cx, new PyListProxyHandler(object), v, arrayPrototype.get()); - JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(object)); } else { JS::RootedObject objectPrototype(cx); JS_GetClassPrototype(cx, JSProto_Object, &objectPrototype); // so that instanceof will work, not that prototype methods will - proxy = js::NewProxyObject(cx, new PyProxyHandler(object), v, objectPrototype.get()); + proxy = js::NewProxyObject(cx, new PyDictProxyHandler(object), v, objectPrototype.get()); } + JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(object)); returnType.setObject(*proxy); } else if (object == Py_None) { diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index 626003d9..d8f8a7a3 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -24,7 +24,8 @@ #include "include/NoneType.hh" #include "include/NullType.hh" #include "include/PromiseType.hh" -#include "include/PyProxyHandler.hh" +#include "include/PyDictProxyHandler.hh" +#include "include/PyListProxyHandler.hh" #include "include/PyType.hh" #include "include/setSpiderMonkeyException.hh" #include "include/StrType.hh" @@ -97,8 +98,8 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted JS::Rooted obj(cx); JS_ValueToObject(cx, *rval, &obj); if (JS::GetClass(obj)->isProxyObject()) { - if (js::GetProxyHandler(obj)->family() == &PyProxyHandler::family) { // this is one of our proxies for python dicts - return new DictType(((PyProxyHandler *)js::GetProxyHandler(obj))->pyObject); + if (js::GetProxyHandler(obj)->family() == &PyDictProxyHandler::family) { // this is one of our proxies for python dicts + return new DictType(((PyDictProxyHandler *)js::GetProxyHandler(obj))->pyObject); } if (js::GetProxyHandler(obj)->family() == &PyListProxyHandler::family) { // this is one of our proxies for python lists return new ListType(((PyListProxyHandler *)js::GetProxyHandler(obj))->pyObject); diff --git a/tests/python/test_dicts.py b/tests/python/test_dicts.py index 9415d79d..783ec376 100644 --- a/tests/python/test_dicts.py +++ b/tests/python/test_dicts.py @@ -278,4 +278,38 @@ def test_update_inplace_or_iterable_wrong_type(): assert (False) except Exception as e: assert str(type(e)) == "" - assert str(e) == "cannot convert dictionary update sequence element #0 to a sequence" + assert str(e) == "cannot convert dictionary update sequence element #0 to a sequence" + +def test_instanceof_object(): + items = {'a': 10} + result = [None] + pm.eval("(result, obj) => {result[0] = obj instanceof Object}")(result, items) + assert result[0] == True + +def test_not_instanceof_string(): + items = {'a': 10} + result = [None] + pm.eval("(result, obj) => {result[0] = obj instanceof String}")(result, items) + assert result[0] == False + +#valueOf +def test_valueOf(): + items = {'a': 10} + result = [0] + pm.eval("(result, obj) => {result[0] = obj.valueOf()}")(result, items) + assert items == {'a': 10} + assert result[0] is items + +# toString +def test_toString(): + items = {'a': 10} + result = [0] + pm.eval("(result, obj) => {result[0] = obj.toString()}")(result, items) + assert result[0] == '[object Object]' + +# toLocaleString +def test_toLocaleString(): + items = {'a': 10} + result = [0] + pm.eval("(result, obj) => {result[0] = obj.toLocaleString()}")(result, items) + assert result[0] == '[object Object]' \ No newline at end of file From ea7935edb0fb4e2fe7bd5445b57849013fcb2d95 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 23 Jan 2024 12:35:12 -0500 Subject: [PATCH 0177/1086] added MPL to license and notes on license usage --- LICENSE | 172 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 170 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index c4867839..085d2547 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Distributive Corp. +Copyright (c) 2023-2024 Distributive Corp. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -22,6 +22,11 @@ SOFTWARE. ------------------------------------------------------------------------------- +We have adapted some parameter parsing and algorithmic logic for our Python +subclasses from cPython + + + Python Software Foundation License Version 2 Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, @@ -76,6 +81,9 @@ Agreement. ------------------------------------------------------------------------------- +We have adapted JS facilities classes such as Console.js from Node + + Copyright Node.js contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy @@ -119,4 +127,164 @@ 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 +""" + +------------------------------------------------------------------------------- + +We have adapted some parameter parsing and algorithmic logic for our Javascript Proxies from +Mozilla's Spidermonkey + + + +Mozilla Public License +Version 2.0 +1. Definitions +1.1. “Contributor” +means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. + +1.2. “Contributor Version” +means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” +means Covered Software of a particular Contributor. + +1.4. “Covered Software” +means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. + +1.5. “Incompatible With Secondary Licenses” +means + +that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or + +that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. + +1.6. “Executable Form” +means any form of the work other than Source Code Form. + +1.7. “Larger Work” +means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. + +1.8. “License” +means this document. + +1.9. “Licensable” +means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. + +1.10. “Modifications” +means any of the following: + +any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or + +any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor +means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. + +1.12. “Secondary License” +means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” +means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) +means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + +2. License Grants and Conditions +2.1. Grants +Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: + +under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and + +under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. + +2.2. Effective Date +The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. + +2.3. Limitations on Grant Scope +The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: + +for any code that a Contributor has removed from Covered Software; or + +for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or + +under Patent Claims infringed by Covered Software in the absence of its Contributions. + +This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). + +2.4. Subsequent Licenses +No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). + +2.5. Representation +Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use +This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. + +3. Responsibilities +3.1. Distribution of Source Form +All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form +If You distribute Covered Software in Executable Form then: + +such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and + +You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work +You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). + +3.4. Notices +You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms +You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. + +5. Termination +5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. + +6. Disclaimer of Warranty +Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. + +7. Limitation of Liability +Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation +Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous +This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. + +10. Versions of the License +10.1. New Versions +Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. + +10.2. Effect of New Versions +You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. + +10.3. Modified Versions +If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses +If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice +This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. + From 68a31ee5060180bfbbabb31bb8dde72f80605855 Mon Sep 17 00:00:00 2001 From: Tom Wenzheng Tang Date: Wed, 24 Jan 2024 02:04:01 +0800 Subject: [PATCH 0178/1086] ci: fix MozillaBuild MozillaBuild changed its behaviour but we didn't know. See https://groups.google.com/u/1/a/mozilla.org/g/dev-platform/c/hF51Q3j6ca8 & https://bugzilla.mozilla.org/show_bug.cgi?id=1869958 --- .github/workflows/test-and-publish.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index daf31da6..843fd41a 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -77,6 +77,10 @@ jobs: powershell -command 'Start-Process -Wait -FilePath "./MozillaBuildSetup-Latest.exe" -ArgumentList "/S"' - name: Build spidermonkey in MozillaBuild environment if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }} + env: + # Preserve MozillaBuild v4.0.x behaviour + # see https://groups.google.com/u/1/a/mozilla.org/g/dev-platform/c/hF51Q3j6ca8 + USE_MINTTY: 0 run: /c/mozilla-build/start-shell.bat -use-full-path -here ./setup.sh build-and-test: needs: [build-spidermonkey-unix, build-spidermonkey-win] From ac2b991dcaf92929861ecf29e18a4482b9beb555 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 23 Jan 2024 17:11:41 -0500 Subject: [PATCH 0179/1086] added latest dev and features to readme --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1fa5dbfd..fec833d0 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,12 @@ ![Testing Suite](https://github.com/Kings-Distributed-Systems/PythonMonkey/actions/workflows/tests.yaml/badge.svg) ## About -[PythonMonkey](https://pythonmonkey.io) is a Mozilla [SpiderMonkey](https://firefox-source-docs.mozilla.org/js/index.html) JavaScript engine embedded into the Python VM, -using the Python engine to provide the JS host environment. +[PythonMonkey](https://pythonmonkey.io) is a Mozilla [SpiderMonkey](https://firefox-source-docs.mozilla.org/js/index.html) JavaScript engine embedded into the Python Runtime, +using the Python engine to provide the Javascript host environment. -This product is in an early stage, approximately 80% to MVP as of July 2023. It is under active development by [Distributive](https://distributive.network/). +We feature JavaScript Array and Object methods on Python List and Dictionaries using the cPython C API, and the inverse using the Mozilla Firefox Spidermonkey JavaScript C++ API. + +This product is in an intermmdiate stage, approximately 90% to MVP as of January 2024. It is under active development by [Distributive](https://distributive.network/). External contributions and feedback are welcome and encouraged. ### tl;dr @@ -24,16 +26,17 @@ js_eval("console.log")('hello, world') - Make writing code in either JS or Python a developer preference - Use JavaScript libraries from Python - Use Python libraries from JavaScript -- Same process runs both JS and Python VMs - no serialization, pipes, etc +- The same process runs both JavaScript and Python VirtualMachines - no serialization, pipes, etc +- Python Lists and Dicts behave as Javacript Arrays and Objects, and vice-versa, fully adapting to the given context. ### Data Interchange -- Strings share immutable backing stores whenever possible (when allocating engine choses UCS-2 or Latin-1 internal string representation) to keep memory consumption under control, and to make it possible to move very large strings between JS and Python library code without memory-copy overhead. +- Strings share immutable backing stores whenever possible (when allocating engine choses UCS-2 or Latin-1 internal string representation) to keep memory consumption under control, and to make it possible to move very large strings between JavaScript and Python library code without memory-copy overhead. - TypedArrays share mutable backing stores. -- JS objects are represented by Python dicts +- JS objects are represented by Python dicts through a Dict subclass for optimal compatibility. Similarly for JS arrays and Python lists. - JS Date objects are represented by Python datetime.datetime objects - Intrinsics (boolean, number, null, undefined) are passed by value - JS Functions are automatically wrapped so that they behave like Python functions, and vice-versa -- Python Lists are represented by JS true Arrays +- Python Lists are represented by JS true arrays and support all Array methods through a JS API Proxy. Similarly for Python Dicts and JS objects. ### Roadmap - [done] JS instrinsics coerce to Python intrinsics @@ -49,14 +52,13 @@ js_eval("console.log")('hello, world') - [done] Python `require` function, returns a coerced dict of module exports - [done] Python functions coerce to JS function wrappers - [done] CommonJS module system .py loader, loads Python modules for use by JS -- JS object->Python dict coercion supports inherited-property lookup (via __getattribute__?) - [done] Python host environment supplies event loop, including EventEmitter, setTimeout, etc. -- [done] Python host environment supplies XMLHttpRequest (other project?) -- Python host environment supplies basic subsets of NodeJS's fs, path, process, etc, modules; as-needed by dcp-client (other project?) +- [done] Python host environment supplies XMLHttpRequest +- Python host environment supplies basic subsets of NodeJS's fs, path, process, etc, modules; as-needed by dcp-client - [done] Python TypedArrays coerce to JS TypeArrays - [done] JS TypedArrays coerce to Python TypeArrays -- [done] JS Arrays coerce to Python Lists, providing all List methods implemented on Arrays -- [done] Python List coerce to JS Arrays, providing all Array methods implemented on Lists +- [done] Python lists coerce to JS Arrays +- [done] JS arrays coerce to Python lists ## Build Instructions From d97716171c84e6ad18850cab815af8a5618ad7c1 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Wed, 24 Jan 2024 09:40:18 -0500 Subject: [PATCH 0180/1086] typo fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fec833d0..44e27b9d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ using the Python engine to provide the Javascript host environment. We feature JavaScript Array and Object methods on Python List and Dictionaries using the cPython C API, and the inverse using the Mozilla Firefox Spidermonkey JavaScript C++ API. -This product is in an intermmdiate stage, approximately 90% to MVP as of January 2024. It is under active development by [Distributive](https://distributive.network/). +This product is in an intermediate stage, approximately 90% to MVP as of January 2024. It is under active development by [Distributive](https://distributive.network/). External contributions and feedback are welcome and encouraged. ### tl;dr From ea2c5d6fb96b9181729f722ca543bdab6e3be479 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Wed, 24 Jan 2024 10:58:49 -0500 Subject: [PATCH 0181/1086] enhanced readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 44e27b9d..8f89b10c 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,8 @@ Where shared backing store is not possible, PythonMonkey will automatically emit the "real" data structure as its value authority. Only immutable intrinsics are copied. This means that if you update an object in JavaScript, the corresponding Dict in Python will be updated, etc. +JavaScript Array and Object methods are implemented on Python List and Dictionaries, and vice-versa. + | Python Type | JavaScript Type | |:------------|:----------------| | String | string From 0d65747d495b4d8d399884284705bc697b44d23d Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Wed, 24 Jan 2024 11:13:08 -0500 Subject: [PATCH 0182/1086] update firefox release --- setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 71655d2d..74a00909 100755 --- a/setup.sh +++ b/setup.sh @@ -39,9 +39,9 @@ $POETRY_BIN self add 'poetry-dynamic-versioning[plugin]' echo "Done installing dependencies" echo "Downloading spidermonkey source code" -wget -c -q https://ftp.mozilla.org/pub/firefox/releases/115.1.0esr/source/firefox-115.1.0esr.source.tar.xz +wget -c -q https://ftp.mozilla.org/pub/firefox/releases/115.7.0esr/source/firefox-115.7.0esr.source.tar.xz mkdir -p firefox-source -tar xf firefox-115.1.0esr.source.tar.xz -C firefox-source --strip-components=1 # strip the root folder +tar xf firefox-115.7.0esr.source.tar.xz -C firefox-source --strip-components=1 # strip the root folder echo "Done downloading spidermonkey source code" echo "Building spidermonkey" From 475708599154ad8972d8c1c16281e353a93da1ef Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 24 Jan 2024 11:37:36 -0500 Subject: [PATCH 0183/1086] remove unused variable --- src/PyProxyHandler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PyProxyHandler.cc b/src/PyProxyHandler.cc index 0bf9e043..af79f477 100644 --- a/src/PyProxyHandler.cc +++ b/src/PyProxyHandler.cc @@ -839,7 +839,7 @@ static bool array_forEach(JSContext *cx, unsigned argc, JS::Value *vp) { rootedThisArg.set(nullptr); } - for (Py_ssize_t index = 0, toIndex = 0; index < len; index++) { + for (Py_ssize_t index = 0; index < len; index++) { jArgs[0].set(jsTypeFactory(cx, PyList_GetItem(self, index))); jArgs[1].setInt32(index); jArgs[2].set(selfValue); From ab460cacf964d913586780c6c3eb6ee7298d408f Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 24 Jan 2024 11:46:55 -0500 Subject: [PATCH 0184/1086] proper way to turn on iterator helpers --- setup.sh | 1 - src/modules/pythonmonkey/pythonmonkey.cc | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 71655d2d..2b8c385e 100755 --- a/setup.sh +++ b/setup.sh @@ -53,7 +53,6 @@ sed -i'' -e '/"winheap.cpp"/d' ./memory/mozalloc/moz.build # https://bugzilla.mo sed -i'' -e 's/"install-name-tool"/"install_name_tool"/' ./moz.configure # `install-name-tool` does not exist, but we have `install_name_tool` sed -i'' -e 's/bool Unbox/JS_PUBLIC_API bool Unbox/g' ./js/public/Class.h # need to manually add JS_PUBLIC_API to js::Unbox until it gets fixed in Spidermonkey sed -i'' -e 's/bool js::Unbox/JS_PUBLIC_API bool js::Unbox/g' ./js/src/vm/JSObject.cpp # same here -sed -i'' -e 's/bool iteratorHelpers_ = false;/bool iteratorHelpers_ = true;/g' ./js/public/RealmOptions.h # turn this on, todo make it available to embedders, currently only available via command-line cd js/src mkdir -p _build cd _build diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 6bfc106c..bbb9bf77 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -381,7 +381,10 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; } - JS::RealmOptions options; + JS::RealmCreationOptions creationOptions = JS::RealmCreationOptions(); + JS::RealmBehaviors behaviours = JS::RealmBehaviors(); + creationOptions.setIteratorHelpersEnabled(true); + JS::RealmOptions options = JS::RealmOptions(creationOptions, behaviours); static JSClass globalClass = {"global", JSCLASS_GLOBAL_FLAGS, &JS::DefaultGlobalClassOps}; global = new JS::RootedObject(GLOBAL_CX, JS_NewGlobalObject(GLOBAL_CX, &globalClass, nullptr, JS::FireOnNewGlobalHook, options)); if (!global) { From 84f8412a3a8eed00ef01e9d433f85381218f7311 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 24 Jan 2024 12:01:54 -0500 Subject: [PATCH 0185/1086] enhanced tests --- tests/python/test_arrays.py | 180 ++++++++++++++++++++++++++++++++++-- 1 file changed, 174 insertions(+), 6 deletions(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index e037b307..d8ccc977 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -649,6 +649,30 @@ def test_includes(): pm.eval("(result, arr) => {result[0] = arr.includes(1)}")(result, items) assert result[0] == True +def test_includes_start_index(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.includes(1, 1)}")(result, items) + assert result[0] == False + +def test_includes_start_index_negative(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.includes(1, -1)}")(result, items) + assert result[0] == False + +def test_includes_start_index_negative_large(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.includes(1, -10)}")(result, items) + assert result[0] == True + +def test_includes_start_index_large(): + items = [1,2,3] + result = [None] + pm.eval("(result, arr) => {result[0] = arr.includes(1, 10)}")(result, items) + assert result[0] == False + def test_includes_other_type(): items = [1,2,'Hi'] result = [None] @@ -844,7 +868,25 @@ def test_forEach_check_this_arg_wrong_type(): # returnResult = [0] # pm.eval("(returnResult, arr, func) => {returnResult[0] = arr.forEach(func)}")(returnResult, items, func) # assert items == ['to each his own', 'to each his own', 'to each his own'] -# assert returnResult == [None] +# assert returnResult == [None] + +#def test_forEach_self(): +# items = ['Four', 'Three', 'One'] +# class Counter: +# def __init__(self): +# self.count = 0 +# def increment(self): +# self.count += 1 + +# obj = Counter() +# result = pm.eval(""" +# (arr, increment, result) => { +# let jsObj = {count: 0} +# arr.forEach(increment, jsObj); +# return jsObj.count; +# } +# """)(items, obj.increment) +# assert result == 3 # TODO should not pass @@ -936,6 +978,24 @@ def test_map_check_array_mutation(): pm.eval("(result, arr) => {arr.map((element, index, array) => {array[0] = 'Ten'; result[0] = array})}")(result, items) assert result[0] == ['Ten', 'Three', 'One'] assert items == ['Ten', 'Three', 'One'] + +#def test_map_self(): +# items = ['Four', 'Three', 'One'] +# class Counter: +# def __init__(self): +# self.count = 0 +# def increment(self): +# self.count += 1 + +# obj = Counter() +# result = pm.eval(""" +# (arr, increment, result) => { +# let jsObj = {count: 0} +# arr.map(increment, jsObj); +# return jsObj.count; +# } +# """)(items, obj.increment) +# assert result == 3 #filter def test_filter(): @@ -989,7 +1049,25 @@ def test_filter_too_few_args(): assert (False) except Exception as e: assert str(type(e)) == "" - assert str(e).__contains__("TypeError: filter: At least 1 argument required, but only 0 passed") + assert str(e).__contains__("TypeError: filter: At least 1 argument required, but only 0 passed") + +#def test_filter_self(): +# items = ['Four', 'Three', 'One'] +# class Counter: +# def __init__(self): +# self.count = 0 +# def increment(self): +# self.count += 1 + +# obj = Counter() +# result = pm.eval(""" +# (arr, increment, result) => { +# let jsObj = {count: 0} +# arr.filter(increment, jsObj); +# return jsObj.count; +# } +# """)(items, obj.increment) +# assert result == 3 #reduce def test_reduce(): @@ -1164,6 +1242,24 @@ def test_some_truthy_conversion(): """)(result) assert result[0] == True +#def test_some_self(): +# items = ['Four', 'Three', 'One'] +# class Counter: +# def __init__(self): +# self.count = 0 +# def increment(self): +# self.count += 1 + +# obj = Counter() +# result = pm.eval(""" +# (arr, increment, result) => { +# let jsObj = {count: 0} +# arr.some(increment, jsObj); +# return jsObj.count; +# } +# """)(items, obj.increment) +# assert result == 3 + #every def test_every_true(): items = [2,4,6] @@ -1213,7 +1309,25 @@ class Counter { } """ )(result, items) - assert result == [1] + assert result == [1] + +#def test_every_self(): +# items = ['Four', 'Three', 'One'] +# class Counter: +# def __init__(self): +# self.count = 0 +# def increment(self): +# self.count += 1 + +# obj = Counter() +# result = pm.eval(""" +# (arr, increment, result) => { +# let jsObj = {count: 0} +# arr.every(increment, jsObj); +# return jsObj.count; +# } +# """)(items, obj.increment) +# assert result == 3 #find def test_find_found_once(): @@ -1270,7 +1384,25 @@ class Counter { } """ )(result, items) - assert result == [3] + assert result == [3] + +#def test_find_self(): +# items = ['Four', 'Three', 'One'] +# class Counter: +# def __init__(self): +# self.count = 0 +# def increment(self): +# self.count += 1 + +# obj = Counter() +# result = pm.eval(""" +# (arr, increment, result) => { +# let jsObj = {count: 0} +# arr.find(increment, jsObj); +# return jsObj.count; +# } +# """)(items, obj.increment) +# assert result == 3 #findIndex def test_findIndex_found_once(): @@ -1327,7 +1459,25 @@ class Counter { } """ )(result, items) - assert result == [3] + assert result == [3] + +#def test_findIndex_self(): +# items = ['Four', 'Three', 'One'] +# class Counter: +# def __init__(self): +# self.count = 0 +# def increment(self): +# self.count += 1 + +# obj = Counter() +# result = pm.eval(""" +# (arr, increment, result) => { +# let jsObj = {count: 0} +# arr.findIndex(increment, jsObj); +# return jsObj.count; +# } +# """)(items, obj.increment) +# assert result == 3 #flat def test_flat(): @@ -1442,7 +1592,25 @@ class Counter { } """ )(result, items) - assert result == [3] + assert result == [3] + +#def test_flatMap_self(): +# items = ['Four', 'Three', 'One'] +# class Counter: +# def __init__(self): +# self.count = 0 +# def increment(self): +# self.count += 1 + +# obj = Counter() +# result = pm.eval(""" +# (arr, increment, result) => { +# let jsObj = {count: 0} +# arr.flatMap(increment, jsObj); +# return jsObj.count; +# } +# """)(items, obj.increment) +# assert result == 3 #valueOf def test_valueOf(): From 963b3670e0950dafead9eee1dac1b98b1815ffef Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Wed, 24 Jan 2024 13:36:57 -0500 Subject: [PATCH 0186/1086] Update src/JSArrayIterProxy.cc Co-authored-by: Caleb Aikens --- src/JSArrayIterProxy.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/JSArrayIterProxy.cc b/src/JSArrayIterProxy.cc index 11e79c68..dc8aade8 100644 --- a/src/JSArrayIterProxy.cc +++ b/src/JSArrayIterProxy.cc @@ -24,8 +24,6 @@ void JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_dealloc(JSArrayIterProxy *self) { - // Py_XDECREF(self->it.it_seq); - // Py_TYPE(self)->tp_free((PyObject *)self); PyObject_GC_UnTrack(self); Py_XDECREF(self->it.it_seq); PyObject_GC_Del(self); From 9ef0e6044e879ef74ed7676b4baf63f903efa7ff Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Wed, 24 Jan 2024 13:39:03 -0500 Subject: [PATCH 0187/1086] Update src/JSArrayIterProxy.cc Co-authored-by: Caleb Aikens --- src/JSArrayIterProxy.cc | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/JSArrayIterProxy.cc b/src/JSArrayIterProxy.cc index dc8aade8..a4d0dbea 100644 --- a/src/JSArrayIterProxy.cc +++ b/src/JSArrayIterProxy.cc @@ -45,19 +45,11 @@ PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_next(JSArrayIterPr return NULL; } - if (self->it.reversed) { - if (self->it.it_index >= 0) { - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index--, elementVal); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); - } - } - else { - if (self->it.it_index < JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)seq)) { - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index++, elementVal); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); - } + if ((self->it.reversed && self->it.it_index >= 0) || (!self->it.reversed && self->it.it_index < JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)seq))) { + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + self->it.it_index += self->it.reversed ? -1 : 1; + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index, elementVal); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); } self->it.it_seq = NULL; From d4b4db62bea0129fb427901ab6162c7c0c1148b8 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 24 Jan 2024 13:47:12 -0500 Subject: [PATCH 0188/1086] revert proposed change --- src/JSArrayIterProxy.cc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/JSArrayIterProxy.cc b/src/JSArrayIterProxy.cc index a4d0dbea..dc8aade8 100644 --- a/src/JSArrayIterProxy.cc +++ b/src/JSArrayIterProxy.cc @@ -45,11 +45,19 @@ PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_next(JSArrayIterPr return NULL; } - if ((self->it.reversed && self->it.it_index >= 0) || (!self->it.reversed && self->it.it_index < JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)seq))) { - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - self->it.it_index += self->it.reversed ? -1 : 1; - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index, elementVal); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); + if (self->it.reversed) { + if (self->it.it_index >= 0) { + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index--, elementVal); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); + } + } + else { + if (self->it.it_index < JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)seq)) { + JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index++, elementVal); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); + } } self->it.it_seq = NULL; From 2fc56a20c8577eb624642eef6625051308545d15 Mon Sep 17 00:00:00 2001 From: philippedistributive <151072087+philippedistributive@users.noreply.github.com> Date: Wed, 24 Jan 2024 13:48:20 -0500 Subject: [PATCH 0189/1086] Update include/PyDictProxyHandler.hh Co-authored-by: Caleb Aikens --- include/PyDictProxyHandler.hh | 1 - 1 file changed, 1 deletion(-) diff --git a/include/PyDictProxyHandler.hh b/include/PyDictProxyHandler.hh index 6fd6680c..8fc2b63d 100644 --- a/include/PyDictProxyHandler.hh +++ b/include/PyDictProxyHandler.hh @@ -48,7 +48,6 @@ public: JS::ObjectOpResult &result) const override; /** * @brief [[HasProperty]] - * // printf("copy\n"); * @param cx - pointer to JSContext * @param proxy - The proxy object who's propery we wish to check * @param id - key value of the property to check From 9f51dc5c75ca2d00eea309ec0c5654401ebd270d Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 24 Jan 2024 20:07:26 -0500 Subject: [PATCH 0190/1086] we need to add a reference to the PyObject we are proxying and keeping in a reserved slot --- src/jsTypeFactory.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 459bf35e..147792fb 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -180,6 +180,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { JS_GetClassPrototype(cx, JSProto_Object, &objectPrototype); // so that instanceof will work, not that prototype methods will proxy = js::NewProxyObject(cx, new PyDictProxyHandler(object), v, objectPrototype.get()); } + Py_INCREF(object); // TODO leak! clean up in finalize JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(object)); returnType.setObject(*proxy); } From cd1b2a6e8463dc114dfbd3909baa90a82c6b0e81 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Wed, 24 Jan 2024 21:04:40 -0500 Subject: [PATCH 0191/1086] minor readme fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f89b10c..a5d19b9d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [PythonMonkey](https://pythonmonkey.io) is a Mozilla [SpiderMonkey](https://firefox-source-docs.mozilla.org/js/index.html) JavaScript engine embedded into the Python Runtime, using the Python engine to provide the Javascript host environment. -We feature JavaScript Array and Object methods on Python List and Dictionaries using the cPython C API, and the inverse using the Mozilla Firefox Spidermonkey JavaScript C++ API. +We feature JavaScript Array and Object methods implemented on Python List and Dictionaries using the cPython C API, and the inverse using the Mozilla Firefox Spidermonkey JavaScript C++ API. This product is in an intermediate stage, approximately 90% to MVP as of January 2024. It is under active development by [Distributive](https://distributive.network/). External contributions and feedback are welcome and encouraged. From cd89b6de1156abffdb3e2279aaa245517e23ce83 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 25 Jan 2024 15:41:18 -0500 Subject: [PATCH 0192/1086] TODOs and minor improvements git action firefox version synced with setup.sh build on any python version setup by pyenv --- .github/workflows/test-and-publish.yaml | 6 +++--- build.py | 2 +- src/PyDictProxyHandler.cc | 14 ++++++++++++-- src/PyListProxyHandler.cc | 11 ++++++++++- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 843fd41a..a2b2e97d 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -40,7 +40,7 @@ jobs: with: path: | ./_spidermonkey_install/* - key: spidermonkey115.1.0-${{ runner.os }}-${{ runner.arch }} + key: spidermonkey115.7.0-${{ runner.os }}-${{ runner.arch }} lookup-only: true # skip download - name: Setup XCode if: ${{ matrix.os == 'macos-13' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }} @@ -60,7 +60,7 @@ jobs: with: path: | ./_spidermonkey_install/* - key: spidermonkey115.1.0-${{ runner.os }}-${{ runner.arch }} + key: spidermonkey115.7.0-${{ runner.os }}-${{ runner.arch }} lookup-only: true # skip download - name: Install dependencies if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }} @@ -141,7 +141,7 @@ jobs: with: path: | ./_spidermonkey_install/* - key: spidermonkey115.1.0-${{ runner.os }}-${{ runner.arch }} + key: spidermonkey115.7.0-${{ runner.os }}-${{ runner.arch }} fail-on-cache-miss: true # SpiderMonkey is expected to be cached in its dedicated job - name: Build pminit run: | diff --git a/build.py b/build.py index 7d26be19..36a0d26c 100644 --- a/build.py +++ b/build.py @@ -40,7 +40,7 @@ def run_cmake_build(): if platform.system() == "Windows": execute("cmake .. -T ClangCL", cwd=BUILD_DIR) # use Clang/LLVM toolset for Visual Studio else: - execute("cmake ..", cwd=BUILD_DIR) + execute("cmake .. -DPYTHON_INCLUDE_DIR=$(python -c 'import sysconfig; print(sysconfig.get_path('include'))') -DPYTHON_LIBRARY=$(python -c 'import sysconfig; print(sysconfig.get_config_var('LIBDIR'))')", cwd=BUILD_DIR) execute(f"cmake --build . -j{CPUS} --config Release", cwd=BUILD_DIR) def copy_artifacts(): diff --git a/src/PyDictProxyHandler.cc b/src/PyDictProxyHandler.cc index c48b2854..c1238096 100644 --- a/src/PyDictProxyHandler.cc +++ b/src/PyDictProxyHandler.cc @@ -167,8 +167,18 @@ bool PyDictProxyHandler::getOwnEnumerablePropertyKeys( return this->ownPropertyKeys(cx, proxy, props); } -// @TODO (Caleb Aikens) implement this -void PyDictProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const {} +// TODO not needed at this time since only called as part of cleanup function's js::DestroyContext call which is only called at cpython exit Py_AtExit in PyInit_pythonmonkey +// put in some combination of the commented-out code below +void PyDictProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { + /*PyThreadState *state = PyThreadState_Get(); + PyThreadState *state = PyGILState_GetThisThreadState(); + if (state) { + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + PyGILState_STATE state = PyGILState_Ensure(); + Py_DECREF(self); // this causes problems + PyGILState_Release(state); + }*/ +} bool PyDictProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 79483b70..d58a37a1 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2098,8 +2098,17 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( return true; } +// TODO not needed at this time since only called as part of cleanup function's js::DestroyContext call which is only called at cpython exit Py_AtExit in PyInit_pythonmonkey +// put in some combination of the commented-out code below void PyListProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { - JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(nullptr)); + /*PyThreadState *state = PyThreadState_Get(); + PyThreadState *state = PyGILState_GetThisThreadState(); + if (state) { + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + PyGILState_STATE state = PyGILState_Ensure(); + Py_DECREF(self); // this causes problems + PyGILState_Release(state); + }*/ } bool PyListProxyHandler::defineProperty( From 84645ab730db182f70db2c1b996509eeff1080dd Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 25 Jan 2024 15:52:38 -0500 Subject: [PATCH 0193/1086] comment cleanup --- src/PyDictProxyHandler.cc | 2 +- src/PyListProxyHandler.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PyDictProxyHandler.cc b/src/PyDictProxyHandler.cc index c1238096..48e1d9dd 100644 --- a/src/PyDictProxyHandler.cc +++ b/src/PyDictProxyHandler.cc @@ -175,7 +175,7 @@ void PyDictProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { if (state) { PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); PyGILState_STATE state = PyGILState_Ensure(); - Py_DECREF(self); // this causes problems + Py_DECREF(self); PyGILState_Release(state); }*/ } diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index d58a37a1..6b796e6d 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2106,7 +2106,7 @@ void PyListProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { if (state) { PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); PyGILState_STATE state = PyGILState_Ensure(); - Py_DECREF(self); // this causes problems + Py_DECREF(self); PyGILState_Release(state); }*/ } From c4c1789041e8e6732ea5e6b68d678ed6dd4f1847 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 26 Jan 2024 16:50:09 -0500 Subject: [PATCH 0194/1086] proxy finalize: there is only ref left at shutdown --- src/PyDictProxyHandler.cc | 15 ++++++--------- src/PyListProxyHandler.cc | 15 ++++++--------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/PyDictProxyHandler.cc b/src/PyDictProxyHandler.cc index 48e1d9dd..9f6983ed 100644 --- a/src/PyDictProxyHandler.cc +++ b/src/PyDictProxyHandler.cc @@ -167,17 +167,14 @@ bool PyDictProxyHandler::getOwnEnumerablePropertyKeys( return this->ownPropertyKeys(cx, proxy, props); } -// TODO not needed at this time since only called as part of cleanup function's js::DestroyContext call which is only called at cpython exit Py_AtExit in PyInit_pythonmonkey -// put in some combination of the commented-out code below void PyDictProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { - /*PyThreadState *state = PyThreadState_Get(); - PyThreadState *state = PyGILState_GetThisThreadState(); - if (state) { - PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - PyGILState_STATE state = PyGILState_Ensure(); + // We cannot call Py_DECREF here when shutting down as the thread state is gone. + // Then, when shutting down, there is only on reference left, and we don't need + // to free the object since the entire process memory is being released. + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + if (Py_REFCNT(self) > 1) { Py_DECREF(self); - PyGILState_Release(state); - }*/ + } } bool PyDictProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 6b796e6d..77a67dff 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2098,17 +2098,14 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( return true; } -// TODO not needed at this time since only called as part of cleanup function's js::DestroyContext call which is only called at cpython exit Py_AtExit in PyInit_pythonmonkey -// put in some combination of the commented-out code below void PyListProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { - /*PyThreadState *state = PyThreadState_Get(); - PyThreadState *state = PyGILState_GetThisThreadState(); - if (state) { - PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - PyGILState_STATE state = PyGILState_Ensure(); + // We cannot call Py_DECREF here when shutting down as the thread state is gone. + // Then, when shutting down, there is only on reference left, and we don't need + // to free the object since the entire process memory is being released. + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + if (Py_REFCNT(self) > 1) { Py_DECREF(self); - PyGILState_Release(state); - }*/ + } } bool PyListProxyHandler::defineProperty( From a9e3cc9477db912a4549d7f3ae479d08a1982778 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 26 Jan 2024 18:50:34 -0500 Subject: [PATCH 0195/1086] comment cleanup --- src/jsTypeFactory.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 147792fb..4ec011c3 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -180,7 +180,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { JS_GetClassPrototype(cx, JSProto_Object, &objectPrototype); // so that instanceof will work, not that prototype methods will proxy = js::NewProxyObject(cx, new PyDictProxyHandler(object), v, objectPrototype.get()); } - Py_INCREF(object); // TODO leak! clean up in finalize + Py_INCREF(object); JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(object)); returnType.setObject(*proxy); } From b6fa7028eb8a904f62675293c0414c8f3068137c Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 29 Jan 2024 18:24:12 -0500 Subject: [PATCH 0196/1086] 'this' object for function calling on js object/array is js object/array not global --- src/JSArrayProxy.cc | 4 ++-- src/JSObjectProxy.cc | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 2a224553..75fccc37 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -63,7 +63,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py if (methodName == NULL) { // reached end of list JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, value); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); + JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsArray); return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); } else if (PyUnicode_Check(key)) { @@ -74,7 +74,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py else { JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, value); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); + JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsArray); return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); } } diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 9739f4ae..d230e3ed 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -92,8 +92,8 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, if (methodName == NULL) { // reached end of list JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsObject); + return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } else if (PyUnicode_Check(key)) { if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { @@ -103,8 +103,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, else { JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - + JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsObject); return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); } } From 72e5477db73fcefdc9d54afb30096618e0d66f4f Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 29 Jan 2024 18:28:08 -0500 Subject: [PATCH 0197/1086] should have been part of previous commit --- src/JSArrayProxy.cc | 4 ++-- src/JSObjectProxy.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 75fccc37..c99f3903 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -64,7 +64,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, value); JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsArray); - return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } else if (PyUnicode_Check(key)) { if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { @@ -75,7 +75,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, value); JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsArray); - return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } } } diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index d230e3ed..3adf3dd8 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -104,7 +104,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsObject); - return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } } } From afedfff4582dc3d8fc697e339692b04f72f6718d Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 29 Jan 2024 18:53:52 -0500 Subject: [PATCH 0198/1086] fix memory leak --- src/pyTypeFactory.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index d8f8a7a3..e77b1096 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -213,6 +213,7 @@ PyObject *callJSFunc(PyObject *jsCxThisFuncTuple, PyObject *args) { JS::HandleValueArray jsArgs(jsArgsVector); JS::Rooted *jsReturnVal = new JS::Rooted(cx); if (!JS_CallFunctionValue(cx, *thisObj, *jsFunc, jsArgs, jsReturnVal)) { + delete thisObj; setSpiderMonkeyException(cx); return NULL; } From 76a6b08625c0edb2290c38fd0154d4da5c1ca7f6 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 29 Jan 2024 19:59:48 -0500 Subject: [PATCH 0199/1086] Revert "fix memory leak" This reverts commit afedfff4582dc3d8fc697e339692b04f72f6718d. --- src/pyTypeFactory.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index e77b1096..d8f8a7a3 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -213,7 +213,6 @@ PyObject *callJSFunc(PyObject *jsCxThisFuncTuple, PyObject *args) { JS::HandleValueArray jsArgs(jsArgsVector); JS::Rooted *jsReturnVal = new JS::Rooted(cx); if (!JS_CallFunctionValue(cx, *thisObj, *jsFunc, jsArgs, jsReturnVal)) { - delete thisObj; setSpiderMonkeyException(cx); return NULL; } From 325ad294071f78e2dbf58b41d97deb5a24a2a6af Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 29 Jan 2024 20:24:12 -0500 Subject: [PATCH 0200/1086] simplification --- src/JSArrayProxy.cc | 10 ++-------- src/JSObjectProxy.cc | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index c99f3903..540ab31e 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -60,23 +60,17 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py // look through the methods for dispatch and return key if no method found for (size_t index = 0;; index++) { const char *methodName = JSArrayProxyType.tp_methods[index].ml_name; - if (methodName == NULL) { // reached end of list + if (methodName == NULL || !PyUnicode_Check(key)) { // reached end of list JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, value); JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsArray); return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } - else if (PyUnicode_Check(key)) { + else { if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { return PyObject_GenericGetAttr((PyObject *)self, key); } } - else { - JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, value); - JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsArray); - return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); - } } } diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 3adf3dd8..0b1550d6 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -89,23 +89,17 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, // look through the methods for dispatch for (size_t index = 0;; index++) { const char *methodName = JSObjectProxyType.tp_methods[index].ml_name; - if (methodName == NULL) { // reached end of list + if (methodName == NULL || !PyUnicode_Check(key)) { JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsObject); return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } - else if (PyUnicode_Check(key)) { + else { if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { return PyObject_GenericGetAttr((PyObject *)self, key); } } - else { - JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); - JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsObject); - return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); - } } } From ede4b1c44c02ac0c0ac6d72053d0b916d70ae2ea Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 30 Jan 2024 10:38:41 -0500 Subject: [PATCH 0201/1086] No need to synthetically add the keys method for JSObjectProxy now that the real method is implemented --- python/pythonmonkey/__init__.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/python/pythonmonkey/__init__.py b/python/pythonmonkey/__init__.py index d02c559e..dafd1931 100644 --- a/python/pythonmonkey/__init__.py +++ b/python/pythonmonkey/__init__.py @@ -14,19 +14,4 @@ require("base64") require("timers") require("url") -require("XMLHttpRequest") - -# Add the `.keys()` method on `Object.prototype` to get JSObjectProxy dict() conversion working -# Conversion from a dict-subclass to a strict dict by `dict(subclass)` internally calls the .keys() method to read the dictionary keys, -# but .keys on a JSObjectProxy can only come from the JS side -pythonmonkey.eval(""" -(makeList) => { - const keysMethod = { - get() { - return () => makeList(...Object.keys(this)) - } - } - Object.defineProperty(Object.prototype, "keys", keysMethod) - Object.defineProperty(Array.prototype, "keys", keysMethod) -} -""", { 'filename': __file__, 'fromPythonFrame': True })(lambda *args: list(args)) +require("XMLHttpRequest") \ No newline at end of file From 3b240505cd064a47f0ce35df436464abcc1de2e2 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 30 Jan 2024 10:50:44 -0500 Subject: [PATCH 0202/1086] further cleanup --- include/JSObjectIterProxy.hh | 2 +- python/pythonmonkey/require.py | 4 ++-- src/modules/pythonmonkey/pythonmonkey.cc | 11 +++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/JSObjectIterProxy.hh b/include/JSObjectIterProxy.hh index 6182320f..d6fb1452 100644 --- a/include/JSObjectIterProxy.hh +++ b/include/JSObjectIterProxy.hh @@ -29,7 +29,7 @@ typedef struct { PyObject_HEAD - JS::RootedIdVector *props; + JS::RootedIdVector *props; // not conceptually the best use of the Rooted type but it works. There is no easy inter-operation with a JS::Heap type int it_index; bool reversed; int kind; diff --git a/python/pythonmonkey/require.py b/python/pythonmonkey/require.py index 31819dac..a19ba2be 100644 --- a/python/pythonmonkey/require.py +++ b/python/pythonmonkey/require.py @@ -1,7 +1,7 @@ # @file require.py # Implementation of CommonJS "require" for PythonMonkey. This implementation uses the # ctx-module npm package to do the heavy lifting. That package makes a complete module -# system, obstensibly in a separate context, but our implementation here reuses the +# system, ostensibly in a separate context, but our implementation here reuses the # PythonMonkey global context for both. # # The context that ctx-module runs in needs a require function supporting @@ -115,7 +115,7 @@ /** * The debug module has as its exports a function which may, depending on the DEBUG env var, emit - * debugging statemnts to stdout. This is quick implementation of the node built-in. + * debugging statements to stdout. This is quick implementation of the node built-in. */ bootstrap.modules.debug = function debug(selector) { diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index b5e654ae..13f79c09 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -1,11 +1,10 @@ /** * @file pythonmonkey.cc - * @author Caleb Aikens (caleb@distributive.network) + * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) * @brief This file defines the pythonmonkey module, along with its various functions. - * @version 0.1 * @date 2023-03-29 * - * @copyright Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2023-2024 Distributive Corp. * */ @@ -68,7 +67,7 @@ static PyTypeObject NullType = { static PyTypeObject BigIntType = { .tp_name = "pythonmonkey.bigint", .tp_flags = Py_TPFLAGS_DEFAULT - | Py_TPFLAGS_LONG_SUBCLASS // https://docs.python.org/3/c-api/typeobj.html#Py_TPFLAGS_LONG_SUBCLASS + | Py_TPFLAGS_LONG_SUBCLASS | Py_TPFLAGS_BASETYPE, // can be subclassed .tp_doc = PyDoc_STR("Javascript BigInt object"), .tp_base = &PyLong_Type, // extending the builtin int type @@ -88,7 +87,7 @@ PyTypeObject JSObjectProxyType = { .tp_getattro = (getattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_get, .tp_setattro = (setattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_assign, .tp_flags = Py_TPFLAGS_DEFAULT - | Py_TPFLAGS_DICT_SUBCLASS, // https://docs.python.org/3/c-api/typeobj.html#Py_TPFLAGS_DICT_SUBCLASS + | Py_TPFLAGS_DICT_SUBCLASS, .tp_doc = PyDoc_STR("Javascript Object proxy dict"), .tp_richcompare = (richcmpfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare, .tp_iter = (getiterfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_iter, @@ -108,7 +107,7 @@ PyTypeObject JSArrayProxyType = { .tp_as_sequence = &JSArrayProxy_sequence_methods, .tp_as_mapping = &JSArrayProxy_mapping_methods, .tp_getattro = (getattrofunc)JSArrayProxyMethodDefinitions::JSArrayProxy_get, - .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DICT_SUBCLASS, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_LIST_SUBCLASS, .tp_doc = PyDoc_STR("Javascript Array proxy list"), .tp_traverse = (traverseproc)JSArrayProxyMethodDefinitions::JSArrayProxy_traverse, .tp_clear = (inquiry)JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot, From 4c3ad1cb2b8ffaa4665b41e9f7d80a7c2cbc4531 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 30 Jan 2024 18:01:11 -0500 Subject: [PATCH 0203/1086] typo fix --- tests/python/test_dict_methods.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_dict_methods.py b/tests/python/test_dict_methods.py index 5239d4b5..dbb46539 100644 --- a/tests/python/test_dict_methods.py +++ b/tests/python/test_dict_methods.py @@ -434,7 +434,7 @@ def test_items_len(): # items = dishes.items() # assert {('eggs', 2)} in items -def test_values_update_object_updates_the_items(): +def test_items_update_object_updates_the_items(): employee = pm.eval("({'name': 'Phil', 'age': 22})") dictionaryItems = employee.items() employee.update({('salary', 3500.0)}) From 8a362d4eea60ecce6883135d9c5d4a8f5a9244ef Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 30 Jan 2024 18:10:43 -0500 Subject: [PATCH 0204/1086] make property length calculation consistent --- src/JSObjectProxy.cc | 4 ++-- tests/python/test_pythonmonkey_eval.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 9739f4ae..7abd720a 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -70,7 +70,7 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_init(JSObjectProxy *self, PyOb Py_ssize_t JSObjectProxyMethodDefinitions::JSObjectProxy_length(JSObjectProxy *self) { JS::RootedIdVector props(GLOBAL_CX); - if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY | JSITER_HIDDEN, &props)) + if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { // @TODO (Caleb Aikens) raise exception here return -1; @@ -186,7 +186,7 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr } JS::RootedIdVector props(GLOBAL_CX); - if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY | JSITER_HIDDEN, &props)) + if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { // @TODO (Caleb Aikens) raise exception here return NULL; diff --git a/tests/python/test_pythonmonkey_eval.py b/tests/python/test_pythonmonkey_eval.py index 67bc0c95..6ce9a3e9 100644 --- a/tests/python/test_pythonmonkey_eval.py +++ b/tests/python/test_pythonmonkey_eval.py @@ -286,3 +286,7 @@ def concatenate(a, b): codepoint = random.randint(0x0000, 0xFFFF) string2 += chr(codepoint) assert caller(concatenate, string1, string2) == string1 + string2 + +def test_globalThis(): + obj = pm.eval('globalThis') + assert str(obj).__contains__("{'python': {'pythonMonkey':") \ No newline at end of file From f439f9627a2189add2d0d83fe7eb90ec74741f48 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Wed, 31 Jan 2024 08:56:17 -0500 Subject: [PATCH 0205/1086] fix JSArrayProxy and PyListProxy sort with proxied function arguments --- include/PyObjectProxyHandler.hh | 4 +- src/JSArrayProxy.cc | 64 ++++++------- src/PyListProxyHandler.cc | 115 +++++------------------ src/PyObjectProxyHandler.cc | 6 +- src/jsTypeFactory.cc | 4 + src/modules/pythonmonkey/pythonmonkey.cc | 4 +- tests/python/test_arrays.py | 12 +-- 7 files changed, 69 insertions(+), 140 deletions(-) diff --git a/include/PyObjectProxyHandler.hh b/include/PyObjectProxyHandler.hh index eb25082e..8b3ce72b 100644 --- a/include/PyObjectProxyHandler.hh +++ b/include/PyObjectProxyHandler.hh @@ -4,9 +4,9 @@ * @brief Structs for creating JS proxy objects. Used for default object coercion * @version 0.1 * @date 2024-01-25 - * + * * Copyright (c) 2023 Distributive Corp. - * + * */ #ifndef PythonMonkey_PyObjectProxy_ diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 2a224553..ea8bf8f8 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -18,6 +18,7 @@ #include "include/jsTypeFactory.hh" #include "include/pyTypeFactory.hh" #include "include/PyBaseProxyHandler.hh" +#include "include/JSFunctionProxy.hh" #include #include @@ -1291,48 +1292,41 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P } } } - else if (PyCFunction_Check(keyfunc)) { - // check if builtin 1-arg python or js 2-arg compare - int flags = PyCFunction_GetFlags((PyObject *)keyfunc); + else if (PyObject_TypeCheck(keyfunc, &JSFunctionProxyType)) { + JS::Rooted> jArgs(GLOBAL_CX); + jArgs[0].setObject(**((JSFunctionProxy *)keyfunc)->jsFunc); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } - if (flags & METH_VARARGS && !(flags & METH_KEYWORDS)) { - // we got a JS compare function, use it as-is - JS::Rooted> jArgs(GLOBAL_CX); - jArgs[0].set(jsTypeFactory(GLOBAL_CX, keyfunc)); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { - PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); - return NULL; - } + if (reverse) { + JSArrayProxy_reverse(self); + } + } + else if (PyCFunction_Check(keyfunc)) { + JS::RootedObject funObj(GLOBAL_CX, JS_GetFunctionObject(JS_NewFunction(GLOBAL_CX, sort_compare_key_func, 2, 0, NULL))); - if (reverse) { - JSArrayProxy_reverse(self); - } + JS::RootedValue privateValue(GLOBAL_CX, JS::PrivateValue(keyfunc)); + if (!JS_SetProperty(GLOBAL_CX, funObj, "_key_func_param", privateValue)) { // JS::SetReservedSlot(functionObj, KeyFuncSlot, JS::PrivateValue(keyfunc)); does not work + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; } - else { - // we got a built-in python function - JS::RootedObject funObj(GLOBAL_CX, JS_GetFunctionObject(JS_NewFunction(GLOBAL_CX, sort_compare_key_func, 2, 0, NULL))); - JS::RootedValue privateValue(GLOBAL_CX, JS::PrivateValue(keyfunc)); - if (!JS_SetProperty(GLOBAL_CX, funObj, "_key_func_param", privateValue)) { // JS::SetReservedSlot(functionObj, KeyFuncSlot, JS::PrivateValue(keyfunc)); does not work - PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); - return NULL; - } + JS::RootedValue reverseValue(GLOBAL_CX); + reverseValue.setBoolean(reverse); + if (!JS_SetProperty(GLOBAL_CX, funObj, "_reverse_param", reverseValue)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); + return NULL; + } - JS::RootedValue reverseValue(GLOBAL_CX); - reverseValue.setBoolean(reverse); - if (!JS_SetProperty(GLOBAL_CX, funObj, "_reverse_param", reverseValue)) { + JS::Rooted> jArgs(GLOBAL_CX); + jArgs[0].setObject(*funObj); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { + if (!PyErr_Occurred()) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); - return NULL; - } - - JS::Rooted> jArgs(GLOBAL_CX); - jArgs[0].setObject(*funObj); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { - if (!PyErr_Occurred()) { - PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); - } - return NULL; } + return NULL; } } else { diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 77a67dff..72535993 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -13,6 +13,7 @@ #include "include/jsTypeFactory.hh" #include "include/JSArrayProxy.hh" +#include "include/JSFunctionProxy.hh" #include "include/pyTypeFactory.hh" #include "include/StrType.hh" @@ -1581,11 +1582,20 @@ static int invokeCallBack(PyObject *list, int index, JS::HandleValue leftValue, throw "JS_CallFunction failed"; } + if (!retVal.isNumber()) { + PyErr_Format(PyExc_TypeError, "incorrect compare function return type"); + return 0; + } + return retVal.toInt32(); } // Adapted from Kernigan&Ritchie's C book static void quickSort(PyObject *list, int left, int right, JSContext *cx, JS::HandleFunction callBack) { + if (PyErr_Occurred()) { + return; + } + if (left >= right) { // base case return; @@ -1597,7 +1607,11 @@ static void quickSort(PyObject *list, int left, int right, JSContext *cx, JS::Ha int last = left; for (int index = left + 1; index <= right; index++) { - if (invokeCallBack(list, index, leftValue, cx, callBack) < 0) { + int result = invokeCallBack(list, index, leftValue, cx, callBack); + if (PyErr_Occurred()) { + return; + } + if (result < 0) { swapItems(list, ++last, index); } } @@ -1658,42 +1672,6 @@ static bool js_sort_compare_default(JSContext *cx, unsigned argc, JS::Value *vp) return true; } -// private -static bool js_sort_compare_key_func(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - JS::RootedObject callee(cx, &args.callee()); - - JS::RootedValue keyFunc(cx); - if (!JS_GetProperty(cx, callee, "_key_func_param", &keyFunc)) { - PyErr_Format(PyExc_SystemError, "JSAPI call failed"); - return false; - } - PyObject *keyfunc = (PyObject *)keyFunc.toPrivate(); - - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(&args.callee())); - - JS::RootedValue *elementVal = new JS::RootedValue(cx, args[0]); - PyObject *args_0 = pyTypeFactory(cx, global, elementVal)->getPyObject(); - - elementVal = new JS::RootedValue(cx, args[1]); - PyObject *args_1 = pyTypeFactory(cx, global, elementVal)->getPyObject(); - - PyObject *result = PyObject_CallFunction(keyfunc, "OO", args_0, args_1); - if (!result) { - return false; - } - - if (PyLong_Check(result)) { - args.rval().setInt32((int32_t)PyLong_AsLongLong(result)); - return true; - } - else { - PyErr_Format(PyExc_TypeError, "incorrect compare function return type"); - return false; - } -} - static bool array_sort(JSContext *cx, unsigned argc, JS::Value *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -1724,64 +1702,19 @@ static bool array_sort(JSContext *cx, unsigned argc, JS::Value *vp) { } JS::RootedValue callBack(cx, callbackfn); - - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - - PyObject *pyFunc = pyTypeFactory(cx, global, new JS::RootedValue(cx, args[0].get()))->getPyObject(); - // check if JS or Python function - if (PyFunction_Check(pyFunc)) { - // it's a user-defined python function, check has two arguments - PyObject *code = PyFunction_GetCode(pyFunc); - if (((PyCodeObject *)code)->co_argcount == 1) { - JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_BAD_SORT_ARG); - return false; - } - else { - JSFunction *compareFun = JS_NewFunction(cx, js_sort_compare_key_func, 2, 0, NULL); - JS::RootedFunction rootedFun(cx, compareFun); - JS::RootedObject rootedFunObj(cx, JS_GetFunctionObject(compareFun)); - - JS::RootedValue privateValue(cx, JS::PrivateValue(pyFunc)); - if (!JS_SetProperty(cx, rootedFunObj, "_key_func_param", privateValue)) { // JS::SetReservedSlot(functionObj, KeyFuncSlot, JS::PrivateValue(keyfunc)); does not work - PyErr_Format(PyExc_SystemError, "JSAPI call failed"); - return NULL; - } - - try { - quickSort(self, 0, len - 1, cx, rootedFun); - } catch (const char *message) { - return false; - } - - // cleanup - if (!JS_DeleteProperty(cx, rootedFunObj, "_key_func_param")) { - PyErr_Format(PyExc_SystemError, "JSAPI call failed"); - return false; - } - } - } else { - // it's either a JS function or a builtin python func - int flags = PyCFunction_GetFlags(pyFunc); - - if (flags & METH_VARARGS && !(flags & METH_KEYWORDS)) { - // it's a user-defined JS func - JS::RootedFunction funObj(cx, JS_ValueToFunction(cx, callBack)); - - try { - quickSort(self, 0, len - 1, cx, funObj); - } catch (const char *message) { - return false; - } - } - else { - // it's a built-in python function - JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_BAD_SORT_ARG); - return false; - } + JS::RootedFunction rootedFun(cx, JS_ValueToFunction(cx, callBack)); + try { + quickSort(self, 0, len - 1, cx, rootedFun); + } catch (const char *message) { + return false; } } } + if (PyErr_Occurred()) { + return false; + } + // return ref to self args.rval().set(jsTypeFactory(cx, self)); return true; diff --git a/src/PyObjectProxyHandler.cc b/src/PyObjectProxyHandler.cc index f814cc0a..d7cd3b80 100644 --- a/src/PyObjectProxyHandler.cc +++ b/src/PyObjectProxyHandler.cc @@ -1,12 +1,12 @@ /** * @file PyObjectProxyHandler.cc * @author Caleb Aikens (caleb@distributive.network) - * @brief + * @brief * @version 0.1 * @date 2024-01-30 - * + * * Copyright (c) 2023 Distributive Corp. - * + * */ #include "include/PyObjectProxyHandler.hh" diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 8805da06..341ab0dd 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -19,6 +19,7 @@ #include "include/JSObjectProxy.hh" #include "include/JSArrayProxy.hh" #include "include/PyDictProxyHandler.hh" +#include "include/JSStringProxy.hh" #include "include/PyListProxyHandler.hh" #include "include/PyObjectProxyHandler.hh" #include "include/pyTypeFactory.hh" @@ -103,6 +104,9 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { else if (PyFloat_Check(object)) { returnType.setNumber(PyFloat_AsDouble(object)); } + else if (PyObject_TypeCheck(object, &JSStringProxyType)) { + returnType.setString(((JSStringProxy *)object)->jsString.toString()); + } else if (PyUnicode_Check(object)) { switch (PyUnicode_KIND(object)) { case (PyUnicode_4BYTE_KIND): { diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 817c7110..7a0b3ade 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -48,8 +48,6 @@ #include #include -JSContext *GLOBAL_CX; - JS::PersistentRootedObject *jsFunctionRegistry; bool functionRegistryCallback(JSContext *cx, unsigned int argc, JS::Value *vp) { @@ -573,7 +571,7 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) Py_DECREF(pyModule); return NULL; } - + Py_INCREF(&JSArrayIterProxyType); if (PyModule_AddObject(pyModule, "JSArrayIterProxy", (PyObject *)&JSArrayIterProxyType) < 0) { Py_DECREF(&JSArrayIterProxyType); diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index d8ccc977..442471ce 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -741,7 +741,7 @@ def myFunc(e,f): try: pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, myFunc) assert (False) - except Exception as e: + except Exception as e: assert str(type(e)) == "" assert str(e) == "incorrect compare function return type" @@ -753,8 +753,8 @@ def myFunc(e,f): pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, myFunc) assert (False) except Exception as e: - assert str(type(e)) == "" - assert str(e) == "object of type 'float' has no len()" + assert str(type(e)) == "" + assert "object of type 'float' has no len()" in str(e) def test_sort_with_one_arg_keyfunc(): items = ['Four', 'Three', 'One'] @@ -765,16 +765,16 @@ def myFunc(e): assert (False) except Exception as e: assert str(type(e)) == "" - assert str(e).__contains__("invalid Array.prototype.sort argument") + assert "takes 1 positional argument but 2 were given" in str(e) def test_sort_with_builtin_keyfunc(): items = ['Four', 'Three', 'One'] try: pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, len) assert (False) - except Exception as e: + except Exception as e: assert str(type(e)) == "" - assert str(e).__contains__("invalid Array.prototype.sort argument") + assert "len() takes exactly one argument (2 given)" in str(e) def test_sort_with_js_func(): items = ['Four', 'Three', 'One'] From e4f4d905d340bd781de3b45bca621b0afe6e4a5d Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 1 Feb 2024 16:29:27 -0500 Subject: [PATCH 0206/1086] added globalThis tests --- tests/python/test_pythonmonkey_eval.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/python/test_pythonmonkey_eval.py b/tests/python/test_pythonmonkey_eval.py index 6ce9a3e9..1968cb7f 100644 --- a/tests/python/test_pythonmonkey_eval.py +++ b/tests/python/test_pythonmonkey_eval.py @@ -3,6 +3,8 @@ import random from datetime import datetime, timedelta, timezone import math +from io import StringIO +import sys def test_passes(): assert True @@ -289,4 +291,17 @@ def concatenate(a, b): def test_globalThis(): obj = pm.eval('globalThis') - assert str(obj).__contains__("{'python': {'pythonMonkey':") \ No newline at end of file + assert str(obj).__contains__("{'python': {'pythonMonkey':") + +def test_console_globalThis(): + temp_out = StringIO() + sys.stdout = temp_out + pm.eval('console.log(globalThis)') + assert temp_out.getvalue().__contains__("{ python: \n { pythonMonkey: \n") + +def test_console_array(): + temp_out = StringIO() + sys.stdout = temp_out + items = [1, 2, 3] + pm.eval('console.log')(items) + assert temp_out.getvalue() == "[ \x1b[33m1\x1b[39m, \x1b[33m2\x1b[39m, \x1b[33m3\x1b[39m ]\n" \ No newline at end of file From a5b12a56ef4ae550cf7556a573f02ff48e800c21 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 1 Feb 2024 16:30:13 -0500 Subject: [PATCH 0207/1086] cleanup --- src/DictType.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/DictType.cc b/src/DictType.cc index 86e029f9..1ba29b64 100644 --- a/src/DictType.cc +++ b/src/DictType.cc @@ -3,7 +3,6 @@ #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/JSObjectProxy.hh" #include "include/PyType.hh" -#include "include/pyTypeFactory.hh" #include #include From 71269e78a1f68226b2e4535ac828a379abbb2676 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 1 Feb 2024 17:37:25 -0500 Subject: [PATCH 0208/1086] value parameter to PyTypeFactory no longer needs to be allocated on the heap --- src/JSArrayIterProxy.cc | 12 +-- src/JSArrayProxy.cc | 101 +++++++++++------------ src/JSFunctionProxy.cc | 6 +- src/JSMethodProxy.cc | 6 +- src/JSObjectIterProxy.cc | 12 +-- src/JSObjectProxy.cc | 40 ++++----- src/JobQueue.cc | 5 +- src/PromiseType.cc | 4 +- src/PyDictProxyHandler.cc | 4 +- src/PyListProxyHandler.cc | 64 +++++++------- src/PyObjectProxyHandler.cc | 4 +- src/internalBinding.cc | 4 +- src/jsTypeFactory.cc | 4 +- src/modules/pythonmonkey/pythonmonkey.cc | 2 +- 14 files changed, 130 insertions(+), 138 deletions(-) diff --git a/src/JSArrayIterProxy.cc b/src/JSArrayIterProxy.cc index dc8aade8..bc30381b 100644 --- a/src/JSArrayIterProxy.cc +++ b/src/JSArrayIterProxy.cc @@ -47,16 +47,16 @@ PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_next(JSArrayIterPr if (self->it.reversed) { if (self->it.it_index >= 0) { - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index--, elementVal); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); + JS::RootedValue elementVal(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index--, &elementVal); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), &elementVal)->getPyObject(); } } else { if (self->it.it_index < JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)seq)) { - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index++, elementVal); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); + JS::RootedValue elementVal(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index++, &elementVal); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), &elementVal)->getPyObject(); } } diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index e393668e..4bfafac7 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -62,10 +62,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py for (size_t index = 0;; index++) { const char *methodName = JSArrayProxyType.tp_methods[index].ml_name; if (methodName == NULL || !PyUnicode_Check(key)) { // reached end of list - JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, value); + JS::RootedValue value(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, &value); JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsArray); - return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, thisObj, &value)->getPyObject(); } else { if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { @@ -81,12 +81,12 @@ static PyObject *list_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihig JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].setInt32(ilow); jArgs[1].setInt32(ihigh); - JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "slice", jArgs, jReturnedArray)) { + JS::RootedValue jReturnedArray(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "slice", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jReturnedArray)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), &jReturnedArray)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy *self, PyObject *key) @@ -111,10 +111,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy JS::RootedId id(GLOBAL_CX); JS_IndexToId(GLOBAL_CX, index, &id); - JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, value); + JS::RootedValue value(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, &value); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), &value)->getPyObject(); } else if (PySlice_Check(key)) { Py_ssize_t start, stop, step, slicelength, index; @@ -140,10 +140,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy JS_SetElement(GLOBAL_CX, jCombinedArray, index, elementVal); } - JS::RootedValue *jCombinedArrayValue = new JS::RootedValue(GLOBAL_CX); - jCombinedArrayValue->setObjectOrNull(jCombinedArray); + JS::RootedValue jCombinedArrayValue(GLOBAL_CX); + jCombinedArrayValue.setObjectOrNull(jCombinedArray); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jCombinedArrayValue)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), &jCombinedArrayValue)->getPyObject(); } } else { @@ -442,20 +442,19 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * } } - JS::RootedValue *elementVal; + JS::RootedValue elementVal(GLOBAL_CX); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); Py_ssize_t index; /* Search for the first index where items are different */ for (index = 0; index < selfLength && index < otherLength; index++) { - elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *leftItem = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + PyObject *leftItem = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); PyObject *rightItem; if (PyObject_TypeCheck(other, &JSArrayProxyType)) { - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)other)->jsArray, index, elementVal); - rightItem = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)other)->jsArray, index, &elementVal); + rightItem = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); } else { rightItem = ((PyListObject *)other)->ob_item[index]; } @@ -490,10 +489,9 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * Py_RETURN_TRUE; } - elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); /* Compare the final item again using the proper operator */ - return PyObject_RichCompare(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(), ((PyListObject *)other)->ob_item[index], op); + return PyObject_RichCompare(pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(), ((PyListObject *)other)->ob_item[index], op); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { @@ -515,6 +513,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { /* "[" + "1" + ", 2" * (len - 1) + "]" */ writer.min_length = 1 + 1 + (2 + 1) * (selfLength - 1) + 1; + JS::RootedValue elementVal(GLOBAL_CX); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); if (_PyUnicodeWriter_WriteChar(&writer, '[') < 0) { @@ -529,14 +528,13 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { } } - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); + JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); PyObject *s; - if (&elementVal->toObject() == self->jsArray.get()) { + if (&elementVal.toObject() == self->jsArray.get()) { s = PyObject_Repr((PyObject *)self); } else { - s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); + s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject()); } if (s == NULL) { goto error; @@ -676,11 +674,11 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyO int cmp; Py_ssize_t numElements = JSArrayProxy_length(self); + JS::RootedValue elementVal(GLOBAL_CX); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (index = 0, cmp = 0; cmp == 0 && index < numElements; ++index) { - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); - PyObject *item = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + PyObject *item = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); Py_INCREF(item); cmp = PyObject_RichCompareBool(item, element, Py_EQ); Py_DECREF(item); @@ -752,12 +750,7 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot(JSArrayProxy *self) { } int JSArrayProxyMethodDefinitions::JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg) { - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); - for (Py_ssize_t i = JSArrayProxy_length(self); --i >= 0; ) { - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsArray, i, elementVal); - Py_VISIT(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); - } + // TODO return 0; } @@ -944,20 +937,20 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_pop(JSArrayProxy *self, Py // need the value in the returned array, not the array itself JS::RootedObject rootedReturnedArray(GLOBAL_CX, jReturnedArray.toObjectOrNull()); - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, rootedReturnedArray, 0, elementVal); + JS::RootedValue elementVal(GLOBAL_CX); + JS_GetElement(GLOBAL_CX, rootedReturnedArray, 0, &elementVal); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), elementVal)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), &elementVal)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self, PyObject *value) { Py_ssize_t selfSize = JSArrayProxy_length(self); + JS::RootedValue elementVal(GLOBAL_CX); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (Py_ssize_t index = 0; index < selfSize; index++) { - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + PyObject *obj = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1019,11 +1012,11 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_index(JSArrayProxy *self, } } + JS::RootedValue elementVal(GLOBAL_CX); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (Py_ssize_t index = start; index < stop && index < selfSize; index++) { - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + PyObject *obj = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1043,11 +1036,11 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_count(JSArrayProxy *self, Py_ssize_t count = 0; Py_ssize_t length = JSArrayProxy_length(self); + JS::RootedValue elementVal(GLOBAL_CX); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (Py_ssize_t index = 0; index < length; index++) { - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, self->jsArray, index, elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + PyObject *obj = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1096,15 +1089,15 @@ static bool sort_compare_key_func(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(&args.callee())); - JS::RootedValue *elementVal = new JS::RootedValue(cx, args[0]); - PyObject *args_0 = pyTypeFactory(cx, global, elementVal)->getPyObject(); + JS::RootedValue elementVal0(cx, args[0]); + PyObject *args_0 = pyTypeFactory(cx, global, &elementVal0)->getPyObject(); PyObject *args_0_result = PyObject_CallFunction(keyfunc, "O", args_0); if (!args_0_result) { return false; } - elementVal = new JS::RootedValue(cx, args[1]); - PyObject *args_1 = pyTypeFactory(cx, global, elementVal)->getPyObject(); + JS::RootedValue elementVal1(cx, args[1]); + PyObject *args_1 = pyTypeFactory(cx, global, &elementVal1)->getPyObject(); PyObject *args_1_result = PyObject_CallFunction(keyfunc, "O", args_1); if (!args_1_result) { return false; @@ -1146,11 +1139,11 @@ static bool sort_compare_default(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(&args.callee())); - JS::RootedValue *elementVal = new JS::RootedValue(cx, args[0]); - PyObject *args_0 = pyTypeFactory(cx, global, elementVal)->getPyObject(); + JS::RootedValue elementVal0(cx, args[0]); + PyObject *args_0 = pyTypeFactory(cx, global, &elementVal0)->getPyObject(); - elementVal = new JS::RootedValue(cx, args[1]); - PyObject *args_1 = pyTypeFactory(cx, global, elementVal)->getPyObject(); + JS::RootedValue elementVal1(cx, args[1]); + PyObject *args_1 = pyTypeFactory(cx, global, &elementVal1)->getPyObject(); int cmp = PyObject_RichCompareBool(args_0, args_1, Py_LT); if (cmp > 0) { diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc index ce2cb93e..b41eb9d8 100644 --- a/src/JSFunctionProxy.cc +++ b/src/JSFunctionProxy.cc @@ -51,11 +51,11 @@ PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_call(PyObject *self, } JS::HandleValueArray jsArgs(jsArgsVector); - JS::Rooted *jsReturnVal = new JS::Rooted(cx); - if (!JS_CallFunctionValue(cx, thisObj, jsFunc, jsArgs, jsReturnVal)) { + JS::RootedValue jsReturnVal(cx); + if (!JS_CallFunctionValue(cx, thisObj, jsFunc, jsArgs, &jsReturnVal)) { setSpiderMonkeyException(cx); return NULL; } - return pyTypeFactory(cx, &thisObj, jsReturnVal)->getPyObject(); + return pyTypeFactory(cx, &thisObj, &jsReturnVal)->getPyObject(); } \ No newline at end of file diff --git a/src/JSMethodProxy.cc b/src/JSMethodProxy.cc index f20041dc..adfdaf57 100644 --- a/src/JSMethodProxy.cc +++ b/src/JSMethodProxy.cc @@ -61,12 +61,12 @@ PyObject *JSMethodProxyMethodDefinitions::JSMethodProxy_call(PyObject *self, PyO } JS::HandleValueArray jsArgs(jsArgsVector); - JS::Rooted *jsReturnVal = new JS::Rooted(cx); - if (!JS_CallFunctionValue(cx, selfObject, jsFunc, jsArgs, jsReturnVal)) { + JS::RootedValue jsReturnVal(cx); + if (!JS_CallFunctionValue(cx, selfObject, jsFunc, jsArgs, &jsReturnVal)) { setSpiderMonkeyException(cx); return NULL; } JS::RootedObject globalObj(cx, JS::CurrentGlobalOrNull(cx)); - return pyTypeFactory(cx, &globalObj, jsReturnVal)->getPyObject(); + return pyTypeFactory(cx, &globalObj, &jsReturnVal)->getPyObject(); } \ No newline at end of file diff --git a/src/JSObjectIterProxy.cc b/src/JSObjectIterProxy.cc index 1a20dac1..17640393 100644 --- a/src/JSObjectIterProxy.cc +++ b/src/JSObjectIterProxy.cc @@ -58,9 +58,9 @@ PyObject *JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_nextkey(JSObject if (self->it.kind != KIND_KEYS) { JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSObjectProxy *)(self->it.di_dict))->jsObject)); - JS::RootedValue *jsVal = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, jsVal); - value = pyTypeFactory(GLOBAL_CX, global, jsVal)->getPyObject(); + JS::RootedValue jsVal(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, &jsVal); + value = pyTypeFactory(GLOBAL_CX, global, &jsVal)->getPyObject(); } PyObject *ret; @@ -85,9 +85,9 @@ PyObject *JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_nextkey(JSObject if (self->it.kind != KIND_KEYS) { JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSObjectProxy *)(self->it.di_dict))->jsObject)); - JS::RootedValue *jsVal = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, jsVal); - value = pyTypeFactory(GLOBAL_CX, global, jsVal)->getPyObject(); + JS::RootedValue jsVal(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, &jsVal); + value = pyTypeFactory(GLOBAL_CX, global, &jsVal)->getPyObject(); } PyObject *ret; diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 7f530249..cdf8177e 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -90,10 +90,10 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, for (size_t index = 0;; index++) { const char *methodName = JSObjectProxyType.tp_methods[index].ml_name; if (methodName == NULL || !PyUnicode_Check(key)) { - JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); + JS::RootedValue value(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsObject); - return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, thisObj, &value)->getPyObject(); } else { if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { @@ -190,11 +190,11 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr for (size_t i = 0; i < length; i++) { JS::HandleId id = props[i]; - JS::RootedValue *key = new JS::RootedValue(GLOBAL_CX); - key->setString(id.toString()); + JS::RootedValue key(GLOBAL_CX); + key.setString(id.toString()); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - PyObject *pyKey = pyTypeFactory(GLOBAL_CX, global, key)->getPyObject(); + PyObject *pyKey = pyTypeFactory(GLOBAL_CX, global, &key)->getPyObject(); PyObject *pyVal1 = PyObject_GetItem((PyObject *)self, pyKey); PyObject *pyVal2 = PyObject_GetItem((PyObject *)other, pyKey); if (!pyVal2) { // if other.key is NULL then not equal @@ -308,13 +308,13 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self goto error; } - JS::RootedValue *elementVal = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, elementVal); + JS::RootedValue elementVal(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &elementVal); - if (&elementVal->toObject() == self->jsObject.get()) { + if (&elementVal.toObject() == self->jsObject.get()) { value = (PyObject *)self; } else { - value = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + value = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); } Py_INCREF(value); @@ -454,13 +454,13 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, } JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); - JS::RootedValue *ret = new JS::RootedValue(GLOBAL_CX); + JS::RootedValue ret(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, ret)) { + if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, global, ret)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); } } @@ -568,9 +568,9 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy return NULL; } - JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); - if (value->isUndefined()) { + JS::RootedValue value(GLOBAL_CX); + JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); + if (value.isUndefined()) { if (default_value != NULL) { Py_INCREF(default_value); return default_value; @@ -583,7 +583,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, global, &value)->getPyObject(); } } @@ -619,12 +619,12 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProx } JS::RootedObject rootedObject(GLOBAL_CX, Object.toObjectOrNull()); - JS::RootedValue *ret = new JS::RootedValue(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, ret)) { + JS::RootedValue ret(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, rootedObject, "assign", args, &ret)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, global, ret)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_update_method(JSObjectProxy *self, PyObject *args, PyObject *kwds) { diff --git a/src/JobQueue.cc b/src/JobQueue.cc index ee7a013f..2aa7f15f 100644 --- a/src/JobQueue.cc +++ b/src/JobQueue.cc @@ -24,8 +24,9 @@ bool JobQueue::enqueuePromiseJob(JSContext *cx, // FIXME (Tom Tang): memory leak, objects not free-ed // FIXME (Tom Tang): `job` function is going to be GC-ed ??? auto global = new JS::RootedObject(cx, incumbentGlobal); - auto jobv = new JS::RootedValue(cx, JS::ObjectValue(*job)); - auto callback = pyTypeFactory(cx, global, jobv)->getPyObject(); + // auto jobv = new JS::RootedValue(cx, JS::ObjectValue(*job)); + JS::RootedValue jobv(cx, JS::ObjectValue(*job)); + auto callback = pyTypeFactory(cx, global, &jobv)->getPyObject(); // Inform the JS runtime that the job queue is no longer empty JS::JobQueueMayNotBeEmpty(cx); diff --git a/src/PromiseType.cc b/src/PromiseType.cc index bf0c6dd9..b43d4f98 100644 --- a/src/PromiseType.cc +++ b/src/PromiseType.cc @@ -42,8 +42,8 @@ static bool onResolvedCb(JSContext *cx, unsigned argc, JS::Value *vp) { // The result might be another JS function, so we must keep them alive JS::RootedObject *thisv = new JS::RootedObject(cx); args.computeThis(cx, thisv); // thisv is the global object, not the promise - JS::RootedValue *resultArg = new JS::RootedValue(cx, args[0]); - PyObject *result = pyTypeFactory(cx, thisv, resultArg)->getPyObject(); + JS::RootedValue resultArg(cx, args[0]); + PyObject *result = pyTypeFactory(cx, thisv, &resultArg)->getPyObject(); if (state == JS::PromiseState::Rejected && !PyExceptionInstance_Check(result)) { // Wrap the result object into a SpiderMonkeyError object // because only *Exception objects can be thrown in Python `raise` statement and alike diff --git a/src/PyDictProxyHandler.cc b/src/PyDictProxyHandler.cc index 9f6983ed..1b81cdcc 100644 --- a/src/PyDictProxyHandler.cc +++ b/src/PyDictProxyHandler.cc @@ -140,10 +140,10 @@ bool PyDictProxyHandler::getOwnPropertyDescriptor( bool PyDictProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::HandleValue v, JS::HandleValue receiver, JS::ObjectOpResult &result) const { - JS::RootedValue *rootedV = new JS::RootedValue(cx, v); + JS::RootedValue rootedV(cx, v); PyObject *attrName = idToKey(cx, id); JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - if (PyDict_SetItem(pyObject, attrName, pyTypeFactory(cx, global, rootedV)->getPyObject())) { + if (PyDict_SetItem(pyObject, attrName, pyTypeFactory(cx, global, &rootedV)->getPyObject())) { return result.failCantSetInterposed(); // raises JS exception } return result.succeed(); diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 72535993..d2913b00 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -89,10 +89,10 @@ static bool array_push(JSContext *cx, unsigned argc, JS::Value *vp) { // surely JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); unsigned numArgs = args.length(); + JS::RootedValue elementVal(cx); for (unsigned index = 0; index < numArgs; index++) { - JS::RootedValue *elementVal = new JS::RootedValue(cx); - elementVal->set(args[index].get()); - if (PyList_Append(self, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + elementVal.set(args[index].get()); + if (PyList_Append(self, pyTypeFactory(cx, global, &elementVal)->getPyObject()) < 0) { return false; } } @@ -139,10 +139,10 @@ static bool array_unshift(JSContext *cx, unsigned argc, JS::Value *vp) { // sure PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + JS::RootedValue elementVal(cx); for (int index = args.length() - 1; index >= 0; index--) { - JS::RootedValue *elementVal = new JS::RootedValue(cx); - elementVal->set(args[index].get()); - if (PyList_Insert(self, 0, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + elementVal.set(args[index].get()); + if (PyList_Insert(self, 0, pyTypeFactory(cx, global, &elementVal)->getPyObject()) < 0) { return false; } } @@ -253,8 +253,8 @@ static bool array_indexOf(JSContext *cx, unsigned argc, JS::Value *vp) { } JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - JS::RootedValue *elementVal = new JS::RootedValue(cx, args[0].get()); - PyObject *result = PyObject_CallMethod(self, "index", "Oi", pyTypeFactory(cx, global, elementVal)->getPyObject(), start); + JS::RootedValue elementVal(cx, args[0].get()); + PyObject *result = PyObject_CallMethod(self, "index", "Oi", pyTypeFactory(cx, global, &elementVal)->getPyObject(), start); if (!result) { PyErr_Clear(); @@ -331,10 +331,11 @@ static bool array_splice(JSContext *cx, unsigned argc, JS::Value *vp) { return false; } + JS::RootedValue elementVal(cx); JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); for (int index = 0; index < insertCount; index++) { - JS::RootedValue *elementVal = new JS::RootedValue(cx, args[index + 2].get()); - if (PyList_SetItem(inserted, index, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + elementVal.set(args[index + 2].get()); + if (PyList_SetItem(inserted, index, pyTypeFactory(cx, global, &elementVal)->getPyObject()) < 0) { return false; } } @@ -397,8 +398,8 @@ static bool array_fill(JSContext *cx, unsigned argc, JS::Value *vp) { } JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - JS::RootedValue *fillValue = new JS::RootedValue(cx, args[0].get()); - PyObject *fillValueItem = pyTypeFactory(cx, global, fillValue)->getPyObject(); + JS::RootedValue fillValue(cx, args[0].get()); + PyObject *fillValueItem = pyTypeFactory(cx, global, &fillValue)->getPyObject(); for (int index = actualStart; index < actualEnd; index++) { if (PyList_SetItem(self, index, fillValueItem) < 0) { return false; @@ -525,20 +526,19 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { } unsigned numArgs = args.length(); + JS::RootedValue elementVal(cx); for (unsigned index = 0; index < numArgs; index++) { - JS::RootedValue *elementVal = new JS::RootedValue(cx); - elementVal->set(args[index].get()); + elementVal.set(args[index].get()); - PyObject *item = pyTypeFactory(cx, global, elementVal)->getPyObject(); + PyObject *item = pyTypeFactory(cx, global, &elementVal)->getPyObject(); if (PyObject_TypeCheck(item, &JSArrayProxyType)) { // flatten the array only a depth 1 Py_ssize_t itemLength = JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)item); for (Py_ssize_t flatIndex = 0; flatIndex < itemLength; flatIndex++) { - elementVal = new JS::RootedValue(cx); - if (!JS_GetElement(cx, ((JSArrayProxy *)item)->jsArray, flatIndex, elementVal)) { + if (!JS_GetElement(cx, ((JSArrayProxy *)item)->jsArray, flatIndex, &elementVal)) { return false; } - if (PyList_Append(result, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + if (PyList_Append(result, pyTypeFactory(cx, global, &elementVal)->getPyObject()) < 0) { return false; } } @@ -553,7 +553,7 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { } } else { - if (PyList_Append(result, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + if (PyList_Append(result, pyTypeFactory(cx, global, &elementVal)->getPyObject()) < 0) { return false; } } @@ -603,8 +603,8 @@ static bool array_lastIndexOf(JSContext *cx, unsigned argc, JS::Value *vp) { } JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - JS::RootedValue *elementVal = new JS::RootedValue(cx, args[0].get()); - PyObject *element = pyTypeFactory(cx, global, elementVal)->getPyObject(); + JS::RootedValue elementVal(cx, args[0].get()); + PyObject *element = pyTypeFactory(cx, global, &elementVal)->getPyObject(); for (int64_t index = start; index >= 0; index--) { PyObject *item = PyList_GetItem(self, index); Py_INCREF(item); @@ -1190,19 +1190,19 @@ static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject global, uint32_t targetIndex = start; + JS::RootedValue elementVal(cx); JS::RootedObject rootedGlobal(cx, global); for (uint32_t sourceIndex = 0; sourceIndex < sourceLen; sourceIndex++) { - JS::RootedValue *elementVal = new JS::RootedValue(cx); if (PyObject_TypeCheck(source, &JSArrayProxyType)) { - JS_GetElement(cx, ((JSArrayProxy *)source)->jsArray, sourceIndex, elementVal); + JS_GetElement(cx, ((JSArrayProxy *)source)->jsArray, sourceIndex, &elementVal); } else if (PyObject_TypeCheck(source, &PyList_Type)) { - elementVal->set(jsTypeFactory(cx, PyList_GetItem(source, sourceIndex))); + elementVal.set(jsTypeFactory(cx, PyList_GetItem(source, sourceIndex))); } - PyObject *element = pyTypeFactory(cx, &rootedGlobal, elementVal)->getPyObject(); + PyObject *element = pyTypeFactory(cx, &rootedGlobal, &elementVal)->getPyObject(); bool shouldFlatten; if (depth > 0) { @@ -1237,7 +1237,7 @@ static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject global, JS::SetArrayLength(cx, rootedRetArray, targetIndex + 1); } - JS_SetElement(cx, rootedRetArray, targetIndex, *elementVal); + JS_SetElement(cx, rootedRetArray, targetIndex, elementVal); targetIndex++; } @@ -1268,16 +1268,14 @@ static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject glo elementVal.set(jsTypeFactory(cx, PyList_GetItem(source, sourceIndex))); } - JS::RootedValue *retVal = new JS::RootedValue(cx); - jArgs[0].set(elementVal); jArgs[1].setInt32(sourceIndex); jArgs[2].set(sourceValue); - if (!JS_CallFunctionValue(cx, thisArg, callBack, jArgs, retVal)) { + if (!JS_CallFunctionValue(cx, thisArg, callBack, jArgs, &retVal)) { return false; } - PyObject *element = pyTypeFactory(cx, &rootedGlobal, retVal)->getPyObject(); + PyObject *element = pyTypeFactory(cx, &rootedGlobal, &retVal)->getPyObject(); bool shouldFlatten; if (depth > 0) { @@ -1336,7 +1334,7 @@ static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject glo JS::SetArrayLength(cx, rootedRetArray, targetIndex + 1); } - JS_SetElement(cx, rootedRetArray, targetIndex, *retVal); + JS_SetElement(cx, rootedRetArray, targetIndex, retVal); targetIndex++; } @@ -2059,8 +2057,8 @@ bool PyListProxyHandler::defineProperty( // FIXME (Tom Tang): memory leak JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - JS::RootedValue *itemV = new JS::RootedValue(cx, desc.value()); - PyObject *item = pyTypeFactory(cx, global, itemV)->getPyObject(); + JS::RootedValue itemV(cx, desc.value()); + PyObject *item = pyTypeFactory(cx, global, &itemV)->getPyObject(); if (PyList_SetItem(pyObject, index, item) < 0) { return result.failBadIndex(); } diff --git a/src/PyObjectProxyHandler.cc b/src/PyObjectProxyHandler.cc index d7cd3b80..3af67651 100644 --- a/src/PyObjectProxyHandler.cc +++ b/src/PyObjectProxyHandler.cc @@ -93,10 +93,10 @@ bool PyObjectProxyHandler::getOwnPropertyDescriptor( bool PyObjectProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::HandleValue v, JS::HandleValue receiver, JS::ObjectOpResult &result) const { - JS::RootedValue *rootedV = new JS::RootedValue(cx, v); + JS::RootedValue rootedV(cx, v); PyObject *attrName = idToKey(cx, id); JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - if (PyObject_SetAttr(pyObject, attrName, pyTypeFactory(cx, global, rootedV)->getPyObject())) { + if (PyObject_SetAttr(pyObject, attrName, pyTypeFactory(cx, global, &rootedV)->getPyObject())) { return result.failCantSetInterposed(); // raises JS exception } return result.succeed(); diff --git a/src/internalBinding.cc b/src/internalBinding.cc index 791783f7..61764791 100644 --- a/src/internalBinding.cc +++ b/src/internalBinding.cc @@ -61,8 +61,8 @@ PyObject *getInternalBindingPyFn(JSContext *cx) { // Convert to a Python function // FIXME (Tom Tang): memory leak, not free-ed JS::RootedObject *thisObj = new JS::RootedObject(cx, nullptr); - JS::RootedValue *jsFnVal = new JS::RootedValue(cx, JS::ObjectValue(*jsFn)); - PyObject *pyFn = pyTypeFactory(cx, thisObj, jsFnVal)->getPyObject(); + JS::RootedValue jsFnVal(cx, JS::ObjectValue(*jsFn)); + PyObject *pyFn = pyTypeFactory(cx, thisObj, &jsFnVal)->getPyObject(); return pyFn; } diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 341ab0dd..6e11da72 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -301,8 +301,8 @@ bool callPyFunc(JSContext *cx, unsigned int argc, JS::Value *vp) { // populate python args tuple PyObject *pyArgs = PyTuple_New(callArgsLength); for (size_t i = 0; i < callArgsLength; i++) { - JS::RootedValue *jsArg = new JS::RootedValue(cx, callargs[i]); - PyType *pyArg = pyTypeFactory(cx, thisv, jsArg); + JS::RootedValue jsArg(cx, callargs[i]); + PyType *pyArg = pyTypeFactory(cx, thisv, &jsArg); if (!pyArg) return false; // error occurred PyObject *pyArgObj = pyArg->getPyObject(); if (!pyArgObj) return false; // error occurred diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 7a0b3ade..5bbcc78b 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -352,7 +352,7 @@ static PyObject *eval(PyObject *self, PyObject *args) { delete code; // evaluate source code - JS::Rooted *rval = new JS::Rooted(GLOBAL_CX); + JS::RootedValue rval = new JS::RootedValue(GLOBAL_CX); if (!JS::Evaluate(GLOBAL_CX, options, source, rval)) { setSpiderMonkeyException(GLOBAL_CX); return NULL; From cb3feef58b9d947e4b7246caa72f700f820e347c Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 1 Feb 2024 17:37:38 -0500 Subject: [PATCH 0209/1086] cleanup --- src/JSObjectKeysProxy.cc | 1 - src/JSObjectValuesProxy.cc | 1 - src/TupleType.cc | 1 - 3 files changed, 3 deletions(-) diff --git a/src/JSObjectKeysProxy.cc b/src/JSObjectKeysProxy.cc index 81adbe59..698b1e81 100644 --- a/src/JSObjectKeysProxy.cc +++ b/src/JSObjectKeysProxy.cc @@ -17,7 +17,6 @@ #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/jsTypeFactory.hh" -#include "include/pyTypeFactory.hh" #include "include/PyDictProxyHandler.hh" #include diff --git a/src/JSObjectValuesProxy.cc b/src/JSObjectValuesProxy.cc index d6a7a9b5..7c7c8977 100644 --- a/src/JSObjectValuesProxy.cc +++ b/src/JSObjectValuesProxy.cc @@ -17,7 +17,6 @@ #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/jsTypeFactory.hh" -#include "include/pyTypeFactory.hh" #include "include/PyDictProxyHandler.hh" #include diff --git a/src/TupleType.cc b/src/TupleType.cc index 7c2018cc..9c3748dc 100644 --- a/src/TupleType.cc +++ b/src/TupleType.cc @@ -12,7 +12,6 @@ #include "include/TupleType.hh" #include "include/PyType.hh" -#include "include/pyTypeFactory.hh" #include From 13938dbb8c2dae08fcd86c6864d370e96d43f0ef Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 1 Feb 2024 17:43:15 -0500 Subject: [PATCH 0210/1086] should have been part of the previous commit --- src/modules/pythonmonkey/pythonmonkey.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 5bbcc78b..d31abc7d 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -352,7 +352,7 @@ static PyObject *eval(PyObject *self, PyObject *args) { delete code; // evaluate source code - JS::RootedValue rval = new JS::RootedValue(GLOBAL_CX); + JS::RootedValue *rval = new JS::RootedValue(GLOBAL_CX); if (!JS::Evaluate(GLOBAL_CX, options, source, rval)) { setSpiderMonkeyException(GLOBAL_CX); return NULL; From a001cca61db9d69e904a3717856d79c2a0ee32f3 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 2 Feb 2024 15:45:23 +0000 Subject: [PATCH 0211/1086] fix: wrong assumption that the `timeoutId` argument to `clearTimeout` is always a `JS::Value` of type `JSVAL_TYPE_INT32` --- src/internalBinding/timers.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/internalBinding/timers.cc b/src/internalBinding/timers.cc index ec4d5e6c..b9653103 100644 --- a/src/internalBinding/timers.cc +++ b/src/internalBinding/timers.cc @@ -44,13 +44,13 @@ static bool cancelByTimeoutId(JSContext *cx, unsigned argc, JS::Value *vp) { args.rval().setUndefined(); - // silently does nothing when an invalid timeoutID is passed in - if (!timeoutIdArg.isInt32()) { + // silently does nothing when an invalid timeoutID (should be an int32 value) is passed in + if (!timeoutIdArg.isNumber()) { return true; } // Retrieve the AsyncHandle by `timeoutID` - int32_t timeoutID = timeoutIdArg.toInt32(); + double timeoutID = timeoutIdArg.toNumber(); AsyncHandle *handle = AsyncHandle::fromId((uint32_t)timeoutID); if (!handle) return true; // does nothing on invalid timeoutID From 320462fe52565df7a65fa866e4c0202637d2d739 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 2 Feb 2024 15:55:16 +0000 Subject: [PATCH 0212/1086] fix(XHR): do nothing instead of throwing a `DOMException` when setting `xhr.withCredentials` Socket.IO would die in the middle between `xhr.open` and `xhr.send` --- python/pythonmonkey/builtin_modules/XMLHttpRequest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index efdea02e..b81533b7 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -182,7 +182,7 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget } set withCredentials(flag) { - throw new DOMException('xhr.withCredentials is not supported in PythonMonkey.', 'InvalidAccessError'); + // do nothing } /** From b463778336516619107a6f8756430dab0706db4f Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 2 Feb 2024 16:21:57 +0000 Subject: [PATCH 0213/1086] feat(XHR): implement `xhr.withCredentials` getter/setter --- .../builtin_modules/XMLHttpRequest.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index b81533b7..b33c00c8 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -176,13 +176,27 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget */ timeout = 0; + /** + * A boolean value that indicates whether or not cross-site `Access-Control` requests should be made using credentials such as cookies, authorization headers or TLS client certificates. + * Setting withCredentials has no effect on same-origin requests. + * @see https://xhr.spec.whatwg.org/#the-withcredentials-attribute + */ get withCredentials() { - return false; + return this.#crossOriginCredentials; } set withCredentials(flag) { - // do nothing + // step 1 + if (this.#state !== XMLHttpRequest.UNSENT && this.#state !== XMLHttpRequest.OPENED) + // The XHR internal state should be UNSENT or OPENED. + throw new DOMException('XMLHttpRequest must not be sending.', 'InvalidStateError'); + // step 2 + if (this.#sendFlag) + throw new DOMException('send() has already been called', 'InvalidStateError'); + // step 3 + this.#crossOriginCredentials = flag; + // TODO: figure out what cross-origin means in PythonMonkey. Is it always same-origin request? What to send? } /** @@ -565,6 +579,7 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget #uploadObject = new XMLHttpRequestUpload(); #state = XMLHttpRequest.UNSENT; // One of unsent, opened, headers received, loading, and done; initially unsent. #sendFlag = false; // A flag, initially unset. + #crossOriginCredentials = false; // A boolean, initially false. /** @type {Method} */ #requestMethod = null; /** @type {URL} */ From c1fbc1fb3ad7ad7046bcf410583581f5544fb545 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 2 Feb 2024 11:27:32 -0500 Subject: [PATCH 0214/1086] pyTypeFactory use HandleValue instead of pointer --- src/JSArrayIterProxy.cc | 4 +- src/JSArrayProxy.cc | 51 ++++++++++++------------ src/JSFunctionProxy.cc | 2 +- src/JSMethodProxy.cc | 4 +- src/JSObjectIterProxy.cc | 4 +- src/JSObjectProxy.cc | 12 +++--- src/JobQueue.cc | 2 +- src/PromiseType.cc | 2 +- src/PyDictProxyHandler.cc | 2 +- src/PyListProxyHandler.cc | 24 +++++------ src/PyObjectProxyHandler.cc | 2 +- src/internalBinding.cc | 2 +- src/internalBinding/timers.cc | 2 +- src/jsTypeFactory.cc | 2 +- src/modules/pythonmonkey/pythonmonkey.cc | 2 +- src/pyTypeFactory.cc | 38 +++++++++--------- 16 files changed, 78 insertions(+), 77 deletions(-) diff --git a/src/JSArrayIterProxy.cc b/src/JSArrayIterProxy.cc index bc30381b..f63b278a 100644 --- a/src/JSArrayIterProxy.cc +++ b/src/JSArrayIterProxy.cc @@ -49,14 +49,14 @@ PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_next(JSArrayIterPr if (self->it.it_index >= 0) { JS::RootedValue elementVal(GLOBAL_CX); JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index--, &elementVal); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), &elementVal)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); } } else { if (self->it.it_index < JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)seq)) { JS::RootedValue elementVal(GLOBAL_CX); JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index++, &elementVal); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), &elementVal)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); } } diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 4bfafac7..31d62d2e 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -65,7 +65,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py JS::RootedValue value(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, &value); JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsArray); - return pyTypeFactory(GLOBAL_CX, thisObj, &value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } else { if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { @@ -86,7 +86,7 @@ static PyObject *list_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihig PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), &jReturnedArray)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jReturnedArray)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy *self, PyObject *key) @@ -114,7 +114,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy JS::RootedValue value(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, &value); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), &value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), value)->getPyObject(); } else if (PySlice_Check(key)) { Py_ssize_t start, stop, step, slicelength, index; @@ -132,7 +132,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy return list_slice(self, start, stop); } else { - JS::RootedObject jCombinedArray = JS::RootedObject(GLOBAL_CX, JS::NewArrayObject(GLOBAL_CX, slicelength)); + JS::RootedObject jCombinedArray(GLOBAL_CX, JS::NewArrayObject(GLOBAL_CX, slicelength)); JS::RootedValue elementVal(GLOBAL_CX); for (size_t cur = start, index = 0; index < slicelength; cur += (size_t)step, index++) { @@ -143,7 +143,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy JS::RootedValue jCombinedArrayValue(GLOBAL_CX); jCombinedArrayValue.setObjectOrNull(jCombinedArray); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), &jCombinedArrayValue)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jCombinedArrayValue)->getPyObject(); } } else { @@ -450,11 +450,11 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * for (index = 0; index < selfLength && index < otherLength; index++) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *leftItem = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + PyObject *leftItem = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); PyObject *rightItem; if (PyObject_TypeCheck(other, &JSArrayProxyType)) { JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)other)->jsArray, index, &elementVal); - rightItem = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + rightItem = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); } else { rightItem = ((PyListObject *)other)->ob_item[index]; } @@ -491,7 +491,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); /* Compare the final item again using the proper operator */ - return PyObject_RichCompare(pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(), ((PyListObject *)other)->ob_item[index], op); + return PyObject_RichCompare(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(), ((PyListObject *)other)->ob_item[index], op); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { @@ -534,7 +534,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { if (&elementVal.toObject() == self->jsArray.get()) { s = PyObject_Repr((PyObject *)self); } else { - s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject()); + s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); } if (s == NULL) { goto error; @@ -614,7 +614,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_concat(JSArrayProxy *self, } } - JS::RootedObject jCombinedArray = JS::RootedObject(GLOBAL_CX, JS::NewArrayObject(GLOBAL_CX, (size_t)sizeSelf + (size_t)sizeValue)); + JS::RootedObject jCombinedArray(GLOBAL_CX, JS::NewArrayObject(GLOBAL_CX, (size_t)sizeSelf + (size_t)sizeValue)); JS::RootedValue elementVal(GLOBAL_CX); @@ -636,8 +636,8 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_concat(JSArrayProxy *self, } } - JS::RootedValue *jCombinedArrayValue = new JS::RootedValue(GLOBAL_CX); - jCombinedArrayValue->setObjectOrNull(jCombinedArray); + JS::RootedValue jCombinedArrayValue(GLOBAL_CX); + jCombinedArrayValue.setObjectOrNull(jCombinedArray); return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jCombinedArrayValue)->getPyObject(); } @@ -652,7 +652,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, return PyErr_NoMemory(); } - JS::RootedObject jCombinedArray = JS::RootedObject(GLOBAL_CX, JS::NewArrayObject(GLOBAL_CX, input_size * n)); + JS::RootedObject jCombinedArray(GLOBAL_CX, JS::NewArrayObject(GLOBAL_CX, input_size * n)); // repeat within new array // one might think of using copyWithin but in SpiderMonkey it's implemented in JS! JS::RootedValue elementVal(GLOBAL_CX); @@ -666,7 +666,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, JS::RootedValue jCombinedArrayValue(GLOBAL_CX); jCombinedArrayValue.setObjectOrNull(jCombinedArray); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), &jCombinedArrayValue)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jCombinedArrayValue)->getPyObject(); } int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyObject *element) { @@ -674,11 +674,12 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyO int cmp; Py_ssize_t numElements = JSArrayProxy_length(self); + JS::RootedValue elementVal(GLOBAL_CX); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (index = 0, cmp = 0; cmp == 0 && index < numElements; ++index) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *item = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + PyObject *item = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); Py_INCREF(item); cmp = PyObject_RichCompareBool(item, element, Py_EQ); Py_DECREF(item); @@ -758,8 +759,8 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) { JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].setInt32(0); jArgs[1].setInt32(JSArrayProxy_length(self)); - JS::RootedValue *jReturnedArray = new JS::RootedValue(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "slice", jArgs, jReturnedArray)) { + JS::RootedValue jReturnedArray(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "slice", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -940,7 +941,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_pop(JSArrayProxy *self, Py JS::RootedValue elementVal(GLOBAL_CX); JS_GetElement(GLOBAL_CX, rootedReturnedArray, 0, &elementVal); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), &elementVal)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), elementVal)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self, PyObject *value) { @@ -950,7 +951,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self, JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (Py_ssize_t index = 0; index < selfSize; index++) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1016,7 +1017,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_index(JSArrayProxy *self, JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (Py_ssize_t index = start; index < stop && index < selfSize; index++) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1040,7 +1041,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_count(JSArrayProxy *self, JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); for (Py_ssize_t index = 0; index < length; index++) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1090,14 +1091,14 @@ static bool sort_compare_key_func(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(&args.callee())); JS::RootedValue elementVal0(cx, args[0]); - PyObject *args_0 = pyTypeFactory(cx, global, &elementVal0)->getPyObject(); + PyObject *args_0 = pyTypeFactory(cx, global, elementVal0)->getPyObject(); PyObject *args_0_result = PyObject_CallFunction(keyfunc, "O", args_0); if (!args_0_result) { return false; } JS::RootedValue elementVal1(cx, args[1]); - PyObject *args_1 = pyTypeFactory(cx, global, &elementVal1)->getPyObject(); + PyObject *args_1 = pyTypeFactory(cx, global, elementVal1)->getPyObject(); PyObject *args_1_result = PyObject_CallFunction(keyfunc, "O", args_1); if (!args_1_result) { return false; @@ -1140,10 +1141,10 @@ static bool sort_compare_default(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(&args.callee())); JS::RootedValue elementVal0(cx, args[0]); - PyObject *args_0 = pyTypeFactory(cx, global, &elementVal0)->getPyObject(); + PyObject *args_0 = pyTypeFactory(cx, global, elementVal0)->getPyObject(); JS::RootedValue elementVal1(cx, args[1]); - PyObject *args_1 = pyTypeFactory(cx, global, &elementVal1)->getPyObject(); + PyObject *args_1 = pyTypeFactory(cx, global, elementVal1)->getPyObject(); int cmp = PyObject_RichCompareBool(args_0, args_1, Py_LT); if (cmp > 0) { diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc index b41eb9d8..440ea31d 100644 --- a/src/JSFunctionProxy.cc +++ b/src/JSFunctionProxy.cc @@ -57,5 +57,5 @@ PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_call(PyObject *self, return NULL; } - return pyTypeFactory(cx, &thisObj, &jsReturnVal)->getPyObject(); + return pyTypeFactory(cx, &thisObj, jsReturnVal)->getPyObject(); } \ No newline at end of file diff --git a/src/JSMethodProxy.cc b/src/JSMethodProxy.cc index adfdaf57..c1c075e7 100644 --- a/src/JSMethodProxy.cc +++ b/src/JSMethodProxy.cc @@ -67,6 +67,6 @@ PyObject *JSMethodProxyMethodDefinitions::JSMethodProxy_call(PyObject *self, PyO return NULL; } - JS::RootedObject globalObj(cx, JS::CurrentGlobalOrNull(cx)); - return pyTypeFactory(cx, &globalObj, &jsReturnVal)->getPyObject(); + JS::RootedObject *globalObj = new JS::RootedObject(cx, JS::CurrentGlobalOrNull(cx)); + return pyTypeFactory(cx, globalObj, jsReturnVal)->getPyObject(); } \ No newline at end of file diff --git a/src/JSObjectIterProxy.cc b/src/JSObjectIterProxy.cc index 17640393..3b17d739 100644 --- a/src/JSObjectIterProxy.cc +++ b/src/JSObjectIterProxy.cc @@ -60,7 +60,7 @@ PyObject *JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_nextkey(JSObject JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSObjectProxy *)(self->it.di_dict))->jsObject)); JS::RootedValue jsVal(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, &jsVal); - value = pyTypeFactory(GLOBAL_CX, global, &jsVal)->getPyObject(); + value = pyTypeFactory(GLOBAL_CX, global, jsVal)->getPyObject(); } PyObject *ret; @@ -87,7 +87,7 @@ PyObject *JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_nextkey(JSObject JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSObjectProxy *)(self->it.di_dict))->jsObject)); JS::RootedValue jsVal(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, &jsVal); - value = pyTypeFactory(GLOBAL_CX, global, &jsVal)->getPyObject(); + value = pyTypeFactory(GLOBAL_CX, global, jsVal)->getPyObject(); } PyObject *ret; diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index cdf8177e..7d4c1f41 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -93,7 +93,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, JS::RootedValue value(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsObject); - return pyTypeFactory(GLOBAL_CX, thisObj, &value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } else { if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { @@ -194,7 +194,7 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr key.setString(id.toString()); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - PyObject *pyKey = pyTypeFactory(GLOBAL_CX, global, &key)->getPyObject(); + PyObject *pyKey = pyTypeFactory(GLOBAL_CX, global, key)->getPyObject(); PyObject *pyVal1 = PyObject_GetItem((PyObject *)self, pyKey); PyObject *pyVal2 = PyObject_GetItem((PyObject *)other, pyKey); if (!pyVal2) { // if other.key is NULL then not equal @@ -314,7 +314,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self if (&elementVal.toObject() == self->jsObject.get()) { value = (PyObject *)self; } else { - value = pyTypeFactory(GLOBAL_CX, global, &elementVal)->getPyObject(); + value = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); } Py_INCREF(value); @@ -460,7 +460,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, global, ret)->getPyObject(); } } @@ -583,7 +583,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, &value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); } } @@ -624,7 +624,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProx PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, global, &ret)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, global, ret)->getPyObject(); } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_update_method(JSObjectProxy *self, PyObject *args, PyObject *kwds) { diff --git a/src/JobQueue.cc b/src/JobQueue.cc index 2aa7f15f..f878f5be 100644 --- a/src/JobQueue.cc +++ b/src/JobQueue.cc @@ -26,7 +26,7 @@ bool JobQueue::enqueuePromiseJob(JSContext *cx, auto global = new JS::RootedObject(cx, incumbentGlobal); // auto jobv = new JS::RootedValue(cx, JS::ObjectValue(*job)); JS::RootedValue jobv(cx, JS::ObjectValue(*job)); - auto callback = pyTypeFactory(cx, global, &jobv)->getPyObject(); + auto callback = pyTypeFactory(cx, global, jobv)->getPyObject(); // Inform the JS runtime that the job queue is no longer empty JS::JobQueueMayNotBeEmpty(cx); diff --git a/src/PromiseType.cc b/src/PromiseType.cc index b43d4f98..9050e841 100644 --- a/src/PromiseType.cc +++ b/src/PromiseType.cc @@ -43,7 +43,7 @@ static bool onResolvedCb(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedObject *thisv = new JS::RootedObject(cx); args.computeThis(cx, thisv); // thisv is the global object, not the promise JS::RootedValue resultArg(cx, args[0]); - PyObject *result = pyTypeFactory(cx, thisv, &resultArg)->getPyObject(); + PyObject *result = pyTypeFactory(cx, thisv, resultArg)->getPyObject(); if (state == JS::PromiseState::Rejected && !PyExceptionInstance_Check(result)) { // Wrap the result object into a SpiderMonkeyError object // because only *Exception objects can be thrown in Python `raise` statement and alike diff --git a/src/PyDictProxyHandler.cc b/src/PyDictProxyHandler.cc index 1b81cdcc..af3902f7 100644 --- a/src/PyDictProxyHandler.cc +++ b/src/PyDictProxyHandler.cc @@ -143,7 +143,7 @@ bool PyDictProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId JS::RootedValue rootedV(cx, v); PyObject *attrName = idToKey(cx, id); JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - if (PyDict_SetItem(pyObject, attrName, pyTypeFactory(cx, global, &rootedV)->getPyObject())) { + if (PyDict_SetItem(pyObject, attrName, pyTypeFactory(cx, global, rootedV)->getPyObject())) { return result.failCantSetInterposed(); // raises JS exception } return result.succeed(); diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index d2913b00..2947e28d 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -92,7 +92,7 @@ static bool array_push(JSContext *cx, unsigned argc, JS::Value *vp) { // surely JS::RootedValue elementVal(cx); for (unsigned index = 0; index < numArgs; index++) { elementVal.set(args[index].get()); - if (PyList_Append(self, pyTypeFactory(cx, global, &elementVal)->getPyObject()) < 0) { + if (PyList_Append(self, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { return false; } } @@ -142,7 +142,7 @@ static bool array_unshift(JSContext *cx, unsigned argc, JS::Value *vp) { // sure JS::RootedValue elementVal(cx); for (int index = args.length() - 1; index >= 0; index--) { elementVal.set(args[index].get()); - if (PyList_Insert(self, 0, pyTypeFactory(cx, global, &elementVal)->getPyObject()) < 0) { + if (PyList_Insert(self, 0, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { return false; } } @@ -254,7 +254,7 @@ static bool array_indexOf(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); JS::RootedValue elementVal(cx, args[0].get()); - PyObject *result = PyObject_CallMethod(self, "index", "Oi", pyTypeFactory(cx, global, &elementVal)->getPyObject(), start); + PyObject *result = PyObject_CallMethod(self, "index", "Oi", pyTypeFactory(cx, global, elementVal)->getPyObject(), start); if (!result) { PyErr_Clear(); @@ -335,7 +335,7 @@ static bool array_splice(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); for (int index = 0; index < insertCount; index++) { elementVal.set(args[index + 2].get()); - if (PyList_SetItem(inserted, index, pyTypeFactory(cx, global, &elementVal)->getPyObject()) < 0) { + if (PyList_SetItem(inserted, index, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { return false; } } @@ -399,7 +399,7 @@ static bool array_fill(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); JS::RootedValue fillValue(cx, args[0].get()); - PyObject *fillValueItem = pyTypeFactory(cx, global, &fillValue)->getPyObject(); + PyObject *fillValueItem = pyTypeFactory(cx, global, fillValue)->getPyObject(); for (int index = actualStart; index < actualEnd; index++) { if (PyList_SetItem(self, index, fillValueItem) < 0) { return false; @@ -530,7 +530,7 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { for (unsigned index = 0; index < numArgs; index++) { elementVal.set(args[index].get()); - PyObject *item = pyTypeFactory(cx, global, &elementVal)->getPyObject(); + PyObject *item = pyTypeFactory(cx, global, elementVal)->getPyObject(); if (PyObject_TypeCheck(item, &JSArrayProxyType)) { // flatten the array only a depth 1 Py_ssize_t itemLength = JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)item); @@ -538,7 +538,7 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { if (!JS_GetElement(cx, ((JSArrayProxy *)item)->jsArray, flatIndex, &elementVal)) { return false; } - if (PyList_Append(result, pyTypeFactory(cx, global, &elementVal)->getPyObject()) < 0) { + if (PyList_Append(result, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { return false; } } @@ -553,7 +553,7 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { } } else { - if (PyList_Append(result, pyTypeFactory(cx, global, &elementVal)->getPyObject()) < 0) { + if (PyList_Append(result, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { return false; } } @@ -604,7 +604,7 @@ static bool array_lastIndexOf(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); JS::RootedValue elementVal(cx, args[0].get()); - PyObject *element = pyTypeFactory(cx, global, &elementVal)->getPyObject(); + PyObject *element = pyTypeFactory(cx, global, elementVal)->getPyObject(); for (int64_t index = start; index >= 0; index--) { PyObject *item = PyList_GetItem(self, index); Py_INCREF(item); @@ -1202,7 +1202,7 @@ static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject global, elementVal.set(jsTypeFactory(cx, PyList_GetItem(source, sourceIndex))); } - PyObject *element = pyTypeFactory(cx, &rootedGlobal, &elementVal)->getPyObject(); + PyObject *element = pyTypeFactory(cx, &rootedGlobal, elementVal)->getPyObject(); bool shouldFlatten; if (depth > 0) { @@ -1275,7 +1275,7 @@ static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject glo return false; } - PyObject *element = pyTypeFactory(cx, &rootedGlobal, &retVal)->getPyObject(); + PyObject *element = pyTypeFactory(cx, &rootedGlobal, retVal)->getPyObject(); bool shouldFlatten; if (depth > 0) { @@ -2058,7 +2058,7 @@ bool PyListProxyHandler::defineProperty( // FIXME (Tom Tang): memory leak JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); JS::RootedValue itemV(cx, desc.value()); - PyObject *item = pyTypeFactory(cx, global, &itemV)->getPyObject(); + PyObject *item = pyTypeFactory(cx, global, itemV)->getPyObject(); if (PyList_SetItem(pyObject, index, item) < 0) { return result.failBadIndex(); } diff --git a/src/PyObjectProxyHandler.cc b/src/PyObjectProxyHandler.cc index 3af67651..13c508c5 100644 --- a/src/PyObjectProxyHandler.cc +++ b/src/PyObjectProxyHandler.cc @@ -96,7 +96,7 @@ bool PyObjectProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::Handle JS::RootedValue rootedV(cx, v); PyObject *attrName = idToKey(cx, id); JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - if (PyObject_SetAttr(pyObject, attrName, pyTypeFactory(cx, global, &rootedV)->getPyObject())) { + if (PyObject_SetAttr(pyObject, attrName, pyTypeFactory(cx, global, rootedV)->getPyObject())) { return result.failCantSetInterposed(); // raises JS exception } return result.succeed(); diff --git a/src/internalBinding.cc b/src/internalBinding.cc index 61764791..410eca6d 100644 --- a/src/internalBinding.cc +++ b/src/internalBinding.cc @@ -62,7 +62,7 @@ PyObject *getInternalBindingPyFn(JSContext *cx) { // FIXME (Tom Tang): memory leak, not free-ed JS::RootedObject *thisObj = new JS::RootedObject(cx, nullptr); JS::RootedValue jsFnVal(cx, JS::ObjectValue(*jsFn)); - PyObject *pyFn = pyTypeFactory(cx, thisObj, &jsFnVal)->getPyObject(); + PyObject *pyFn = pyTypeFactory(cx, thisObj, jsFnVal)->getPyObject(); return pyFn; } diff --git a/src/internalBinding/timers.cc b/src/internalBinding/timers.cc index ec4d5e6c..fc30df42 100644 --- a/src/internalBinding/timers.cc +++ b/src/internalBinding/timers.cc @@ -23,7 +23,7 @@ static bool enqueueWithDelay(JSContext *cx, unsigned argc, JS::Value *vp) { // Convert to a Python function // FIXME (Tom Tang): memory leak, not free-ed JS::RootedObject *thisv = new JS::RootedObject(cx, nullptr); - JS::RootedValue *jobArg = new JS::RootedValue(cx, jobArgVal); + JS::RootedValue jobArg(cx, jobArgVal); PyObject *job = pyTypeFactory(cx, thisv, jobArg)->getPyObject(); // Schedule job to the running Python event-loop diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 6e11da72..5f0c58f6 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -302,7 +302,7 @@ bool callPyFunc(JSContext *cx, unsigned int argc, JS::Value *vp) { PyObject *pyArgs = PyTuple_New(callArgsLength); for (size_t i = 0; i < callArgsLength; i++) { JS::RootedValue jsArg(cx, callargs[i]); - PyType *pyArg = pyTypeFactory(cx, thisv, &jsArg); + PyType *pyArg = pyTypeFactory(cx, thisv, jsArg); if (!pyArg) return false; // error occurred PyObject *pyArgObj = pyArg->getPyObject(); if (!pyArgObj) return false; // error occurred diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index d31abc7d..c856b5c2 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -359,7 +359,7 @@ static PyObject *eval(PyObject *self, PyObject *args) { } // translate to the proper python type - PyType *returnValue = pyTypeFactory(GLOBAL_CX, global, rval); + PyType *returnValue = pyTypeFactory(GLOBAL_CX, global, *rval); if (PyErr_Occurred()) { return NULL; } diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index 88425643..f8897f0e 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -68,32 +68,32 @@ PyType *pyTypeFactory(PyObject *object) { return pyType; } -PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted *rval) { - if (rval->isUndefined()) { +PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::HandleValue rval) { + if (rval.isUndefined()) { return new NoneType(); } - else if (rval->isNull()) { + else if (rval.isNull()) { return new NullType(); } - else if (rval->isBoolean()) { - return new BoolType(rval->toBoolean()); + else if (rval.isBoolean()) { + return new BoolType(rval.toBoolean()); } - else if (rval->isNumber()) { - return new FloatType(rval->toNumber()); + else if (rval.isNumber()) { + return new FloatType(rval.toNumber()); } - else if (rval->isString()) { - StrType *s = new StrType(cx, rval->toString()); + else if (rval.isString()) { + StrType *s = new StrType(cx, rval.toString()); return s; } - else if (rval->isSymbol()) { + else if (rval.isSymbol()) { printf("symbol type is not handled by PythonMonkey yet"); } - else if (rval->isBigInt()) { - return new IntType(cx, rval->toBigInt()); + else if (rval.isBigInt()) { + return new IntType(cx, rval.toBigInt()); } - else if (rval->isObject()) { + else if (rval.isObject()) { JS::Rooted obj(cx); - JS_ValueToObject(cx, *rval, &obj); + JS_ValueToObject(cx, rval, &obj); if (JS::GetClass(obj)->isProxyObject()) { if (js::GetProxyHandler(obj)->family() == &PyDictProxyHandler::family) { // this is one of our proxies for python dicts return new DictType(((PyDictProxyHandler *)js::GetProxyHandler(obj))->pyObject); @@ -137,7 +137,7 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted pyFunc = (PyObject *)(pyFuncVal.toPrivate()); f = new FuncType(pyFunc); } else { - f = new FuncType(cx, *rval); + f = new FuncType(cx, rval); } return f; } @@ -167,20 +167,20 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted } } } - return new DictType(cx, *rval); + return new DictType(cx, rval); } - else if (rval->isMagic()) { + else if (rval.isMagic()) { printf("magic type is not handled by PythonMonkey yet\n"); } std::string errorString("pythonmonkey cannot yet convert Javascript value of: "); - JS::RootedString str(cx, JS::ToString(cx, *rval)); + JS::RootedString str(cx, JS::ToString(cx, rval)); errorString += JS_EncodeStringToUTF8(cx, str).get(); PyErr_SetString(PyExc_TypeError, errorString.c_str()); return NULL; } -PyType *pyTypeFactorySafe(JSContext *cx, JS::Rooted *thisObj, JS::Rooted *rval) { +PyType *pyTypeFactorySafe(JSContext *cx, JS::Rooted *thisObj, JS::HandleValue rval) { PyType *v = pyTypeFactory(cx, thisObj, rval); if (PyErr_Occurred()) { // Clear Python error From 636fcdeafea3ea3161e1f17b867811df7aba08a3 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 2 Feb 2024 11:27:41 -0500 Subject: [PATCH 0215/1086] cleanup --- src/JSObjectItemsProxy.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/JSObjectItemsProxy.cc b/src/JSObjectItemsProxy.cc index 91f593d2..b06c1c09 100644 --- a/src/JSObjectItemsProxy.cc +++ b/src/JSObjectItemsProxy.cc @@ -17,7 +17,6 @@ #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/jsTypeFactory.hh" -#include "include/pyTypeFactory.hh" #include "include/PyBaseProxyHandler.hh" #include From b5bd09493c316b2cef03508e6447aa9cacaf9867 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 2 Feb 2024 11:28:03 -0500 Subject: [PATCH 0216/1086] should have bee part of previous commit --- include/pyTypeFactory.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pyTypeFactory.hh b/include/pyTypeFactory.hh index 3b79cbdd..e76143e1 100644 --- a/include/pyTypeFactory.hh +++ b/include/pyTypeFactory.hh @@ -35,11 +35,11 @@ PyType *pyTypeFactory(PyObject *object); * @param rval - Pointer to the JS::Value who's type and value we wish to encapsulate * @return PyType* - Pointer to a PyType object corresponding to the JS::Value */ -PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted *rval); +PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::HandleValue rval); /** * @brief same to pyTypeFactory, but it's guaranteed that no error would be set on the Python error stack, instead * return `pythonmonkey.null` on error */ -PyType *pyTypeFactorySafe(JSContext *cx, JS::Rooted *thisObj, JS::Rooted *rval); +PyType *pyTypeFactorySafe(JSContext *cx, JS::Rooted *thisObj, JS::HandleValue rval); #endif \ No newline at end of file From fade8f0c4a2d9282a71c83e5b0b06d060e11488c Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 2 Feb 2024 12:35:46 -0500 Subject: [PATCH 0217/1086] cleanup --- src/DictType.cc | 1 - src/FuncType.cc | 2 -- src/IntType.cc | 2 -- src/ListType.cc | 5 ----- src/NoneType.cc | 11 ----------- src/NullType.cc | 11 ----------- src/PromiseType.cc | 3 --- src/PyType.cc | 1 - src/StrType.cc | 1 - src/TupleType.cc | 12 ------------ src/setSpiderMonkeyException.cc | 1 - 11 files changed, 50 deletions(-) diff --git a/src/DictType.cc b/src/DictType.cc index 1ba29b64..93568dac 100644 --- a/src/DictType.cc +++ b/src/DictType.cc @@ -1,6 +1,5 @@ #include "include/DictType.hh" -#include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/JSObjectProxy.hh" #include "include/PyType.hh" diff --git a/src/FuncType.cc b/src/FuncType.cc index b2d76d6b..6b3a53fd 100644 --- a/src/FuncType.cc +++ b/src/FuncType.cc @@ -1,6 +1,4 @@ #include "include/FuncType.hh" - -#include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/JSFunctionProxy.hh" #include "include/PyType.hh" diff --git a/src/IntType.cc b/src/IntType.cc index 71b8c976..9e441856 100644 --- a/src/IntType.cc +++ b/src/IntType.cc @@ -1,7 +1,5 @@ #include "include/modules/pythonmonkey/pythonmonkey.hh" - #include "include/IntType.hh" - #include "include/PyType.hh" #include "include/TypeEnum.hh" diff --git a/src/ListType.cc b/src/ListType.cc index 96eeec53..2d79bc68 100644 --- a/src/ListType.cc +++ b/src/ListType.cc @@ -2,14 +2,9 @@ #include "include/PyType.hh" #include "include/JSArrayProxy.hh" -#include "include/modules/pythonmonkey/pythonmonkey.hh" - #include - - - ListType::ListType() : PyType(PyList_New(0)) {} ListType::ListType(PyObject *object) : PyType(object) {} diff --git a/src/NoneType.cc b/src/NoneType.cc index 3136c779..b7bc2e6c 100644 --- a/src/NoneType.cc +++ b/src/NoneType.cc @@ -1,14 +1,3 @@ -/** - * @file NoneType.hh - * @author Caleb Aikens (caleb@distributive.network) - * @brief Struct for representing None - * @version 0.1 - * @date 2023-02-22 - * - * @copyright Copyright (c) 2023 - * - */ - #include "include/NoneType.hh" #include "include/PyType.hh" diff --git a/src/NullType.cc b/src/NullType.cc index 9aa510ed..c830c7f3 100644 --- a/src/NullType.cc +++ b/src/NullType.cc @@ -1,14 +1,3 @@ -/** - * @file NullType.hh - * @author Caleb Aikens (caleb@distributive.network) - * @brief Struct for representing JS null in a python object - * @version 0.1 - * @date 2023-02-22 - * - * @copyright Copyright (c) 2023 - * - */ - #include "include/NullType.hh" #include "include/modules/pythonmonkey/pythonmonkey.hh" diff --git a/src/PromiseType.cc b/src/PromiseType.cc index 9050e841..2fac0866 100644 --- a/src/PromiseType.cc +++ b/src/PromiseType.cc @@ -2,7 +2,6 @@ * @file PromiseType.cc * @author Tom Tang (xmader@distributive.network) * @brief Struct for representing Promises - * @version 0.1 * @date 2023-03-29 * * @copyright Copyright (c) 2023 @@ -10,9 +9,7 @@ */ #include "include/modules/pythonmonkey/pythonmonkey.hh" - #include "include/PromiseType.hh" - #include "include/PyEventLoop.hh" #include "include/PyType.hh" #include "include/TypeEnum.hh" diff --git a/src/PyType.cc b/src/PyType.cc index 5725b054..d74af221 100644 --- a/src/PyType.cc +++ b/src/PyType.cc @@ -1,5 +1,4 @@ #include "include/PyType.hh" - #include "include/TypeEnum.hh" #include diff --git a/src/StrType.cc b/src/StrType.cc index dbb43ae4..0aae1b53 100644 --- a/src/StrType.cc +++ b/src/StrType.cc @@ -1,5 +1,4 @@ #include "include/StrType.hh" - #include "include/PyType.hh" #include "include/JSStringProxy.hh" diff --git a/src/TupleType.cc b/src/TupleType.cc index 9c3748dc..25c6b076 100644 --- a/src/TupleType.cc +++ b/src/TupleType.cc @@ -1,16 +1,4 @@ -/** - * @file TupleType.cc - * @author Giovanni Tedesco - * @brief Implementation for the methods of the Tuple Type struct - * @version 0.1 - * @date 2022-08-19 - * - * @copyright Copyright (c) 2022 - * - */ - #include "include/TupleType.hh" - #include "include/PyType.hh" #include diff --git a/src/setSpiderMonkeyException.cc b/src/setSpiderMonkeyException.cc index 0412a847..285f68b6 100644 --- a/src/setSpiderMonkeyException.cc +++ b/src/setSpiderMonkeyException.cc @@ -2,7 +2,6 @@ * @file setSpiderMonkeyException.cc * @author Caleb Aikens (caleb@distributive.network) * @brief Call this function whenever a JS_* function call fails in order to set an appropriate python exception (remember to also return NULL) - * @version 0.1 * @date 2023-02-28 * * @copyright Copyright (c) 2023 From fee7bf3eaa4e57d8c6539c6b080b788c07d6e073 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 2 Feb 2024 13:26:55 -0500 Subject: [PATCH 0218/1086] typo fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ac8db92..6586eeaa 100644 --- a/README.md +++ b/README.md @@ -357,7 +357,7 @@ exports['today'] = date.today() # Troubleshooting Tips ## CommonJS (require) -If you are having trouble with the CommonJS require function, set environment variable `DEBUG='ctx-module*'` and you can see the filenames it tries to laod. +If you are having trouble with the CommonJS require function, set environment variable `DEBUG='ctx-module*'` and you can see the filenames it tries to load. ## pmdb From 695c71a8520b8801d4ab0e0e61368a011617aa7a Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 2 Feb 2024 17:26:32 -0500 Subject: [PATCH 0219/1086] crash fix --- src/JSObjectProxy.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 7d4c1f41..f2cdb37b 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -292,13 +292,12 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self Py_INCREF(key); PyObject *s = PyObject_Repr(key); - if (s == NULL) { - Py_DECREF(s); goto error; } int res = _PyUnicodeWriter_WriteStr(&writer, s); + Py_DECREF(s); if (res < 0) { goto error; @@ -316,12 +315,10 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self } else { value = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); } - Py_INCREF(value); - s = PyObject_Repr(value); + s = PyObject_Repr(value); if (s == NULL) { - Py_DECREF(s); goto error; } From 234da4687ca5a9c712ebb18bd860a30245e05f36 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 2 Feb 2024 17:39:55 -0500 Subject: [PATCH 0220/1086] test for crash fix --- tests/python/test_dicts.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/python/test_dicts.py b/tests/python/test_dicts.py index 783ec376..c4c9b63e 100644 --- a/tests/python/test_dicts.py +++ b/tests/python/test_dicts.py @@ -1,5 +1,6 @@ import pythonmonkey as pm import sys +import subprocess def test_eval_dicts(): d = {"a":1} @@ -312,4 +313,15 @@ def test_toLocaleString(): items = {'a': 10} result = [0] pm.eval("(result, obj) => {result[0] = obj.toLocaleString()}")(result, items) - assert result[0] == '[object Object]' \ No newline at end of file + assert result[0] == '[object Object]' + +#repr +def test_repr_max_recursion_depth(): + subprocess.check_call('npm install crypto-js', shell=True) + CryptoJS = pm.require('crypto-js') + try: + repr(CryptoJS) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == "maximum recursion depth exceeded while getting the repr of an object" \ No newline at end of file From 324ad7aaeff11de2c06888d3f2ceb40b62ca8308 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 2 Feb 2024 17:46:56 -0500 Subject: [PATCH 0221/1086] added test for issue #58 --- tests/python/test_functions_this.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/python/test_functions_this.py b/tests/python/test_functions_this.py index 4018470f..e45cb7fd 100644 --- a/tests/python/test_functions_this.py +++ b/tests/python/test_functions_this.py @@ -1,4 +1,5 @@ import pythonmonkey as pm +import subprocess def test_python_functions_self(): def pyFunc(param): @@ -114,4 +115,11 @@ class Class: return jsObj.jsMethod(4); } """)(jsObj) - assert pyObj == result[0] and 4 == result[1] #TODO (Caleb Aikens) should `this` be `pyObj` or `jsObj` here? \ No newline at end of file + assert pyObj == result[0] and 4 == result[1] #TODO (Caleb Aikens) should `this` be `pyObj` or `jsObj` here? + +#require +def test_require_this(): + subprocess.check_call('npm install crypto-js', shell=True) + CryptoJS = pm.require('crypto-js') + cipher = CryptoJS.SHA256("Hello, World!").toString() + assert cipher == "dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f" \ No newline at end of file From 2f5264f4df83c4fdb57fce4ed94a89ee1d6a5c4a Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 2 Feb 2024 17:52:18 -0500 Subject: [PATCH 0222/1086] better naming --- tests/python/test_functions_this.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_functions_this.py b/tests/python/test_functions_this.py index e45cb7fd..99bd9608 100644 --- a/tests/python/test_functions_this.py +++ b/tests/python/test_functions_this.py @@ -118,7 +118,7 @@ class Class: assert pyObj == result[0] and 4 == result[1] #TODO (Caleb Aikens) should `this` be `pyObj` or `jsObj` here? #require -def test_require_this(): +def test_require_correct_this(): subprocess.check_call('npm install crypto-js', shell=True) CryptoJS = pm.require('crypto-js') cipher = CryptoJS.SHA256("Hello, World!").toString() From fd25bb21fad1ffa068b4219a98c4b2d5b99af2ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 03:34:29 +0000 Subject: [PATCH 0223/1086] Bump core-js from 3.32.0 to 3.35.1 in /python/pminit/pythonmonkey Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.32.0 to 3.35.1. - [Release notes](https://github.com/zloirock/core-js/releases) - [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/zloirock/core-js/commits/v3.35.1/packages/core-js) --- updated-dependencies: - dependency-name: core-js dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- python/pminit/pythonmonkey/package-lock.json | 6 +++--- python/pminit/pythonmonkey/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/pminit/pythonmonkey/package-lock.json b/python/pminit/pythonmonkey/package-lock.json index faa8b2ab..9a36949a 100644 --- a/python/pminit/pythonmonkey/package-lock.json +++ b/python/pminit/pythonmonkey/package-lock.json @@ -120,9 +120,9 @@ } }, "core-js": { - "version": "3.32.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.32.0.tgz", - "integrity": "sha512-rd4rYZNlF3WuoYuRIDEmbR/ga9CeuWX9U05umAvgrrZoHY4Z++cp/xwPQMvUpBB4Ag6J8KfD80G0zwCyaSxDww==" + "version": "3.35.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.35.1.tgz", + "integrity": "sha512-IgdsbxNyMskrTFxa9lWHyMwAJU5gXOPP+1yO+K59d50VLVAIDAbs7gIv705KzALModfK3ZrSZTPNpC0PQgIZuw==" }, "create-ecdh": { "version": "4.0.4", diff --git a/python/pminit/pythonmonkey/package.json b/python/pminit/pythonmonkey/package.json index 44d5e884..b2afffeb 100644 --- a/python/pminit/pythonmonkey/package.json +++ b/python/pminit/pythonmonkey/package.json @@ -21,7 +21,7 @@ }, "homepage": "https://github.com/Distributive-Network/PythonMonkey#readme", "dependencies": { - "core-js": "^3.32.0", + "core-js": "^3.35.1", "ctx-module": "^1.0.14" } } From f14ae78205e40478ec89f884a8e2ce38fe210022 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Mon, 5 Feb 2024 14:54:58 +0000 Subject: [PATCH 0224/1086] feat(XHR): support `xhr.responseType` to be "json" --- .../builtin_modules/XMLHttpRequest.js | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index b33c00c8..686f63cd 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -515,8 +515,8 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget { if (this.#state === XMLHttpRequest.LOADING || this.#state === XMLHttpRequest.DONE) throw new DOMException('responseType can only be set before send()', 'InvalidStateError'); - if (!['', 'text', 'arraybuffer'].includes(t)) - throw new DOMException('only responseType "text" or "arraybuffer" is supported', 'NotSupportedError'); + if (!['', 'text', 'arraybuffer', 'json'].includes(t)) + throw new DOMException('only responseType "text" or "arraybuffer" or "json" is supported', 'NotSupportedError'); this.#responseType = t; } @@ -550,7 +550,29 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget this.#responseObject = this.#mergeReceivedBytes().buffer; return this.#responseObject; } + + if (this.#responseType === 'json') // step 8 + { + // step 8.2 + if (this.#receivedLength === 0) // response’s body is null + return null; + // step 8.3 + let jsonObject = null; + try + { + // TODO: use proper TextDecoder API + const str = decodeStr(this.#mergeReceivedBytes(), 'utf-8'); // only supports utf-8, see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value + jsonObject = JSON.parse(str); + } + catch (exception) + { + return null; + } + // step 8.4 + this.#responseObject = jsonObject; + } + // step 6 and step 7 ("blob" or "document") are not supported throw new DOMException(`unsupported responseType "${this.#responseType}"`, 'InvalidStateError'); } @@ -600,7 +622,7 @@ class XMLHttpRequest extends XMLHttpRequestEventTarget #responseType = ''; /** * cache for converting receivedBytes to the desired response type - * @type {ArrayBuffer | string} + * @type {ArrayBuffer | string | Record} */ #responseObject = null; From 839d3e84a862a4c59694b1b3a730cc57b9ea8216 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 5 Feb 2024 11:38:07 -0500 Subject: [PATCH 0225/1086] cleanup --- include/JSArrayProxy.hh | 10 ---------- include/PyBaseProxyHandler.hh | 2 +- include/PyDictProxyHandler.hh | 15 +++++---------- include/PyObjectProxyHandler.hh | 8 ++------ src/JSArrayProxy.cc | 5 ----- src/JSObjectProxy.cc | 8 ++------ src/jsTypeFactory.cc | 2 +- 7 files changed, 11 insertions(+), 39 deletions(-) diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh index 911e5edf..9b42a26a 100644 --- a/include/JSArrayProxy.hh +++ b/include/JSArrayProxy.hh @@ -192,16 +192,6 @@ public: */ static int JSArrayProxy_clear_slot(JSArrayProxy *self); - /** - * @brief .tp_traverse method - * - * @param self - The JSArrayProxy - * @param visitproc - The function to be applied on each element of the list - * @param arg - The argument to the visit function - * @return 0 on success - */ - static int JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg); - /** * @brief copy method * diff --git a/include/PyBaseProxyHandler.hh b/include/PyBaseProxyHandler.hh index 793f6b2a..7e5e6d7d 100644 --- a/include/PyBaseProxyHandler.hh +++ b/include/PyBaseProxyHandler.hh @@ -25,7 +25,7 @@ struct PyBaseProxyHandler : public js::BaseProxyHandler { public: PyBaseProxyHandler(PyObject *pyObj, const void *family) : js::BaseProxyHandler(family), pyObject(pyObj) {}; - PyObject *pyObject; // @TODO (Caleb Aikens) Consider putting this in a private slot + PyObject *pyObject; bool getPrototypeIfOrdinary(JSContext *cx, JS::HandleObject proxy, bool *isOrdinary, JS::MutableHandleObject protop) const override final; bool preventExtensions(JSContext *cx, JS::HandleObject proxy, JS::ObjectOpResult &result) const override final; diff --git a/include/PyDictProxyHandler.hh b/include/PyDictProxyHandler.hh index bf56c2a6..d7843bd0 100644 --- a/include/PyDictProxyHandler.hh +++ b/include/PyDictProxyHandler.hh @@ -40,7 +40,7 @@ public: * @param cx - pointer to JSContext * @param proxy - The proxy object who's property we wish to delete * @param id - The key we wish to delete - * @param result - @TODO (Caleb Aikens) read up on JS::ObjectOpResult + * @param result - operation result * @return true - call succeeded * @return false - call failed and an exception has been raised */ @@ -49,7 +49,7 @@ public: /** * @brief [[HasProperty]] * @param cx - pointer to JSContext - * @param proxy - The proxy object who's propery we wish to check + * @param proxy - The proxy object who's property we wish to check * @param id - key value of the property to check * @param bp - out-paramter: true if object has property, false if not * @return true - call succeeded @@ -64,8 +64,8 @@ public: * @param proxy The proxy object who's property we wish to set * @param id Key of the property we wish to set * @param v Value that we wish to set the property to - * @param receiver @TODO (Caleb Aikens) read ECMAScript docs about this - * @param result @TODO (Caleb Aikens) read ECMAScript docs about this + * @param receiver unused + * @param result operation result * @return true call succeed * @return false call failed and an exception has been raised */ @@ -79,7 +79,6 @@ public: * @param proxy - The proxy object who's keys we output * @param props - out-parameter of object IDsoverride; - // @TODO (Caleb Aikens) The following are Spidermonkey-unique extensions, need to read into them more /** * @return true - call succeeded * @return false - call failed and an exception has been raised @@ -87,10 +86,7 @@ public: bool enumerate(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override; - // @TODO (Caleb Aikens) The following are Spidermonkey-unique extensions, need to read into them more /** - * @brief @TODO (Caleb Aikens) read up on what this trap does exactly - * * @param cx pointer to JSContext * @param proxy The proxy object who's property we wish to check * @param id Key of the property we wish to check @@ -100,13 +96,12 @@ public: */ bool hasOwn(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp) const override; + /** - * @brief @TODO (Caleb Aikens) read up on what this trap does exactly * * @param cx - pointer to JSContext * @param proxy - The proxy object who's keys we outputoverride; - // @TODO (Caleb Aikens) The following are Spidermonkey-unique extensions, need to read into them more /** * @param props - out-parameter of object IDs * @return true - call succeeded diff --git a/include/PyObjectProxyHandler.hh b/include/PyObjectProxyHandler.hh index 8b3ce72b..6f5c4a47 100644 --- a/include/PyObjectProxyHandler.hh +++ b/include/PyObjectProxyHandler.hh @@ -44,7 +44,7 @@ public: * @param cx - pointer to JSContext * @param proxy - The proxy object who's property we wish to delete * @param id - The key we wish to delete - * @param result - @TODO (Caleb Aikens) read up on JS::ObjectOpResult + * @param result - operation result * @return true - call succeeded * @return false - call failed and an exception has been raised */ @@ -69,8 +69,7 @@ public: * @param proxy The proxy object who's property we wish to set * @param id Key of the property we wish to set * @param v Value that we wish to set the property to - * @param receiver @TODO (Caleb Aikens) read ECMAScript docs about this - * @param result @TODO (Caleb Aikens) read ECMAScript docs about this + * @param result operation result * @return true call succeed * @return false call failed and an exception has been raised */ @@ -88,8 +87,6 @@ public: */ bool enumerate(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override; - - // @TODO (Caleb Aikens) The following are Spidermonkey-unique extensions, need to read into them more /** * @brief @TODO (Caleb Aikens) read up on what this trap does exactly * @@ -103,7 +100,6 @@ public: bool hasOwn(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp) const override; /** - * @brief @TODO (Caleb Aikens) read up on what this trap does exactly * * @param cx - pointer to JSContext * @param proxy - The proxy object who's keys we output diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 31d62d2e..ac5b15bf 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -750,11 +750,6 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot(JSArrayProxy *self) { return 0; } -int JSArrayProxyMethodDefinitions::JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg) { - // TODO - return 0; -} - PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) { JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].setInt32(0); diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index f2cdb37b..a02c3260 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -39,7 +39,7 @@ bool keyToId(PyObject *key, JS::MutableHandleId idp) { idString.set(JS_NewStringCopyUTF8Z(GLOBAL_CX, utf8Chars)); return JS_StringToId(GLOBAL_CX, idString, idp); } else if (PyLong_Check(key)) { // key is int type - uint32_t keyAsInt = PyLong_AsUnsignedLong(key); // raise OverflowError if the value of pylong is out of range for a unsigned long + uint32_t keyAsInt = PyLong_AsUnsignedLong(key); // TODO raise OverflowError if the value of pylong is out of range for a unsigned long return JS_IndexToId(GLOBAL_CX, keyAsInt, idp); } else { return false; // fail @@ -48,7 +48,6 @@ bool keyToId(PyObject *key, JS::MutableHandleId idp) { void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) { - // TODO (Caleb Aikens): intentional override of PyDict_Type's tp_dealloc. Probably results in leaking dict memory self->jsObject.set(nullptr); PyObject_GC_UnTrack(self); Py_TYPE(self)->tp_free((PyObject *)self); @@ -72,7 +71,6 @@ Py_ssize_t JSObjectProxyMethodDefinitions::JSObjectProxy_length(JSObjectProxy *s JS::RootedIdVector props(GLOBAL_CX); if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { - // @TODO (Caleb Aikens) raise exception here return -1; } return props.length(); @@ -181,7 +179,6 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr JS::RootedIdVector props(GLOBAL_CX); if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { - // @TODO (Caleb Aikens) raise exception here return NULL; } @@ -561,7 +558,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy skip_optional: JS::RootedId id(GLOBAL_CX); if (!keyToId(key, &id)) { - // TODO (Caleb Aikens): raise exception here PyObject *seq = PyTuple_New(length); + // TODO (Caleb Aikens): raise exception here return NULL; } @@ -588,7 +585,6 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method(JSObjectPro JS::RootedIdVector props(GLOBAL_CX); if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { - // @TODO (Caleb Aikens) raise exception here return NULL; } diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 5f0c58f6..b29a9348 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -314,7 +314,7 @@ bool callPyFunc(JSContext *cx, unsigned int argc, JS::Value *vp) { setPyException(cx); return false; } - // @TODO (Caleb Aikens) need to check for python exceptions here + callargs.rval().set(jsTypeFactory(cx, pyRval)); if (PyErr_Occurred()) { setPyException(cx); From a7d7a1a3e59154f3f47d65e10faa1c90bbdd95a7 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 5 Feb 2024 11:58:41 -0500 Subject: [PATCH 0226/1086] should have been part of the previous commit --- src/modules/pythonmonkey/pythonmonkey.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index c856b5c2..28e11cab 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -145,7 +145,6 @@ PyTypeObject JSArrayProxyType = { .tp_getattro = (getattrofunc)JSArrayProxyMethodDefinitions::JSArrayProxy_get, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_LIST_SUBCLASS, .tp_doc = PyDoc_STR("Javascript Array proxy list"), - .tp_traverse = (traverseproc)JSArrayProxyMethodDefinitions::JSArrayProxy_traverse, .tp_clear = (inquiry)JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot, .tp_richcompare = (richcmpfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare, .tp_iter = (getiterfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_iter, From 7b17b0f16328eb158beea64fc89cd03cc4941049 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 5 Feb 2024 14:31:20 -0500 Subject: [PATCH 0227/1086] added array test --- tests/python/test_arrays.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 442471ce..7f4d3d72 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -1752,4 +1752,12 @@ def test_iterator_last_next(): result = [0] pm.eval("(result, arr) => { let iterator = arr[Symbol.iterator](); iterator.next(); iterator.next(); result[0] = iterator.next()}")(result, items) assert result[0].value == None - assert result[0].done == True \ No newline at end of file + assert result[0].done == True + +#Array.from +def test_array_from(): + items = [1,2] + result = [0] + pm.eval("(result, arr) => { result[0] = Array.from(arr)}")(result, items) + assert result[0] == [1,2] + assert result[0] is not items \ No newline at end of file From 982f57839fe8e13f3ccb15dd2504007e09f284ce Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 5 Feb 2024 14:32:31 -0500 Subject: [PATCH 0228/1086] cleanup test that uses CryptoJS --- tests/python/test_functions_this.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/python/test_functions_this.py b/tests/python/test_functions_this.py index 99bd9608..3b4c432b 100644 --- a/tests/python/test_functions_this.py +++ b/tests/python/test_functions_this.py @@ -122,4 +122,5 @@ def test_require_correct_this(): subprocess.check_call('npm install crypto-js', shell=True) CryptoJS = pm.require('crypto-js') cipher = CryptoJS.SHA256("Hello, World!").toString() - assert cipher == "dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f" \ No newline at end of file + assert cipher == "dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f" + subprocess.check_call('npm uninstall crypto-js', shell=True) \ No newline at end of file From d0ed527e9a98ea1aff1067e8a8982e2874e302a4 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 5 Feb 2024 14:34:00 -0500 Subject: [PATCH 0229/1086] cleanup after test --- tests/python/test_dicts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/python/test_dicts.py b/tests/python/test_dicts.py index c4c9b63e..df7efbb2 100644 --- a/tests/python/test_dicts.py +++ b/tests/python/test_dicts.py @@ -324,4 +324,5 @@ def test_repr_max_recursion_depth(): assert (False) except Exception as e: assert str(type(e)) == "" - assert str(e) == "maximum recursion depth exceeded while getting the repr of an object" \ No newline at end of file + assert str(e) == "maximum recursion depth exceeded while getting the repr of an object" + subprocess.check_call('npm uninstall crypto-js', shell=True) \ No newline at end of file From 428005a59f769dfa779f8d83461be1e90cf1ced5 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 5 Feb 2024 15:40:55 -0500 Subject: [PATCH 0230/1086] cleanup --- src/TupleType.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/TupleType.cc b/src/TupleType.cc index 25c6b076..d710418d 100644 --- a/src/TupleType.cc +++ b/src/TupleType.cc @@ -1,5 +1,4 @@ #include "include/TupleType.hh" -#include "include/PyType.hh" #include From 8e827f98695a0cda4bef7db9bc57ccc4798540cc Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Mon, 5 Feb 2024 15:44:18 -0500 Subject: [PATCH 0231/1086] formatting --- src/PyBaseProxyHandler.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PyBaseProxyHandler.cc b/src/PyBaseProxyHandler.cc index dc50d095..1e86eac5 100644 --- a/src/PyBaseProxyHandler.cc +++ b/src/PyBaseProxyHandler.cc @@ -10,7 +10,9 @@ #include "include/PyBaseProxyHandler.hh" + #include + #include From 15db75875f603aaf20e0fe3ec221a7dfc3311007 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 6 Feb 2024 09:58:45 -0500 Subject: [PATCH 0232/1086] added iterator test --- tests/python/test_arrays.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 7f4d3d72..ff37c701 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -1754,6 +1754,12 @@ def test_iterator_last_next(): assert result[0].value == None assert result[0].done == True +def test_iterator_iterator(): + items = [1,2,3,4] + result = [0] + pm.eval("(result, arr) => {let iter = arr[Symbol.iterator](); let head = iter.next().value; result[0] = [...iter] }")(result, items) + assert result[0] == [2,3,4] + #Array.from def test_array_from(): items = [1,2] From 050096f136e8cc34412977c932597cd29bb35721 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 6 Feb 2024 10:42:08 -0500 Subject: [PATCH 0233/1086] crash fix and its test --- src/DictType.cc | 10 ++++++---- src/JSFunctionProxy.cc | 4 ++++ src/JSMethodProxy.cc | 4 ++++ src/ListType.cc | 6 ++++-- tests/python/test_arrays.py | 14 +++++++++++++- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/DictType.cc b/src/DictType.cc index 93568dac..b4221548 100644 --- a/src/DictType.cc +++ b/src/DictType.cc @@ -17,8 +17,10 @@ DictType::DictType(PyObject *object) : PyType(object) {} DictType::DictType(JSContext *cx, JS::Handle jsObject) { JSObjectProxy *proxy = (JSObjectProxy *)PyObject_CallObject((PyObject *)&JSObjectProxyType, NULL); - JS::RootedObject obj(cx); - JS_ValueToObject(cx, jsObject, &obj); - proxy->jsObject.set(obj); - this->pyObject = (PyObject *)proxy; + if (proxy != NULL) { + JS::RootedObject obj(cx); + JS_ValueToObject(cx, jsObject, &obj); + proxy->jsObject.set(obj); + this->pyObject = (PyObject *)proxy; + } } \ No newline at end of file diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc index 440ea31d..013e6157 100644 --- a/src/JSFunctionProxy.cc +++ b/src/JSFunctionProxy.cc @@ -57,5 +57,9 @@ PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_call(PyObject *self, return NULL; } + if (PyErr_Occurred()) { + return NULL; + } + return pyTypeFactory(cx, &thisObj, jsReturnVal)->getPyObject(); } \ No newline at end of file diff --git a/src/JSMethodProxy.cc b/src/JSMethodProxy.cc index c1c075e7..b702b306 100644 --- a/src/JSMethodProxy.cc +++ b/src/JSMethodProxy.cc @@ -67,6 +67,10 @@ PyObject *JSMethodProxyMethodDefinitions::JSMethodProxy_call(PyObject *self, PyO return NULL; } + if (PyErr_Occurred()) { + return NULL; + } + JS::RootedObject *globalObj = new JS::RootedObject(cx, JS::CurrentGlobalOrNull(cx)); return pyTypeFactory(cx, globalObj, jsReturnVal)->getPyObject(); } \ No newline at end of file diff --git a/src/ListType.cc b/src/ListType.cc index 2d79bc68..dac9cf2f 100644 --- a/src/ListType.cc +++ b/src/ListType.cc @@ -11,6 +11,8 @@ ListType::ListType(PyObject *object) : PyType(object) {} ListType::ListType(JSContext *cx, JS::HandleObject jsArrayObj) { JSArrayProxy *proxy = (JSArrayProxy *)PyObject_CallObject((PyObject *)&JSArrayProxyType, NULL); - proxy->jsArray.set(jsArrayObj); - this->pyObject = (PyObject *)proxy; + if (proxy != NULL) { + proxy->jsArray.set(jsArrayObj); + this->pyObject = (PyObject *)proxy; + } } \ No newline at end of file diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index ff37c701..5817c3f3 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -1766,4 +1766,16 @@ def test_array_from(): result = [0] pm.eval("(result, arr) => { result[0] = Array.from(arr)}")(result, items) assert result[0] == [1,2] - assert result[0] is not items \ No newline at end of file + assert result[0] is not items + +# assign generic dict to non-existent slot +def test_generic_dict_bad_index(): + items = [1,2,3] + result = [] + try: + pm.eval("(result, arr) => {result[0] = arr[Symbol.iterator]() }")(result, items) + assert (False) + except Exception as e: + assert str(type(e)) == "" + assert str(e) == ("list assignment index out of range") + \ No newline at end of file From 20a8227fb63cd6ab14231f7d69ed59fd0bf7ac61 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 6 Feb 2024 11:39:08 -0500 Subject: [PATCH 0234/1086] assign to list beyond current length js-style --- src/PyListProxyHandler.cc | 84 ++++++++++++++++++++++++++++++++++++- tests/python/test_arrays.py | 25 +++++++---- 2 files changed, 99 insertions(+), 10 deletions(-) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 2947e28d..3549e5cc 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2039,6 +2039,73 @@ void PyListProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { } } +/* Ensure ob_item has room for at least newsize elements, and set + * ob_size to newsize. If newsize > ob_size on entry, the content + * of the new slots at exit is undefined heap trash; it's the caller's + * responsibility to overwrite them with sane values. + * The number of allocated elements may grow, shrink, or stay the same. + * Failure is impossible if newsize <= self.allocated on entry, although + * that partly relies on an assumption that the system realloc() never + * fails when passed a number of bytes <= the number of bytes last + * allocated (the C standard doesn't guarantee this, but it's hard to + * imagine a realloc implementation where it wouldn't be true). + * Note that self->ob_item may change, and even if newsize is less + * than ob_size on entry. + */ +static int +list_resize(PyListObject *self, Py_ssize_t newsize) +{ + PyObject **items; + size_t new_allocated, num_allocated_bytes; + Py_ssize_t allocated = self->allocated; + + /* Bypass realloc() when a previous overallocation is large enough + to accommodate the newsize. If the newsize falls lower than half + the allocated size, then proceed with the realloc() to shrink the list. + */ + if (allocated >= newsize && newsize >= (allocated >> 1)) { + assert(self->ob_item != NULL || newsize == 0); + Py_SET_SIZE(self, newsize); + return 0; + } + + /* This over-allocates proportional to the list size, making room + * for additional growth. The over-allocation is mild, but is + * enough to give linear-time amortized behavior over a long + * sequence of appends() in the presence of a poorly-performing + * system realloc(). + * Add padding to make the allocated size multiple of 4. + * The growth pattern is: 0, 4, 8, 16, 24, 32, 40, 52, 64, 76, ... + * Note: new_allocated won't overflow because the largest possible value + * is PY_SSIZE_T_MAX * (9 / 8) + 6 which always fits in a size_t. + */ + new_allocated = ((size_t)newsize + (newsize >> 3) + 6) & ~(size_t)3; + /* Do not overallocate if the new size is closer to overallocated size + * than to the old size. + */ + if (newsize - Py_SIZE(self) > (Py_ssize_t)(new_allocated - newsize)) + new_allocated = ((size_t)newsize + 3) & ~(size_t)3; + + if (newsize == 0) + new_allocated = 0; + if (new_allocated <= (size_t)PY_SSIZE_T_MAX / sizeof(PyObject *)) { + num_allocated_bytes = new_allocated * sizeof(PyObject *); + items = (PyObject **)PyMem_Realloc(self->ob_item, num_allocated_bytes); + } + else { + // integer overflow + items = NULL; + } + if (items == NULL) { + PyErr_NoMemory(); + return -1; + } + self->ob_item = items; + Py_SET_SIZE(self, newsize); + self->allocated = new_allocated; + return 0; +} + bool PyListProxyHandler::defineProperty( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::Handle desc, JS::ObjectOpResult &result @@ -2060,8 +2127,23 @@ bool PyListProxyHandler::defineProperty( JS::RootedValue itemV(cx, desc.value()); PyObject *item = pyTypeFactory(cx, global, itemV)->getPyObject(); if (PyList_SetItem(pyObject, index, item) < 0) { - return result.failBadIndex(); + // expand array JS-style + Py_XINCREF(item); + Py_ssize_t len = PyList_GET_SIZE(pyObject); + if (list_resize((PyListObject *)pyObject, index + 1) < 0) { + Py_XDECREF(item); + return result.failBadIndex(); + } + PyList_SET_ITEM((PyListObject *)pyObject, index, item); + for (int i = len; i < index; i++) { + Py_INCREF(Py_None); + PyList_SET_ITEM((PyListObject *)pyObject, i, Py_None); + } + + // clear pending exception + PyErr_Clear(); } + return result.succeed(); } diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 5817c3f3..44bd79a8 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -1768,14 +1768,21 @@ def test_array_from(): assert result[0] == [1,2] assert result[0] is not items -# assign generic dict to non-existent slot -def test_generic_dict_bad_index(): +# bad index size expansion +def test_assign_generic_dict_bad_index(): items = [1,2,3] result = [] - try: - pm.eval("(result, arr) => {result[0] = arr[Symbol.iterator]() }")(result, items) - assert (False) - except Exception as e: - assert str(type(e)) == "" - assert str(e) == ("list assignment index out of range") - \ No newline at end of file + pm.eval("(result, arr) => {result[0] = arr[Symbol.iterator]() }")(result, items) + assert repr(result) == "[]" + +def test_assign_bad_index(): + items = [1,2,3] + result = [] + pm.eval("(result, arr) => {result[0] = 4}")(result, items) + assert result[0] == 4 + +def test_assign_bad_index(): + items = [1,2,3] + result = [] + pm.eval("(result, arr) => {result[0] = 4; result[5] = 6}")(result, items) + assert result == [4, None, None, None, None, 6] \ No newline at end of file From 2d934fe9b245100598f066078f12884848fa5aba Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 6 Feb 2024 11:44:24 -0500 Subject: [PATCH 0235/1086] comment --- src/PyListProxyHandler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 3549e5cc..a91068a5 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2127,7 +2127,7 @@ bool PyListProxyHandler::defineProperty( JS::RootedValue itemV(cx, desc.value()); PyObject *item = pyTypeFactory(cx, global, itemV)->getPyObject(); if (PyList_SetItem(pyObject, index, item) < 0) { - // expand array JS-style + // expand Py_XINCREF(item); Py_ssize_t len = PyList_GET_SIZE(pyObject); if (list_resize((PyListObject *)pyObject, index + 1) < 0) { From 63956876cb27134139561add1a30020a8fb138c9 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 6 Feb 2024 11:46:04 -0500 Subject: [PATCH 0236/1086] cleanup --- src/PyListProxyHandler.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index a91068a5..ca5e23fa 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2165,14 +2165,14 @@ bool PyListProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, bool PyListProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const { Py_ssize_t index; if (!idToIndex(cx, id, &index)) { - return result.failBadIndex(); // report failure + return result.failBadIndex(); } // Set to undefined instead of actually deleting it if (PyList_SetItem(pyObject, index, Py_None) < 0) { - return result.failCantDelete(); // report failure + return result.failCantDelete(); } - return result.succeed(); // report success + return result.succeed(); } bool PyListProxyHandler::isArray(JSContext *cx, JS::HandleObject proxy, JS::IsArrayAnswer *answer) const { From 10c8c795c87e8ff51bceec13aa37982b9db5b746 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 6 Feb 2024 11:50:26 -0500 Subject: [PATCH 0237/1086] improved naming --- src/PyListProxyHandler.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index ca5e23fa..515c3f3b 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2129,13 +2129,13 @@ bool PyListProxyHandler::defineProperty( if (PyList_SetItem(pyObject, index, item) < 0) { // expand Py_XINCREF(item); - Py_ssize_t len = PyList_GET_SIZE(pyObject); + Py_ssize_t oldLen = PyList_GET_SIZE(pyObject); if (list_resize((PyListObject *)pyObject, index + 1) < 0) { Py_XDECREF(item); return result.failBadIndex(); } PyList_SET_ITEM((PyListObject *)pyObject, index, item); - for (int i = len; i < index; i++) { + for (int i = oldLen; i < index; i++) { Py_INCREF(Py_None); PyList_SET_ITEM((PyListObject *)pyObject, i, Py_None); } From de32916b9260597f42054e603dcdb42b822ab1c5 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 6 Feb 2024 11:50:39 -0500 Subject: [PATCH 0238/1086] formatting --- src/JSFunctionProxy.cc | 4 ++-- src/JSMethodProxy.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc index 013e6157..abf2056b 100644 --- a/src/JSFunctionProxy.cc +++ b/src/JSFunctionProxy.cc @@ -57,8 +57,8 @@ PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_call(PyObject *self, return NULL; } - if (PyErr_Occurred()) { - return NULL; + if (PyErr_Occurred()) { + return NULL; } return pyTypeFactory(cx, &thisObj, jsReturnVal)->getPyObject(); diff --git a/src/JSMethodProxy.cc b/src/JSMethodProxy.cc index b702b306..9a75eb3c 100644 --- a/src/JSMethodProxy.cc +++ b/src/JSMethodProxy.cc @@ -67,8 +67,8 @@ PyObject *JSMethodProxyMethodDefinitions::JSMethodProxy_call(PyObject *self, PyO return NULL; } - if (PyErr_Occurred()) { - return NULL; + if (PyErr_Occurred()) { + return NULL; } JS::RootedObject *globalObj = new JS::RootedObject(cx, JS::CurrentGlobalOrNull(cx)); From c827e66256f03340d042f735fc71fa4dd0302b7b Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 6 Feb 2024 12:11:53 -0500 Subject: [PATCH 0239/1086] added missing pyExceptions --- src/JSObjectProxy.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index a02c3260..84614e2d 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -71,6 +71,7 @@ Py_ssize_t JSObjectProxyMethodDefinitions::JSObjectProxy_length(JSObjectProxy *s JS::RootedIdVector props(GLOBAL_CX); if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return -1; } return props.length(); @@ -179,6 +180,7 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr JS::RootedIdVector props(GLOBAL_CX); if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } @@ -585,6 +587,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method(JSObjectPro JS::RootedIdVector props(GLOBAL_CX); if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } From fa94dae30878c343718903aef7f6d27097ab2487 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Tue, 6 Feb 2024 17:26:35 +0000 Subject: [PATCH 0240/1086] refactor: move `clearTimeout` argument checks to the JavaScript side --- python/pythonmonkey/builtin_modules/timers.js | 4 ++++ src/internalBinding/timers.cc | 9 +-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/timers.js b/python/pythonmonkey/builtin_modules/timers.js index 862bccc1..51da4fb7 100644 --- a/python/pythonmonkey/builtin_modules/timers.js +++ b/python/pythonmonkey/builtin_modules/timers.js @@ -53,6 +53,10 @@ function setTimeout(handler, delayMs = 0, ...args) */ function clearTimeout(timeoutId) { + // silently does nothing when an invalid timeoutId (should be an int32 value) is passed in + if (!Number.isInteger(timeoutId)) + return; + return cancelByTimeoutId(timeoutId); } diff --git a/src/internalBinding/timers.cc b/src/internalBinding/timers.cc index b9653103..df1757d2 100644 --- a/src/internalBinding/timers.cc +++ b/src/internalBinding/timers.cc @@ -36,21 +36,14 @@ static bool enqueueWithDelay(JSContext *cx, unsigned argc, JS::Value *vp) { return true; } -// TODO (Tom Tang): move argument checks to the JavaScript side static bool cancelByTimeoutId(JSContext *cx, unsigned argc, JS::Value *vp) { using AsyncHandle = PyEventLoop::AsyncHandle; JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::HandleValue timeoutIdArg = args.get(0); + double timeoutID = args.get(0).toNumber(); args.rval().setUndefined(); - // silently does nothing when an invalid timeoutID (should be an int32 value) is passed in - if (!timeoutIdArg.isNumber()) { - return true; - } - // Retrieve the AsyncHandle by `timeoutID` - double timeoutID = timeoutIdArg.toNumber(); AsyncHandle *handle = AsyncHandle::fromId((uint32_t)timeoutID); if (!handle) return true; // does nothing on invalid timeoutID From 8f2408f82dd07b4874a54dac57e5c0119dc37213 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Tue, 6 Feb 2024 12:36:35 -0500 Subject: [PATCH 0241/1086] no Py_SET_SIZE on python 3.8 --- src/PyListProxyHandler.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 515c3f3b..70c19d12 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2065,7 +2065,11 @@ list_resize(PyListObject *self, Py_ssize_t newsize) */ if (allocated >= newsize && newsize >= (allocated >> 1)) { assert(self->ob_item != NULL || newsize == 0); + #if PY_VERSION_HEX >= 0x03090000 // 3.9 Py_SET_SIZE(self, newsize); + #else + Py_SIZE(self) = newsize; + #endif return 0; } @@ -2101,7 +2105,11 @@ list_resize(PyListObject *self, Py_ssize_t newsize) return -1; } self->ob_item = items; + #if PY_VERSION_HEX >= 0x03090000 // 3.9 Py_SET_SIZE(self, newsize); + #else + Py_SIZE(self) = newsize; + #endif self->allocated = new_allocated; return 0; } From 95a1b4d0ed8847c2da5c1929018e795861db7b6c Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Tue, 6 Feb 2024 15:21:09 -0500 Subject: [PATCH 0242/1086] removed incorrect comment --- src/PromiseType.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/PromiseType.cc b/src/PromiseType.cc index 2fac0866..7ab86e7d 100644 --- a/src/PromiseType.cc +++ b/src/PromiseType.cc @@ -24,7 +24,6 @@ #define PY_FUTURE_OBJ_SLOT 0 // slot id to access the python object in JS callbacks #define PROMISE_OBJ_SLOT 1 -// slot id must be less than 2 (https://hg.mozilla.org/releases/mozilla-esr102/file/tip/js/src/vm/JSFunction.h#l866), otherwise it will access to arbitrary unsafe memory locations static bool onResolvedCb(JSContext *cx, unsigned argc, JS::Value *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); From 1dc7dd18a76aa25a23bf7d34ca591eb1a09bc119 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Tue, 6 Feb 2024 15:24:57 -0500 Subject: [PATCH 0243/1086] missing file headers improved --- include/PyEventLoop.hh | 1 - src/PyEventLoop.cc | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/PyEventLoop.hh b/include/PyEventLoop.hh index 36fdb03c..dd833a04 100644 --- a/include/PyEventLoop.hh +++ b/include/PyEventLoop.hh @@ -2,7 +2,6 @@ * @file PyEventLoop.hh * @author Tom Tang (xmader@distributive.network) * @brief Send jobs to the Python event-loop - * @version 0.1 * @date 2023-04-05 * * @copyright Copyright (c) 2023 diff --git a/src/PyEventLoop.cc b/src/PyEventLoop.cc index d5b7f0a9..e9ce4df7 100644 --- a/src/PyEventLoop.cc +++ b/src/PyEventLoop.cc @@ -1,3 +1,14 @@ +/** + * @file PyEventLoop.cc + * @author Tom Tang (xmader@distributive.network) + * @brief Send jobs to the Python event-loop + * @date 2023-04-05 + * + * @copyright Copyright (c) 2023 + * + */ + + #include "include/PyEventLoop.hh" #include From 2d1462d58380397622d10f8f31503f83708c2de9 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Tue, 6 Feb 2024 16:23:08 -0500 Subject: [PATCH 0244/1086] type improvement --- src/PyListProxyHandler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 70c19d12..d1a575be 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2143,7 +2143,7 @@ bool PyListProxyHandler::defineProperty( return result.failBadIndex(); } PyList_SET_ITEM((PyListObject *)pyObject, index, item); - for (int i = oldLen; i < index; i++) { + for (Py_ssize_t i = oldLen; i < index; i++) { Py_INCREF(Py_None); PyList_SET_ITEM((PyListObject *)pyObject, i, Py_None); } From 9ff38bc862374712eea6749751a99112678b4bca Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Tue, 6 Feb 2024 16:23:22 -0500 Subject: [PATCH 0245/1086] improved comment --- src/PromiseType.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PromiseType.cc b/src/PromiseType.cc index 7ab86e7d..becf7e91 100644 --- a/src/PromiseType.cc +++ b/src/PromiseType.cc @@ -22,7 +22,8 @@ #include -#define PY_FUTURE_OBJ_SLOT 0 // slot id to access the python object in JS callbacks +// slot ids to access the python object in JS callbacks +#define PY_FUTURE_OBJ_SLOT 0 #define PROMISE_OBJ_SLOT 1 static bool onResolvedCb(JSContext *cx, unsigned argc, JS::Value *vp) { From 6f2581324786c49efa6ff6b424ce590d62461952 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Wed, 7 Feb 2024 10:01:01 -0500 Subject: [PATCH 0246/1086] fix(JSObjectProxy): correctly handle 'this' value of methods on JSObjectProxys --- src/JSObjectProxy.cc | 28 ++++++++++++++++++++++++++++ tests/python/test_functions_this.py | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 7f530249..2798bf8a 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -93,6 +93,34 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsObject); + // if value is a JSFunction, bind `this` to self + /* TODO (Caleb Aikens) its potentially problematic to bind it like this since if the function + * ever gets assigned to another object like so: + * + * jsObjA.func = jsObjB.func + * jsObjA.func() # `this` will be jsObjB not jsObjA + * + * it will be bound to the wrong object, however I can't find a better way to do this, + * and even pyodide works this way weirdly enough: + * https://github.com/pyodide/pyodide/blob/ee863a7f7907dfb6ee4948bde6908453c9d7ac43/src/core/jsproxy.c#L388 + * + * if the user wants to get an unbound JS function to bind later, they will have to get it without accessing it through + * a JSObjectProxy (such as via pythonmonkey.eval or as the result of some other function) + */ + if (value->isObject()) { + JS::RootedObject valueObject(GLOBAL_CX); + JS_ValueToObject(GLOBAL_CX, *value, &valueObject); + js::ESClass cls; + JS::GetBuiltinClass(GLOBAL_CX, valueObject, &cls); + if (cls == js::ESClass::Function) { + JS::Rooted> args(GLOBAL_CX); + args[0].setObject(*(self->jsObject)); + JS::Rooted boundFunction(GLOBAL_CX); + JS_CallFunctionName(GLOBAL_CX, valueObject, "bind", args, &boundFunction); + value->set(boundFunction); + } + } + return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } else { diff --git a/tests/python/test_functions_this.py b/tests/python/test_functions_this.py index 3b4c432b..9648225d 100644 --- a/tests/python/test_functions_this.py +++ b/tests/python/test_functions_this.py @@ -70,7 +70,7 @@ class Class: result = pyObj.jsFunc(2) assert globalThis == result[0] and 2 == result[1] result = jsObj.jsFunc(3) - assert globalThis == result[0] and 3 == result[1] # TODO (Caleb Aikens) should `this` be `globalThis` or `jsObj` here? + assert jsObj == result[0] and 3 == result[1] result = pm.eval("""(jsFunc) => { return jsFunc(4); } From 7b2b613ed9b8626916d752b2cd84312139356e96 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Wed, 7 Feb 2024 10:14:16 -0500 Subject: [PATCH 0247/1086] test(JSObjectProxy): added test for issue #172 --- tests/python/test_functions_this.py | 49 ++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/tests/python/test_functions_this.py b/tests/python/test_functions_this.py index 9648225d..c2eb0199 100644 --- a/tests/python/test_functions_this.py +++ b/tests/python/test_functions_this.py @@ -123,4 +123,51 @@ def test_require_correct_this(): CryptoJS = pm.require('crypto-js') cipher = CryptoJS.SHA256("Hello, World!").toString() assert cipher == "dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f" - subprocess.check_call('npm uninstall crypto-js', shell=True) \ No newline at end of file + subprocess.check_call('npm uninstall crypto-js', shell=True) + +def test_require_correct_this_old_style_class(): + example = pm.eval(""" + () => { + // old style class + function Rectangle(w, h) { + this.w = w; + this.h = h; + } + + Rectangle.prototype = { + getThis: function () { + return this; + }, + getArea: function () { + return this.w * this.h; + }, + }; + + // es5 class + class Rectangle2 { + constructor(w,h) { + this.w = w; + this.h = h; + } + + getThis() { + return this; + } + + getArea() { + return this.w * this.h; + } + } + + return { Rectangle: Rectangle, Rectangle2: Rectangle2}; + } + """)() + r = pm.new(example.Rectangle)(1,2) + + assert r.getArea() == 2 + assert r.getThis() == r + + r2 = pm.new(example.Rectangle2)(1,2) + + assert r2.getArea() == 2 + assert r2.getThis() == r2 \ No newline at end of file From 5ab92c8b771726a8b5f19d8a30314d596b83f0fb Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Wed, 7 Feb 2024 10:47:35 -0500 Subject: [PATCH 0248/1086] chore(meta): update all top-of-file comments --- .vscode/c_cpp_properties.json | 3 ++- CMakeLists.txt | 2 +- LICENSE | 2 +- cmake/externals/autopep8/CMakeLists.txt | 2 +- cmake/externals/uncrustify/CMakeLists.txt | 2 +- cmake/format/CMakeLists.txt | 2 +- cmake/format/uncrustify.cfg | 2 +- include/BoolType.hh | 3 +-- include/BufferType.hh | 3 +-- include/DateType.hh | 3 +-- include/DictType.hh | 3 +-- include/ExceptionType.hh | 3 +-- include/FloatType.hh | 3 +-- include/FuncType.hh | 3 +-- include/IntType.hh | 3 +-- include/JSArrayIterProxy.hh | 3 +-- include/JSArrayProxy.hh | 3 +-- include/JSFunctionProxy.hh | 3 +-- include/JSMethodProxy.hh | 3 +-- include/JSObjectItemsProxy.hh | 3 +-- include/JSObjectIterProxy.hh | 3 +-- include/JSObjectKeysProxy.hh | 3 +-- include/JSObjectProxy.hh | 3 +-- include/JSObjectValuesProxy.hh | 3 +-- include/JSStringProxy.hh | 3 +-- include/JobQueue.hh | 3 +-- include/ListType.hh | 3 +-- include/NoneType.hh | 3 +-- include/NullType.hh | 3 +-- include/PromiseType.hh | 3 +-- include/PyBaseProxyHandler.hh | 3 +-- include/PyDictProxyHandler.hh | 2 +- include/PyEventLoop.hh | 3 +-- include/PyListProxyHandler.hh | 3 +-- include/PyObjectProxyHandler.hh | 3 +-- include/PyType.hh | 3 +-- include/StrType.hh | 3 +-- include/TupleType.hh | 3 +-- include/TypeEnum.hh | 3 +-- include/internalBinding.hh | 3 +-- include/jsTypeFactory.hh | 3 +-- include/modules/pythonmonkey/pythonmonkey.hh | 3 +-- include/pyTypeFactory.hh | 3 +-- include/setSpiderMonkeyException.hh | 3 +-- peter-jr | 2 +- src/BufferType.cc | 3 +-- src/JSArrayIterProxy.cc | 2 +- src/JSArrayProxy.cc | 3 +-- src/JSFunctionProxy.cc | 3 +-- src/JSMethodProxy.cc | 3 +-- src/JSObjectItemsProxy.cc | 3 +-- src/JSObjectIterProxy.cc | 2 +- src/JSObjectKeysProxy.cc | 3 +-- src/JSObjectProxy.cc | 3 +-- src/JSObjectValuesProxy.cc | 3 +-- src/NoneType.cc | 3 +-- src/NullType.cc | 3 +-- src/PromiseType.cc | 3 +-- src/PyBaseProxyHandler.cc | 2 +- src/PyDictProxyHandler.cc | 2 +- src/PyListProxyHandler.cc | 2 +- src/PyObjectProxyHandler.cc | 3 +-- src/TupleType.cc | 3 +-- src/internalBinding.cc | 3 ++- src/jsTypeFactory.cc | 3 +-- src/modules/pythonmonkey/pythonmonkey.cc | 2 +- src/pyTypeFactory.cc | 3 +-- src/setSpiderMonkeyException.cc | 3 +-- 68 files changed, 70 insertions(+), 120 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index d1ac024f..a3eea6a2 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -3,7 +3,8 @@ { "name": "Linux", "includePath": [ - "${workspaceFolder}/include/**" + "${workspaceFolder}/include/**", + "/usr/include/python3.11" ], "defines": [], "compilerPath": "/usr/bin/clang", diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cbe02d0..f9ec11f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Distributive Inc. All Rights Reserved. +# Copyright (c) 2024 Distributive Corp. All Rights Reserved. cmake_minimum_required(VERSION 3.25) # Set minimum cmake version diff --git a/LICENSE b/LICENSE index 085d2547..94696de0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023-2024 Distributive Corp. +Copyright (c) 2022-2024 Distributive Corp. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/externals/autopep8/CMakeLists.txt b/cmake/externals/autopep8/CMakeLists.txt index ebc95787..092d07db 100644 --- a/cmake/externals/autopep8/CMakeLists.txt +++ b/cmake/externals/autopep8/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Distributive Inc. All Rights Reserved. +# Copyright (c) 2024 Distributive Corp. All Rights Reserved. set(AUTOPEP8_ROOT "${CMAKE_CURRENT_BINARY_DIR}/install" CACHE PATH "The autopep8 root directory." diff --git a/cmake/externals/uncrustify/CMakeLists.txt b/cmake/externals/uncrustify/CMakeLists.txt index ba95422b..080f93b6 100644 --- a/cmake/externals/uncrustify/CMakeLists.txt +++ b/cmake/externals/uncrustify/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Distributive Inc. All Rights Reserved. +# Copyright (c) 2024 Distributive Corp. All Rights Reserved. set(UNCRUSTIFY_ROOT "${CMAKE_CURRENT_BINARY_DIR}/install" CACHE PATH "The Uncrustify root directory." diff --git a/cmake/format/CMakeLists.txt b/cmake/format/CMakeLists.txt index 19d8c7ce..24e34517 100644 --- a/cmake/format/CMakeLists.txt +++ b/cmake/format/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Distributive Inc. All Rights Reserved. +# Copyright (c) 2024 Distributive Corp. All Rights Reserved. if(NOT UNCRUSTIFY_EXECUTABLE) if(UNCRUSTIFY_ROOT STREQUAL "") diff --git a/cmake/format/uncrustify.cfg b/cmake/format/uncrustify.cfg index 56d94610..5de0790b 100644 --- a/cmake/format/uncrustify.cfg +++ b/cmake/format/uncrustify.cfg @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Kings Distributed Systems. All Rights Reserved. +# Copyright (c) 2024 Distributive Corp. All Rights Reserved. file_ext CPP .cc .hh diff --git a/include/BoolType.hh b/include/BoolType.hh index 5e2cc05c..951bbf5e 100644 --- a/include/BoolType.hh +++ b/include/BoolType.hh @@ -2,10 +2,9 @@ * @file BoolType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing python bools - * @version 0.1 * @date 2022-12-02 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/BufferType.hh b/include/BufferType.hh index ea2bd954..73fc5483 100644 --- a/include/BufferType.hh +++ b/include/BufferType.hh @@ -2,10 +2,9 @@ * @file BufferType.hh * @author Tom Tang (xmader@distributive.network) * @brief Struct for representing ArrayBuffers - * @version 0.1 * @date 2023-04-27 * - * @copyright Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/DateType.hh b/include/DateType.hh index 23f59707..f7830ede 100644 --- a/include/DateType.hh +++ b/include/DateType.hh @@ -2,10 +2,9 @@ * @file DateType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing python dates - * @version 0.1 * @date 2022-12-21 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/DictType.hh b/include/DictType.hh index 780a0e73..27d6e413 100644 --- a/include/DictType.hh +++ b/include/DictType.hh @@ -2,10 +2,9 @@ * @file DictType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct representing python dictionaries - * @version 0.1 * @date 2022-08-10 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/ExceptionType.hh b/include/ExceptionType.hh index 86045e8f..bb71e2d7 100644 --- a/include/ExceptionType.hh +++ b/include/ExceptionType.hh @@ -2,10 +2,9 @@ * @file ExceptionType.hh * @author Tom Tang (xmader@distributive.network) * @brief Struct for representing Python Exception objects from a corresponding JS Error object - * @version 0.1 * @date 2023-04-11 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/FloatType.hh b/include/FloatType.hh index 2544c251..499b2bc6 100644 --- a/include/FloatType.hh +++ b/include/FloatType.hh @@ -2,10 +2,9 @@ * @file FloatType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing python floats - * @version 0.1 * @date 2022-12-02 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/FuncType.hh b/include/FuncType.hh index af2d2dfb..391d5bfc 100644 --- a/include/FuncType.hh +++ b/include/FuncType.hh @@ -2,10 +2,9 @@ * @file FuncType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct representing python functions - * @version 0.1 * @date 2022-08-08 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2024 Distributive Corp. * */ #ifndef PythonMonkey_FuncType_ diff --git a/include/IntType.hh b/include/IntType.hh index 81111216..efbb431e 100644 --- a/include/IntType.hh +++ b/include/IntType.hh @@ -2,10 +2,9 @@ * @file IntType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) & Tom Tang (xmader@distributive.network) * @brief Struct for representing python ints - * @version 0.2 * @date 2023-03-16 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSArrayIterProxy.hh b/include/JSArrayIterProxy.hh index a4a9e660..fc4a93f7 100644 --- a/include/JSArrayIterProxy.hh +++ b/include/JSArrayIterProxy.hh @@ -2,10 +2,9 @@ * @file JSArrayIterProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSArrayIterProxy is a custom C-implemented python type that derives from PyListIter - * @version 0.1 * @date 2024-01-15 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh index 911e5edf..ce4ce26e 100644 --- a/include/JSArrayProxy.hh +++ b/include/JSArrayProxy.hh @@ -2,10 +2,9 @@ * @file JSArrayProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSArrayProxy is a custom C-implemented python type that derives from list. It acts as a proxy for JSArrays from Spidermonkey, and behaves like a list would. - * @version 0.1 * @date 2023-11-22 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSFunctionProxy.hh b/include/JSFunctionProxy.hh index a73ae6ea..a46980ef 100644 --- a/include/JSFunctionProxy.hh +++ b/include/JSFunctionProxy.hh @@ -2,10 +2,9 @@ * @file JSFunctionProxy.hh * @author Caleb Aikens (caleb@distributive.network) * @brief JSFunctionProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a function would. - * @version 0.1 * @date 2023-09-28 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSMethodProxy.hh b/include/JSMethodProxy.hh index f08bd81b..009229fb 100644 --- a/include/JSMethodProxy.hh +++ b/include/JSMethodProxy.hh @@ -2,10 +2,9 @@ * @file JSMethodProxy.hh * @author Caleb Aikens (caleb@distributive.network) * @brief JSMethodProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a method would, treating `self` as `this`. - * @version 0.1 * @date 2023-11-14 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSObjectItemsProxy.hh b/include/JSObjectItemsProxy.hh index 91c8bc72..480a48ae 100644 --- a/include/JSObjectItemsProxy.hh +++ b/include/JSObjectItemsProxy.hh @@ -2,10 +2,9 @@ * @file JSObjectItemsProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectItemsProxy is a custom C-implemented python type that derives from dict items - * @version 0.1 * @date 2024-01-19 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSObjectIterProxy.hh b/include/JSObjectIterProxy.hh index d6fb1452..d8f46075 100644 --- a/include/JSObjectIterProxy.hh +++ b/include/JSObjectIterProxy.hh @@ -2,10 +2,9 @@ * @file JSObjectIterProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectIterProxy is a custom C-implemented python type that derives from PyDictIterKey - * @version 0.1 * @date 2024-01-17 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSObjectKeysProxy.hh b/include/JSObjectKeysProxy.hh index 1dea37be..2564bb3f 100644 --- a/include/JSObjectKeysProxy.hh +++ b/include/JSObjectKeysProxy.hh @@ -2,10 +2,9 @@ * @file JSObjectKeysProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectKeysProxy is a custom C-implemented python type that derives from dict keys - * @version 0.1 * @date 2024-01-16 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 920a03d5..54eb38f2 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -2,10 +2,9 @@ * @file JSObjectProxy.hh * @author Caleb Aikens (caleb@distributive.network) & Tom Tang (xmader@distributive.network) * @brief JSObjectProxy is a custom C-implemented python type that derives from dict. It acts as a proxy for JSObjects from Spidermonkey, and behaves like a dict would. - * @version 0.1 * @date 2023-06-26 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSObjectValuesProxy.hh b/include/JSObjectValuesProxy.hh index 238d3066..c2b3be59 100644 --- a/include/JSObjectValuesProxy.hh +++ b/include/JSObjectValuesProxy.hh @@ -2,10 +2,9 @@ * @file JSObjectValuesProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectValuesProxy is a custom C-implemented python type that derives from dict values - * @version 0.1 * @date 2023-06-26 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSStringProxy.hh b/include/JSStringProxy.hh index 135eac6f..8c82374c 100644 --- a/include/JSStringProxy.hh +++ b/include/JSStringProxy.hh @@ -2,10 +2,9 @@ * @file JSStringProxy.hh * @author Caleb Aikens (caleb@distributive.network) * @brief JSStringProxy is a custom C-implemented python type that derives from str. It acts as a proxy for JSStrings from Spidermonkey, and behaves like a str would. - * @version 0.1 * @date 2024-01-03 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JobQueue.hh b/include/JobQueue.hh index 5d10e9a7..183bcf9f 100644 --- a/include/JobQueue.hh +++ b/include/JobQueue.hh @@ -2,10 +2,9 @@ * @file JobQueue.hh * @author Tom Tang (xmader@distributive.network) * @brief Implement the ECMAScript Job Queue - * @version 0.1 * @date 2023-04-03 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/ListType.hh b/include/ListType.hh index df5ba9ac..d5112057 100644 --- a/include/ListType.hh +++ b/include/ListType.hh @@ -2,10 +2,9 @@ * @file ListType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct for representing python lists - * @version 0.1 * @date 2022-08-18 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/NoneType.hh b/include/NoneType.hh index a2f7a82d..abfbacd2 100644 --- a/include/NoneType.hh +++ b/include/NoneType.hh @@ -2,10 +2,9 @@ * @file NoneType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing None - * @version 0.1 * @date 2023-02-22 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/NullType.hh b/include/NullType.hh index 80b91e20..9dbf68c0 100644 --- a/include/NullType.hh +++ b/include/NullType.hh @@ -2,10 +2,9 @@ * @file NullType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing JS null in a python object - * @version 0.1 * @date 2023-02-22 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/PromiseType.hh b/include/PromiseType.hh index cc8381f1..e2c7bc3e 100644 --- a/include/PromiseType.hh +++ b/include/PromiseType.hh @@ -2,10 +2,9 @@ * @file PromiseType.hh * @author Tom Tang (xmader@distributive.network) * @brief Struct for representing Promises - * @version 0.1 * @date 2023-03-29 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/PyBaseProxyHandler.hh b/include/PyBaseProxyHandler.hh index 793f6b2a..dc3700a8 100644 --- a/include/PyBaseProxyHandler.hh +++ b/include/PyBaseProxyHandler.hh @@ -2,10 +2,9 @@ * @file PyBaseProxyHandler.hh * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) * @brief Structs for creating JS proxy objects. - * @version 0.1 * @date 2023-04-20 * - * Copyright (c) 2023-2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/PyDictProxyHandler.hh b/include/PyDictProxyHandler.hh index bf56c2a6..97ebc162 100644 --- a/include/PyDictProxyHandler.hh +++ b/include/PyDictProxyHandler.hh @@ -4,7 +4,7 @@ * @brief Structs for creating JS proxy objects. Used by DictType for object coercion * @date 2023-04-20 * - * Copyright (c) 2023-2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/PyEventLoop.hh b/include/PyEventLoop.hh index 36fdb03c..8c623479 100644 --- a/include/PyEventLoop.hh +++ b/include/PyEventLoop.hh @@ -2,10 +2,9 @@ * @file PyEventLoop.hh * @author Tom Tang (xmader@distributive.network) * @brief Send jobs to the Python event-loop - * @version 0.1 * @date 2023-04-05 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/PyListProxyHandler.hh b/include/PyListProxyHandler.hh index ba7abe97..faebac51 100644 --- a/include/PyListProxyHandler.hh +++ b/include/PyListProxyHandler.hh @@ -2,10 +2,9 @@ * @file PyListProxyHandler.hh * @author Philippe Laporte (philippe@distributive.network) * @brief Structs for creating JS proxy objects. Used by ListType for List coercion - * @version 0.1 * @date 2023-12-01 * - * Copyright (c) 2023-2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/PyObjectProxyHandler.hh b/include/PyObjectProxyHandler.hh index 8b3ce72b..5dc29737 100644 --- a/include/PyObjectProxyHandler.hh +++ b/include/PyObjectProxyHandler.hh @@ -2,10 +2,9 @@ * @file PyObjectProxyHandler.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Structs for creating JS proxy objects. Used for default object coercion - * @version 0.1 * @date 2024-01-25 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/PyType.hh b/include/PyType.hh index b75d7f1b..382c4729 100644 --- a/include/PyType.hh +++ b/include/PyType.hh @@ -2,10 +2,9 @@ * @file PyType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct representing python types - * @version 0.1 * @date 2022-07-27 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/StrType.hh b/include/StrType.hh index b6f5e16c..af67ca71 100644 --- a/include/StrType.hh +++ b/include/StrType.hh @@ -2,10 +2,9 @@ * @file StrType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct for representing python strings - * @version 0.1 * @date 2022-08-08 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/TupleType.hh b/include/TupleType.hh index c1209cb4..783b8549 100644 --- a/include/TupleType.hh +++ b/include/TupleType.hh @@ -2,10 +2,9 @@ * @file TupleType.hh * @author Giovanni Tedesco (giovanni@distributive.network) * @brief Struct for representing python tuples - * @version 0.1 * @date 2022-08-19 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/TypeEnum.hh b/include/TypeEnum.hh index a2d2c875..580bf6f7 100644 --- a/include/TypeEnum.hh +++ b/include/TypeEnum.hh @@ -2,10 +2,9 @@ * @file TypeEnum.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) & Tom Tang (xmader@distributive.network) * @brief Enum for every PyType - * @version 0.1 * @date 2022-08-08 * - * @copyright Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/internalBinding.hh b/include/internalBinding.hh index 24c00082..c29aa79b 100644 --- a/include/internalBinding.hh +++ b/include/internalBinding.hh @@ -2,10 +2,9 @@ * @file internalBinding.hh * @author Tom Tang (xmader@distributive.network) * @brief - * @version 0.1 * @date 2023-05-16 * - * @copyright Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/jsTypeFactory.hh b/include/jsTypeFactory.hh index 6ec68412..6150ceaa 100644 --- a/include/jsTypeFactory.hh +++ b/include/jsTypeFactory.hh @@ -2,10 +2,9 @@ * @file jsTypeFactory.hh * @author Caleb Aikens (caleb@distributive.network) * @brief - * @version 0.1 * @date 2023-02-15 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/modules/pythonmonkey/pythonmonkey.hh b/include/modules/pythonmonkey/pythonmonkey.hh index 7f964bce..3e8c9424 100644 --- a/include/modules/pythonmonkey/pythonmonkey.hh +++ b/include/modules/pythonmonkey/pythonmonkey.hh @@ -2,10 +2,9 @@ * @file pythonmonkey.hh * @author Caleb Aikens (caleb@kingsds.network) * @brief This file defines the pythonmonkey module, along with its various functions. - * @version 0.1 * @date 2022-09-06 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2024 Distributive Corp. * */ #ifndef PythonMonkey_Module_PythonMonkey diff --git a/include/pyTypeFactory.hh b/include/pyTypeFactory.hh index 3b79cbdd..c2d0353e 100644 --- a/include/pyTypeFactory.hh +++ b/include/pyTypeFactory.hh @@ -2,10 +2,9 @@ * @file pyTypeFactory.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Function for wrapping arbitrary PyObjects into the appropriate PyType class, and coercing JS types to python types - * @version 0.1 * @date 2022-08-08 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/setSpiderMonkeyException.hh b/include/setSpiderMonkeyException.hh index f838e5e4..fcaf8141 100644 --- a/include/setSpiderMonkeyException.hh +++ b/include/setSpiderMonkeyException.hh @@ -2,10 +2,9 @@ * @file setSpiderMonkeyException.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Call this function whenever a JS_* function call fails in order to set an appropriate python exception (remember to also return NULL) - * @version 0.1 * @date 2023-02-28 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/peter-jr b/peter-jr index 873a85f6..1bdbcfe9 100755 --- a/peter-jr +++ b/peter-jr @@ -27,7 +27,7 @@ if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then cat < Date: Wed, 7 Feb 2024 11:26:47 -0500 Subject: [PATCH 0249/1086] cleanup: no need for overriding methods that merely call super. proper traverse methods --- include/JSArrayProxy.hh | 44 +++++++++--------------- include/JSObjectProxy.hh | 38 ++++++++++---------- src/JSArrayProxy.cc | 17 ++++----- src/JSObjectProxy.cc | 25 +++++++------- src/modules/pythonmonkey/pythonmonkey.cc | 28 +++++++-------- 5 files changed, 66 insertions(+), 86 deletions(-) diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh index 9b42a26a..ff2bb482 100644 --- a/include/JSArrayProxy.hh +++ b/include/JSArrayProxy.hh @@ -40,26 +40,6 @@ public: */ static void JSArrayProxy_dealloc(JSArrayProxy *self); - /** - * @brief New method (.tp_new), creates a new instance of the JSArrayProxy type, exposed as the __new()__ method in python - * - * @param type - The type of object to be created, will always be JSArrayProxyType or a derived type - * @param args - arguments to the __new()__ method, not used - * @param kwds - keyword arguments to the __new()__ method, not used - * @return PyObject* - A new instance of JSArrayProxy - */ - static PyObject *JSArrayProxy_new(PyTypeObject *type, PyObject *args, PyObject *kwds); - - /** - * @brief Initialization method (.tp_init), initializes a newly created instance of JSArrayProxy. exposed as the __init()__ method in python - * - * @param self - The JSArrayProxy to be initialized - * @param args - arguments to the __init()__ method, expected to be a dict - * @param kwds - keyword arguments to the __init()__ method, not used - * @return int - -1 on exception, return any other value otherwise - */ - static int JSArrayProxy_init(JSArrayProxy *self, PyObject *args, PyObject *kwds); - /** * @brief Length method (.mp_length and .sq_length), returns the number of keys in the JSObject, used by the python len() method * @@ -78,13 +58,13 @@ public: static PyObject *JSArrayProxy_get(JSArrayProxy *self, PyObject *key); -/** - * @brief Getter method (.mp_subscript), returns a value from the JSArrayProxy given a key which can be a slice, used by several built-in python methods as well as the [] and operator - * - * @param self - The JSArrayProxy - * @param key - The key for the value in the JSArrayProxy - * @return PyObject* NULL on exception, the corresponding value otherwise - */ + /** + * @brief Getter method (.mp_subscript), returns a value from the JSArrayProxy given a key which can be a slice, used by several built-in python methods as well as the [] and operator + * + * @param self - The JSArrayProxy + * @param key - The key for the value in the JSArrayProxy + * @return PyObject* NULL on exception, the corresponding value otherwise + */ static PyObject *JSArrayProxy_get_subscript(JSArrayProxy *self, PyObject *key); /** @@ -192,6 +172,16 @@ public: */ static int JSArrayProxy_clear_slot(JSArrayProxy *self); + /** + * @brief .tp_traverse method + * + * @param self - The JSArrayProxy + * @param visitproc - The function to be applied on each element of the list + * @param arg - The argument to the visit function + * @return 0 on success + */ + static int JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg); + /** * @brief copy method * diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 920a03d5..9e292e6a 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -40,26 +40,6 @@ public: */ static void JSObjectProxy_dealloc(JSObjectProxy *self); - /** - * @brief New method (.tp_new), creates a new instance of the JSObjectProxy type, exposed as the __new()__ method in python - * - * @param type - The type of object to be created, will always be JSObjectProxyType or a derived type - * @param args - arguments to the __new()__ method, not used - * @param kwds - keyword arguments to the __new()__ method, not used - * @return PyObject* - A new instance of JSObjectProxy - */ - static PyObject *JSObjectProxy_new(PyTypeObject *type, PyObject *args, PyObject *kwds); - - /** - * @brief Initialization method (.tp_init), initializes a newly created instance of JSObjectProxy. exposed as the __init()__ method in python - * - * @param self - The JSObjectProxy to be initialized - * @param args - arguments to the __init()__ method, expected to be a dict - * @param kwds - keyword arguments to the __init()__ method, not used - * @return int - -1 on exception, return any other value otherwise - */ - static int JSObjectProxy_init(JSObjectProxy *self, PyObject *args, PyObject *kwds); - /** * @brief Length method (.mp_length), returns the number of key-value pairs in the JSObject, used by the python len() method * @@ -96,6 +76,24 @@ public: */ static int JSObjectProxy_assign(JSObjectProxy *self, PyObject *key, PyObject *value); + /** + * @brief .tp_traverse method + * + * @param self - The JSObjectProxy + * @param visitproc - The function to be applied on each element of the dict + * @param arg - The argument to the visit function + * @return 0 on success + */ + static int JSObjectProxy_traverse(JSObjectProxy *self, visitproc visit, void *arg); + + /** + * @brief clear method + * + * @param self - The JSObjectProxy + * @return 0 on success + */ + static int JSObjectProxy_clear(JSObjectProxy *self); + /** * @brief Comparison method (.tp_richcompare), returns appropriate boolean given a comparison operator and other pyobject * diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index ac5b15bf..00ab09e3 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -29,20 +29,10 @@ void JSArrayProxyMethodDefinitions::JSArrayProxy_dealloc(JSArrayProxy *self) { self->jsArray.set(nullptr); + PyObject_GC_UnTrack(self); Py_TYPE(self)->tp_free((PyObject *)self); } -PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) -{ - return PyList_Type.tp_new(subtype, args, kwds); -} - -int JSArrayProxyMethodDefinitions::JSArrayProxy_init(JSArrayProxy *self, PyObject *args, PyObject *kwds) -{ - PyList_Type.tp_init((PyObject *)self, args, kwds); - return 0; -} - Py_ssize_t JSArrayProxyMethodDefinitions::JSArrayProxy_length(JSArrayProxy *self) { uint32_t length; @@ -750,6 +740,11 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot(JSArrayProxy *self) { return 0; } +int JSArrayProxyMethodDefinitions::JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg) { + // Nothing to be done + return 0; +} + PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) { JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].setInt32(0); diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 84614e2d..84092867 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -53,19 +53,6 @@ void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) Py_TYPE(self)->tp_free((PyObject *)self); } -PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) -{ - return PyDict_Type.tp_new(subtype, args, kwds); -} - -int JSObjectProxyMethodDefinitions::JSObjectProxy_init(JSObjectProxy *self, PyObject *args, PyObject *kwds) -{ - if (PyDict_Type.tp_init((PyObject *)self, args, kwds) < 0) { - return -1; - } - return 0; -} - Py_ssize_t JSObjectProxyMethodDefinitions::JSObjectProxy_length(JSObjectProxy *self) { JS::RootedIdVector props(GLOBAL_CX); @@ -133,6 +120,18 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, Py return 0; } +int JSObjectProxyMethodDefinitions::JSObjectProxy_traverse(JSObjectProxy *self, visitproc visit, void *arg) { + // Nothing to be done + return 0; +} + +int JSObjectProxyMethodDefinitions::JSObjectProxy_clear(JSObjectProxy *self) { + if (!JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method(self)) { + return -1; + } + return 0; +} + PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare(JSObjectProxy *self, PyObject *other, int op) { if (op != Py_EQ && op != Py_NE) { diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 28e11cab..129e9c48 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -65,7 +65,7 @@ static PyTypeObject NullType = { .tp_name = "pythonmonkey.null", .tp_basicsize = sizeof(NullObject), .tp_flags = Py_TPFLAGS_DEFAULT, - .tp_doc = PyDoc_STR("Javascript null object"), + .tp_doc = PyDoc_STR("Javascript null object") }; static PyTypeObject BigIntType = { @@ -74,7 +74,7 @@ static PyTypeObject BigIntType = { | Py_TPFLAGS_LONG_SUBCLASS | Py_TPFLAGS_BASETYPE, // can be subclassed .tp_doc = PyDoc_STR("Javascript BigInt object"), - .tp_base = &PyLong_Type, // extending the builtin int type + .tp_base = &PyLong_Type }; PyTypeObject JSObjectProxyType = { @@ -90,25 +90,24 @@ PyTypeObject JSObjectProxyType = { .tp_hash = PyObject_HashNotImplemented, .tp_getattro = (getattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_get, .tp_setattro = (setattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_assign, - .tp_flags = Py_TPFLAGS_DEFAULT - | Py_TPFLAGS_DICT_SUBCLASS, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DICT_SUBCLASS | Py_TPFLAGS_HAVE_GC, .tp_doc = PyDoc_STR("Javascript Object proxy dict"), + .tp_traverse = (traverseproc)JSObjectProxyMethodDefinitions::JSObjectProxy_traverse, + .tp_clear = (inquiry)JSObjectProxyMethodDefinitions::JSObjectProxy_clear, .tp_richcompare = (richcmpfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare, .tp_iter = (getiterfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_iter, .tp_methods = JSObjectProxy_methods, - .tp_base = &PyDict_Type, - .tp_init = (initproc)JSObjectProxyMethodDefinitions::JSObjectProxy_init, - .tp_new = JSObjectProxyMethodDefinitions::JSObjectProxy_new, + .tp_base = &PyDict_Type }; PyTypeObject JSStringProxyType = { .tp_name = "pythonmonkey.JSStringProxy", .tp_basicsize = sizeof(JSStringProxy), .tp_flags = Py_TPFLAGS_DEFAULT - | Py_TPFLAGS_UNICODE_SUBCLASS // https://docs.python.org/3/c-api/typeobj.html#Py_TPFLAGS_LONG_SUBCLASS + | Py_TPFLAGS_UNICODE_SUBCLASS | Py_TPFLAGS_BASETYPE, // can be subclassed .tp_doc = PyDoc_STR("Javascript String value"), - .tp_base = &PyUnicode_Type, // extending the builtin int type + .tp_base = &PyUnicode_Type }; PyTypeObject JSFunctionProxyType = { @@ -119,7 +118,7 @@ PyTypeObject JSFunctionProxyType = { .tp_call = JSFunctionProxyMethodDefinitions::JSFunctionProxy_call, .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = PyDoc_STR("Javascript Function proxy object"), - .tp_new = JSFunctionProxyMethodDefinitions::JSFunctionProxy_new, + .tp_new = JSFunctionProxyMethodDefinitions::JSFunctionProxy_new }; PyTypeObject JSMethodProxyType = { @@ -130,7 +129,7 @@ PyTypeObject JSMethodProxyType = { .tp_call = JSMethodProxyMethodDefinitions::JSMethodProxy_call, .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = PyDoc_STR("Javascript Method proxy object"), - .tp_new = JSMethodProxyMethodDefinitions::JSMethodProxy_new, + .tp_new = JSMethodProxyMethodDefinitions::JSMethodProxy_new }; PyTypeObject JSArrayProxyType = { @@ -143,15 +142,14 @@ PyTypeObject JSArrayProxyType = { .tp_as_sequence = &JSArrayProxy_sequence_methods, .tp_as_mapping = &JSArrayProxy_mapping_methods, .tp_getattro = (getattrofunc)JSArrayProxyMethodDefinitions::JSArrayProxy_get, - .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_LIST_SUBCLASS, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_LIST_SUBCLASS | Py_TPFLAGS_HAVE_GC, .tp_doc = PyDoc_STR("Javascript Array proxy list"), + .tp_traverse = (traverseproc)JSArrayProxyMethodDefinitions::JSArrayProxy_traverse, .tp_clear = (inquiry)JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot, .tp_richcompare = (richcmpfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare, .tp_iter = (getiterfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_iter, .tp_methods = JSArrayProxy_methods, - .tp_base = &PyList_Type, - .tp_init = (initproc)JSArrayProxyMethodDefinitions::JSArrayProxy_init, - .tp_new = JSArrayProxyMethodDefinitions::JSArrayProxy_new, + .tp_base = &PyList_Type }; PyTypeObject JSArrayIterProxyType = { From 4d1d9c21155b84a5e8084ae91e5732478cfc7669 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 7 Feb 2024 12:05:35 -0500 Subject: [PATCH 0250/1086] cleanup --- src/jsTypeFactory.cc | 8 +++----- src/pyTypeFactory.cc | 5 ++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index b29a9348..7a343ee0 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -1,11 +1,10 @@ /** * @file jsTypeFactory.cc - * @author Caleb Aikens (caleb@distributive.network) + * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) * @brief - * @version 0.1 * @date 2023-02-15 * - * @copyright Copyright (c) 2023 + * @copyright 2023-2024 Distributive Corp. * */ @@ -37,7 +36,7 @@ #include #include -#include // https://docs.python.org/3/c-api/datetime.html +#include #include @@ -145,7 +144,6 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { // can't determine number of arguments for PyCFunctions, so just assume potentially unbounded uint16_t nargs = 0; if (PyFunction_Check(object)) { - // https://docs.python.org/3.11/reference/datamodel.html?highlight=co_argcount PyCodeObject *bytecode = (PyCodeObject *)PyFunction_GetCode(object); // borrowed reference nargs = bytecode->co_argcount; } diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index f8897f0e..09384bfd 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -1,11 +1,10 @@ /** * @file pyTypeFactory.cc - * @author Caleb Aikens (caleb@distributive.network) + * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) * @brief Function for wrapping arbitrary PyObjects into the appropriate PyType class, and coercing JS types to python types - * @version 0.1 * @date 2023-03-29 * - * @copyright Copyright (c) 2023 + * @copyright 2023-2024 Distributive Corp. * */ From cc13130398d3a6cc8a0c347703987f95e89311c6 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 7 Feb 2024 12:07:13 -0500 Subject: [PATCH 0251/1086] further cleanup --- src/jsTypeFactory.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 7a343ee0..c0515e07 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -291,7 +291,6 @@ bool callPyFunc(JSContext *cx, unsigned int argc, JS::Value *vp) { setPyException(cx); return false; } - // @TODO (Caleb Aikens) need to check for python exceptions here callargs.rval().set(jsTypeFactory(cx, pyRval)); return true; } From 32d2d41e6ab2a25645e2f337ea5ce4d8b8ec7842 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 7 Feb 2024 12:22:00 -0500 Subject: [PATCH 0252/1086] added missing file headers. cleanup --- include/BoolType.hh | 1 - include/BufferType.hh | 1 - include/DateType.hh | 1 - include/DictType.hh | 1 - include/ExceptionType.hh | 1 - include/FloatType.hh | 1 - include/FuncType.hh | 2 +- include/IntType.hh | 1 - include/JSFunctionProxy.hh | 1 - include/JSMethodProxy.hh | 1 - include/JSStringProxy.hh | 1 - include/JobQueue.hh | 1 - include/ListType.hh | 1 - include/NoneType.hh | 1 - include/NullType.hh | 1 - include/PromiseType.hh | 1 - include/PyBaseProxyHandler.hh | 1 - include/PyListProxyHandler.hh | 1 - include/PyObjectProxyHandler.hh | 1 - include/PyType.hh | 1 - include/StrType.hh | 1 - include/TupleType.hh | 1 - include/TypeEnum.hh | 1 - include/internalBinding.hh | 1 - include/jsTypeFactory.hh | 1 - include/pyTypeFactory.hh | 1 - include/setSpiderMonkeyException.hh | 1 - src/BoolType.cc | 10 ++++++++++ src/BufferType.cc | 3 +-- src/DateType.cc | 10 ++++++++++ src/DictType.cc | 11 +++++++++++ src/ExceptionType.cc | 10 ++++++++++ src/FloatType.cc | 10 ++++++++++ src/FuncType.cc | 10 ++++++++++ src/IntType.cc | 10 ++++++++++ src/JobQueue.cc | 9 +++++++++ src/ListType.cc | 11 +++++++++++ src/NoneType.cc | 10 ++++++++++ src/NullType.cc | 10 ++++++++++ src/PyObjectProxyHandler.cc | 1 - src/PyType.cc | 10 ++++++++++ src/StrType.cc | 10 ++++++++++ src/TupleType.cc | 10 ++++++++++ 43 files changed, 143 insertions(+), 30 deletions(-) diff --git a/include/BoolType.hh b/include/BoolType.hh index 5e2cc05c..97274383 100644 --- a/include/BoolType.hh +++ b/include/BoolType.hh @@ -2,7 +2,6 @@ * @file BoolType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing python bools - * @version 0.1 * @date 2022-12-02 * * @copyright Copyright (c) 2022 diff --git a/include/BufferType.hh b/include/BufferType.hh index ea2bd954..d428c103 100644 --- a/include/BufferType.hh +++ b/include/BufferType.hh @@ -2,7 +2,6 @@ * @file BufferType.hh * @author Tom Tang (xmader@distributive.network) * @brief Struct for representing ArrayBuffers - * @version 0.1 * @date 2023-04-27 * * @copyright Copyright (c) 2023 Distributive Corp. diff --git a/include/DateType.hh b/include/DateType.hh index 23f59707..55ee1d6d 100644 --- a/include/DateType.hh +++ b/include/DateType.hh @@ -2,7 +2,6 @@ * @file DateType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing python dates - * @version 0.1 * @date 2022-12-21 * * @copyright Copyright (c) 2022 diff --git a/include/DictType.hh b/include/DictType.hh index 780a0e73..1d2f0516 100644 --- a/include/DictType.hh +++ b/include/DictType.hh @@ -2,7 +2,6 @@ * @file DictType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct representing python dictionaries - * @version 0.1 * @date 2022-08-10 * * @copyright Copyright (c) 2022 diff --git a/include/ExceptionType.hh b/include/ExceptionType.hh index 86045e8f..7cff9952 100644 --- a/include/ExceptionType.hh +++ b/include/ExceptionType.hh @@ -2,7 +2,6 @@ * @file ExceptionType.hh * @author Tom Tang (xmader@distributive.network) * @brief Struct for representing Python Exception objects from a corresponding JS Error object - * @version 0.1 * @date 2023-04-11 * * @copyright Copyright (c) 2023 diff --git a/include/FloatType.hh b/include/FloatType.hh index 2544c251..079ebca2 100644 --- a/include/FloatType.hh +++ b/include/FloatType.hh @@ -2,7 +2,6 @@ * @file FloatType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing python floats - * @version 0.1 * @date 2022-12-02 * * @copyright Copyright (c) 2022 diff --git a/include/FuncType.hh b/include/FuncType.hh index af2d2dfb..1fb7e973 100644 --- a/include/FuncType.hh +++ b/include/FuncType.hh @@ -2,12 +2,12 @@ * @file FuncType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct representing python functions - * @version 0.1 * @date 2022-08-08 * * @copyright Copyright (c) 2022 * */ + #ifndef PythonMonkey_FuncType_ #define PythonMonkey_FuncType_ diff --git a/include/IntType.hh b/include/IntType.hh index 81111216..0cf2634a 100644 --- a/include/IntType.hh +++ b/include/IntType.hh @@ -2,7 +2,6 @@ * @file IntType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) & Tom Tang (xmader@distributive.network) * @brief Struct for representing python ints - * @version 0.2 * @date 2023-03-16 * * @copyright Copyright (c) 2023 diff --git a/include/JSFunctionProxy.hh b/include/JSFunctionProxy.hh index a73ae6ea..f0e95554 100644 --- a/include/JSFunctionProxy.hh +++ b/include/JSFunctionProxy.hh @@ -2,7 +2,6 @@ * @file JSFunctionProxy.hh * @author Caleb Aikens (caleb@distributive.network) * @brief JSFunctionProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a function would. - * @version 0.1 * @date 2023-09-28 * * Copyright (c) 2023 Distributive Corp. diff --git a/include/JSMethodProxy.hh b/include/JSMethodProxy.hh index f08bd81b..ffa02308 100644 --- a/include/JSMethodProxy.hh +++ b/include/JSMethodProxy.hh @@ -2,7 +2,6 @@ * @file JSMethodProxy.hh * @author Caleb Aikens (caleb@distributive.network) * @brief JSMethodProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a method would, treating `self` as `this`. - * @version 0.1 * @date 2023-11-14 * * Copyright (c) 2023 Distributive Corp. diff --git a/include/JSStringProxy.hh b/include/JSStringProxy.hh index 135eac6f..35d9f7ed 100644 --- a/include/JSStringProxy.hh +++ b/include/JSStringProxy.hh @@ -2,7 +2,6 @@ * @file JSStringProxy.hh * @author Caleb Aikens (caleb@distributive.network) * @brief JSStringProxy is a custom C-implemented python type that derives from str. It acts as a proxy for JSStrings from Spidermonkey, and behaves like a str would. - * @version 0.1 * @date 2024-01-03 * * Copyright (c) 2024 Distributive Corp. diff --git a/include/JobQueue.hh b/include/JobQueue.hh index 5d10e9a7..ef68bf7e 100644 --- a/include/JobQueue.hh +++ b/include/JobQueue.hh @@ -2,7 +2,6 @@ * @file JobQueue.hh * @author Tom Tang (xmader@distributive.network) * @brief Implement the ECMAScript Job Queue - * @version 0.1 * @date 2023-04-03 * * @copyright Copyright (c) 2023 diff --git a/include/ListType.hh b/include/ListType.hh index df5ba9ac..28842a66 100644 --- a/include/ListType.hh +++ b/include/ListType.hh @@ -2,7 +2,6 @@ * @file ListType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct for representing python lists - * @version 0.1 * @date 2022-08-18 * * @copyright Copyright (c) 2022 diff --git a/include/NoneType.hh b/include/NoneType.hh index a2f7a82d..bfd34169 100644 --- a/include/NoneType.hh +++ b/include/NoneType.hh @@ -2,7 +2,6 @@ * @file NoneType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing None - * @version 0.1 * @date 2023-02-22 * * @copyright Copyright (c) 2023 diff --git a/include/NullType.hh b/include/NullType.hh index 80b91e20..cdc5066f 100644 --- a/include/NullType.hh +++ b/include/NullType.hh @@ -2,7 +2,6 @@ * @file NullType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing JS null in a python object - * @version 0.1 * @date 2023-02-22 * * @copyright Copyright (c) 2023 diff --git a/include/PromiseType.hh b/include/PromiseType.hh index cc8381f1..df8becea 100644 --- a/include/PromiseType.hh +++ b/include/PromiseType.hh @@ -2,7 +2,6 @@ * @file PromiseType.hh * @author Tom Tang (xmader@distributive.network) * @brief Struct for representing Promises - * @version 0.1 * @date 2023-03-29 * * @copyright Copyright (c) 2023 diff --git a/include/PyBaseProxyHandler.hh b/include/PyBaseProxyHandler.hh index 7e5e6d7d..58993228 100644 --- a/include/PyBaseProxyHandler.hh +++ b/include/PyBaseProxyHandler.hh @@ -2,7 +2,6 @@ * @file PyBaseProxyHandler.hh * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) * @brief Structs for creating JS proxy objects. - * @version 0.1 * @date 2023-04-20 * * Copyright (c) 2023-2024 Distributive Corp. diff --git a/include/PyListProxyHandler.hh b/include/PyListProxyHandler.hh index ba7abe97..b94c9057 100644 --- a/include/PyListProxyHandler.hh +++ b/include/PyListProxyHandler.hh @@ -2,7 +2,6 @@ * @file PyListProxyHandler.hh * @author Philippe Laporte (philippe@distributive.network) * @brief Structs for creating JS proxy objects. Used by ListType for List coercion - * @version 0.1 * @date 2023-12-01 * * Copyright (c) 2023-2024 Distributive Corp. diff --git a/include/PyObjectProxyHandler.hh b/include/PyObjectProxyHandler.hh index 6f5c4a47..ce003eea 100644 --- a/include/PyObjectProxyHandler.hh +++ b/include/PyObjectProxyHandler.hh @@ -2,7 +2,6 @@ * @file PyObjectProxyHandler.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Structs for creating JS proxy objects. Used for default object coercion - * @version 0.1 * @date 2024-01-25 * * Copyright (c) 2023 Distributive Corp. diff --git a/include/PyType.hh b/include/PyType.hh index b75d7f1b..e90180d4 100644 --- a/include/PyType.hh +++ b/include/PyType.hh @@ -2,7 +2,6 @@ * @file PyType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct representing python types - * @version 0.1 * @date 2022-07-27 * * @copyright Copyright (c) 2022 diff --git a/include/StrType.hh b/include/StrType.hh index b6f5e16c..409d52be 100644 --- a/include/StrType.hh +++ b/include/StrType.hh @@ -2,7 +2,6 @@ * @file StrType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct for representing python strings - * @version 0.1 * @date 2022-08-08 * * @copyright Copyright (c) 2022 diff --git a/include/TupleType.hh b/include/TupleType.hh index c1209cb4..e2b66e78 100644 --- a/include/TupleType.hh +++ b/include/TupleType.hh @@ -2,7 +2,6 @@ * @file TupleType.hh * @author Giovanni Tedesco (giovanni@distributive.network) * @brief Struct for representing python tuples - * @version 0.1 * @date 2022-08-19 * * @copyright Copyright (c) 2022 diff --git a/include/TypeEnum.hh b/include/TypeEnum.hh index a2d2c875..ec6f441d 100644 --- a/include/TypeEnum.hh +++ b/include/TypeEnum.hh @@ -2,7 +2,6 @@ * @file TypeEnum.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) & Tom Tang (xmader@distributive.network) * @brief Enum for every PyType - * @version 0.1 * @date 2022-08-08 * * @copyright Copyright (c) 2023 Distributive Corp. diff --git a/include/internalBinding.hh b/include/internalBinding.hh index 24c00082..ca5907db 100644 --- a/include/internalBinding.hh +++ b/include/internalBinding.hh @@ -2,7 +2,6 @@ * @file internalBinding.hh * @author Tom Tang (xmader@distributive.network) * @brief - * @version 0.1 * @date 2023-05-16 * * @copyright Copyright (c) 2023 Distributive Corp. diff --git a/include/jsTypeFactory.hh b/include/jsTypeFactory.hh index 6ec68412..e3af11cc 100644 --- a/include/jsTypeFactory.hh +++ b/include/jsTypeFactory.hh @@ -2,7 +2,6 @@ * @file jsTypeFactory.hh * @author Caleb Aikens (caleb@distributive.network) * @brief - * @version 0.1 * @date 2023-02-15 * * @copyright Copyright (c) 2023 diff --git a/include/pyTypeFactory.hh b/include/pyTypeFactory.hh index e76143e1..ecdaeac6 100644 --- a/include/pyTypeFactory.hh +++ b/include/pyTypeFactory.hh @@ -2,7 +2,6 @@ * @file pyTypeFactory.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Function for wrapping arbitrary PyObjects into the appropriate PyType class, and coercing JS types to python types - * @version 0.1 * @date 2022-08-08 * * @copyright Copyright (c) 2022 diff --git a/include/setSpiderMonkeyException.hh b/include/setSpiderMonkeyException.hh index f838e5e4..5c24e794 100644 --- a/include/setSpiderMonkeyException.hh +++ b/include/setSpiderMonkeyException.hh @@ -2,7 +2,6 @@ * @file setSpiderMonkeyException.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Call this function whenever a JS_* function call fails in order to set an appropriate python exception (remember to also return NULL) - * @version 0.1 * @date 2023-02-28 * * @copyright Copyright (c) 2023 diff --git a/src/BoolType.cc b/src/BoolType.cc index 47239a35..2e70b472 100644 --- a/src/BoolType.cc +++ b/src/BoolType.cc @@ -1,3 +1,13 @@ +/** + * @file BoolType.cc + * @author Caleb Aikens (caleb@distributive.network) + * @brief Struct for representing python bools + * @date 2022-12-02 + * + * @copyright Copyright (c) 2022 + * + */ + #include "include/BoolType.hh" #include "include/PyType.hh" diff --git a/src/BufferType.cc b/src/BufferType.cc index f94b76b3..f58292d6 100644 --- a/src/BufferType.cc +++ b/src/BufferType.cc @@ -1,8 +1,7 @@ /** - * @file BufferType.hh + * @file BufferType.cc * @author Tom Tang (xmader@distributive.network) * @brief Struct for representing ArrayBuffers - * @version 0.1 * @date 2023-04-27 * * @copyright Copyright (c) 2023 Distributive Corp. diff --git a/src/DateType.cc b/src/DateType.cc index 8b9dc584..9aebee8b 100644 --- a/src/DateType.cc +++ b/src/DateType.cc @@ -1,3 +1,13 @@ +/** + * @file DateType.cc + * @author Caleb Aikens (caleb@distributive.network) + * @brief Struct for representing python dates + * @date 2022-12-21 + * + * @copyright Copyright (c) 2022 + * + */ + #include "include/DateType.hh" #include "include/PyType.hh" diff --git a/src/DictType.cc b/src/DictType.cc index b4221548..eaf2ca65 100644 --- a/src/DictType.cc +++ b/src/DictType.cc @@ -1,3 +1,14 @@ +/** + * @file DictType.cc + * @author Caleb Aikens (caleb@distributive.network), Giovanni Tedesco (giovanni@distributive.network) and Philippe Laporte (philippe@distributive.network) + * @brief Struct representing python dictionaries + * @date 2022-08-10 + * + * @copyright Copyright (c) 2022 + * + */ + + #include "include/DictType.hh" #include "include/JSObjectProxy.hh" diff --git a/src/ExceptionType.cc b/src/ExceptionType.cc index e3fdb92f..6cb0b5bc 100644 --- a/src/ExceptionType.cc +++ b/src/ExceptionType.cc @@ -1,3 +1,13 @@ +/** + * @file ExceptionType.cc + * @author Tom Tang (xmader@distributive.network) + * @brief Struct for representing Python Exception objects from a corresponding JS Error object + * @date 2023-04-11 + * + * @copyright Copyright (c) 2023 + * + */ + #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/setSpiderMonkeyException.hh" diff --git a/src/FloatType.cc b/src/FloatType.cc index 4c4c4bf0..1dcd4e51 100644 --- a/src/FloatType.cc +++ b/src/FloatType.cc @@ -1,3 +1,13 @@ +/** + * @file FloatType.cc + * @author Caleb Aikens (caleb@distributive.network) + * @brief Struct for representing python floats + * @date 2022-12-02 + * + * @copyright Copyright (c) 2022 + * + */ + #include "include/FloatType.hh" #include "include/PyType.hh" diff --git a/src/FuncType.cc b/src/FuncType.cc index 6b3a53fd..1ad47e90 100644 --- a/src/FuncType.cc +++ b/src/FuncType.cc @@ -1,3 +1,13 @@ +/** + * @file FuncType.cc + * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) + * @brief Struct representing python functions + * @date 2022-08-08 + * + * @copyright Copyright (c) 2022 + * + */ + #include "include/FuncType.hh" #include "include/JSFunctionProxy.hh" #include "include/PyType.hh" diff --git a/src/IntType.cc b/src/IntType.cc index 9e441856..b371f3b2 100644 --- a/src/IntType.cc +++ b/src/IntType.cc @@ -1,3 +1,13 @@ +/** + * @file IntType.cc + * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) & Tom Tang (xmader@distributive.network) + * @brief Struct for representing python ints + * @date 2023-03-16 + * + * @copyright Copyright (c) 2023 + * + */ + #include "include/modules/pythonmonkey/pythonmonkey.hh" #include "include/IntType.hh" #include "include/PyType.hh" diff --git a/src/JobQueue.cc b/src/JobQueue.cc index f878f5be..ba6e5a66 100644 --- a/src/JobQueue.cc +++ b/src/JobQueue.cc @@ -1,3 +1,12 @@ +/** + * @file JobQueue.cc + * @author Tom Tang (xmader@distributive.network) + * @brief Implement the ECMAScript Job Queue + * @date 2023-04-03 + * + * @copyright Copyright (c) 2023 + * + */ #include "include/JobQueue.hh" diff --git a/src/ListType.cc b/src/ListType.cc index dac9cf2f..f5f8df67 100644 --- a/src/ListType.cc +++ b/src/ListType.cc @@ -1,3 +1,14 @@ +/** + * @file ListType.cc + * @author Caleb Aikens (caleb@distributive.network), Giovanni Tedesco (giovanni@distributive.network) and Philippe Laporte (philippe@distributive.network) + * @brief Struct for representing python lists + * @date 2022-08-18 + * + * @copyright Copyright (c) 2022, 2023, 2024 Distributive Corp + * + */ + + #include "include/ListType.hh" #include "include/PyType.hh" #include "include/JSArrayProxy.hh" diff --git a/src/NoneType.cc b/src/NoneType.cc index b7bc2e6c..80ecc2b9 100644 --- a/src/NoneType.cc +++ b/src/NoneType.cc @@ -1,3 +1,13 @@ +/** + * @file NoneType.cc + * @author Caleb Aikens (caleb@distributive.network) + * @brief Struct for representing None + * @date 2023-02-22 + * + * @copyright Copyright (c) 2023 + * + */ + #include "include/NoneType.hh" #include "include/PyType.hh" diff --git a/src/NullType.cc b/src/NullType.cc index c830c7f3..0748fca0 100644 --- a/src/NullType.cc +++ b/src/NullType.cc @@ -1,3 +1,13 @@ +/** + * @file NullType.cc + * @author Caleb Aikens (caleb@distributive.network) + * @brief Struct for representing JS null in a python object + * @date 2023-02-22 + * + * @copyright Copyright (c) 2023 + * + */ + #include "include/NullType.hh" #include "include/modules/pythonmonkey/pythonmonkey.hh" diff --git a/src/PyObjectProxyHandler.cc b/src/PyObjectProxyHandler.cc index 13c508c5..4f523b10 100644 --- a/src/PyObjectProxyHandler.cc +++ b/src/PyObjectProxyHandler.cc @@ -2,7 +2,6 @@ * @file PyObjectProxyHandler.cc * @author Caleb Aikens (caleb@distributive.network) * @brief - * @version 0.1 * @date 2024-01-30 * * Copyright (c) 2023 Distributive Corp. diff --git a/src/PyType.cc b/src/PyType.cc index d74af221..d9881c42 100644 --- a/src/PyType.cc +++ b/src/PyType.cc @@ -1,3 +1,13 @@ +/** + * @file PyType.cc + * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) + * @brief Struct representing python types + * @date 2022-07-27 + * + * @copyright Copyright (c) 2022 + * + */ + #include "include/PyType.hh" #include "include/TypeEnum.hh" diff --git a/src/StrType.cc b/src/StrType.cc index 0aae1b53..3f412301 100644 --- a/src/StrType.cc +++ b/src/StrType.cc @@ -1,3 +1,13 @@ +/** + * @file StrType.cc + * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) + * @brief Struct for representing python strings + * @date 2022-08-08 + * + * @copyright Copyright (c) 2022 + * + */ + #include "include/StrType.hh" #include "include/PyType.hh" #include "include/JSStringProxy.hh" diff --git a/src/TupleType.cc b/src/TupleType.cc index d710418d..9b2046d7 100644 --- a/src/TupleType.cc +++ b/src/TupleType.cc @@ -1,3 +1,13 @@ +/** + * @file TupleType.cc + * @author Giovanni Tedesco (giovanni@distributive.network) + * @brief Struct for representing python tuples + * @date 2022-08-19 + * + * @copyright Copyright (c) 2022 + * + */ + #include "include/TupleType.hh" #include From 7843271d79053cc33064e9da393415627702e230 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 7 Feb 2024 13:28:35 -0500 Subject: [PATCH 0253/1086] further cleanup --- src/JSArrayProxy.cc | 1 - src/JSFunctionProxy.cc | 1 - src/JSMethodProxy.cc | 1 - src/JSObjectItemsProxy.cc | 1 - src/JSObjectKeysProxy.cc | 1 - src/JSObjectProxy.cc | 1 - src/JSObjectValuesProxy.cc | 1 - 7 files changed, 7 deletions(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 00ab09e3..774eee02 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -2,7 +2,6 @@ * @file JSArrayProxy.cc * @author Philippe Laporte (philippe@distributive.network) * @brief JSArrayProxy is a custom C-implemented python type that derives from list. It acts as a proxy for JSArrays from Spidermonkey, and behaves like a list would. - * @version 0.1 * @date 2023-11-22 * * Copyright (c) 2023 Distributive Corp. diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc index abf2056b..b23c35d9 100644 --- a/src/JSFunctionProxy.cc +++ b/src/JSFunctionProxy.cc @@ -2,7 +2,6 @@ * @file JSFunctionProxy.cc * @author Caleb Aikens (caleb@distributive.network) * @brief JSFunctionProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a function would. - * @version 0.1 * @date 2023-09-28 * * Copyright (c) 2023 Distributive Corp. diff --git a/src/JSMethodProxy.cc b/src/JSMethodProxy.cc index 9a75eb3c..5df87d48 100644 --- a/src/JSMethodProxy.cc +++ b/src/JSMethodProxy.cc @@ -2,7 +2,6 @@ * @file JSMethodProxy.cc * @author Caleb Aikens (caleb@distributive.network) * @brief JSMethodProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a method would, treating `self` as `this`. - * @version 0.1 * @date 2023-11-14 * * Copyright (c) 2023 Distributive Corp. diff --git a/src/JSObjectItemsProxy.cc b/src/JSObjectItemsProxy.cc index b06c1c09..39877255 100644 --- a/src/JSObjectItemsProxy.cc +++ b/src/JSObjectItemsProxy.cc @@ -2,7 +2,6 @@ * @file JSObjectItemsProxy.cc * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectItemsProxy is a custom C-implemented python type that derives from dict keys - * @version 0.1 * @date 2024-01-19 * * Copyright (c) 2024 Distributive Corp. diff --git a/src/JSObjectKeysProxy.cc b/src/JSObjectKeysProxy.cc index 698b1e81..d4733c7b 100644 --- a/src/JSObjectKeysProxy.cc +++ b/src/JSObjectKeysProxy.cc @@ -2,7 +2,6 @@ * @file JSObjectKeysProxy.cc * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectKeysProxy is a custom C-implemented python type that derives from dict keys - * @version 0.1 * @date 2024-01-18 * * Copyright (c) 2024 Distributive Corp. diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 84092867..77ed0eaf 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -2,7 +2,6 @@ * @file JSObjectProxy.cc * @author Caleb Aikens (caleb@distributive.network), Tom Tang (xmader@distributive.network) and Philippe Laporte (philippe@distributive.network) * @brief JSObjectProxy is a custom C-implemented python type that derives from dict. It acts as a proxy for JSObjects from Spidermonkey, and behaves like a dict would. - * @version 0.1 * @date 2023-06-26 * * Copyright (c) 2023-2024 Distributive Corp. diff --git a/src/JSObjectValuesProxy.cc b/src/JSObjectValuesProxy.cc index 7c7c8977..a6dc5c45 100644 --- a/src/JSObjectValuesProxy.cc +++ b/src/JSObjectValuesProxy.cc @@ -2,7 +2,6 @@ * @file JSObjectValuesProxy.cc * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectValuesProxy is a custom C-implemented python type that derives from dict values - * @version 0.1 * @date 2024-01-19 * * Copyright (c) 2024 Distributive Corp. From 809b5faf7b0ab6b98b9573f24e8c094146cacb31 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 7 Feb 2024 13:37:25 -0500 Subject: [PATCH 0254/1086] improved comment --- src/PyListProxyHandler.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index d1a575be..436c43d2 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2052,6 +2052,7 @@ void PyListProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { * Note that self->ob_item may change, and even if newsize is less * than ob_size on entry. */ +//private static int list_resize(PyListObject *self, Py_ssize_t newsize) { From 976327bf8da940f6b01f21446909ad1ab6560bb9 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 7 Feb 2024 14:03:41 -0500 Subject: [PATCH 0255/1086] fixed copyright headers --- include/BoolType.hh | 2 +- include/DateType.hh | 2 +- include/DictType.hh | 2 +- include/ExceptionType.hh | 2 +- include/FloatType.hh | 2 +- include/FuncType.hh | 2 +- include/IntType.hh | 2 +- include/JSObjectItemsProxy.hh | 1 - include/JSObjectIterProxy.hh | 1 - include/JSObjectKeysProxy.hh | 1 - include/JSObjectProxy.hh | 1 - include/JSObjectValuesProxy.hh | 3 +-- include/JobQueue.hh | 2 +- include/ListType.hh | 2 +- include/NoneType.hh | 2 +- include/NullType.hh | 2 +- include/PromiseType.hh | 2 +- include/PyEventLoop.hh | 2 +- include/PyType.hh | 2 +- include/StrType.hh | 2 +- include/TupleType.hh | 2 +- include/jsTypeFactory.hh | 2 +- include/modules/pythonmonkey/pythonmonkey.hh | 3 +-- include/pyTypeFactory.hh | 2 +- include/setSpiderMonkeyException.hh | 2 +- .../pythonmonkey/builtin_modules/XMLHttpRequest-internal.py | 1 + python/pythonmonkey/builtin_modules/XMLHttpRequest.js | 2 ++ python/pythonmonkey/builtin_modules/base64.py | 1 + python/pythonmonkey/builtin_modules/console.js | 2 ++ python/pythonmonkey/builtin_modules/event-target.js | 2 ++ python/pythonmonkey/builtin_modules/timers.js | 2 ++ python/pythonmonkey/builtin_modules/url.js | 2 ++ python/pythonmonkey/helpers.py | 1 + python/pythonmonkey/newfile.py | 6 ++++++ python/pythonmonkey/require.py | 1 + src/BoolType.cc | 2 +- src/DateType.cc | 2 +- src/DictType.cc | 2 +- src/ExceptionType.cc | 2 +- src/FloatType.cc | 2 +- src/FuncType.cc | 2 +- src/IntType.cc | 2 +- src/JSArrayProxy.cc | 2 +- src/JobQueue.cc | 2 +- src/NoneType.cc | 2 +- src/NullType.cc | 2 +- src/PromiseType.cc | 2 +- src/PyEventLoop.cc | 2 +- src/PyListProxyHandler.cc | 2 +- src/PyType.cc | 2 +- src/StrType.cc | 2 +- src/TupleType.cc | 2 +- src/setSpiderMonkeyException.cc | 2 +- 53 files changed, 59 insertions(+), 45 deletions(-) create mode 100644 python/pythonmonkey/newfile.py diff --git a/include/BoolType.hh b/include/BoolType.hh index 97274383..b282d70b 100644 --- a/include/BoolType.hh +++ b/include/BoolType.hh @@ -4,7 +4,7 @@ * @brief Struct for representing python bools * @date 2022-12-02 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/include/DateType.hh b/include/DateType.hh index 55ee1d6d..b213f2fe 100644 --- a/include/DateType.hh +++ b/include/DateType.hh @@ -4,7 +4,7 @@ * @brief Struct for representing python dates * @date 2022-12-21 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/include/DictType.hh b/include/DictType.hh index 1d2f0516..0f4a9415 100644 --- a/include/DictType.hh +++ b/include/DictType.hh @@ -4,7 +4,7 @@ * @brief Struct representing python dictionaries * @date 2022-08-10 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/include/ExceptionType.hh b/include/ExceptionType.hh index 7cff9952..f94a0fe5 100644 --- a/include/ExceptionType.hh +++ b/include/ExceptionType.hh @@ -4,7 +4,7 @@ * @brief Struct for representing Python Exception objects from a corresponding JS Error object * @date 2023-04-11 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/FloatType.hh b/include/FloatType.hh index 079ebca2..fb0620fa 100644 --- a/include/FloatType.hh +++ b/include/FloatType.hh @@ -4,7 +4,7 @@ * @brief Struct for representing python floats * @date 2022-12-02 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/include/FuncType.hh b/include/FuncType.hh index 1fb7e973..2d1e3979 100644 --- a/include/FuncType.hh +++ b/include/FuncType.hh @@ -4,7 +4,7 @@ * @brief Struct representing python functions * @date 2022-08-08 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/include/IntType.hh b/include/IntType.hh index 0cf2634a..0f7bee4a 100644 --- a/include/IntType.hh +++ b/include/IntType.hh @@ -4,7 +4,7 @@ * @brief Struct for representing python ints * @date 2023-03-16 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/JSObjectItemsProxy.hh b/include/JSObjectItemsProxy.hh index 91c8bc72..0584ad33 100644 --- a/include/JSObjectItemsProxy.hh +++ b/include/JSObjectItemsProxy.hh @@ -2,7 +2,6 @@ * @file JSObjectItemsProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectItemsProxy is a custom C-implemented python type that derives from dict items - * @version 0.1 * @date 2024-01-19 * * Copyright (c) 2024 Distributive Corp. diff --git a/include/JSObjectIterProxy.hh b/include/JSObjectIterProxy.hh index d6fb1452..d91ec489 100644 --- a/include/JSObjectIterProxy.hh +++ b/include/JSObjectIterProxy.hh @@ -2,7 +2,6 @@ * @file JSObjectIterProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectIterProxy is a custom C-implemented python type that derives from PyDictIterKey - * @version 0.1 * @date 2024-01-17 * * Copyright (c) 2024 Distributive Corp. diff --git a/include/JSObjectKeysProxy.hh b/include/JSObjectKeysProxy.hh index 1dea37be..59ed72af 100644 --- a/include/JSObjectKeysProxy.hh +++ b/include/JSObjectKeysProxy.hh @@ -2,7 +2,6 @@ * @file JSObjectKeysProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectKeysProxy is a custom C-implemented python type that derives from dict keys - * @version 0.1 * @date 2024-01-16 * * Copyright (c) 2024 Distributive Corp. diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 9e292e6a..04da6ab0 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -2,7 +2,6 @@ * @file JSObjectProxy.hh * @author Caleb Aikens (caleb@distributive.network) & Tom Tang (xmader@distributive.network) * @brief JSObjectProxy is a custom C-implemented python type that derives from dict. It acts as a proxy for JSObjects from Spidermonkey, and behaves like a dict would. - * @version 0.1 * @date 2023-06-26 * * Copyright (c) 2023 Distributive Corp. diff --git a/include/JSObjectValuesProxy.hh b/include/JSObjectValuesProxy.hh index 238d3066..0582e25b 100644 --- a/include/JSObjectValuesProxy.hh +++ b/include/JSObjectValuesProxy.hh @@ -2,8 +2,7 @@ * @file JSObjectValuesProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectValuesProxy is a custom C-implemented python type that derives from dict values - * @version 0.1 - * @date 2023-06-26 + * @date 2024-01-17 * * Copyright (c) 2023 Distributive Corp. * diff --git a/include/JobQueue.hh b/include/JobQueue.hh index ef68bf7e..d1d0a09e 100644 --- a/include/JobQueue.hh +++ b/include/JobQueue.hh @@ -4,7 +4,7 @@ * @brief Implement the ECMAScript Job Queue * @date 2023-04-03 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/ListType.hh b/include/ListType.hh index 28842a66..59004458 100644 --- a/include/ListType.hh +++ b/include/ListType.hh @@ -4,7 +4,7 @@ * @brief Struct for representing python lists * @date 2022-08-18 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/include/NoneType.hh b/include/NoneType.hh index bfd34169..c8b8b54d 100644 --- a/include/NoneType.hh +++ b/include/NoneType.hh @@ -4,7 +4,7 @@ * @brief Struct for representing None * @date 2023-02-22 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/NullType.hh b/include/NullType.hh index cdc5066f..35b539b7 100644 --- a/include/NullType.hh +++ b/include/NullType.hh @@ -4,7 +4,7 @@ * @brief Struct for representing JS null in a python object * @date 2023-02-22 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/PromiseType.hh b/include/PromiseType.hh index df8becea..d6992a8f 100644 --- a/include/PromiseType.hh +++ b/include/PromiseType.hh @@ -4,7 +4,7 @@ * @brief Struct for representing Promises * @date 2023-03-29 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/PyEventLoop.hh b/include/PyEventLoop.hh index dd833a04..3bbcbbb3 100644 --- a/include/PyEventLoop.hh +++ b/include/PyEventLoop.hh @@ -4,7 +4,7 @@ * @brief Send jobs to the Python event-loop * @date 2023-04-05 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/PyType.hh b/include/PyType.hh index e90180d4..33cc675c 100644 --- a/include/PyType.hh +++ b/include/PyType.hh @@ -4,7 +4,7 @@ * @brief Struct representing python types * @date 2022-07-27 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/include/StrType.hh b/include/StrType.hh index 409d52be..1e7c37dc 100644 --- a/include/StrType.hh +++ b/include/StrType.hh @@ -4,7 +4,7 @@ * @brief Struct for representing python strings * @date 2022-08-08 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/include/TupleType.hh b/include/TupleType.hh index e2b66e78..c406fc87 100644 --- a/include/TupleType.hh +++ b/include/TupleType.hh @@ -4,7 +4,7 @@ * @brief Struct for representing python tuples * @date 2022-08-19 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/include/jsTypeFactory.hh b/include/jsTypeFactory.hh index e3af11cc..a02dfcdb 100644 --- a/include/jsTypeFactory.hh +++ b/include/jsTypeFactory.hh @@ -4,7 +4,7 @@ * @brief * @date 2023-02-15 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/modules/pythonmonkey/pythonmonkey.hh b/include/modules/pythonmonkey/pythonmonkey.hh index 7f964bce..2c3bb2d7 100644 --- a/include/modules/pythonmonkey/pythonmonkey.hh +++ b/include/modules/pythonmonkey/pythonmonkey.hh @@ -2,10 +2,9 @@ * @file pythonmonkey.hh * @author Caleb Aikens (caleb@kingsds.network) * @brief This file defines the pythonmonkey module, along with its various functions. - * @version 0.1 * @date 2022-09-06 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ #ifndef PythonMonkey_Module_PythonMonkey diff --git a/include/pyTypeFactory.hh b/include/pyTypeFactory.hh index ecdaeac6..71c6abab 100644 --- a/include/pyTypeFactory.hh +++ b/include/pyTypeFactory.hh @@ -4,7 +4,7 @@ * @brief Function for wrapping arbitrary PyObjects into the appropriate PyType class, and coercing JS types to python types * @date 2022-08-08 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/include/setSpiderMonkeyException.hh b/include/setSpiderMonkeyException.hh index 5c24e794..aa388ca9 100644 --- a/include/setSpiderMonkeyException.hh +++ b/include/setSpiderMonkeyException.hh @@ -4,7 +4,7 @@ * @brief Call this function whenever a JS_* function call fails in order to set an appropriate python exception (remember to also return NULL) * @date 2023-02-28 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py index 0b19043f..7ab5ed24 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py @@ -2,6 +2,7 @@ # @brief internal helper functions for XMLHttpRequest # @author Tom Tang # @date August 2023 +# @copyright Copyright (c) 2023 Distributive Corp. import asyncio import aiohttp diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js index efdea02e..03a233ae 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest.js +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest.js @@ -4,6 +4,8 @@ * * @author Tom Tang * @date August 2023 + * + * @copyright Copyright (c) 2023 Distributive Corp. */ const { EventTarget, Event } = require('event-target'); diff --git a/python/pythonmonkey/builtin_modules/base64.py b/python/pythonmonkey/builtin_modules/base64.py index 196f48ff..7239911b 100644 --- a/python/pythonmonkey/builtin_modules/base64.py +++ b/python/pythonmonkey/builtin_modules/base64.py @@ -1,6 +1,7 @@ # @file base64.py # @author Tom Tang , Hamada Gasmallah # @date July 2023 +# @copyright Copyright (c) 2023 Distributive Corp. import base64 diff --git a/python/pythonmonkey/builtin_modules/console.js b/python/pythonmonkey/builtin_modules/console.js index 7bf6e2b4..4cdca634 100644 --- a/python/pythonmonkey/builtin_modules/console.js +++ b/python/pythonmonkey/builtin_modules/console.js @@ -2,6 +2,8 @@ * @file console.js * @author Tom Tang * @date June 2023 + * + * @copyright Copyright (c) 2023 Distributive Corp. */ const { customInspectSymbol, format } = require("util"); diff --git a/python/pythonmonkey/builtin_modules/event-target.js b/python/pythonmonkey/builtin_modules/event-target.js index b978c049..c2b1a7fb 100644 --- a/python/pythonmonkey/builtin_modules/event-target.js +++ b/python/pythonmonkey/builtin_modules/event-target.js @@ -4,6 +4,8 @@ * @see https://dom.spec.whatwg.org/#eventtarget * @author Tom Tang * @date August 2023 + * + * @copyright Copyright (c) 2023 Distributive Corp. */ /** diff --git a/python/pythonmonkey/builtin_modules/timers.js b/python/pythonmonkey/builtin_modules/timers.js index 862bccc1..51cd48c5 100644 --- a/python/pythonmonkey/builtin_modules/timers.js +++ b/python/pythonmonkey/builtin_modules/timers.js @@ -2,6 +2,8 @@ * @file timers.js * @author Tom Tang * @date May 2023 + * + * @copyright Copyright (c) 2023 Distributive Corp. */ const internalBinding = require('internal-binding'); diff --git a/python/pythonmonkey/builtin_modules/url.js b/python/pythonmonkey/builtin_modules/url.js index 8d13806f..1419b5b1 100644 --- a/python/pythonmonkey/builtin_modules/url.js +++ b/python/pythonmonkey/builtin_modules/url.js @@ -4,6 +4,8 @@ * * @author Tom Tang * @date August 2023 + * + * @copyright Copyright (c) 2023 Distributive Corp. */ // Apply polyfills from core-js diff --git a/python/pythonmonkey/helpers.py b/python/pythonmonkey/helpers.py index a491cb57..638a76a0 100644 --- a/python/pythonmonkey/helpers.py +++ b/python/pythonmonkey/helpers.py @@ -5,6 +5,7 @@ # @author Wes Garland, wes@distributive.network # @date July 2023 # +# @copyright Copyright (c) 2023 Distributive Corp. from . import pythonmonkey as pm evalOpts = { 'filename': __file__, 'fromPythonFrame': True } diff --git a/python/pythonmonkey/newfile.py b/python/pythonmonkey/newfile.py new file mode 100644 index 00000000..484eb717 --- /dev/null +++ b/python/pythonmonkey/newfile.py @@ -0,0 +1,6 @@ +import pythonmonkey as pm + +#likes = pm.eval('({"color": "blue", "fruit": "apple", "pet": "dog"})') + +CryptoJS = pm.require('crypto-js') +CryptoJS diff --git a/python/pythonmonkey/require.py b/python/pythonmonkey/require.py index a19ba2be..8f56ec16 100644 --- a/python/pythonmonkey/require.py +++ b/python/pythonmonkey/require.py @@ -22,6 +22,7 @@ # @author Wes Garland, wes@distributive.network # @date May 2023 # +# @copyright Copyright (c) 2023 Distributive Corp. import sys, os, io from typing import Union, Dict, Literal, List diff --git a/src/BoolType.cc b/src/BoolType.cc index 2e70b472..b45d5f7d 100644 --- a/src/BoolType.cc +++ b/src/BoolType.cc @@ -4,7 +4,7 @@ * @brief Struct for representing python bools * @date 2022-12-02 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/src/DateType.cc b/src/DateType.cc index 9aebee8b..a2708955 100644 --- a/src/DateType.cc +++ b/src/DateType.cc @@ -4,7 +4,7 @@ * @brief Struct for representing python dates * @date 2022-12-21 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/src/DictType.cc b/src/DictType.cc index eaf2ca65..c24eabf8 100644 --- a/src/DictType.cc +++ b/src/DictType.cc @@ -4,7 +4,7 @@ * @brief Struct representing python dictionaries * @date 2022-08-10 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/src/ExceptionType.cc b/src/ExceptionType.cc index 6cb0b5bc..361d0d18 100644 --- a/src/ExceptionType.cc +++ b/src/ExceptionType.cc @@ -4,7 +4,7 @@ * @brief Struct for representing Python Exception objects from a corresponding JS Error object * @date 2023-04-11 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/src/FloatType.cc b/src/FloatType.cc index 1dcd4e51..bd7a74a8 100644 --- a/src/FloatType.cc +++ b/src/FloatType.cc @@ -4,7 +4,7 @@ * @brief Struct for representing python floats * @date 2022-12-02 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/src/FuncType.cc b/src/FuncType.cc index 1ad47e90..fca424d5 100644 --- a/src/FuncType.cc +++ b/src/FuncType.cc @@ -4,7 +4,7 @@ * @brief Struct representing python functions * @date 2022-08-08 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/src/IntType.cc b/src/IntType.cc index b371f3b2..841e90eb 100644 --- a/src/IntType.cc +++ b/src/IntType.cc @@ -4,7 +4,7 @@ * @brief Struct for representing python ints * @date 2023-03-16 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 774eee02..a5c555b9 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -4,7 +4,7 @@ * @brief JSArrayProxy is a custom C-implemented python type that derives from list. It acts as a proxy for JSArrays from Spidermonkey, and behaves like a list would. * @date 2023-11-22 * - * Copyright (c) 2023 Distributive Corp. + * Copyright (c) 2023-2024 Distributive Corp. * */ diff --git a/src/JobQueue.cc b/src/JobQueue.cc index ba6e5a66..6e8f6e7a 100644 --- a/src/JobQueue.cc +++ b/src/JobQueue.cc @@ -4,7 +4,7 @@ * @brief Implement the ECMAScript Job Queue * @date 2023-04-03 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/src/NoneType.cc b/src/NoneType.cc index 80ecc2b9..5c448c51 100644 --- a/src/NoneType.cc +++ b/src/NoneType.cc @@ -4,7 +4,7 @@ * @brief Struct for representing None * @date 2023-02-22 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/src/NullType.cc b/src/NullType.cc index 0748fca0..a63e8e46 100644 --- a/src/NullType.cc +++ b/src/NullType.cc @@ -4,7 +4,7 @@ * @brief Struct for representing JS null in a python object * @date 2023-02-22 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/src/PromiseType.cc b/src/PromiseType.cc index becf7e91..55ceefa7 100644 --- a/src/PromiseType.cc +++ b/src/PromiseType.cc @@ -4,7 +4,7 @@ * @brief Struct for representing Promises * @date 2023-03-29 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/src/PyEventLoop.cc b/src/PyEventLoop.cc index e9ce4df7..160105a8 100644 --- a/src/PyEventLoop.cc +++ b/src/PyEventLoop.cc @@ -4,7 +4,7 @@ * @brief Send jobs to the Python event-loop * @date 2023-04-05 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 436c43d2..dacb92f3 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2052,7 +2052,7 @@ void PyListProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { * Note that self->ob_item may change, and even if newsize is less * than ob_size on entry. */ -//private +// private static int list_resize(PyListObject *self, Py_ssize_t newsize) { diff --git a/src/PyType.cc b/src/PyType.cc index d9881c42..abbcdb9e 100644 --- a/src/PyType.cc +++ b/src/PyType.cc @@ -4,7 +4,7 @@ * @brief Struct representing python types * @date 2022-07-27 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/src/StrType.cc b/src/StrType.cc index 3f412301..bd2c0176 100644 --- a/src/StrType.cc +++ b/src/StrType.cc @@ -4,7 +4,7 @@ * @brief Struct for representing python strings * @date 2022-08-08 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/src/TupleType.cc b/src/TupleType.cc index 9b2046d7..f3da52fe 100644 --- a/src/TupleType.cc +++ b/src/TupleType.cc @@ -4,7 +4,7 @@ * @brief Struct for representing python tuples * @date 2022-08-19 * - * @copyright Copyright (c) 2022 + * @copyright Copyright (c) 2022 Distributive Corp. * */ diff --git a/src/setSpiderMonkeyException.cc b/src/setSpiderMonkeyException.cc index 285f68b6..9826771f 100644 --- a/src/setSpiderMonkeyException.cc +++ b/src/setSpiderMonkeyException.cc @@ -4,7 +4,7 @@ * @brief Call this function whenever a JS_* function call fails in order to set an appropriate python exception (remember to also return NULL) * @date 2023-02-28 * - * @copyright Copyright (c) 2023 + * @copyright Copyright (c) 2023 Distributive Corp. * */ From 1884f79f6557da0eb30dda62f645d5fd35dbd9a4 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 7 Feb 2024 14:13:44 -0500 Subject: [PATCH 0256/1086] uniform copyright headers --- include/JSArrayIterProxy.hh | 2 +- include/JSArrayProxy.hh | 2 +- include/JSFunctionProxy.hh | 2 +- include/JSMethodProxy.hh | 2 +- include/JSObjectItemsProxy.hh | 2 +- include/JSObjectIterProxy.hh | 2 +- include/JSObjectKeysProxy.hh | 2 +- include/JSObjectProxy.hh | 2 +- include/JSObjectValuesProxy.hh | 2 +- include/JSStringProxy.hh | 2 +- include/PyBaseProxyHandler.hh | 2 +- include/PyDictProxyHandler.hh | 2 +- include/PyListProxyHandler.hh | 2 +- include/PyObjectProxyHandler.hh | 2 +- src/JSArrayIterProxy.cc | 2 +- src/JSArrayProxy.cc | 2 +- src/JSFunctionProxy.cc | 2 +- src/JSMethodProxy.cc | 2 +- src/JSObjectItemsProxy.cc | 2 +- src/JSObjectIterProxy.cc | 2 +- src/JSObjectKeysProxy.cc | 2 +- src/JSObjectProxy.cc | 2 +- src/JSObjectValuesProxy.cc | 2 +- src/PyBaseProxyHandler.cc | 2 +- src/PyDictProxyHandler.cc | 2 +- src/PyListProxyHandler.cc | 2 +- src/PyObjectProxyHandler.cc | 2 +- src/internalBinding/timers.cc | 2 ++ src/internalBinding/utils.cc | 2 ++ 29 files changed, 31 insertions(+), 27 deletions(-) diff --git a/include/JSArrayIterProxy.hh b/include/JSArrayIterProxy.hh index a4a9e660..ff23e880 100644 --- a/include/JSArrayIterProxy.hh +++ b/include/JSArrayIterProxy.hh @@ -5,7 +5,7 @@ * @version 0.1 * @date 2024-01-15 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh index ff2bb482..efc53afa 100644 --- a/include/JSArrayProxy.hh +++ b/include/JSArrayProxy.hh @@ -5,7 +5,7 @@ * @version 0.1 * @date 2023-11-22 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/JSFunctionProxy.hh b/include/JSFunctionProxy.hh index f0e95554..82109b63 100644 --- a/include/JSFunctionProxy.hh +++ b/include/JSFunctionProxy.hh @@ -4,7 +4,7 @@ * @brief JSFunctionProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a function would. * @date 2023-09-28 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/JSMethodProxy.hh b/include/JSMethodProxy.hh index ffa02308..680db116 100644 --- a/include/JSMethodProxy.hh +++ b/include/JSMethodProxy.hh @@ -4,7 +4,7 @@ * @brief JSMethodProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a method would, treating `self` as `this`. * @date 2023-11-14 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/JSObjectItemsProxy.hh b/include/JSObjectItemsProxy.hh index 0584ad33..480a48ae 100644 --- a/include/JSObjectItemsProxy.hh +++ b/include/JSObjectItemsProxy.hh @@ -4,7 +4,7 @@ * @brief JSObjectItemsProxy is a custom C-implemented python type that derives from dict items * @date 2024-01-19 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSObjectIterProxy.hh b/include/JSObjectIterProxy.hh index d91ec489..d8f46075 100644 --- a/include/JSObjectIterProxy.hh +++ b/include/JSObjectIterProxy.hh @@ -4,7 +4,7 @@ * @brief JSObjectIterProxy is a custom C-implemented python type that derives from PyDictIterKey * @date 2024-01-17 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSObjectKeysProxy.hh b/include/JSObjectKeysProxy.hh index 59ed72af..2564bb3f 100644 --- a/include/JSObjectKeysProxy.hh +++ b/include/JSObjectKeysProxy.hh @@ -4,7 +4,7 @@ * @brief JSObjectKeysProxy is a custom C-implemented python type that derives from dict keys * @date 2024-01-16 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 04da6ab0..1bf8ef49 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -4,7 +4,7 @@ * @brief JSObjectProxy is a custom C-implemented python type that derives from dict. It acts as a proxy for JSObjects from Spidermonkey, and behaves like a dict would. * @date 2023-06-26 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/JSObjectValuesProxy.hh b/include/JSObjectValuesProxy.hh index 0582e25b..fbce05d1 100644 --- a/include/JSObjectValuesProxy.hh +++ b/include/JSObjectValuesProxy.hh @@ -4,7 +4,7 @@ * @brief JSObjectValuesProxy is a custom C-implemented python type that derives from dict values * @date 2024-01-17 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/JSStringProxy.hh b/include/JSStringProxy.hh index 35d9f7ed..8c82374c 100644 --- a/include/JSStringProxy.hh +++ b/include/JSStringProxy.hh @@ -4,7 +4,7 @@ * @brief JSStringProxy is a custom C-implemented python type that derives from str. It acts as a proxy for JSStrings from Spidermonkey, and behaves like a str would. * @date 2024-01-03 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/PyBaseProxyHandler.hh b/include/PyBaseProxyHandler.hh index 58993228..4f36188f 100644 --- a/include/PyBaseProxyHandler.hh +++ b/include/PyBaseProxyHandler.hh @@ -4,7 +4,7 @@ * @brief Structs for creating JS proxy objects. * @date 2023-04-20 * - * Copyright (c) 2023-2024 Distributive Corp. + * @copyright Copyright (c) 2023-2024 Distributive Corp. * */ diff --git a/include/PyDictProxyHandler.hh b/include/PyDictProxyHandler.hh index d7843bd0..f8e1822b 100644 --- a/include/PyDictProxyHandler.hh +++ b/include/PyDictProxyHandler.hh @@ -4,7 +4,7 @@ * @brief Structs for creating JS proxy objects. Used by DictType for object coercion * @date 2023-04-20 * - * Copyright (c) 2023-2024 Distributive Corp. + * @copyright Copyright (c) 2023-2024 Distributive Corp. * */ diff --git a/include/PyListProxyHandler.hh b/include/PyListProxyHandler.hh index b94c9057..3c564165 100644 --- a/include/PyListProxyHandler.hh +++ b/include/PyListProxyHandler.hh @@ -4,7 +4,7 @@ * @brief Structs for creating JS proxy objects. Used by ListType for List coercion * @date 2023-12-01 * - * Copyright (c) 2023-2024 Distributive Corp. + * @copyright Copyright (c) 2023-2024 Distributive Corp. * */ diff --git a/include/PyObjectProxyHandler.hh b/include/PyObjectProxyHandler.hh index ce003eea..2577d5ce 100644 --- a/include/PyObjectProxyHandler.hh +++ b/include/PyObjectProxyHandler.hh @@ -4,7 +4,7 @@ * @brief Structs for creating JS proxy objects. Used for default object coercion * @date 2024-01-25 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/src/JSArrayIterProxy.cc b/src/JSArrayIterProxy.cc index f63b278a..f7a73b36 100644 --- a/src/JSArrayIterProxy.cc +++ b/src/JSArrayIterProxy.cc @@ -4,7 +4,7 @@ * @brief JSArrayIterProxy is a custom C-implemented python type that derives from list iterator * @date 2024-01-15 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index a5c555b9..7febaa82 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -4,7 +4,7 @@ * @brief JSArrayProxy is a custom C-implemented python type that derives from list. It acts as a proxy for JSArrays from Spidermonkey, and behaves like a list would. * @date 2023-11-22 * - * Copyright (c) 2023-2024 Distributive Corp. + * @copyright Copyright (c) 2023-2024 Distributive Corp. * */ diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc index b23c35d9..f950b357 100644 --- a/src/JSFunctionProxy.cc +++ b/src/JSFunctionProxy.cc @@ -4,7 +4,7 @@ * @brief JSFunctionProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a function would. * @date 2023-09-28 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/src/JSMethodProxy.cc b/src/JSMethodProxy.cc index 5df87d48..ef05a497 100644 --- a/src/JSMethodProxy.cc +++ b/src/JSMethodProxy.cc @@ -4,7 +4,7 @@ * @brief JSMethodProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a method would, treating `self` as `this`. * @date 2023-11-14 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/src/JSObjectItemsProxy.cc b/src/JSObjectItemsProxy.cc index 39877255..117b7d4c 100644 --- a/src/JSObjectItemsProxy.cc +++ b/src/JSObjectItemsProxy.cc @@ -4,7 +4,7 @@ * @brief JSObjectItemsProxy is a custom C-implemented python type that derives from dict keys * @date 2024-01-19 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/src/JSObjectIterProxy.cc b/src/JSObjectIterProxy.cc index 3b17d739..e720d496 100644 --- a/src/JSObjectIterProxy.cc +++ b/src/JSObjectIterProxy.cc @@ -4,7 +4,7 @@ * @brief JSObjectIterProxy is a custom C-implemented python type that derives from list iterator * @date 2024-01-17 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/src/JSObjectKeysProxy.cc b/src/JSObjectKeysProxy.cc index d4733c7b..ddb6d2b0 100644 --- a/src/JSObjectKeysProxy.cc +++ b/src/JSObjectKeysProxy.cc @@ -4,7 +4,7 @@ * @brief JSObjectKeysProxy is a custom C-implemented python type that derives from dict keys * @date 2024-01-18 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 77ed0eaf..6d476c2c 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -4,7 +4,7 @@ * @brief JSObjectProxy is a custom C-implemented python type that derives from dict. It acts as a proxy for JSObjects from Spidermonkey, and behaves like a dict would. * @date 2023-06-26 * - * Copyright (c) 2023-2024 Distributive Corp. + * @copyright Copyright (c) 2023-2024 Distributive Corp. * */ diff --git a/src/JSObjectValuesProxy.cc b/src/JSObjectValuesProxy.cc index a6dc5c45..ef83492f 100644 --- a/src/JSObjectValuesProxy.cc +++ b/src/JSObjectValuesProxy.cc @@ -4,7 +4,7 @@ * @brief JSObjectValuesProxy is a custom C-implemented python type that derives from dict values * @date 2024-01-19 * - * Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2024 Distributive Corp. * */ diff --git a/src/PyBaseProxyHandler.cc b/src/PyBaseProxyHandler.cc index 1e86eac5..6c6f33ae 100644 --- a/src/PyBaseProxyHandler.cc +++ b/src/PyBaseProxyHandler.cc @@ -4,7 +4,7 @@ * @brief Struct for creating JS proxy objects * @date 2023-04-20 * - * Copyright (c) 2023-2024 Distributive Corp. + * @copyright Copyright (c) 2023-2024 Distributive Corp. * */ diff --git a/src/PyDictProxyHandler.cc b/src/PyDictProxyHandler.cc index af3902f7..1b18b822 100644 --- a/src/PyDictProxyHandler.cc +++ b/src/PyDictProxyHandler.cc @@ -4,7 +4,7 @@ * @brief Struct for creating JS proxy objects. Used by DictType for object coercion TODO * @date 2023-04-20 * - * Copyright (c) 2023-2024 Distributive Corp. + * @copyright Copyright (c) 2023-2024 Distributive Corp. * */ diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index dacb92f3..3a204f64 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -4,7 +4,7 @@ * @brief Struct for creating JS proxy objects. Used by ListType for List coercion * @date 2023-12-01 * - * Copyright (c) 2023-2024 Distributive Corp. + * @copyright Copyright (c) 2023-2024 Distributive Corp. * */ diff --git a/src/PyObjectProxyHandler.cc b/src/PyObjectProxyHandler.cc index 4f523b10..1e3213f5 100644 --- a/src/PyObjectProxyHandler.cc +++ b/src/PyObjectProxyHandler.cc @@ -4,7 +4,7 @@ * @brief * @date 2024-01-30 * - * Copyright (c) 2023 Distributive Corp. + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/src/internalBinding/timers.cc b/src/internalBinding/timers.cc index fc30df42..a37fae11 100644 --- a/src/internalBinding/timers.cc +++ b/src/internalBinding/timers.cc @@ -2,6 +2,8 @@ * @file timers.cc * @author Tom Tang (xmader@distributive.network) * @brief Implement functions in `internalBinding("timers")` + * + * @copyright Copyright (c) 2023 Distributive Corp. */ #include "include/internalBinding.hh" diff --git a/src/internalBinding/utils.cc b/src/internalBinding/utils.cc index 2104a264..ac61fc80 100644 --- a/src/internalBinding/utils.cc +++ b/src/internalBinding/utils.cc @@ -2,6 +2,8 @@ * @file utils.cc * @author Tom Tang (xmader@distributive.network) * @brief Implement functions in `internalBinding("utils")` + * + * @copyright Copyright (c) 2023 Distributive Corp. */ #include "include/internalBinding.hh" From bcf55ae709524b2bebac2e6997442c2fb736bfbd Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 7 Feb 2024 14:21:07 -0500 Subject: [PATCH 0257/1086] last missing copyrights. license statements fixes --- include/modules/pythonmonkey/pythonmonkey.hh | 2 +- .../pythonmonkey/builtin_modules/dom-exception.js | 2 ++ python/pythonmonkey/builtin_modules/util.js | 13 ++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/modules/pythonmonkey/pythonmonkey.hh b/include/modules/pythonmonkey/pythonmonkey.hh index 2c3bb2d7..91fdf8c1 100644 --- a/include/modules/pythonmonkey/pythonmonkey.hh +++ b/include/modules/pythonmonkey/pythonmonkey.hh @@ -4,7 +4,7 @@ * @brief This file defines the pythonmonkey module, along with its various functions. * @date 2022-09-06 * - * @copyright Copyright (c) 2022 Distributive Corp. + * @copyright Copyright (c) 2022-2024 Distributive Corp. * */ #ifndef PythonMonkey_Module_PythonMonkey diff --git a/python/pythonmonkey/builtin_modules/dom-exception.js b/python/pythonmonkey/builtin_modules/dom-exception.js index d6cc2971..40cf427d 100644 --- a/python/pythonmonkey/builtin_modules/dom-exception.js +++ b/python/pythonmonkey/builtin_modules/dom-exception.js @@ -4,6 +4,8 @@ * * @author Tom Tang * @date August 2023 + * + * @copyright Copyright (c) 2023 Distributive Corp. */ // Apply polyfill from core-js diff --git a/python/pythonmonkey/builtin_modules/util.js b/python/pythonmonkey/builtin_modules/util.js index dbe2fccb..a482c191 100644 --- a/python/pythonmonkey/builtin_modules/util.js +++ b/python/pythonmonkey/builtin_modules/util.js @@ -5,6 +5,8 @@ * * @author Tom Tang * @date June 2023 + * + * @copyright Copyright (c) 2023 Distributive Corp. */ const internalBinding = require("internal-binding") @@ -84,7 +86,6 @@ function objectToString(o) { } // https://github.com/nodejs/node/blob/v8.17.0/lib/internal/util.js#L189-L202 -// MIT License function getConstructorOf(obj) { while (obj) { var descriptor = Object.getOwnPropertyDescriptor(obj, 'constructor'); @@ -100,10 +101,8 @@ function getConstructorOf(obj) { return null; } -/*! - * Modified from https://github.com/nodejs/node/blob/v8.17.0/lib/util.js#L59-L852 - * Node.js - * MIT License, Copyright Joyent, Inc. and other Node contributors. +/*! Start verbatim Node.js + * https://github.com/nodejs/node/blob/v8.17.0/lib/util.js#L59-L852 */ const inspectDefaultOptions = Object.seal({ showHidden: false, @@ -896,11 +895,11 @@ function reduceToSingleString(ctx, output, base, braces, addLn) { } /*! - * End of Node.js code + * End of verbatim Node.js excerpt */ module.exports = exports = { customInspectSymbol, format, inspect, -}; +}; \ No newline at end of file From e2f446e59c6083c80ec851847afda3c3184cca1a Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 7 Feb 2024 16:09:49 -0500 Subject: [PATCH 0258/1086] improved comment --- src/PyListProxyHandler.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 3a204f64..55e32ba8 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2136,7 +2136,7 @@ bool PyListProxyHandler::defineProperty( JS::RootedValue itemV(cx, desc.value()); PyObject *item = pyTypeFactory(cx, global, itemV)->getPyObject(); if (PyList_SetItem(pyObject, index, item) < 0) { - // expand + // we are out-of-bounds and need to expand Py_XINCREF(item); Py_ssize_t oldLen = PyList_GET_SIZE(pyObject); if (list_resize((PyListObject *)pyObject, index + 1) < 0) { @@ -2144,6 +2144,7 @@ bool PyListProxyHandler::defineProperty( return result.failBadIndex(); } PyList_SET_ITEM((PyListObject *)pyObject, index, item); + // fill the space until the inserted index for (Py_ssize_t i = oldLen; i < index; i++) { Py_INCREF(Py_None); PyList_SET_ITEM((PyListObject *)pyObject, i, Py_None); From 5153405399d17f755e422c02f12976c442f19fde Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Thu, 8 Feb 2024 09:59:06 -0500 Subject: [PATCH 0259/1086] logic improvement --- src/PyListProxyHandler.cc | 87 ++----------------------------------- tests/python/test_arrays.py | 14 +++--- 2 files changed, 10 insertions(+), 91 deletions(-) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 55e32ba8..14b0251c 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2039,82 +2039,6 @@ void PyListProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { } } -/* Ensure ob_item has room for at least newsize elements, and set - * ob_size to newsize. If newsize > ob_size on entry, the content - * of the new slots at exit is undefined heap trash; it's the caller's - * responsibility to overwrite them with sane values. - * The number of allocated elements may grow, shrink, or stay the same. - * Failure is impossible if newsize <= self.allocated on entry, although - * that partly relies on an assumption that the system realloc() never - * fails when passed a number of bytes <= the number of bytes last - * allocated (the C standard doesn't guarantee this, but it's hard to - * imagine a realloc implementation where it wouldn't be true). - * Note that self->ob_item may change, and even if newsize is less - * than ob_size on entry. - */ -// private -static int -list_resize(PyListObject *self, Py_ssize_t newsize) -{ - PyObject **items; - size_t new_allocated, num_allocated_bytes; - Py_ssize_t allocated = self->allocated; - - /* Bypass realloc() when a previous overallocation is large enough - to accommodate the newsize. If the newsize falls lower than half - the allocated size, then proceed with the realloc() to shrink the list. - */ - if (allocated >= newsize && newsize >= (allocated >> 1)) { - assert(self->ob_item != NULL || newsize == 0); - #if PY_VERSION_HEX >= 0x03090000 // 3.9 - Py_SET_SIZE(self, newsize); - #else - Py_SIZE(self) = newsize; - #endif - return 0; - } - - /* This over-allocates proportional to the list size, making room - * for additional growth. The over-allocation is mild, but is - * enough to give linear-time amortized behavior over a long - * sequence of appends() in the presence of a poorly-performing - * system realloc(). - * Add padding to make the allocated size multiple of 4. - * The growth pattern is: 0, 4, 8, 16, 24, 32, 40, 52, 64, 76, ... - * Note: new_allocated won't overflow because the largest possible value - * is PY_SSIZE_T_MAX * (9 / 8) + 6 which always fits in a size_t. - */ - new_allocated = ((size_t)newsize + (newsize >> 3) + 6) & ~(size_t)3; - /* Do not overallocate if the new size is closer to overallocated size - * than to the old size. - */ - if (newsize - Py_SIZE(self) > (Py_ssize_t)(new_allocated - newsize)) - new_allocated = ((size_t)newsize + 3) & ~(size_t)3; - - if (newsize == 0) - new_allocated = 0; - if (new_allocated <= (size_t)PY_SSIZE_T_MAX / sizeof(PyObject *)) { - num_allocated_bytes = new_allocated * sizeof(PyObject *); - items = (PyObject **)PyMem_Realloc(self->ob_item, num_allocated_bytes); - } - else { - // integer overflow - items = NULL; - } - if (items == NULL) { - PyErr_NoMemory(); - return -1; - } - self->ob_item = items; - #if PY_VERSION_HEX >= 0x03090000 // 3.9 - Py_SET_SIZE(self, newsize); - #else - Py_SIZE(self) = newsize; - #endif - self->allocated = new_allocated; - return 0; -} - bool PyListProxyHandler::defineProperty( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::Handle desc, JS::ObjectOpResult &result @@ -2137,18 +2061,13 @@ bool PyListProxyHandler::defineProperty( PyObject *item = pyTypeFactory(cx, global, itemV)->getPyObject(); if (PyList_SetItem(pyObject, index, item) < 0) { // we are out-of-bounds and need to expand - Py_XINCREF(item); Py_ssize_t oldLen = PyList_GET_SIZE(pyObject); - if (list_resize((PyListObject *)pyObject, index + 1) < 0) { - Py_XDECREF(item); - return result.failBadIndex(); - } - PyList_SET_ITEM((PyListObject *)pyObject, index, item); // fill the space until the inserted index for (Py_ssize_t i = oldLen; i < index; i++) { - Py_INCREF(Py_None); - PyList_SET_ITEM((PyListObject *)pyObject, i, Py_None); + PyList_Append(pyObject, Py_None); } + // insert the item + PyList_Append(pyObject, item); // clear pending exception PyErr_Clear(); diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 44bd79a8..e8bb96b4 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -1769,19 +1769,19 @@ def test_array_from(): assert result[0] is not items # bad index size expansion -def test_assign_generic_dict_bad_index(): - items = [1,2,3] - result = [] - pm.eval("(result, arr) => {result[0] = arr[Symbol.iterator]() }")(result, items) - assert repr(result) == "[]" - def test_assign_bad_index(): items = [1,2,3] result = [] pm.eval("(result, arr) => {result[0] = 4}")(result, items) assert result[0] == 4 -def test_assign_bad_index(): +def test_assign_bad_index_with_existing_next(): + items = [1,2,3] + result = [8] + pm.eval("(result, arr) => {result[1] = 4}")(result, items) + assert result == [8,4] + +def test_assign_bad_index_with_gap(): items = [1,2,3] result = [] pm.eval("(result, arr) => {result[0] = 4; result[5] = 6}")(result, items) From 454b943cd70490889f40e7af05bf19db0105b3c9 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Thu, 8 Feb 2024 10:00:17 -0500 Subject: [PATCH 0260/1086] improved naming --- src/PyListProxyHandler.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 14b0251c..45b62e4b 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2061,9 +2061,9 @@ bool PyListProxyHandler::defineProperty( PyObject *item = pyTypeFactory(cx, global, itemV)->getPyObject(); if (PyList_SetItem(pyObject, index, item) < 0) { // we are out-of-bounds and need to expand - Py_ssize_t oldLen = PyList_GET_SIZE(pyObject); + Py_ssize_t len = PyList_GET_SIZE(pyObject); // fill the space until the inserted index - for (Py_ssize_t i = oldLen; i < index; i++) { + for (Py_ssize_t i = len; i < index; i++) { PyList_Append(pyObject, Py_None); } // insert the item From a26680ea1fc55cfc64da8bb7db1f93996ce2d5e7 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Thu, 8 Feb 2024 13:34:55 -0500 Subject: [PATCH 0261/1086] cleanup --- src/PyListProxyHandler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 45b62e4b..7bc51c28 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -2066,7 +2066,7 @@ bool PyListProxyHandler::defineProperty( for (Py_ssize_t i = len; i < index; i++) { PyList_Append(pyObject, Py_None); } - // insert the item + PyList_Append(pyObject, item); // clear pending exception From 20013a405bbd7cd803ccd165d0b108e21240adcc Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Thu, 8 Feb 2024 14:46:59 -0500 Subject: [PATCH 0262/1086] project at advanced stage --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6586eeaa..d1e3102b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ using the Python engine to provide the Javascript host environment. We feature JavaScript Array and Object methods implemented on Python List and Dictionaries using the cPython C API, and the inverse using the Mozilla Firefox Spidermonkey JavaScript C++ API. -This product is in an intermediate stage, approximately 90% to MVP as of January 2024. It is under active development by [Distributive](https://distributive.network/). +This product is in an advanced stage, approximately 90% to MVP as of January 2024. It is under active development by [Distributive](https://distributive.network/). External contributions and feedback are welcome and encouraged. ### tl;dr From d946421c2ef75e10f7c7f527f0d473bb087b3cde Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 8 Feb 2024 15:13:29 -0500 Subject: [PATCH 0263/1086] copyright headers missing and documentation cleanup --- README.md | 3 --- .../XMLHttpRequest-internal.d.ts | 2 ++ .../pythonmonkey/builtin_modules/base64.d.ts | 2 ++ .../builtin_modules/dom-exception.d.ts | 5 ---- .../builtin_modules/internal-binding.d.ts | 2 ++ python/pythonmonkey/pythonmonkey.pyi | 24 +------------------ 6 files changed, 7 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index d1e3102b..7a26808b 100644 --- a/README.md +++ b/README.md @@ -149,9 +149,6 @@ These methods are exported from the pythonmonkey module. * isCompilableUnit(code) * collect() * bigint(int) -* `SpiderMonkeyError` -* `JSObjectProxy` -* `null` See definitions in [python/pythonmonkey/pythonmonkey.pyi](https://github.com/Distributive-Network/PythonMonkey/blob/main/python/pythonmonkey/pythonmonkey.pyi). diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts index d6b88f56..bdb159b0 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.d.ts @@ -3,6 +3,8 @@ * @brief TypeScript type declarations for the internal XMLHttpRequest helpers * @author Tom Tang * @date August 2023 + * + * @copyright Copyright (c) 2023 Distributive Corp. */ /** diff --git a/python/pythonmonkey/builtin_modules/base64.d.ts b/python/pythonmonkey/builtin_modules/base64.d.ts index a1a3c38a..6575386f 100644 --- a/python/pythonmonkey/builtin_modules/base64.d.ts +++ b/python/pythonmonkey/builtin_modules/base64.d.ts @@ -3,6 +3,8 @@ * @brief TypeScript type declarations for base64.py * @author Tom Tang * @date July 2023 + * + * @copyright Copyright (c) 2023 Distributive Corp. */ /** diff --git a/python/pythonmonkey/builtin_modules/dom-exception.d.ts b/python/pythonmonkey/builtin_modules/dom-exception.d.ts index 849c1882..e37f747b 100644 --- a/python/pythonmonkey/builtin_modules/dom-exception.d.ts +++ b/python/pythonmonkey/builtin_modules/dom-exception.d.ts @@ -2,11 +2,6 @@ * @file dom-exception.d.ts * Type definitions for DOMException * - * @author Tom Tang - * @date August 2023 - */ - -/*! * Copied from https://www.npmjs.com/package/@types/web * Apache License 2.0 */ diff --git a/python/pythonmonkey/builtin_modules/internal-binding.d.ts b/python/pythonmonkey/builtin_modules/internal-binding.d.ts index 3fbf441e..ec01c598 100644 --- a/python/pythonmonkey/builtin_modules/internal-binding.d.ts +++ b/python/pythonmonkey/builtin_modules/internal-binding.d.ts @@ -2,6 +2,8 @@ * @file internal-binding.d.ts * @author Tom Tang * @date June 2023 + * + * @copyright Copyright (c) 2023 Distributive Corp. */ /** diff --git a/python/pythonmonkey/pythonmonkey.pyi b/python/pythonmonkey/pythonmonkey.pyi index 15bed09d..3c0c1c06 100644 --- a/python/pythonmonkey/pythonmonkey.pyi +++ b/python/pythonmonkey/pythonmonkey.pyi @@ -1,5 +1,4 @@ """ -stub file for type hints & documentations for the native module @see https://typing.readthedocs.io/en/latest/source/stubs.html """ @@ -48,25 +47,4 @@ def internalBinding(namespace: str) -> JSObjectProxy: def collect() -> None: """ Calls the spidermonkey garbage collector - """ - -class bigint(int): - """ - Representing JavaScript BigInt in Python - """ - -class SpiderMonkeyError(Exception): - """ - Representing a corresponding JS Error in Python - """ - -class JSObjectProxy(dict): - """ - JavaScript Object proxy dict - """ - def __init__(self) -> None: ... - -null = _typing.Annotated[ - _typing.NewType("pythonmonkey.null", object), - "Representing the JS null type in Python using a singleton object", -] + """ \ No newline at end of file From 1f42778740b89e8f6947b13b2c6b4c80267f298c Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 8 Feb 2024 15:53:15 -0500 Subject: [PATCH 0264/1086] further cleanup and missing copyrights --- build.py | 2 ++ python/pythonmonkey/lib/pmdb.py | 1 + python/pythonmonkey/lib/pmjs/global-init.js | 2 ++ python/pythonmonkey/pythonmonkey.pyi | 7 ------- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/build.py b/build.py index 36a0d26c..0d10b2bc 100644 --- a/build.py +++ b/build.py @@ -2,7 +2,9 @@ # Main PythonMonkey build automation script. Run with `poetry build`. # @author Hamada Gasmallah, hamada@distributive.network # @date April 2023 +# @copyright Copyright (c) 2023 Distributive Corp. # + import subprocess import os, sys import platform diff --git a/python/pythonmonkey/lib/pmdb.py b/python/pythonmonkey/lib/pmdb.py index 13a6565f..a79fe823 100644 --- a/python/pythonmonkey/lib/pmdb.py +++ b/python/pythonmonkey/lib/pmdb.py @@ -1,6 +1,7 @@ # @file pmdb - A gdb-like JavaScript debugger interface # @author Tom Tang # @date July 2023 +# @copyright Copyright (c) 2023 Distributive Corp. import pythonmonkey as pm diff --git a/python/pythonmonkey/lib/pmjs/global-init.js b/python/pythonmonkey/lib/pmjs/global-init.js index db78892c..12b6618e 100644 --- a/python/pythonmonkey/lib/pmjs/global-init.js +++ b/python/pythonmonkey/lib/pmjs/global-init.js @@ -5,6 +5,8 @@ * * @author Wes Garland, wes@distributive.network * @date June 2023 + * + * @copyright Copyright (c) 2023 Distributive Corp. */ 'use strict'; diff --git a/python/pythonmonkey/pythonmonkey.pyi b/python/pythonmonkey/pythonmonkey.pyi index 3c0c1c06..97bf87ea 100644 --- a/python/pythonmonkey/pythonmonkey.pyi +++ b/python/pythonmonkey/pythonmonkey.pyi @@ -37,13 +37,6 @@ def isCompilableUnit(code: str) -> bool: Hint if a string might be compilable Javascript without actual evaluation """ -def internalBinding(namespace: str) -> JSObjectProxy: - """ - INTERNAL USE ONLY - - See function declarations in ./builtin_modules/internal-binding.d.ts - """ - def collect() -> None: """ Calls the spidermonkey garbage collector From c484f7e33244f9974774239ef27c7b407c8a36d3 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 8 Feb 2024 16:02:22 -0500 Subject: [PATCH 0265/1086] more missing copyrights --- python/pythonmonkey/global.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/pythonmonkey/global.d.ts b/python/pythonmonkey/global.d.ts index 03321ed5..16986691 100644 --- a/python/pythonmonkey/global.d.ts +++ b/python/pythonmonkey/global.d.ts @@ -2,6 +2,8 @@ * @file global.d.ts * @author Tom Tang * @date May 2023 + * + * @copyright Copyright (c) 2023 Distributive Corp. */ declare const python: { From 7ed102284042c7bc378e4fff94d6a7828633e825 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 9 Feb 2024 11:23:44 -0500 Subject: [PATCH 0266/1086] chore(JSFunctionProxy): remove unnecessary return on JSFunctionProxy_dealloc --- src/JSFunctionProxy.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc index e1da2afc..11bb89bd 100644 --- a/src/JSFunctionProxy.cc +++ b/src/JSFunctionProxy.cc @@ -22,7 +22,6 @@ void JSFunctionProxyMethodDefinitions::JSFunctionProxy_dealloc(JSFunctionProxy *self) { delete self->jsFunc; - return; } PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { From 968ef9c6bcb06e7b20b550bf82d58b6e6aa0cf3f Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 9 Feb 2024 11:24:48 -0500 Subject: [PATCH 0267/1086] refactor(JSFunctionProxy): remove loop invariant in JSFunctionProxy_call, renaming of variables --- src/JSFunctionProxy.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc index 11bb89bd..0aea3c20 100644 --- a/src/JSFunctionProxy.cc +++ b/src/JSFunctionProxy.cc @@ -35,12 +35,13 @@ PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_new(PyTypeObject *su PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_call(PyObject *self, PyObject *args, PyObject *kwargs) { JSContext *cx = GLOBAL_CX; JS::RootedValue jsFunc(GLOBAL_CX, JS::ObjectValue(**((JSFunctionProxy *)self)->jsFunc)); - JSObject *o = jsFunc.toObjectOrNull(); - JS::RootedObject thisObj(GLOBAL_CX, JS::GetNonCCWObjectGlobal(o)); + JSObject *jsFuncObj = jsFunc.toObjectOrNull(); + JS::RootedObject thisObj(GLOBAL_CX, JS::GetNonCCWObjectGlobal(jsFuncObj)); // if jsFunc is not bound, assume `this` is `globalThis` JS::RootedVector jsArgsVector(cx); - for (size_t i = 0; i < PyTuple_Size(args); i++) { + Py_ssize_t nargs = PyTuple_Size(args); + for (size_t i = 0; i < nargs; i++) { JS::Value jsValue = jsTypeFactory(cx, PyTuple_GetItem(args, i)); if (PyErr_Occurred()) { // Check if an exception has already been set in the flow of control return NULL; // Fail-fast From 4ce69b133474db78ad349c1223ef59e198138706 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 9 Feb 2024 11:26:50 -0500 Subject: [PATCH 0268/1086] refactor(PyObjectProxyHandler): remove one-use variable --- src/PyObjectProxyHandler.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PyObjectProxyHandler.cc b/src/PyObjectProxyHandler.cc index dc39c8e0..ade1ebd3 100644 --- a/src/PyObjectProxyHandler.cc +++ b/src/PyObjectProxyHandler.cc @@ -32,8 +32,7 @@ bool PyObjectProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy PyObject *nonDunderKeys = PyList_New(0); for (size_t i = 0; i < keysLength; i++) { PyObject *key = PyList_GetItem(keys, i); - PyObject *isDunder = PyObject_CallMethod(key, "startswith", "(s)", "__"); - if (Py_IsFalse(isDunder)) { // if key starts with "__", ignore it + if (Py_IsFalse(PyObject_CallMethod(key, "startswith", "(s)", "__"))) { // if key starts with "__", ignore it PyList_Append(nonDunderKeys, key); } } From f4ba03ac9455e72d564d9da3c72212a9cdc40063 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 9 Feb 2024 11:30:46 -0500 Subject: [PATCH 0269/1086] feat(PyObjectProxyHandler): set Object prototype on PyObjectProxyHandler so instanceOf(Object) works --- src/jsTypeFactory.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 0d1f37b3..6e95c5fc 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -230,8 +230,9 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { } else { JS::RootedValue v(cx); - JSObject *proxy; - proxy = js::NewProxyObject(cx, new PyObjectProxyHandler(object), v, NULL); + JS::RootedObject objectPrototype(cx); + JS_GetClassPrototype(cx, JSProto_Object, &objectPrototype); // so that instanceof will work, not that prototype methods will + JSObject *proxy = js::NewProxyObject(cx, new PyObjectProxyHandler(object), v, objectPrototype.get()); Py_INCREF(object); JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(object)); returnType.setObject(*proxy); From 251d9cc3166ff688f1447826ee019b92acfef8f4 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 9 Feb 2024 11:41:44 -0500 Subject: [PATCH 0270/1086] fix(JSMethodProxy): correctly increment JSMethodProxy when accessing from JavaScript --- src/jsTypeFactory.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 6e95c5fc..4f0a933f 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -194,6 +194,8 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { registerArgs[1].setPrivate(object); JS::RootedValue ignoredOutVal(GLOBAL_CX); JS_CallFunctionName(GLOBAL_CX, *jsFunctionRegistry, "register", registerArgs, &ignoredOutVal); + + Py_INCREF(object); } else if (PyObject_TypeCheck(object, &JSFunctionProxyType)) { returnType.setObject(**((JSFunctionProxy *)object)->jsFunc); From 98b21d64f2a0657e1f6ae97bbec1554544402782 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 9 Feb 2024 11:47:25 -0500 Subject: [PATCH 0271/1086] feat(PyObjectProxyHandler): store proxied PyObject in reserved slot --- src/PyObjectProxyHandler.cc | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/PyObjectProxyHandler.cc b/src/PyObjectProxyHandler.cc index ade1ebd3..a4b067e9 100644 --- a/src/PyObjectProxyHandler.cc +++ b/src/PyObjectProxyHandler.cc @@ -26,7 +26,8 @@ const char PyObjectProxyHandler::family = 0; bool PyObjectProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { - PyObject *keys = PyObject_Dir(pyObject); + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + PyObject *keys = PyObject_Dir(self); size_t keysLength = PyList_Size(keys); PyObject *nonDunderKeys = PyList_New(0); @@ -58,7 +59,8 @@ bool PyObjectProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy bool PyObjectProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const { PyObject *attrName = idToKey(cx, id); - if (PyObject_SetAttr(pyObject, attrName, NULL) < 0) { + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + if (PyObject_SetAttr(self, attrName, NULL) < 0) { return result.failCantDelete(); // raises JS exception } return result.succeed(); @@ -74,7 +76,8 @@ bool PyObjectProxyHandler::getOwnPropertyDescriptor( JS::MutableHandle> desc ) const { PyObject *attrName = idToKey(cx, id); - PyObject *item = PyObject_GetAttr(pyObject, attrName); + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + PyObject *item = PyObject_GetAttr(self, attrName); if (!item) { // NULL if the key is not present desc.set(mozilla::Nothing()); // JS objects return undefined for nonpresent keys } else { @@ -94,7 +97,8 @@ bool PyObjectProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::Handle JS::RootedValue *rootedV = new JS::RootedValue(cx, v); PyObject *attrName = idToKey(cx, id); JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - if (PyObject_SetAttr(pyObject, attrName, pyTypeFactory(cx, global, rootedV)->getPyObject())) { + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + if (PyObject_SetAttr(self, attrName, pyTypeFactory(cx, global, rootedV)->getPyObject())) { return result.failCantSetInterposed(); // raises JS exception } return result.succeed(); @@ -108,7 +112,8 @@ bool PyObjectProxyHandler::enumerate(JSContext *cx, JS::HandleObject proxy, bool PyObjectProxyHandler::hasOwn(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp) const { PyObject *attrName = idToKey(cx, id); - *bp = PyObject_HasAttr(pyObject, attrName) == 1; + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + *bp = PyObject_HasAttr(self, attrName) == 1; return true; } @@ -122,8 +127,9 @@ void PyObjectProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { // We cannot call Py_DECREF here when shutting down as the thread state is gone. // Then, when shutting down, there is only on reference left, and we don't need // to free the object since the entire process memory is being released. - if (Py_REFCNT(pyObject) > 1) { - Py_DECREF(pyObject); + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + if (Py_REFCNT(self) > 1) { + Py_DECREF(self); } } From b30b57069d48ff3ef7b2dcc2bbea5bc2dbc59a90 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 9 Feb 2024 11:48:20 -0500 Subject: [PATCH 0272/1086] can now assign arguments directly from sys.arg --- python/pythonmonkey/cli/pmjs.py | 11 +++++------ python/pythonmonkey/lib/pmjs/global-init.js | 16 ---------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/python/pythonmonkey/cli/pmjs.py b/python/pythonmonkey/cli/pmjs.py index f1bd1ac9..1da0a9fa 100755 --- a/python/pythonmonkey/cli/pmjs.py +++ b/python/pythonmonkey/cli/pmjs.py @@ -2,6 +2,7 @@ # @file pmjs - PythonMonkey REPL # @author Wes Garland, wes@distributive.network # @date June 2023 +# @copyright Copyright (c) 2023 Distributive Corp. import sys, os, signal, getopt import readline @@ -300,18 +301,16 @@ def usage(): def initGlobalThis(): """ - Initialize globalThis for for pmjs use in the extra-module context (eg -r, -e, -p). This context - needs a require function which resolve modules relative to the current working directory at pmjs - launch. The global require is to the JS function using a trick iinstead of a JS-wrapped-Python-wrapped function + Initialize globalThis for pmjs use in the extra-module context (eg -r, -e, -p). This context + needs a require function which resolves modules relative to the current working directory at pmjs + launch. The global require is to the JS function using a trick instead of a JS-wrapped-Python-wrapped function """ global requirePath require = pm.createRequire(os.path.abspath(os.getcwd() + '/__pmjs_virtual__'), requirePath) globalThis.require = require globalInitModule = require(os.path.realpath(os.path.dirname(__file__) + "/../lib/pmjs/global-init")) # module load has side-effects - argvBuilder = globalInitModule.makeArgvBuilder() - for arg in sys.argv: - argvBuilder(arg); # list=>Array not working yet + globalThis.arguments = sys.argv return globalInitModule def main(): diff --git a/python/pythonmonkey/lib/pmjs/global-init.js b/python/pythonmonkey/lib/pmjs/global-init.js index 12b6618e..e2ac1497 100644 --- a/python/pythonmonkey/lib/pmjs/global-init.js +++ b/python/pythonmonkey/lib/pmjs/global-init.js @@ -17,22 +17,6 @@ for (let mid in require.cache) delete require.cache[mid]; -/** - * Set the global arguments array, which is just the program's argv. We use an argvBuilder function to - * get around PythonMonkey's missing list->Array coercion. /wg june 2023 - */ -exports.makeArgvBuilder = function pmjsRequire$$makeArgvBuilder() -{ - const argv = []; - globalThis.arguments = argv; - return argvBuilder; - - function argvBuilder(arg) - { - globalThis.arguments.push(arg) - } -} - /** * runProgramModule wants to include the require.cache from the pre-program loads (e.g. via -r or -e), but * due to current bugs in PythonMonkey, we can't access the cache property of require because it is a JS From 2f5a0c6d3fefc962e96403073f1cbe6a0d6dec6e Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 9 Feb 2024 11:49:14 -0500 Subject: [PATCH 0273/1086] refactor(jsTypeFactory.cc): remove obvious comment --- src/jsTypeFactory.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 4f0a933f..6f1c2b23 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -36,7 +36,7 @@ #include #include -#include // https://docs.python.org/3/c-api/datetime.html +#include #include From 7f5bb5541c93bdd3f99c03b05eafd26eb75f80ee Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 9 Feb 2024 11:52:09 -0500 Subject: [PATCH 0274/1086] refactor(JSFunctionProxy): remove extra line from JSFunctionProxy_call --- src/JSFunctionProxy.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc index 0aea3c20..49325453 100644 --- a/src/JSFunctionProxy.cc +++ b/src/JSFunctionProxy.cc @@ -38,7 +38,6 @@ PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_call(PyObject *self, JSObject *jsFuncObj = jsFunc.toObjectOrNull(); JS::RootedObject thisObj(GLOBAL_CX, JS::GetNonCCWObjectGlobal(jsFuncObj)); // if jsFunc is not bound, assume `this` is `globalThis` - JS::RootedVector jsArgsVector(cx); Py_ssize_t nargs = PyTuple_Size(args); for (size_t i = 0; i < nargs; i++) { From 519e784ae42583995f6f4f720b104adb75de2782 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 9 Feb 2024 11:58:05 -0500 Subject: [PATCH 0275/1086] refactor(pyTypeFactory): remove one-use variables --- src/pyTypeFactory.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index a06c9013..901c7b80 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -81,8 +81,7 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted return new FloatType(rval->toNumber()); } else if (rval->isString()) { - StrType *s = new StrType(cx, rval->toString()); - return s; + return new StrType(cx, rval->toString()); } else if (rval->isSymbol()) { printf("symbol type is not handled by PythonMonkey yet"); @@ -153,8 +152,7 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted case js::ESClass::String: { JS::RootedValue unboxed(cx); js::Unbox(cx, obj, &unboxed); - StrType *s = new StrType(cx, unboxed.toString()); - return s; + return new StrType(cx, unboxed.toString()); } case js::ESClass::Array: { return new ListType(cx, obj); From a16436d19703c8e0f31c792ae5d08efb76ef3827 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 9 Feb 2024 12:08:13 -0500 Subject: [PATCH 0276/1086] updates --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7a26808b..02fe5054 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,7 @@ Care should be taken to ensure that only one program module is run per JS contex ## Built-In Functions See definitions in [python/pythonmonkey/global.d.ts](https://github.com/Distributive-Network/PythonMonkey/blob/main/python/pythonmonkey/global.d.ts). +Including: - `console` - `atob` @@ -324,10 +325,10 @@ in Python. Simply decorate a Dict named `exports` inside a file with a `.py` ext loaded by `require()` -- in either JavaScript or Python. ### Program Module -The program module, or main module, is a special module in CommonJS. In a program module, +The program module, or main module, is a special module in CommonJS. In a program module: - variables defined in the outermost scope are properties of `globalThis` - returning from the outermost scope is a syntax error - - the `arguments` variable in an Array-like object which holds your program's argument vector + - the `arguments` variable in an Array which holds your program's argument vector (command-line arguments) ```console @@ -391,7 +392,7 @@ List of commands: ```console $ pmjs -Welcome to PythonMonkey v0.2.0. +Welcome to PythonMonkey v0.3.0. Type ".help" for more information. > .python import sys > .python sys.path From a93fcd20f0d30fe5ed9c2a732f9f51d3e5e10523 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 9 Feb 2024 16:11:48 -0500 Subject: [PATCH 0277/1086] English fix and improved organization --- include/PyEventLoop.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/PyEventLoop.hh b/include/PyEventLoop.hh index 3bbcbbb3..92accbdf 100644 --- a/include/PyEventLoop.hh +++ b/include/PyEventLoop.hh @@ -215,7 +215,7 @@ public: } /** - * @brief An `asyncio.Event` instance to notify that there are no queueing asynchronous jobs + * @brief An `asyncio.Event` instance to notify that there are no queued asynchronous jobs * @see https://docs.python.org/3/library/asyncio-sync.html#asyncio.Event */ PyObject *_queueIsEmpty = nullptr; From ea2a2ec83e56d0e206fe82b744849a671ab2f93e Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 9 Feb 2024 16:32:44 -0500 Subject: [PATCH 0278/1086] no more leak with the second parameter of pyTypeFactory --- include/JobQueue.hh | 30 +++++------ include/pyTypeFactory.hh | 15 +++--- src/JSArrayIterProxy.cc | 6 ++- src/JSArrayProxy.cc | 64 +++++++++++++----------- src/JSFunctionProxy.cc | 2 +- src/JSMethodProxy.cc | 2 +- src/JSObjectIterProxy.cc | 8 +-- src/JSObjectProxy.cc | 30 +++++------ src/JobQueue.cc | 47 ++++++++--------- src/PromiseType.cc | 5 +- src/PyDictProxyHandler.cc | 4 +- src/PyListProxyHandler.cc | 51 +++++++++---------- src/PyObjectProxyHandler.cc | 4 +- src/internalBinding.cc | 9 ++-- src/internalBinding/timers.cc | 9 ++-- src/jsTypeFactory.cc | 4 +- src/modules/pythonmonkey/pythonmonkey.cc | 20 +++++--- src/pyTypeFactory.cc | 4 +- 18 files changed, 156 insertions(+), 158 deletions(-) diff --git a/include/JobQueue.hh b/include/JobQueue.hh index d1d0a09e..b714de74 100644 --- a/include/JobQueue.hh +++ b/include/JobQueue.hh @@ -1,7 +1,7 @@ /** * @file JobQueue.hh * @author Tom Tang (xmader@distributive.network) - * @brief Implement the ECMAScript Job Queue + * @brief Implements the ECMAScript Job Queue * @date 2023-04-03 * * @copyright Copyright (c) 2023 Distributive Corp. @@ -22,12 +22,17 @@ * @see https://hg.mozilla.org/releases/mozilla-esr102/file/5741ffa/js/public/Promise.h#l22 */ class JobQueue : public JS::JobQueue { -// -// JS::JobQueue methods. -// + public: ~JobQueue() = default; +/** + * @brief Initialize PythonMonkey's event-loop job queue + * @param cx - javascript context pointer + * @return success + */ +bool init(JSContext *cx); + /** * @brief Ask the embedding for the incumbent global. * @@ -72,7 +77,9 @@ void runJobs(JSContext *cx) override; */ bool empty() const override; + private: + /** * @brief Capture this JobQueue's current job queue as a SavedJobQueue and return it, * leaving the JobQueue's job queue empty. Destroying the returned object @@ -84,18 +91,6 @@ private: */ js::UniquePtr saveJobQueue(JSContext *) override; -// -// Custom methods -// -public: -/** - * @brief Initialize PythonMonkey's event-loop job queue - * @param cx - javascript context pointer - * @return success - */ -bool init(JSContext *cx); - -private: /** * @brief The callback for dispatching an off-thread promise to the event loop * see https://hg.mozilla.org/releases/mozilla-esr102/file/tip/js/public/Promise.h#l580 @@ -105,7 +100,8 @@ private: * @return not shutting down */ static bool dispatchToEventLoop(void *closure, JS::Dispatchable *dispatchable); -}; + +}; // class /** * @brief Send job to the Python event-loop on main thread diff --git a/include/pyTypeFactory.hh b/include/pyTypeFactory.hh index 71c6abab..c122161b 100644 --- a/include/pyTypeFactory.hh +++ b/include/pyTypeFactory.hh @@ -1,10 +1,10 @@ /** * @file pyTypeFactory.hh - * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) + * @author Caleb Aikens (caleb@distributive.network), Giovanni Tedesco (giovanni@distributive.network) and Philippe Laporte (philippe@distributive.network) * @brief Function for wrapping arbitrary PyObjects into the appropriate PyType class, and coercing JS types to python types * @date 2022-08-08 * - * @copyright Copyright (c) 2022 Distributive Corp. + * @copyright Copyright (c) 2022, 2023, 2024 Distributive Corp. * */ @@ -30,15 +30,16 @@ PyType *pyTypeFactory(PyObject *object); * @brief Function that takes a JS::Value and returns a corresponding PyType* object, doing shared memory management when necessary * * @param cx - Pointer to the javascript context of the JS::Value - * @param thisObj - Pointer to the JS `this` object for the value's scope - * @param rval - Pointer to the JS::Value who's type and value we wish to encapsulate + * @param thisObj - The JS `this` object for the value's scope + * @param rval - The JS::Value who's type and value we wish to encapsulate * @return PyType* - Pointer to a PyType object corresponding to the JS::Value */ -PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::HandleValue rval); +PyType *pyTypeFactory(JSContext *cx, JS::HandleObject thisObj, JS::HandleValue rval); + /** * @brief same to pyTypeFactory, but it's guaranteed that no error would be set on the Python error stack, instead - * return `pythonmonkey.null` on error + * returning `pythonmonkey.null` on error */ -PyType *pyTypeFactorySafe(JSContext *cx, JS::Rooted *thisObj, JS::HandleValue rval); +PyType *pyTypeFactorySafe(JSContext *cx, JS::HandleObject thisObj, JS::HandleValue rval); #endif \ No newline at end of file diff --git a/src/JSArrayIterProxy.cc b/src/JSArrayIterProxy.cc index f7a73b36..6d5923da 100644 --- a/src/JSArrayIterProxy.cc +++ b/src/JSArrayIterProxy.cc @@ -47,16 +47,18 @@ PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_next(JSArrayIterPr if (self->it.reversed) { if (self->it.it_index >= 0) { + JS::RootedObject thisObj(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray); JS::RootedValue elementVal(GLOBAL_CX); JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index--, &elementVal); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); } } else { if (self->it.it_index < JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)seq)) { + JS::RootedObject thisObj(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray); JS::RootedValue elementVal(GLOBAL_CX); JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index++, &elementVal); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSArrayProxy *)seq)->jsArray)), elementVal)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); } } diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 7febaa82..3162b8a9 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -53,7 +53,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py if (methodName == NULL || !PyUnicode_Check(key)) { // reached end of list JS::RootedValue value(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, &value); - JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsArray); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } else { @@ -75,7 +75,8 @@ static PyObject *list_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihig PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jReturnedArray)->getPyObject(); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); + return pyTypeFactory(GLOBAL_CX, thisObj, jReturnedArray)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy *self, PyObject *key) @@ -103,7 +104,8 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy JS::RootedValue value(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, &value); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), value)->getPyObject(); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); + return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } else if (PySlice_Check(key)) { Py_ssize_t start, stop, step, slicelength, index; @@ -132,7 +134,8 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy JS::RootedValue jCombinedArrayValue(GLOBAL_CX); jCombinedArrayValue.setObjectOrNull(jCombinedArray); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jCombinedArrayValue)->getPyObject(); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); + return pyTypeFactory(GLOBAL_CX, thisObj, jCombinedArrayValue)->getPyObject(); } } else { @@ -432,18 +435,18 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * } JS::RootedValue elementVal(GLOBAL_CX); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); Py_ssize_t index; /* Search for the first index where items are different */ for (index = 0; index < selfLength && index < otherLength; index++) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *leftItem = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + PyObject *leftItem = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); PyObject *rightItem; if (PyObject_TypeCheck(other, &JSArrayProxyType)) { JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)other)->jsArray, index, &elementVal); - rightItem = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + rightItem = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); } else { rightItem = ((PyListObject *)other)->ob_item[index]; } @@ -480,7 +483,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); /* Compare the final item again using the proper operator */ - return PyObject_RichCompare(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(), ((PyListObject *)other)->ob_item[index], op); + return PyObject_RichCompare(pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(), ((PyListObject *)other)->ob_item[index], op); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { @@ -503,7 +506,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { writer.min_length = 1 + 1 + (2 + 1) * (selfLength - 1) + 1; JS::RootedValue elementVal(GLOBAL_CX); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); if (_PyUnicodeWriter_WriteChar(&writer, '[') < 0) { goto error; @@ -523,7 +526,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { if (&elementVal.toObject() == self->jsArray.get()) { s = PyObject_Repr((PyObject *)self); } else { - s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject()); + s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject()); } if (s == NULL) { goto error; @@ -628,7 +631,8 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_concat(JSArrayProxy *self, JS::RootedValue jCombinedArrayValue(GLOBAL_CX); jCombinedArrayValue.setObjectOrNull(jCombinedArray); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jCombinedArrayValue)->getPyObject(); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); + return pyTypeFactory(GLOBAL_CX, thisObj, jCombinedArrayValue)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, Py_ssize_t n) { @@ -655,7 +659,8 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, JS::RootedValue jCombinedArrayValue(GLOBAL_CX); jCombinedArrayValue.setObjectOrNull(jCombinedArray); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jCombinedArrayValue)->getPyObject(); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); + return pyTypeFactory(GLOBAL_CX, thisObj, jCombinedArrayValue)->getPyObject(); } int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyObject *element) { @@ -665,10 +670,10 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyO Py_ssize_t numElements = JSArrayProxy_length(self); JS::RootedValue elementVal(GLOBAL_CX); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); for (index = 0, cmp = 0; cmp == 0 && index < numElements; ++index) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *item = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + PyObject *item = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); Py_INCREF(item); cmp = PyObject_RichCompareBool(item, element, Py_EQ); Py_DECREF(item); @@ -753,7 +758,8 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), jReturnedArray)->getPyObject(); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); + return pyTypeFactory(GLOBAL_CX, thisObj, jReturnedArray)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_append(JSArrayProxy *self, PyObject *value) { @@ -930,17 +936,18 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_pop(JSArrayProxy *self, Py JS::RootedValue elementVal(GLOBAL_CX); JS_GetElement(GLOBAL_CX, rootedReturnedArray, 0, &elementVal); - return pyTypeFactory(GLOBAL_CX, new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)), elementVal)->getPyObject(); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); + return pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self, PyObject *value) { Py_ssize_t selfSize = JSArrayProxy_length(self); JS::RootedValue elementVal(GLOBAL_CX); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); for (Py_ssize_t index = 0; index < selfSize; index++) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + PyObject *obj = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1003,10 +1010,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_index(JSArrayProxy *self, } JS::RootedValue elementVal(GLOBAL_CX); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); for (Py_ssize_t index = start; index < stop && index < selfSize; index++) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + PyObject *obj = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1027,10 +1034,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_count(JSArrayProxy *self, Py_ssize_t length = JSArrayProxy_length(self); JS::RootedValue elementVal(GLOBAL_CX); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsArray)); + JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); for (Py_ssize_t index = 0; index < length; index++) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + PyObject *obj = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1076,18 +1083,17 @@ static bool sort_compare_key_func(JSContext *cx, unsigned argc, JS::Value *vp) { } bool reverse = reverseValue.toBoolean(); - - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(&args.callee())); + JS::RootedObject thisObj(cx, JS::GetNonCCWObjectGlobal(&args.callee())); JS::RootedValue elementVal0(cx, args[0]); - PyObject *args_0 = pyTypeFactory(cx, global, elementVal0)->getPyObject(); + PyObject *args_0 = pyTypeFactory(cx, thisObj, elementVal0)->getPyObject(); PyObject *args_0_result = PyObject_CallFunction(keyfunc, "O", args_0); if (!args_0_result) { return false; } JS::RootedValue elementVal1(cx, args[1]); - PyObject *args_1 = pyTypeFactory(cx, global, elementVal1)->getPyObject(); + PyObject *args_1 = pyTypeFactory(cx, thisObj, elementVal1)->getPyObject(); PyObject *args_1_result = PyObject_CallFunction(keyfunc, "O", args_1); if (!args_1_result) { return false; @@ -1127,13 +1133,13 @@ static bool sort_compare_default(JSContext *cx, unsigned argc, JS::Value *vp) { } bool reverse = reverseValue.toBoolean(); - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(&args.callee())); + JS::RootedObject thisObj(cx, JS::GetNonCCWObjectGlobal(&args.callee())); JS::RootedValue elementVal0(cx, args[0]); - PyObject *args_0 = pyTypeFactory(cx, global, elementVal0)->getPyObject(); + PyObject *args_0 = pyTypeFactory(cx, thisObj, elementVal0)->getPyObject(); JS::RootedValue elementVal1(cx, args[1]); - PyObject *args_1 = pyTypeFactory(cx, global, elementVal1)->getPyObject(); + PyObject *args_1 = pyTypeFactory(cx, thisObj, elementVal1)->getPyObject(); int cmp = PyObject_RichCompareBool(args_0, args_1, Py_LT); if (cmp > 0) { diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc index f950b357..ec974012 100644 --- a/src/JSFunctionProxy.cc +++ b/src/JSFunctionProxy.cc @@ -60,5 +60,5 @@ PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_call(PyObject *self, return NULL; } - return pyTypeFactory(cx, &thisObj, jsReturnVal)->getPyObject(); + return pyTypeFactory(cx, thisObj, jsReturnVal)->getPyObject(); } \ No newline at end of file diff --git a/src/JSMethodProxy.cc b/src/JSMethodProxy.cc index ef05a497..679c04b8 100644 --- a/src/JSMethodProxy.cc +++ b/src/JSMethodProxy.cc @@ -70,6 +70,6 @@ PyObject *JSMethodProxyMethodDefinitions::JSMethodProxy_call(PyObject *self, PyO return NULL; } - JS::RootedObject *globalObj = new JS::RootedObject(cx, JS::CurrentGlobalOrNull(cx)); + JS::RootedObject globalObj(cx, JS::CurrentGlobalOrNull(cx)); return pyTypeFactory(cx, globalObj, jsReturnVal)->getPyObject(); } \ No newline at end of file diff --git a/src/JSObjectIterProxy.cc b/src/JSObjectIterProxy.cc index e720d496..02c5f602 100644 --- a/src/JSObjectIterProxy.cc +++ b/src/JSObjectIterProxy.cc @@ -57,10 +57,10 @@ PyObject *JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_nextkey(JSObject PyObject *value; if (self->it.kind != KIND_KEYS) { - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSObjectProxy *)(self->it.di_dict))->jsObject)); + JS::RootedObject thisObj(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject); JS::RootedValue jsVal(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, &jsVal); - value = pyTypeFactory(GLOBAL_CX, global, jsVal)->getPyObject(); + value = pyTypeFactory(GLOBAL_CX, thisObj, jsVal)->getPyObject(); } PyObject *ret; @@ -84,10 +84,10 @@ PyObject *JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_nextkey(JSObject PyObject *value; if (self->it.kind != KIND_KEYS) { - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(((JSObjectProxy *)(self->it.di_dict))->jsObject)); + JS::RootedObject thisObj(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject); JS::RootedValue jsVal(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, &jsVal); - value = pyTypeFactory(GLOBAL_CX, global, jsVal)->getPyObject(); + value = pyTypeFactory(GLOBAL_CX, thisObj, jsVal)->getPyObject(); } PyObject *ret; diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 6d476c2c..24c76406 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -77,7 +77,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, if (methodName == NULL || !PyUnicode_Check(key)) { JS::RootedValue value(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); - JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsObject); + JS::RootedObject thisObj(GLOBAL_CX, self->jsObject); return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } else { @@ -190,8 +190,8 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr JS::RootedValue key(GLOBAL_CX); key.setString(id.toString()); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - PyObject *pyKey = pyTypeFactory(GLOBAL_CX, global, key)->getPyObject(); + JS::RootedObject thisObj(GLOBAL_CX, self->jsObject); + PyObject *pyKey = pyTypeFactory(GLOBAL_CX, thisObj, key)->getPyObject(); PyObject *pyVal1 = PyObject_GetItem((PyObject *)self, pyKey); PyObject *pyVal2 = PyObject_GetItem((PyObject *)other, pyKey); if (!pyVal2) { // if other.key is NULL then not equal @@ -260,7 +260,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self PyObject *key = NULL, *value = NULL; - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject thisObj(GLOBAL_CX, self->jsObject); JS::RootedIdVector props(GLOBAL_CX); @@ -310,7 +310,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self if (&elementVal.toObject() == self->jsObject.get()) { value = (PyObject *)self; } else { - value = pyTypeFactory(GLOBAL_CX, global, elementVal)->getPyObject(); + value = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); } Py_INCREF(value); @@ -438,11 +438,11 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, JS::RootedValue jValueOther(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, other)); args[2].setObject(jValueOther.toObject()); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); // call Object.assign JS::RootedValue Object(GLOBAL_CX); - if (!JS_GetProperty(GLOBAL_CX, *global, "Object", &Object)) { + if (!JS_GetProperty(GLOBAL_CX, global, "Object", &Object)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } @@ -454,7 +454,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, global, ret)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, rootedObject, ret)->getPyObject(); } } @@ -465,11 +465,11 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_ior(JSObjectProxy *self, JS::RootedValue jValueOther(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, other)); args[1].setObject(jValueOther.toObject()); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); // call Object.assign JS::RootedValue Object(GLOBAL_CX); - if (!JS_GetProperty(GLOBAL_CX, *global, "Object", &Object)) { + if (!JS_GetProperty(GLOBAL_CX, global, "Object", &Object)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } @@ -576,8 +576,8 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy JS::ObjectOpResult ignoredResult; JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); - return pyTypeFactory(GLOBAL_CX, global, value)->getPyObject(); + JS::RootedObject thisObj(GLOBAL_CX, self->jsObject); + return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } } @@ -603,11 +603,11 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProx args[0].setObjectOrNull(JS_NewPlainObject(GLOBAL_CX)); args[1].setObjectOrNull(self->jsObject); - JS::RootedObject *global = new JS::RootedObject(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); // call Object.assign JS::RootedValue Object(GLOBAL_CX); - if (!JS_GetProperty(GLOBAL_CX, *global, "Object", &Object)) { + if (!JS_GetProperty(GLOBAL_CX, global, "Object", &Object)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } @@ -618,7 +618,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProx PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, global, ret)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, rootedObject, ret)->getPyObject(); } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_update_method(JSObjectProxy *self, PyObject *args, PyObject *kwds) { diff --git a/src/JobQueue.cc b/src/JobQueue.cc index 6e8f6e7a..799c5678 100644 --- a/src/JobQueue.cc +++ b/src/JobQueue.cc @@ -1,7 +1,7 @@ /** * @file JobQueue.cc * @author Tom Tang (xmader@distributive.network) - * @brief Implement the ECMAScript Job Queue + * @brief Implements the ECMAScript Job Queue * @date 2023-04-03 * * @copyright Copyright (c) 2023 Distributive Corp. @@ -29,13 +29,9 @@ bool JobQueue::enqueuePromiseJob(JSContext *cx, JS::HandleObject incumbentGlobal) { // Convert the `job` JS function to a Python function for event-loop callback - MOZ_RELEASE_ASSERT(js::IsFunctionObject(job)); - // FIXME (Tom Tang): memory leak, objects not free-ed - // FIXME (Tom Tang): `job` function is going to be GC-ed ??? - auto global = new JS::RootedObject(cx, incumbentGlobal); - // auto jobv = new JS::RootedValue(cx, JS::ObjectValue(*job)); + JS::RootedObject global(cx, incumbentGlobal); JS::RootedValue jobv(cx, JS::ObjectValue(*job)); - auto callback = pyTypeFactory(cx, global, jobv)->getPyObject(); + PyObject *callback = pyTypeFactory(cx, global, jobv)->getPyObject(); // Inform the JS runtime that the job queue is no longer empty JS::JobQueueMayNotBeEmpty(cx); @@ -49,10 +45,9 @@ bool JobQueue::enqueuePromiseJob(JSContext *cx, } void JobQueue::runJobs(JSContext *cx) { - return; + // Do nothing } -// is empty bool JobQueue::empty() const { // TODO (Tom Tang): implement using `get_running_loop` and getting job count on loop??? throw std::logic_error("JobQueue::empty is not implemented\n"); @@ -65,7 +60,7 @@ js::UniquePtr JobQueue::saveJobQueue(JSContext *cx) bool JobQueue::init(JSContext *cx) { JS::SetJobQueue(cx, this); - JS::InitDispatchToEventLoop(cx, /* callback */ dispatchToEventLoop, /* closure */ cx); + JS::InitDispatchToEventLoop(cx, dispatchToEventLoop, cx); return true; } @@ -75,24 +70,9 @@ static PyObject *callDispatchFunc(PyObject *dispatchFuncTuple, PyObject *Py_UNUS dispatchable->run(cx, JS::Dispatchable::NotShuttingDown); Py_RETURN_NONE; } -static PyMethodDef callDispatchFuncDef = {"JsDispatchCallable", callDispatchFunc, METH_NOARGS, NULL}; - -bool sendJobToMainLoop(PyObject *pyFunc) { - PyGILState_STATE gstate = PyGILState_Ensure(); - - // Send job to the running Python event-loop on `cx`'s thread (the main thread) - PyEventLoop loop = PyEventLoop::getMainLoop(); - if (!loop.initialized()) { - PyGILState_Release(gstate); - return false; - } - loop.enqueue(pyFunc); - PyGILState_Release(gstate); - return true; -} +static PyMethodDef callDispatchFuncDef = {"JsDispatchCallable", callDispatchFunc, METH_NOARGS, NULL}; -/* static */ bool JobQueue::dispatchToEventLoop(void *closure, JS::Dispatchable *dispatchable) { JSContext *cx = (JSContext *)closure; // `closure` is provided in `JS::InitDispatchToEventLoop` call @@ -110,3 +90,18 @@ bool JobQueue::dispatchToEventLoop(void *closure, JS::Dispatchable *dispatchable PyGILState_Release(gstate); return true; // dispatchable must eventually run } + +bool sendJobToMainLoop(PyObject *pyFunc) { + PyGILState_STATE gstate = PyGILState_Ensure(); + + // Send job to the running Python event-loop on cx's thread (the main thread) + PyEventLoop loop = PyEventLoop::getMainLoop(); + if (!loop.initialized()) { + PyGILState_Release(gstate); + return false; + } + loop.enqueue(pyFunc); + + PyGILState_Release(gstate); + return true; +} \ No newline at end of file diff --git a/src/PromiseType.cc b/src/PromiseType.cc index 55ceefa7..d34202d2 100644 --- a/src/PromiseType.cc +++ b/src/PromiseType.cc @@ -35,10 +35,9 @@ static bool onResolvedCb(JSContext *cx, unsigned argc, JS::Value *vp) { JS::PromiseState state = JS::GetPromiseState(promise); // Convert the Promise's result (either fulfilled resolution or rejection reason) to a Python object - // FIXME (Tom Tang): memory leak, not free-ed // The result might be another JS function, so we must keep them alive - JS::RootedObject *thisv = new JS::RootedObject(cx); - args.computeThis(cx, thisv); // thisv is the global object, not the promise + JS::RootedObject thisv(cx); + args.computeThis(cx, &thisv); // thisv is the global object, not the promise JS::RootedValue resultArg(cx, args[0]); PyObject *result = pyTypeFactory(cx, thisv, resultArg)->getPyObject(); if (state == JS::PromiseState::Rejected && !PyExceptionInstance_Check(result)) { diff --git a/src/PyDictProxyHandler.cc b/src/PyDictProxyHandler.cc index 1b18b822..08932d39 100644 --- a/src/PyDictProxyHandler.cc +++ b/src/PyDictProxyHandler.cc @@ -142,8 +142,8 @@ bool PyDictProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId JS::ObjectOpResult &result) const { JS::RootedValue rootedV(cx, v); PyObject *attrName = idToKey(cx, id); - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - if (PyDict_SetItem(pyObject, attrName, pyTypeFactory(cx, global, rootedV)->getPyObject())) { + JS::RootedObject thisObj(cx, proxy); + if (PyDict_SetItem(pyObject, attrName, pyTypeFactory(cx, thisObj, rootedV)->getPyObject())) { return result.failCantSetInterposed(); // raises JS exception } return result.succeed(); diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 7bc51c28..73d8316a 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -87,12 +87,12 @@ static bool array_push(JSContext *cx, unsigned argc, JS::Value *vp) { // surely } PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + JS::RootedObject thisObj(cx, proxy); unsigned numArgs = args.length(); JS::RootedValue elementVal(cx); for (unsigned index = 0; index < numArgs; index++) { elementVal.set(args[index].get()); - if (PyList_Append(self, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + if (PyList_Append(self, pyTypeFactory(cx, thisObj, elementVal)->getPyObject()) < 0) { return false; } } @@ -138,11 +138,11 @@ static bool array_unshift(JSContext *cx, unsigned argc, JS::Value *vp) { // sure } PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + JS::RootedObject thisObj(cx, proxy); JS::RootedValue elementVal(cx); for (int index = args.length() - 1; index >= 0; index--) { elementVal.set(args[index].get()); - if (PyList_Insert(self, 0, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + if (PyList_Insert(self, 0, pyTypeFactory(cx, thisObj, elementVal)->getPyObject()) < 0) { return false; } } @@ -252,9 +252,9 @@ static bool array_indexOf(JSContext *cx, unsigned argc, JS::Value *vp) { } } - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + JS::RootedObject thisObj(cx, proxy); JS::RootedValue elementVal(cx, args[0].get()); - PyObject *result = PyObject_CallMethod(self, "index", "Oi", pyTypeFactory(cx, global, elementVal)->getPyObject(), start); + PyObject *result = PyObject_CallMethod(self, "index", "Oi", pyTypeFactory(cx, thisObj, elementVal)->getPyObject(), start); if (!result) { PyErr_Clear(); @@ -332,10 +332,10 @@ static bool array_splice(JSContext *cx, unsigned argc, JS::Value *vp) { } JS::RootedValue elementVal(cx); - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + JS::RootedObject thisObj(cx, proxy); for (int index = 0; index < insertCount; index++) { elementVal.set(args[index + 2].get()); - if (PyList_SetItem(inserted, index, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + if (PyList_SetItem(inserted, index, pyTypeFactory(cx, thisObj, elementVal)->getPyObject()) < 0) { return false; } } @@ -397,9 +397,9 @@ static bool array_fill(JSContext *cx, unsigned argc, JS::Value *vp) { actualEnd = uint64_t(std::min(double(relativeEnd), double(selfLength))); } - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + JS::RootedObject thisObj(cx, proxy); JS::RootedValue fillValue(cx, args[0].get()); - PyObject *fillValueItem = pyTypeFactory(cx, global, fillValue)->getPyObject(); + PyObject *fillValueItem = pyTypeFactory(cx, thisObj, fillValue)->getPyObject(); for (int index = actualStart; index < actualEnd; index++) { if (PyList_SetItem(self, index, fillValueItem) < 0) { return false; @@ -515,7 +515,7 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { } PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + JS::RootedObject thisObj(cx, proxy); Py_ssize_t selfSize = PyList_GET_SIZE(self); @@ -530,7 +530,7 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { for (unsigned index = 0; index < numArgs; index++) { elementVal.set(args[index].get()); - PyObject *item = pyTypeFactory(cx, global, elementVal)->getPyObject(); + PyObject *item = pyTypeFactory(cx, thisObj, elementVal)->getPyObject(); if (PyObject_TypeCheck(item, &JSArrayProxyType)) { // flatten the array only a depth 1 Py_ssize_t itemLength = JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)item); @@ -538,7 +538,7 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { if (!JS_GetElement(cx, ((JSArrayProxy *)item)->jsArray, flatIndex, &elementVal)) { return false; } - if (PyList_Append(result, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + if (PyList_Append(result, pyTypeFactory(cx, thisObj, elementVal)->getPyObject()) < 0) { return false; } } @@ -553,7 +553,7 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { } } else { - if (PyList_Append(result, pyTypeFactory(cx, global, elementVal)->getPyObject()) < 0) { + if (PyList_Append(result, pyTypeFactory(cx, thisObj, elementVal)->getPyObject()) < 0) { return false; } } @@ -602,9 +602,9 @@ static bool array_lastIndexOf(JSContext *cx, unsigned argc, JS::Value *vp) { } } - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + JS::RootedObject thisObj(cx, proxy); JS::RootedValue elementVal(cx, args[0].get()); - PyObject *element = pyTypeFactory(cx, global, elementVal)->getPyObject(); + PyObject *element = pyTypeFactory(cx, thisObj, elementVal)->getPyObject(); for (int64_t index = start; index >= 0; index--) { PyObject *item = PyList_GetItem(self, index); Py_INCREF(item); @@ -1184,14 +1184,13 @@ static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { } // private -static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject global, +static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject thisObj, JSObject *retArray, PyObject *source, Py_ssize_t sourceLen, uint32_t start, uint32_t depth) { uint32_t targetIndex = start; JS::RootedValue elementVal(cx); - JS::RootedObject rootedGlobal(cx, global); for (uint32_t sourceIndex = 0; sourceIndex < sourceLen; sourceIndex++) { @@ -1202,7 +1201,7 @@ static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject global, elementVal.set(jsTypeFactory(cx, PyList_GetItem(source, sourceIndex))); } - PyObject *element = pyTypeFactory(cx, &rootedGlobal, elementVal)->getPyObject(); + PyObject *element = pyTypeFactory(cx, thisObj, elementVal)->getPyObject(); bool shouldFlatten; if (depth > 0) { @@ -1220,7 +1219,7 @@ static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject global, elementLen = PyList_GET_SIZE(element); } - targetIndex = FlattenIntoArray(cx, global, + targetIndex = FlattenIntoArray(cx, thisObj, retArray, element, elementLen, @@ -1247,14 +1246,13 @@ static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject global, } // private -static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject global, +static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject thisObj, JSObject *retArray, PyObject *source, Py_ssize_t sourceLen, uint32_t start, uint32_t depth, JS::HandleValue callBack, JS::HandleObject thisArg) { uint32_t targetIndex = start; - JS::RootedObject rootedGlobal(cx, global); JS::RootedValue sourceValue(cx, jsTypeFactory(cx, source)); JS::Rooted> jArgs(cx); JS::RootedValue elementVal(cx); @@ -1275,7 +1273,7 @@ static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject glo return false; } - PyObject *element = pyTypeFactory(cx, &rootedGlobal, retVal)->getPyObject(); + PyObject *element = pyTypeFactory(cx, thisObj, retVal)->getPyObject(); bool shouldFlatten; if (depth > 0) { @@ -1293,7 +1291,7 @@ static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject glo } if (shouldFlatten) { - targetIndex = FlattenIntoArrayWithCallBack(cx, global, + targetIndex = FlattenIntoArrayWithCallBack(cx, thisObj, retArray, element, elementLen, @@ -2055,10 +2053,9 @@ bool PyListProxyHandler::defineProperty( return result.failInvalidDescriptor(); } - // FIXME (Tom Tang): memory leak - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); + JS::RootedObject thisObj(cx, proxy); JS::RootedValue itemV(cx, desc.value()); - PyObject *item = pyTypeFactory(cx, global, itemV)->getPyObject(); + PyObject *item = pyTypeFactory(cx, thisObj, itemV)->getPyObject(); if (PyList_SetItem(pyObject, index, item) < 0) { // we are out-of-bounds and need to expand Py_ssize_t len = PyList_GET_SIZE(pyObject); diff --git a/src/PyObjectProxyHandler.cc b/src/PyObjectProxyHandler.cc index 1e3213f5..19edbaee 100644 --- a/src/PyObjectProxyHandler.cc +++ b/src/PyObjectProxyHandler.cc @@ -94,8 +94,8 @@ bool PyObjectProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::Handle JS::ObjectOpResult &result) const { JS::RootedValue rootedV(cx, v); PyObject *attrName = idToKey(cx, id); - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - if (PyObject_SetAttr(pyObject, attrName, pyTypeFactory(cx, global, rootedV)->getPyObject())) { + JS::RootedObject thisObj(cx, proxy); + if (PyObject_SetAttr(pyObject, attrName, pyTypeFactory(cx, thisObj, rootedV)->getPyObject())) { return result.failCantSetInterposed(); // raises JS exception } return result.succeed(); diff --git a/src/internalBinding.cc b/src/internalBinding.cc index 410eca6d..bf789fa2 100644 --- a/src/internalBinding.cc +++ b/src/internalBinding.cc @@ -59,10 +59,7 @@ PyObject *getInternalBindingPyFn(JSContext *cx) { JSObject *jsFn = (JSObject *)createInternalBinding(cx); // Convert to a Python function - // FIXME (Tom Tang): memory leak, not free-ed - JS::RootedObject *thisObj = new JS::RootedObject(cx, nullptr); + JS::RootedObject thisObj(cx, nullptr); JS::RootedValue jsFnVal(cx, JS::ObjectValue(*jsFn)); - PyObject *pyFn = pyTypeFactory(cx, thisObj, jsFnVal)->getPyObject(); - - return pyFn; -} + return pyTypeFactory(cx, thisObj, jsFnVal)->getPyObject(); +} \ No newline at end of file diff --git a/src/internalBinding/timers.cc b/src/internalBinding/timers.cc index a37fae11..934f4f7b 100644 --- a/src/internalBinding/timers.cc +++ b/src/internalBinding/timers.cc @@ -2,7 +2,7 @@ * @file timers.cc * @author Tom Tang (xmader@distributive.network) * @brief Implement functions in `internalBinding("timers")` - * + * * @copyright Copyright (c) 2023 Distributive Corp. */ @@ -23,8 +23,7 @@ static bool enqueueWithDelay(JSContext *cx, unsigned argc, JS::Value *vp) { double delaySeconds = args.get(1).toNumber(); // Convert to a Python function - // FIXME (Tom Tang): memory leak, not free-ed - JS::RootedObject *thisv = new JS::RootedObject(cx, nullptr); + JS::RootedObject thisv(cx, nullptr); JS::RootedValue jobArg(cx, jobArgVal); PyObject *job = pyTypeFactory(cx, thisv, jobArg)->getPyObject(); @@ -56,7 +55,7 @@ static bool cancelByTimeoutId(JSContext *cx, unsigned argc, JS::Value *vp) { AsyncHandle *handle = AsyncHandle::fromId((uint32_t)timeoutID); if (!handle) return true; // does nothing on invalid timeoutID - // Cancel this job on Python event-loop + // Cancel this job on the Python event-loop handle->cancel(); return true; @@ -66,4 +65,4 @@ JSFunctionSpec InternalBinding::timers[] = { JS_FN("enqueueWithDelay", enqueueWithDelay, /* nargs */ 2, 0), JS_FN("cancelByTimeoutId", cancelByTimeoutId, 1, 0), JS_FS_END -}; +}; \ No newline at end of file diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index c0515e07..c7ce7ac1 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -276,8 +276,8 @@ bool callPyFunc(JSContext *cx, unsigned int argc, JS::Value *vp) { JS::Value pyFuncVal = js::GetFunctionNativeReserved(&(callargs.callee()), 0); PyObject *pyFunc = (PyObject *)(pyFuncVal.toPrivate()); - JS::RootedObject *thisv = new JS::RootedObject(cx); - JS_ValueToObject(cx, callargs.thisv(), thisv); + JS::RootedObject thisv(cx); + JS_ValueToObject(cx, callargs.thisv(), &thisv); unsigned int callArgsLength = callargs.length(); diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 129e9c48..e99cf366 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -356,7 +356,7 @@ static PyObject *eval(PyObject *self, PyObject *args) { } // translate to the proper python type - PyType *returnValue = pyTypeFactory(GLOBAL_CX, global, *rval); + PyType *returnValue = pyTypeFactory(GLOBAL_CX, *global, *rval); if (PyErr_Occurred()) { return NULL; } @@ -524,8 +524,11 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; pyModule = PyModule_Create(&pythonmonkey); - if (pyModule == NULL) + if (pyModule == NULL) { return NULL; + } + + // Register Types Py_INCREF(&NullType); if (PyModule_AddObject(pyModule, "null", (PyObject *)&NullType) < 0) { @@ -616,9 +619,6 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; } - // Initialize event-loop shield - PyEventLoop::_locker = new PyEventLoop::Lock(); - PyObject *internalBindingPy = getInternalBindingPyFn(GLOBAL_CX); if (PyModule_AddObject(pyModule, "internalBinding", internalBindingPy) < 0) { Py_DECREF(internalBindingPy); @@ -626,7 +626,12 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) return NULL; } - // initialize FinalizationRegistry of JSFunctions to Python Functions + + // Initialize event-loop shield + PyEventLoop::_locker = new PyEventLoop::Lock(); + + + // Initialize FinalizationRegistry of JSFunctions to Python Functions JS::RootedValue FinalizationRegistry(GLOBAL_CX); JS::RootedObject registryObject(GLOBAL_CX); @@ -642,5 +647,6 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) jsFunctionRegistry = new JS::PersistentRootedObject(GLOBAL_CX); jsFunctionRegistry->set(registryObject); + return pyModule; -} +} \ No newline at end of file diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index 09384bfd..576bf95d 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -67,7 +67,7 @@ PyType *pyTypeFactory(PyObject *object) { return pyType; } -PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::HandleValue rval) { +PyType *pyTypeFactory(JSContext *cx, JS::HandleObject thisObj, JS::HandleValue rval) { if (rval.isUndefined()) { return new NoneType(); } @@ -179,7 +179,7 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Handle return NULL; } -PyType *pyTypeFactorySafe(JSContext *cx, JS::Rooted *thisObj, JS::HandleValue rval) { +PyType *pyTypeFactorySafe(JSContext *cx, JS::HandleObject thisObj, JS::HandleValue rval) { PyType *v = pyTypeFactory(cx, thisObj, rval); if (PyErr_Occurred()) { // Clear Python error From e970277f4e6326c8a2c7b09bf41f752a73e4fe72 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Tue, 13 Feb 2024 03:15:14 -0500 Subject: [PATCH 0279/1086] refactor(PyBaseProxyHandler): refactor shared code between PyDictProxyHandler and PyObjectProxyHandler into a shared parent struct called PyDictOrObjectProxyHandler. Also remove pointer to the pyObject in the ProxyHandlers and use private slot instead, and only ever instantiate one instance of each ProxyHandler, rather than creating a new handler every time we make a new proxy object --- include/PyBaseProxyHandler.hh | 3 +- include/PyDictOrObjectProxyHandler.hh | 88 ++++++++++++++++++++ include/PyDictProxyHandler.hh | 6 +- include/PyListProxyHandler.hh | 2 +- include/PyObjectProxyHandler.hh | 8 +- src/PyDictOrObjectProxyHandler.cc | 115 ++++++++++++++++++++++++++ src/PyDictProxyHandler.cc | 107 ++++-------------------- src/PyListProxyHandler.cc | 14 ++-- src/PyObjectProxyHandler.cc | 42 +++------- src/jsTypeFactory.cc | 10 ++- src/pyTypeFactory.cc | 6 +- 11 files changed, 256 insertions(+), 145 deletions(-) create mode 100644 include/PyDictOrObjectProxyHandler.hh create mode 100644 src/PyDictOrObjectProxyHandler.cc diff --git a/include/PyBaseProxyHandler.hh b/include/PyBaseProxyHandler.hh index dc3700a8..353973be 100644 --- a/include/PyBaseProxyHandler.hh +++ b/include/PyBaseProxyHandler.hh @@ -23,8 +23,7 @@ */ struct PyBaseProxyHandler : public js::BaseProxyHandler { public: - PyBaseProxyHandler(PyObject *pyObj, const void *family) : js::BaseProxyHandler(family), pyObject(pyObj) {}; - PyObject *pyObject; // @TODO (Caleb Aikens) Consider putting this in a private slot + PyBaseProxyHandler(const void *family) : js::BaseProxyHandler(family) {}; bool getPrototypeIfOrdinary(JSContext *cx, JS::HandleObject proxy, bool *isOrdinary, JS::MutableHandleObject protop) const override final; bool preventExtensions(JSContext *cx, JS::HandleObject proxy, JS::ObjectOpResult &result) const override final; diff --git a/include/PyDictOrObjectProxyHandler.hh b/include/PyDictOrObjectProxyHandler.hh new file mode 100644 index 00000000..a41d81ad --- /dev/null +++ b/include/PyDictOrObjectProxyHandler.hh @@ -0,0 +1,88 @@ +/** + * @file PyDictOrObjectProxyHandler.hh + * @author Caleb Aikens (caleb@distributive.network) + * @brief Abstract class inherited by PyDictProxyHandler and PyObjectProxyHandler since they share a lot of logic + * @date 2024-02-13 + * + * Copyright (c) 2024 Distributive Corp. + * + */ + +#ifndef PythonMonkey_PyDictOrObjectProxyHandler_ +#define PythonMonkey_PyDictOrObjectProxyHandler_ + +#include "include/PyBaseProxyHandler.hh" + +#include + +#include + +struct PyDictOrObjectProxyHandler : public PyBaseProxyHandler { + PyDictOrObjectProxyHandler(const void *family) : PyBaseProxyHandler(family) {}; + + /** + * @brief Helper function used by dicts and objects for ownPropertyKeys + * + * @param cx - pointer to the JSContext + * @param keys - PyListObject containing the keys of the proxy'd dict/object + * @param length - the length of keys param + * @param props - out-param, will be a JS vector of the keys converted to JS Ids + * @return true - the function succeeded + * @return false - the function failed (an Exception should be raised) + */ + static bool handleOwnPropertyKeys(JSContext *cx, PyObject *keys, size_t length, JS::MutableHandleIdVector props); + + /** + * @brief Helper function used by dicts and objects for get OwnPropertyDescriptor + * + * @param cx - pointer to the JSContext + * @param id - id of the prop to get + * @param desc - out-param, the property descriptor + * @param item - the python object to be converted to a JS prop + * @return true - the function succeeded + * @return false - the function has failed and an exception has been raised + */ + static bool handleGetOwnPropertyDescriptor(JSContext *cx, JS::HandleId id, + JS::MutableHandle> desc, PyObject *item); + + static void handleFinalize(JSObject *proxy); + + /** + * @brief Helper function used by dicts and objects to convert dict/object to String + * + * @param cx - pointer to the JSContext + * @param argc - unused + * @param vp - unused + * @return true - this function always returns true + */ + static bool object_toString(JSContext *cx, unsigned argc, JS::Value *vp); + + /** + * @brief Helper function used by dicts and objects to convert dict/object to LocaleString + * + * @param cx - pointer to the JSContext + * @param argc - unused + * @param vp - unused + * @return true - this function always returns true + */ + static bool object_toLocaleString(JSContext *cx, unsigned argc, JS::Value *vp); + + /** + * @brief Helper function used by dicts and objects to get valueOf, just returns a new reference to `self` + * + * @param cx - pointer to the JSContext + * @param argc - unused + * @param vp - unused + * @return true - the function succeeded + * @return false - the function failed and an exception has been raised + */ + static bool object_valueOf(JSContext *cx, unsigned argc, JS::Value *vp); + + /** + * @brief An array of method definitions for Object prototype methods + * + */ + static JSMethodDef object_methods[]; +}; + +#endif \ No newline at end of file diff --git a/include/PyDictProxyHandler.hh b/include/PyDictProxyHandler.hh index 97ebc162..36b4d82f 100644 --- a/include/PyDictProxyHandler.hh +++ b/include/PyDictProxyHandler.hh @@ -11,16 +11,16 @@ #ifndef PythonMonkey_PyDictProxy_ #define PythonMonkey_PyDictProxy_ -#include "include/PyBaseProxyHandler.hh" +#include "include/PyDictOrObjectProxyHandler.hh" /** * @brief This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates to handle coercion from python dicts to JS Objects * */ -struct PyDictProxyHandler : public PyBaseProxyHandler { +struct PyDictProxyHandler : public PyDictOrObjectProxyHandler { public: - PyDictProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; + PyDictProxyHandler() : PyDictOrObjectProxyHandler(&family) {}; static const char family; /** diff --git a/include/PyListProxyHandler.hh b/include/PyListProxyHandler.hh index faebac51..18ed3aec 100644 --- a/include/PyListProxyHandler.hh +++ b/include/PyListProxyHandler.hh @@ -20,7 +20,7 @@ */ struct PyListProxyHandler : public PyBaseProxyHandler { public: - PyListProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; + PyListProxyHandler() : PyBaseProxyHandler(&family) {}; static const char family; /** diff --git a/include/PyObjectProxyHandler.hh b/include/PyObjectProxyHandler.hh index 5dc29737..bfd54fee 100644 --- a/include/PyObjectProxyHandler.hh +++ b/include/PyObjectProxyHandler.hh @@ -11,7 +11,7 @@ #ifndef PythonMonkey_PyObjectProxy_ #define PythonMonkey_PyObjectProxy_ -#include "include/PyBaseProxyHandler.hh" +#include "include/PyDictOrObjectProxyHandler.hh" #include #include @@ -21,9 +21,9 @@ * @brief This struct is the ProxyHandler for JS Proxy Objects pythonmonkey creates to handle coercion from python objects to JS Objects * */ -struct PyObjectProxyHandler : public PyBaseProxyHandler { +struct PyObjectProxyHandler : public PyDictOrObjectProxyHandler { public: - PyObjectProxyHandler(PyObject *pyObj) : PyBaseProxyHandler(pyObj, &family) {}; + PyObjectProxyHandler() : PyDictOrObjectProxyHandler(&family) {}; static const char family; /** @@ -130,6 +130,8 @@ public: JS::HandleId id, JS::Handle desc, JS::ObjectOpResult &result) const override; + + bool getBuiltinClass(JSContext *cx, JS::HandleObject proxy, js::ESClass *cls) const override; }; #endif \ No newline at end of file diff --git a/src/PyDictOrObjectProxyHandler.cc b/src/PyDictOrObjectProxyHandler.cc new file mode 100644 index 00000000..6f56dda7 --- /dev/null +++ b/src/PyDictOrObjectProxyHandler.cc @@ -0,0 +1,115 @@ +/** + * @file PyDictOrObjectProxyHandler.cc + * @author Caleb Aikens (caleb@distributive.network) + * @brief + * @date 2024-02-13 + * + * Copyright (c) 2024 Distributive Corp. + * + */ + +#include "include/PyDictOrObjectProxyHandler.hh" + +#include "include/jsTypeFactory.hh" + +#include +#include + +bool PyDictOrObjectProxyHandler::object_toString(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + args.rval().setString(JS_NewStringCopyZ(cx, "[object Object]")); + return true; +} + +bool PyDictOrObjectProxyHandler::object_toLocaleString(JSContext *cx, unsigned argc, JS::Value *vp) { + return object_toString(cx, argc, vp); +} + +bool PyDictOrObjectProxyHandler::object_valueOf(JSContext *cx, unsigned argc, JS::Value *vp) { + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + + JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); + if (!proxy) { + return false; + } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + // return ref to self + args.rval().set(jsTypeFactory(cx, self)); + return true; +} + +JSMethodDef PyDictOrObjectProxyHandler::object_methods[] = { + {"toString", PyDictOrObjectProxyHandler::object_toString, 0}, + {"toLocaleString", PyDictOrObjectProxyHandler::object_toLocaleString, 0}, + {"valueOf", PyDictOrObjectProxyHandler::object_valueOf, 0}, + {NULL, NULL, 0} +}; + + +bool PyDictOrObjectProxyHandler::handleOwnPropertyKeys(JSContext *cx, PyObject *keys, size_t length, JS::MutableHandleIdVector props) { + if (!props.reserve(length)) { + return false; // out of memory + } + + for (size_t i = 0; i < length; i++) { + PyObject *key = PyList_GetItem(keys, i); + JS::RootedId jsId(cx); + if (!keyToId(key, &jsId)) { + // TODO (Caleb Aikens): raise exception here + return false; // key is not a str or int + } + props.infallibleAppend(jsId); + } + return true; +} + +bool PyDictOrObjectProxyHandler::handleGetOwnPropertyDescriptor(JSContext *cx, JS::HandleId id, + JS::MutableHandle> desc, PyObject *item) { + // see if we're calling a function + if (id.isString()) { + for (size_t index = 0;; index++) { + bool isThatFunction; + const char *methodName = object_methods[index].name; + if (methodName == NULL) { + break; + } + else if (JS_StringEqualsAscii(cx, id.toString(), methodName, &isThatFunction) && isThatFunction) { + JSFunction *newFunction = JS_NewFunction(cx, object_methods[index].call, object_methods[index].nargs, 0, NULL); + if (!newFunction) return false; + JS::RootedObject funObj(cx, JS_GetFunctionObject(newFunction)); + desc.set(mozilla::Some( + JS::PropertyDescriptor::Data( + JS::ObjectValue(*funObj), + {JS::PropertyAttribute::Enumerable} + ) + )); + return true; + } + } + } + + if (!item) { // NULL if the key is not present + desc.set(mozilla::Nothing()); // JS objects return undefined for nonpresent keys + } else { + desc.set(mozilla::Some( + JS::PropertyDescriptor::Data( + jsTypeFactory(cx, item), + {JS::PropertyAttribute::Writable, JS::PropertyAttribute::Enumerable} + ) + )); + } + return true; +} + +void PyDictOrObjectProxyHandler::handleFinalize(JSObject *proxy) { + // We cannot call Py_DECREF here when shutting down as the thread state is gone. + // Then, when shutting down, there is only on reference left, and we don't need + // to free the object since the entire process memory is being released. + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + + if (Py_REFCNT(self) > 1) { + Py_DECREF(self); + } +} \ No newline at end of file diff --git a/src/PyDictProxyHandler.cc b/src/PyDictProxyHandler.cc index e885aaa1..56a47820 100644 --- a/src/PyDictProxyHandler.cc +++ b/src/PyDictProxyHandler.cc @@ -27,64 +27,20 @@ const char PyDictProxyHandler::family = 0; - -static bool object_toString(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - args.rval().setString(JS_NewStringCopyZ(cx, "[object Object]")); - return true; -} - -static bool object_toLocaleString(JSContext *cx, unsigned argc, JS::Value *vp) { - return object_toString(cx, argc, vp); -} - -static bool object_valueOf(JSContext *cx, unsigned argc, JS::Value *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - - JS::RootedObject proxy(cx, JS::ToObject(cx, args.thisv())); - if (!proxy) { - return false; - } +bool PyDictProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + PyObject *keys = PyDict_Keys(self); - // return ref to self - args.rval().set(jsTypeFactory(cx, self)); - return true; -} - - -static JSMethodDef object_methods[] = { - {"toString", object_toString, 0}, - {"toLocaleString", object_toLocaleString, 0}, - {"valueOf", object_valueOf, 0}, - {NULL, NULL, 0} -}; - - -bool PyDictProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { - PyObject *keys = PyDict_Keys(pyObject); size_t length = PyList_Size(keys); - if (!props.reserve(length)) { - return false; // out of memory - } - for (size_t i = 0; i < length; i++) { - PyObject *key = PyList_GetItem(keys, i); - JS::RootedId jsId(cx); - if (!keyToId(key, &jsId)) { - // TODO (Caleb Aikens): raise exception here - return false; // key is not a str or int - } - props.infallibleAppend(jsId); - } - return true; + return handleOwnPropertyKeys(cx, keys, length, props); } bool PyDictProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const { PyObject *attrName = idToKey(cx, id); - if (PyDict_DelItem(pyObject, attrName) < 0) { + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + if (PyDict_DelItem(self, attrName) < 0) { return result.failCantDelete(); // raises JS exception } return result.succeed(); @@ -99,42 +55,11 @@ bool PyDictProxyHandler::getOwnPropertyDescriptor( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::MutableHandle> desc ) const { - // see if we're calling a function - if (id.isString()) { - for (size_t index = 0;; index++) { - bool isThatFunction; - const char *methodName = object_methods[index].name; - if (methodName == NULL) { // reached end of list - break; - } - else if (JS_StringEqualsAscii(cx, id.toString(), methodName, &isThatFunction) && isThatFunction) { - JSFunction *newFunction = JS_NewFunction(cx, object_methods[index].call, object_methods[index].nargs, 0, NULL); - if (!newFunction) return false; - JS::RootedObject funObj(cx, JS_GetFunctionObject(newFunction)); - desc.set(mozilla::Some( - JS::PropertyDescriptor::Data( - JS::ObjectValue(*funObj), - {JS::PropertyAttribute::Enumerable} - ) - )); - return true; - } - } - } - PyObject *attrName = idToKey(cx, id); - PyObject *item = PyDict_GetItemWithError(pyObject, attrName); - if (!item) { // NULL if the key is not present - desc.set(mozilla::Nothing()); // JS objects return undefined for nonpresent keys - } else { - desc.set(mozilla::Some( - JS::PropertyDescriptor::Data( - jsTypeFactory(cx, item), - {JS::PropertyAttribute::Writable, JS::PropertyAttribute::Enumerable} - ) - )); - } - return true; + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + PyObject *item = PyDict_GetItemWithError(self, attrName); + + return handleGetOwnPropertyDescriptor(cx, id, desc, item); } bool PyDictProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, @@ -143,7 +68,8 @@ bool PyDictProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId JS::RootedValue *rootedV = new JS::RootedValue(cx, v); PyObject *attrName = idToKey(cx, id); JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - if (PyDict_SetItem(pyObject, attrName, pyTypeFactory(cx, global, rootedV)->getPyObject())) { + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + if (PyDict_SetItem(self, attrName, pyTypeFactory(cx, global, rootedV)->getPyObject())) { return result.failCantSetInterposed(); // raises JS exception } return result.succeed(); @@ -157,7 +83,8 @@ bool PyDictProxyHandler::enumerate(JSContext *cx, JS::HandleObject proxy, bool PyDictProxyHandler::hasOwn(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp) const { PyObject *attrName = idToKey(cx, id); - *bp = PyDict_Contains(pyObject, attrName) == 1; + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + *bp = PyDict_Contains(self, attrName) == 1; return true; } @@ -168,13 +95,7 @@ bool PyDictProxyHandler::getOwnEnumerablePropertyKeys( } void PyDictProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { - // We cannot call Py_DECREF here when shutting down as the thread state is gone. - // Then, when shutting down, there is only on reference left, and we don't need - // to free the object since the entire process memory is being released. - PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - if (Py_REFCNT(self) > 1) { - Py_DECREF(self); - } + return handleFinalize(proxy); } bool PyDictProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 9acb8a01..1b27aed9 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -1960,12 +1960,13 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( } } + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); // "length" property bool isLengthProperty; if (id.isString() && JS_StringEqualsLiteral(cx, id.toString(), "length", &isLengthProperty) && isLengthProperty) { desc.set(mozilla::Some( JS::PropertyDescriptor::Data( - JS::Int32Value(PyList_Size(pyObject)) + JS::Int32Value(PyList_Size(self)) ) )); return true; @@ -2018,7 +2019,7 @@ bool PyListProxyHandler::getOwnPropertyDescriptor( // item Py_ssize_t index; PyObject *item; - if (idToIndex(cx, id, &index) && (item = PyList_GetItem(pyObject, index))) { + if (idToIndex(cx, id, &index) && (item = PyList_GetItem(self, index))) { desc.set(mozilla::Some( JS::PropertyDescriptor::Data( jsTypeFactory(cx, item), @@ -2061,7 +2062,8 @@ bool PyListProxyHandler::defineProperty( JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); JS::RootedValue *itemV = new JS::RootedValue(cx, desc.value()); PyObject *item = pyTypeFactory(cx, global, itemV)->getPyObject(); - if (PyList_SetItem(pyObject, index, item) < 0) { + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + if (PyList_SetItem(self, index, item) < 0) { return result.failBadIndex(); } return result.succeed(); @@ -2069,7 +2071,8 @@ bool PyListProxyHandler::defineProperty( bool PyListProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const { // Modified from https://hg.mozilla.org/releases/mozilla-esr102/file/3b574e1/dom/base/RemoteOuterWindowProxy.cpp#l137 - int32_t length = PyList_Size(pyObject); + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); + int32_t length = PyList_Size(self); if (!props.reserve(length + 1)) { return false; } @@ -2084,12 +2087,13 @@ bool PyListProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy, bool PyListProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::ObjectOpResult &result) const { Py_ssize_t index; + PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); if (!idToIndex(cx, id, &index)) { return result.failBadIndex(); // report failure } // Set to undefined instead of actually deleting it - if (PyList_SetItem(pyObject, index, Py_None) < 0) { + if (PyList_SetItem(self, index, Py_None) < 0) { return result.failCantDelete(); // report failure } return result.succeed(); // report success diff --git a/src/PyObjectProxyHandler.cc b/src/PyObjectProxyHandler.cc index a4b067e9..66c03ced 100644 --- a/src/PyObjectProxyHandler.cc +++ b/src/PyObjectProxyHandler.cc @@ -40,20 +40,7 @@ bool PyObjectProxyHandler::ownPropertyKeys(JSContext *cx, JS::HandleObject proxy size_t length = PyList_Size(nonDunderKeys); - if (!props.reserve(length)) { - return false; // out of memory - } - - for (size_t i = 0; i < length; i++) { - PyObject *key = PyList_GetItem(nonDunderKeys, i); - JS::RootedId jsId(cx); - if (!keyToId(key, &jsId)) { - // TODO (Caleb Aikens): raise exception here - return false; // key is not a str or int - } - props.infallibleAppend(jsId); - } - return true; + return handleOwnPropertyKeys(cx, nonDunderKeys, length, props); } bool PyObjectProxyHandler::delete_(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, @@ -78,17 +65,8 @@ bool PyObjectProxyHandler::getOwnPropertyDescriptor( PyObject *attrName = idToKey(cx, id); PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); PyObject *item = PyObject_GetAttr(self, attrName); - if (!item) { // NULL if the key is not present - desc.set(mozilla::Nothing()); // JS objects return undefined for nonpresent keys - } else { - desc.set(mozilla::Some( - JS::PropertyDescriptor::Data( - jsTypeFactory(cx, item), - {JS::PropertyAttribute::Writable, JS::PropertyAttribute::Enumerable} - ) - )); - } - return true; + + return handleGetOwnPropertyDescriptor(cx, id, desc, item); } bool PyObjectProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, @@ -124,13 +102,7 @@ bool PyObjectProxyHandler::getOwnEnumerablePropertyKeys( } void PyObjectProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { - // We cannot call Py_DECREF here when shutting down as the thread state is gone. - // Then, when shutting down, there is only on reference left, and we don't need - // to free the object since the entire process memory is being released. - PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - if (Py_REFCNT(self) > 1) { - Py_DECREF(self); - } + return handleFinalize(proxy); } bool PyObjectProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, @@ -139,4 +111,10 @@ bool PyObjectProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, JS::ObjectOpResult &result) const { // Block direct `Object.defineProperty` since we already have the `set` method return result.failInvalidDescriptor(); +} + +bool PyObjectProxyHandler::getBuiltinClass(JSContext *cx, JS::HandleObject proxy, + js::ESClass *cls) const { + *cls = js::ESClass::Object; + return true; } \ No newline at end of file diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 6f1c2b23..fba88e2a 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -45,6 +45,10 @@ #define LOW_SURROGATE_END 0xDFFF #define BMP_END 0x10000 +static PyDictProxyHandler pyDictProxyHandler; +static PyObjectProxyHandler pyObjectProxyHandler; +static PyListProxyHandler pyListProxyHandler; + std::unordered_map charToPyObjectMap; // a map of char16_t buffers to their corresponding PyObjects, used when finalizing JSExternalStrings @@ -209,11 +213,11 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { if (PyList_Check(object)) { JS::RootedObject arrayPrototype(cx); JS_GetClassPrototype(cx, JSProto_Array, &arrayPrototype); // so that instanceof will work, not that prototype methods will - proxy = js::NewProxyObject(cx, new PyListProxyHandler(object), v, arrayPrototype.get()); + proxy = js::NewProxyObject(cx, &pyListProxyHandler, v, arrayPrototype.get()); } else { JS::RootedObject objectPrototype(cx); JS_GetClassPrototype(cx, JSProto_Object, &objectPrototype); // so that instanceof will work, not that prototype methods will - proxy = js::NewProxyObject(cx, new PyDictProxyHandler(object), v, objectPrototype.get()); + proxy = js::NewProxyObject(cx, &pyDictProxyHandler, v, objectPrototype.get()); } Py_INCREF(object); JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(object)); @@ -234,7 +238,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { JS::RootedValue v(cx); JS::RootedObject objectPrototype(cx); JS_GetClassPrototype(cx, JSProto_Object, &objectPrototype); // so that instanceof will work, not that prototype methods will - JSObject *proxy = js::NewProxyObject(cx, new PyObjectProxyHandler(object), v, objectPrototype.get()); + JSObject *proxy = js::NewProxyObject(cx, &pyObjectProxyHandler, v, objectPrototype.get()); Py_INCREF(object); JS::SetReservedSlot(proxy, PyObjectSlot, JS::PrivateValue(object)); returnType.setObject(*proxy); diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index 901c7b80..517cfaa1 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -94,13 +94,13 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted JS_ValueToObject(cx, *rval, &obj); if (JS::GetClass(obj)->isProxyObject()) { if (js::GetProxyHandler(obj)->family() == &PyDictProxyHandler::family) { // this is one of our proxies for python dicts - return new DictType(((PyDictProxyHandler *)js::GetProxyHandler(obj))->pyObject); + return new DictType(JS::GetMaybePtrFromReservedSlot(obj, PyObjectSlot)); } if (js::GetProxyHandler(obj)->family() == &PyListProxyHandler::family) { // this is one of our proxies for python lists - return new ListType(((PyListProxyHandler *)js::GetProxyHandler(obj))->pyObject); + return new ListType(JS::GetMaybePtrFromReservedSlot(obj, PyObjectSlot)); } if (js::GetProxyHandler(obj)->family() == &PyObjectProxyHandler::family) { // this is one of our proxies for python objects - return new PyType(((PyObjectProxyHandler *)js::GetProxyHandler(obj))->pyObject); + return new PyType(JS::GetMaybePtrFromReservedSlot(obj, PyObjectSlot)); } } js::ESClass cls; From b9250f947d6a527ee1c0df56bdbe085f225a02e5 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Tue, 13 Feb 2024 15:43:26 -0500 Subject: [PATCH 0280/1086] fixed english --- tests/python/test_event_loop.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/python/test_event_loop.py b/tests/python/test_event_loop.py index a5d3cc83..3466857d 100644 --- a/tests/python/test_event_loop.py +++ b/tests/python/test_event_loop.py @@ -208,13 +208,13 @@ async def coro_to_throw1(): # TODO (Tom Tang): properly test unhandled rejection # await scheduled jobs on the Python event-loop - js_sleep = pm.eval("(second) => new Promise((resolve) => setTimeout(resolve, second*1000))") - def py_sleep(second): # asyncio.sleep has issues on Python 3.8 + js_sleep = pm.eval("(seconds) => new Promise((resolve) => setTimeout(resolve, seconds*1000))") + def py_sleep(seconds): # asyncio.sleep has issues on Python 3.8 loop = asyncio.get_running_loop() future = loop.create_future() - loop.call_later(second, lambda:future.set_result(None)) + loop.call_later(seconds, lambda:future.set_result(None)) return future - both_sleep = pm.eval("(js_sleep, py_sleep) => async (second) => { await js_sleep(second); await py_sleep(second) }")(js_sleep, py_sleep) + both_sleep = pm.eval("(js_sleep, py_sleep) => async (seconds) => { await js_sleep(seconds); await py_sleep(seconds) }")(js_sleep, py_sleep) await asyncio.wait_for(both_sleep(0.1), timeout=0.3) # won't be precisely 0.2s with pytest.raises(asyncio.exceptions.TimeoutError): await asyncio.wait_for(both_sleep(0.1), timeout=0.19) @@ -248,4 +248,4 @@ async def async_fn(): # making sure the async_fn is run return True - assert asyncio.run(async_fn()) + assert asyncio.run(async_fn()) \ No newline at end of file From dba06b3f32aaa5a87e84e9a3608c2873ef415b22 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Wed, 14 Feb 2024 11:27:20 -0500 Subject: [PATCH 0281/1086] test(PyObjectProxyHandler): write a test suit for PyObjectProxyHandler, fix bug where error was raised rather than returning undefined when accessing non-existent attribute on a python object from JavaScript --- src/PyObjectProxyHandler.cc | 3 + tests/python/test_objects.py | 138 +++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 tests/python/test_objects.py diff --git a/src/PyObjectProxyHandler.cc b/src/PyObjectProxyHandler.cc index 66c03ced..1c548d47 100644 --- a/src/PyObjectProxyHandler.cc +++ b/src/PyObjectProxyHandler.cc @@ -65,6 +65,9 @@ bool PyObjectProxyHandler::getOwnPropertyDescriptor( PyObject *attrName = idToKey(cx, id); PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); PyObject *item = PyObject_GetAttr(self, attrName); + if (!item) { // clear error, we will be returning undefined in this case + PyErr_Clear(); + } return handleGetOwnPropertyDescriptor(cx, id, desc, item); } diff --git a/tests/python/test_objects.py b/tests/python/test_objects.py new file mode 100644 index 00000000..3e487554 --- /dev/null +++ b/tests/python/test_objects.py @@ -0,0 +1,138 @@ +import pythonmonkey as pm + +def test_eval_pyobjects(): + class MyClass: + pass + + o = MyClass() + proxy_o = pm.eval("(obj) => { return obj; }")(o) + assert o is proxy_o + +def test_eval_pyobjects_subobjects(): + class InnerClass: + def __init__(self): + self.c = 2 + + class OuterClass: + def __init__(self): + self.a = 1 + self.b = InnerClass() + + o = OuterClass() + + assert pm.eval("(obj) => { return obj.a; }")(o) == 1.0 + assert pm.eval("(obj) => { return obj.b; }")(o) is o.b + assert pm.eval("(obj) => { return obj.b.c; }")(o) == 2.0 + +def test_eval_pyobjects_cycle(): + class MyClass: + def __init__(self): + self.a = 1 + self.b = 2 + self.recursive = self + + o = MyClass() + + assert pm.eval("(obj) => { return obj.a; }")(o) == 1.0 + assert pm.eval("(obj) => { return obj.b; }")(o) == 2.0 + assert pm.eval("(obj) => { return obj.recursive; }")(o) is o.recursive + +def test_eval_pyobjects_proxy_get(): + class MyClass: + def __init__(self): + self.a = 42 + + o = MyClass() + + assert pm.eval("(obj) => { return obj.a}")(o) == 42.0 + +def test_eval_pyobjects_proxy_set(): + class MyClass: + def __init__(self): + self.a = 42 + + o = MyClass() + + pm.eval("(obj) => { obj.b = 43; }")(o) + assert o.b == 43.0 + +def test_eval_pyobjects_proxy_keys(): + class MyClass: + def __init__(self): + self.a = 42 + + o = MyClass() + + assert pm.eval("(obj) => { return Object.keys(obj)[0]; }")(o) == 'a' + +def test_eval_pyobjects_proxy_delete(): + class MyClass: + def __init__(self): + self.a = 42 + + o = MyClass() + + pm.eval("(obj) => { delete obj.a; }")(o) + assert not hasattr(o, 'a') + +def test_eval_pyobjects_proxy_has(): + class MyClass: + def __init__(self): + self.a = 42 + + o = MyClass() + + assert pm.eval("(obj) => { return 'a' in obj; }")(o) + +def test_eval_pyobjects_proxy_not_extensible(): + class MyClass: + def __init__(self): + self.a = 42 + + o = MyClass() + + assert not pm.eval("(o) => Object.isExtensible(o)")(o) + assert pm.eval("(o) => Object.preventExtensions(o) === o")(o) + +def test_instanceof_pyobject(): + class MyClass: + def __init__(self): + self.a = 42 + + o = MyClass() + assert pm.eval("(obj) => { return obj instanceof Object; }")(o) + +def test_pyobjects_not_instanceof_string(): + class MyClass: + def __init__(self): + self.a = 42 + + o = MyClass() + + assert not pm.eval("(obj) => { return obj instanceof String; }")(o) + +def test_pyobjects_valueOf(): + class MyClass: + def __init__(self): + self.a = 42 + + o = MyClass() + assert o is pm.eval("(obj) => { return obj.valueOf(); }")(o) + +def test_pyobjects_toString(): + class MyClass: + def __init__(self): + self.a = 42 + + o = MyClass() + assert '[object Object]' == pm.eval("(obj) => { return obj.toString(); }")(o) + +def test_pyobjects_toLocaleString(): + class MyClass: + def __init__(self): + self.a = 42 + + o = MyClass() + assert '[object Object]' == pm.eval("(obj) => { return obj.toLocaleString(); }")(o) + + \ No newline at end of file From 270218302df61f30d11c74c570e9fc0b5044b4de Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Wed, 14 Feb 2024 13:02:17 -0500 Subject: [PATCH 0282/1086] refactor(pyTypeFactory): refactor pyTypeFactory to use recursive calls for boxed objects --- src/pyTypeFactory.cc | 58 +++++++++++++++----------------------------- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index 517cfaa1..b9f05986 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -109,23 +109,20 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted cls = js::ESClass::Function; // In SpiderMonkey 115 ESR, bound function is no longer a JSFunction but a js::BoundFunctionObject. // js::ESClass::Function only assigns to JSFunction objects by JS::GetBuiltinClass. } + JS::RootedValue unboxed(cx); switch (cls) { - case js::ESClass::Boolean: { - // TODO (Caleb Aikens): refactor out all `js::Unbox` calls - // TODO (Caleb Aikens): refactor using recursive call to `pyTypeFactory` - JS::RootedValue unboxed(cx); - js::Unbox(cx, obj, &unboxed); - return new BoolType(unboxed.toBoolean()); - } - case js::ESClass::Date: { - return new DateType(cx, obj); - } - case js::ESClass::Promise: { - return new PromiseType(cx, obj); - } - case js::ESClass::Error: { - return new ExceptionType(cx, obj); - } + case js::ESClass::Boolean: + case js::ESClass::Number: + case js::ESClass::BigInt: + case js::ESClass::String: + js::Unbox(cx, obj, &unboxed); + return pyTypeFactory(cx, thisObj, &unboxed); + case js::ESClass::Date: + return new DateType(cx, obj); + case js::ESClass::Promise: + return new PromiseType(cx, obj); + case js::ESClass::Error: + return new ExceptionType(cx, obj); case js::ESClass::Function: { PyObject *pyFunc; FuncType *f; @@ -139,29 +136,12 @@ PyType *pyTypeFactory(JSContext *cx, JS::Rooted *thisObj, JS::Rooted } return f; } - case js::ESClass::Number: { - JS::RootedValue unboxed(cx); - js::Unbox(cx, obj, &unboxed); - return new FloatType(unboxed.toNumber()); - } - case js::ESClass::BigInt: { - JS::RootedValue unboxed(cx); - js::Unbox(cx, obj, &unboxed); - return new IntType(cx, unboxed.toBigInt()); - } - case js::ESClass::String: { - JS::RootedValue unboxed(cx); - js::Unbox(cx, obj, &unboxed); - return new StrType(cx, unboxed.toString()); - } - case js::ESClass::Array: { - return new ListType(cx, obj); - } - default: { - if (BufferType::isSupportedJsTypes(obj)) { // TypedArray or ArrayBuffer - // TODO (Tom Tang): ArrayBuffers have cls == js::ESClass::ArrayBuffer - return new BufferType(cx, obj); - } + case js::ESClass::Array: + return new ListType(cx, obj); + default: + if (BufferType::isSupportedJsTypes(obj)) { // TypedArray or ArrayBuffer + // TODO (Tom Tang): ArrayBuffers have cls == js::ESClass::ArrayBuffer + return new BufferType(cx, obj); } } return new DictType(cx, *rval); From 3de663de0873a2503bb0ae92e59d90dce8cf9e95 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Thu, 15 Feb 2024 09:04:52 -0500 Subject: [PATCH 0283/1086] chore(TODO): resolve various TODOs related to exception handling --- src/JSArrayProxy.cc | 4 ++-- src/JSObjectProxy.cc | 20 ++++++++++---------- src/PyDictOrObjectProxyHandler.cc | 3 +-- src/jsTypeFactory.cc | 2 -- tests/python/test_functions_this.py | 2 +- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 673efc22..735e614b 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -53,8 +53,8 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py { JS::RootedId id(GLOBAL_CX); if (!keyToId(key, &id)) { - // TODO (Caleb Aikens): raise exception here - return NULL; // key is not a str or int + PyErr_SetString(PyExc_AttributeError, "JSArrayProxy property name must be of type str or int"); + return NULL; } // look through the methods for dispatch and return key if no method found diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 7e29fdd7..4a4e8b3a 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -71,7 +71,7 @@ Py_ssize_t JSObjectProxyMethodDefinitions::JSObjectProxy_length(JSObjectProxy *s JS::RootedIdVector props(GLOBAL_CX); if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { - // @TODO (Caleb Aikens) raise exception here + PyErr_Format(SpiderMonkeyError, "Failed to retrieve properties when calculating length of: %S", self); return -1; } return props.length(); @@ -81,8 +81,8 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, { JS::RootedId id(GLOBAL_CX); if (!keyToId(key, &id)) { - // TODO (Caleb Aikens): raise exception here - return NULL; // key is not a str or int + PyErr_SetString(PyExc_AttributeError, "JSObjectProxy property name must be of type str or int"); + return NULL; } // look through the methods for dispatch @@ -93,7 +93,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); JS::RootedObject *thisObj = new JS::RootedObject(GLOBAL_CX, self->jsObject); // if value is a JSFunction, bind `this` to self - /* TODO (Caleb Aikens) its potentially problematic to bind it like this since if the function + /* (Caleb Aikens) its potentially problematic to bind it like this since if the function * ever gets assigned to another object like so: * * jsObjA.func = jsObjB.func @@ -134,8 +134,8 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, { JS::RootedId id(GLOBAL_CX); if (!keyToId(key, &id)) { - // TODO (Caleb Aikens): raise exception here - return -1; // key is not a str or int + PyErr_SetString(PyExc_AttributeError, "JSObjectProxy property name must be of type str or int"); + return -1; } JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); @@ -146,7 +146,7 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, Py { JS::RootedId id(GLOBAL_CX); if (!keyToId(key, &id)) { // invalid key - // TODO (Caleb Aikens): raise exception here + PyErr_SetString(PyExc_AttributeError, "JSObjectProxy property name must be of type str or int"); return -1; } @@ -208,7 +208,7 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr JS::RootedIdVector props(GLOBAL_CX); if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { - // @TODO (Caleb Aikens) raise exception here + PyErr_Format(SpiderMonkeyError, "During rich comparison, failed to retrieve property keys of: %S", self); return NULL; } @@ -591,7 +591,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy skip_optional: JS::RootedId id(GLOBAL_CX); if (!keyToId(key, &id)) { - // TODO (Caleb Aikens): raise exception here PyObject *seq = PyTuple_New(length); + PyErr_SetString(PyExc_AttributeError, "JSObjectProxy property name must be of type str or int"); return NULL; } @@ -618,7 +618,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method(JSObjectPro JS::RootedIdVector props(GLOBAL_CX); if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { - // @TODO (Caleb Aikens) raise exception here + PyErr_Format(SpiderMonkeyError, "During clear(), failed to retrieve property keys of: %S", self); return NULL; } diff --git a/src/PyDictOrObjectProxyHandler.cc b/src/PyDictOrObjectProxyHandler.cc index 6f56dda7..3b41b5a4 100644 --- a/src/PyDictOrObjectProxyHandler.cc +++ b/src/PyDictOrObjectProxyHandler.cc @@ -57,8 +57,7 @@ bool PyDictOrObjectProxyHandler::handleOwnPropertyKeys(JSContext *cx, PyObject * PyObject *key = PyList_GetItem(keys, i); JS::RootedId jsId(cx); if (!keyToId(key, &jsId)) { - // TODO (Caleb Aikens): raise exception here - return false; // key is not a str or int + continue; // skip over keys that are not str or int } props.infallibleAppend(jsId); } diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index fba88e2a..c89642e5 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -299,7 +299,6 @@ bool callPyFunc(JSContext *cx, unsigned int argc, JS::Value *vp) { setPyException(cx); return false; } - // @TODO (Caleb Aikens) need to check for python exceptions here callargs.rval().set(jsTypeFactory(cx, pyRval)); return true; } @@ -320,7 +319,6 @@ bool callPyFunc(JSContext *cx, unsigned int argc, JS::Value *vp) { setPyException(cx); return false; } - // @TODO (Caleb Aikens) need to check for python exceptions here callargs.rval().set(jsTypeFactory(cx, pyRval)); if (PyErr_Occurred()) { setPyException(cx); diff --git a/tests/python/test_functions_this.py b/tests/python/test_functions_this.py index c2eb0199..0d376d09 100644 --- a/tests/python/test_functions_this.py +++ b/tests/python/test_functions_this.py @@ -115,7 +115,7 @@ class Class: return jsObj.jsMethod(4); } """)(jsObj) - assert pyObj == result[0] and 4 == result[1] #TODO (Caleb Aikens) should `this` be `pyObj` or `jsObj` here? + assert pyObj == result[0] and 4 == result[1] #require def test_require_correct_this(): From cb57161b77c8c7999acc7941214d9b75c7b83b27 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Thu, 15 Feb 2024 13:50:17 -0500 Subject: [PATCH 0284/1086] more precise error reporting --- src/setSpiderMonkeyException.cc | 2 +- tests/python/test_event_loop.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/setSpiderMonkeyException.cc b/src/setSpiderMonkeyException.cc index 9826771f..a4f8c72b 100644 --- a/src/setSpiderMonkeyException.cc +++ b/src/setSpiderMonkeyException.cc @@ -41,7 +41,7 @@ PyObject *getExceptionString(JSContext *cx, const JS::ExceptionStack &exceptionS std::string offsetSpaces(errorReport->tokenOffset(), ' '); // number of spaces equal to tokenOffset std::string linebuf; // the offending JS line of code (can be empty) - outStrStream << "Error in file " << errorReport->filename << ", on line " << errorReport->lineno << ":\n"; + outStrStream << "Error in file " << errorReport->filename << ", on line " << errorReport->lineno << ", column " << errorReport->column << ":\n"; if (errorReport->linebuf()) { std::wstring_convert, char16_t> convert; std::u16string u16linebuf(errorReport->linebuf()); diff --git a/tests/python/test_event_loop.py b/tests/python/test_event_loop.py index 3466857d..73592aaf 100644 --- a/tests/python/test_event_loop.py +++ b/tests/python/test_event_loop.py @@ -198,7 +198,7 @@ async def coro_to_throw1(): # FIXME (Tom Tang): We currently handle Promise exceptions by converting the object thrown to a Python Exception object through `pyTypeFactory` # # await pm.eval("Promise.resolve().then(()=>{ throw {a:1,toString(){return'anything'}} })") - with pytest.raises(pm.SpiderMonkeyError, match="on line 1:\nTypeError: undefined has no properties"): # not going through the conversion + with pytest.raises(pm.SpiderMonkeyError, match="on line 1, column 31:\nTypeError: undefined has no properties"): # not going through the conversion await pm.eval("Promise.resolve().then(()=>{ (undefined).prop })") # TODO (Tom Tang): Modify this testcase once we support ES2020-style dynamic import From e28e16069423fbf382345db8b64968704dc3d89c Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Thu, 15 Feb 2024 13:51:56 -0500 Subject: [PATCH 0285/1086] simplification --- src/jsTypeFactory.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index c7ce7ac1..f738b658 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -223,9 +223,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { returnType.setNull(); } else if (PythonAwaitable_Check(object)) { - PromiseType *p = new PromiseType(object); - JSObject *promise = p->toJsPromise(cx); // may return null - returnType.setObjectOrNull(promise); + returnType.setObjectOrNull((new PromiseType(object))->toJsPromise(cx)); } else { JS::RootedValue v(cx); From 9416d920670322e481bbb107e91d53e963a9ad43 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Thu, 15 Feb 2024 16:17:31 -0500 Subject: [PATCH 0286/1086] fix(JSFunctionProxy): correctly error out if an error occurs during a call to a JSFunctionProxy --- src/JSFunctionProxy.cc | 4 ++++ src/JSMethodProxy.cc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc index 49325453..6a8c93e1 100644 --- a/src/JSFunctionProxy.cc +++ b/src/JSFunctionProxy.cc @@ -55,5 +55,9 @@ PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_call(PyObject *self, return NULL; } + if (PyErr_Occurred()) { + return NULL; + } + return pyTypeFactory(cx, &thisObj, jsReturnVal)->getPyObject(); } \ No newline at end of file diff --git a/src/JSMethodProxy.cc b/src/JSMethodProxy.cc index 813c6703..c86c87fe 100644 --- a/src/JSMethodProxy.cc +++ b/src/JSMethodProxy.cc @@ -66,6 +66,10 @@ PyObject *JSMethodProxyMethodDefinitions::JSMethodProxy_call(PyObject *self, PyO return NULL; } + if (PyErr_Occurred()) { + return NULL; + } + JS::RootedObject globalObj(cx, JS::CurrentGlobalOrNull(cx)); return pyTypeFactory(cx, &globalObj, jsReturnVal)->getPyObject(); } \ No newline at end of file From b1c3b6b4daeb603d7d04b6d48b479045105ba066 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 16 Feb 2024 14:22:04 +0000 Subject: [PATCH 0287/1086] refactor: return `timeoutID` using `.setNumber()` --- src/internalBinding/timers.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internalBinding/timers.cc b/src/internalBinding/timers.cc index df1757d2..035a26a7 100644 --- a/src/internalBinding/timers.cc +++ b/src/internalBinding/timers.cc @@ -32,7 +32,7 @@ static bool enqueueWithDelay(JSContext *cx, unsigned argc, JS::Value *vp) { PyEventLoop::AsyncHandle handle = loop.enqueueWithDelay(job, delaySeconds); // Return the `timeoutID` to use in `clearTimeout` - args.rval().setDouble((double)PyEventLoop::AsyncHandle::getUniqueId(std::move(handle))); + args.rval().setNumber(PyEventLoop::AsyncHandle::getUniqueId(std::move(handle))); return true; } From 5a25afd9c618dba7f30227f8ab3f90b932320731 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 16 Feb 2024 15:09:38 +0000 Subject: [PATCH 0288/1086] test(event-loop): complete TODO tests in `test_event_loop.py` --- tests/python/test_event_loop.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/python/test_event_loop.py b/tests/python/test_event_loop.py index 1377f400..1fe0f7ab 100644 --- a/tests/python/test_event_loop.py +++ b/tests/python/test_event_loop.py @@ -37,8 +37,16 @@ def to_raise(msg): # `setTimeout` should allow passing additional arguments to the callback, as spec-ed assert 3.0 == await pm.eval("new Promise((resolve) => setTimeout(function(){ resolve(arguments.length) }, 100, 90, 91, 92))") assert 92.0 == await pm.eval("new Promise((resolve) => setTimeout((...args) => { resolve(args[2]) }, 100, 90, 91, 92))") - # TODO (Tom Tang): test `setTimeout` setting delay to 0 if < 0 - # TODO (Tom Tang): test `setTimeout` accepting string as the delay, coercing to a number like parseFloat + # test `setTimeout` setting delay to 0 if < 0 + await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, 0))"), timeout=0.02) + await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, -10000))"), timeout=0.02) # won't be precisely 0s + # test `setTimeout` accepting string as the delay, coercing to a number. + # Number('100') -> 100, pass if the actual delay is > 90ms and < 120ms + await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, '100'))"), timeout=0.12) # won't be precisely 100ms + with pytest.raises(asyncio.exceptions.TimeoutError): + await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, '100'))"), timeout=0.09) + # Number("1 second") -> NaN -> delay turns to be 0s + await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, '1 second'))"), timeout=0.02) # won't be precisely 0s # passing an invalid ID to `clearTimeout` should silently do nothing; no exception is thrown. pm.eval("clearTimeout(NaN)") From 4ac7aab75502cb391aa8893c292cfa83bc72c974 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 16 Feb 2024 15:21:19 +0000 Subject: [PATCH 0289/1086] test(event-loop): loosen `setTimeout(..., 0)` timeout to 0.05s because it won't be precisely 0s --- tests/python/test_event_loop.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/python/test_event_loop.py b/tests/python/test_event_loop.py index 1fe0f7ab..ef823449 100644 --- a/tests/python/test_event_loop.py +++ b/tests/python/test_event_loop.py @@ -38,15 +38,15 @@ def to_raise(msg): assert 3.0 == await pm.eval("new Promise((resolve) => setTimeout(function(){ resolve(arguments.length) }, 100, 90, 91, 92))") assert 92.0 == await pm.eval("new Promise((resolve) => setTimeout((...args) => { resolve(args[2]) }, 100, 90, 91, 92))") # test `setTimeout` setting delay to 0 if < 0 - await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, 0))"), timeout=0.02) - await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, -10000))"), timeout=0.02) # won't be precisely 0s + await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, 0))"), timeout=0.05) + await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, -10000))"), timeout=0.05) # won't be precisely 0s # test `setTimeout` accepting string as the delay, coercing to a number. - # Number('100') -> 100, pass if the actual delay is > 90ms and < 120ms - await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, '100'))"), timeout=0.12) # won't be precisely 100ms + # Number('100') -> 100, pass if the actual delay is > 90ms and < 150ms + await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, '100'))"), timeout=0.15) # won't be precisely 100ms with pytest.raises(asyncio.exceptions.TimeoutError): await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, '100'))"), timeout=0.09) # Number("1 second") -> NaN -> delay turns to be 0s - await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, '1 second'))"), timeout=0.02) # won't be precisely 0s + await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, '1 second'))"), timeout=0.05) # won't be precisely 0s # passing an invalid ID to `clearTimeout` should silently do nothing; no exception is thrown. pm.eval("clearTimeout(NaN)") From cdceef1b9cfc6ad467da805c96e98acb55984426 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Fri, 16 Feb 2024 11:15:48 -0500 Subject: [PATCH 0290/1086] crash fix --- src/PyEventLoop.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/PyEventLoop.cc b/src/PyEventLoop.cc index 160105a8..e24ee3cd 100644 --- a/src/PyEventLoop.cc +++ b/src/PyEventLoop.cc @@ -17,15 +17,19 @@ * @brief Wrapper to decrement the counter of queueing event-loop jobs after the job finishes */ static PyObject *eventLoopJobWrapper(PyObject *jobFn, PyObject *Py_UNUSED(_)) { - PyObject *ret = PyObject_CallObject(jobFn, NULL); // jobFn() - Py_XDECREF(ret); // don't care about its return value + PyObject *ret = PyObject_CallObject(jobFn, NULL); PyEventLoop::_locker->decCounter(); + if (!ret) { + return NULL; + } + Py_DECREF(ret); if (PyErr_Occurred()) { return NULL; } else { Py_RETURN_NONE; } } + static PyMethodDef jobWrapperDef = {"eventLoopJobWrapper", eventLoopJobWrapper, METH_NOARGS, NULL}; PyEventLoop::AsyncHandle PyEventLoop::enqueue(PyObject *jobFn) { @@ -33,7 +37,7 @@ PyEventLoop::AsyncHandle PyEventLoop::enqueue(PyObject *jobFn) { PyObject *wrapper = PyCFunction_New(&jobWrapperDef, jobFn); // Enqueue job to the Python event-loop // https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.call_soon - PyObject *asyncHandle = PyObject_CallMethod(_loop, "call_soon_threadsafe", "O", wrapper); // https://docs.python.org/3/c-api/arg.html#c.Py_BuildValue + PyObject *asyncHandle = PyObject_CallMethod(_loop, "call_soon_threadsafe", "O", wrapper); return PyEventLoop::AsyncHandle(asyncHandle); } @@ -42,7 +46,7 @@ PyEventLoop::AsyncHandle PyEventLoop::enqueueWithDelay(PyObject *jobFn, double d PyObject *wrapper = PyCFunction_New(&jobWrapperDef, jobFn); // Schedule job to the Python event-loop // https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.call_later - PyObject *asyncHandle = PyObject_CallMethod(_loop, "call_later", "dO", delaySeconds, wrapper); // https://docs.python.org/3/c-api/arg.html#c.Py_BuildValue + PyObject *asyncHandle = PyObject_CallMethod(_loop, "call_later", "dO", delaySeconds, wrapper); if (asyncHandle == nullptr) { PyErr_Print(); // RuntimeError: Non-thread-safe operation invoked on an event loop other than the current one } @@ -74,6 +78,7 @@ PyEventLoop::Future PyEventLoop::ensureFuture(PyObject *awaitable) { Py_DECREF(args); Py_DECREF(kwargs); + // Py_INCREF(futureObj); return PyEventLoop::Future(futureObj); } @@ -127,7 +132,7 @@ PyThreadState *PyEventLoop::_getMainThread() { // The last element in the linked-list of threads associated with the main interpreter should be the main thread // (The first element is the current thread, see https://github.com/python/cpython/blob/7cb3a44/Python/pystate.c#L291-L293) PyInterpreterState *interp = PyInterpreterState_Main(); - PyThreadState *tstate = PyInterpreterState_ThreadHead(interp); // https://docs.python.org/3/c-api/init.html#c.PyInterpreterState_ThreadHead + PyThreadState *tstate = PyInterpreterState_ThreadHead(interp); while (PyThreadState_Next(tstate) != nullptr) { tstate = PyThreadState_Next(tstate); } @@ -138,7 +143,7 @@ PyThreadState *PyEventLoop::_getMainThread() { PyThreadState *PyEventLoop::_getCurrentThread() { // `PyThreadState_Get` is used under the hood of the Python `asyncio.get_running_loop` method, // see https://github.com/python/cpython/blob/7cb3a44/Modules/_asynciomodule.c#L234 - return PyThreadState_Get(); // https://docs.python.org/3/c-api/init.html#c.PyThreadState_Get + return PyThreadState_Get(); } /* static */ From 52888781c11de6553e39c400ef4b0362a96a4cce Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 16 Feb 2024 16:20:31 +0000 Subject: [PATCH 0291/1086] ci: use GitHub hosted runners to build for arm64 macOS --- .github/workflows/test-and-publish.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index a2b2e97d..2a742d08 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -25,8 +25,8 @@ jobs: strategy: fail-fast: false matrix: - # Use Ubuntu 20.04 / macOS 13 + Python 3.10 to build SpiderMonkey - os: [ 'ubuntu-20.04', 'macos-13', 'm2ci' ] + # Use Ubuntu 20.04 / macOS 13 x86_64 / macOS 14 arm64 + Python 3.10 to build SpiderMonkey + os: [ 'ubuntu-20.04', 'macos-13', 'macos-14-arm64' ] python_version: [ '3.10' ] runs-on: ${{ matrix.os }} steps: @@ -88,7 +88,7 @@ jobs: fail-fast: false matrix: # The lowest supported version is Ubuntu 20.04 + Python 3.8 or macOS 12 + Python 3.9 - os: [ 'ubuntu-20.04', 'macos-12', 'windows-2019', 'm2ci' ] + os: [ 'ubuntu-20.04', 'macos-12', 'windows-2019', 'macos-14-arm64' ] python_version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] exclude: # macOS 12 comes with Python 3.9 by default, so we drop ci support for Python 3.8 on macOS @@ -97,9 +97,9 @@ jobs: python_version: '3.8' # actions/setup-python: The version '3.8'/'3.9' with architecture 'arm64' was not found for macOS. # see https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json - - os: 'm2ci' + - os: 'macos-14-arm64' python_version: '3.8' - - os: 'm2ci' + - os: 'macos-14-arm64' python_version: '3.9' runs-on: ${{ matrix.os }} steps: From c402def5960a00d2ae4ca24ab4ea69417ef372bc Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 16 Feb 2024 16:27:58 +0000 Subject: [PATCH 0292/1086] ci: use GitHub hosted runners to build for arm64 macOS --- .github/workflows/test-and-publish.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 2a742d08..61c37d1d 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -26,7 +26,8 @@ jobs: fail-fast: false matrix: # Use Ubuntu 20.04 / macOS 13 x86_64 / macOS 14 arm64 + Python 3.10 to build SpiderMonkey - os: [ 'ubuntu-20.04', 'macos-13', 'macos-14-arm64' ] + os: [ 'ubuntu-20.04', 'macos-13', 'macos-14' ] # macOS 14 runner exclusively runs on M1 hardwares + # see https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available python_version: [ '3.10' ] runs-on: ${{ matrix.os }} steps: @@ -88,7 +89,7 @@ jobs: fail-fast: false matrix: # The lowest supported version is Ubuntu 20.04 + Python 3.8 or macOS 12 + Python 3.9 - os: [ 'ubuntu-20.04', 'macos-12', 'windows-2019', 'macos-14-arm64' ] + os: [ 'ubuntu-20.04', 'macos-12', 'windows-2019', 'macos-14' ] python_version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] exclude: # macOS 12 comes with Python 3.9 by default, so we drop ci support for Python 3.8 on macOS @@ -97,9 +98,9 @@ jobs: python_version: '3.8' # actions/setup-python: The version '3.8'/'3.9' with architecture 'arm64' was not found for macOS. # see https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json - - os: 'macos-14-arm64' + - os: 'macos-14' python_version: '3.8' - - os: 'macos-14-arm64' + - os: 'macos-14' python_version: '3.9' runs-on: ${{ matrix.os }} steps: From d6b8abdf286f6bdb0e970cd4192ec55740e5c7b9 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 16 Feb 2024 12:34:11 -0500 Subject: [PATCH 0293/1086] fix(FinalizationRegistry): set the FinalizationRegistry cleanup callback so that it actually works, and add a test that ensures python functions passed through JS are finalized correctly --- src/modules/pythonmonkey/pythonmonkey.cc | 13 ++++++++++- tests/python/test_functions_this.py | 28 +++++++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 373918ba..58b0ff15 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -56,6 +56,15 @@ bool functionRegistryCallback(JSContext *cx, unsigned int argc, JS::Value *vp) { return true; } +static void cleanupFinalizationRegistry(JSFunction *callback, JSObject *global [[maybe_unused]], void *user_data [[maybe_unused]]) { + JS::ExposeObjectToActiveJS(JS_GetFunctionObject(callback)); + JS::RootedFunction rootedCallback(GLOBAL_CX, callback); + JS::RootedValue unused(GLOBAL_CX); + if (!JS_CallFunction(GLOBAL_CX, NULL, rootedCallback, JS::HandleValueArray::empty(), &unused)) { + setSpiderMonkeyException(GLOBAL_CX); + } +} + typedef struct { PyObject_HEAD } NullObject; @@ -471,7 +480,7 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) JS::RealmCreationOptions creationOptions = JS::RealmCreationOptions(); JS::RealmBehaviors behaviours = JS::RealmBehaviors(); - creationOptions.setWeakRefsEnabled(JS::WeakRefSpecifier::EnabledWithCleanupSome); // enable FinalizationRegistry + creationOptions.setWeakRefsEnabled(JS::WeakRefSpecifier::EnabledWithoutCleanupSome); // enable FinalizationRegistry creationOptions.setIteratorHelpersEnabled(true); JS::RealmOptions options = JS::RealmOptions(creationOptions, behaviours); static JSClass globalClass = {"global", JSCLASS_GLOBAL_FLAGS, &JS::DefaultGlobalClassOps}; @@ -645,5 +654,7 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) jsFunctionRegistry = new JS::PersistentRootedObject(GLOBAL_CX); jsFunctionRegistry->set(registryObject); + JS::SetHostCleanupFinalizationRegistryCallback(GLOBAL_CX, cleanupFinalizationRegistry, NULL); + return pyModule; } diff --git a/tests/python/test_functions_this.py b/tests/python/test_functions_this.py index 0d376d09..4ec6f13c 100644 --- a/tests/python/test_functions_this.py +++ b/tests/python/test_functions_this.py @@ -1,5 +1,7 @@ import pythonmonkey as pm import subprocess +import weakref +import sys def test_python_functions_self(): def pyFunc(param): @@ -170,4 +172,28 @@ class Rectangle2 { r2 = pm.new(example.Rectangle2)(1,2) assert r2.getArea() == 2 - assert r2.getThis() == r2 \ No newline at end of file + assert r2.getThis() == r2 + +def test_function_finalization(): + ref = [] + starting_ref_count = [] + + def outerScope(): + def pyFunc(): + return 42 + + ref.append(weakref.ref(pyFunc)) + starting_ref_count.append(sys.getrefcount(pyFunc)) + assert 42 == pm.eval("(func) => func()")(pyFunc) + + assert ref[0]() is pyFunc + current_ref_count = sys.getrefcount(pyFunc) + assert current_ref_count == starting_ref_count[0] + 1 + + outerScope() + pm.collect() # this should collect the JS proxy to pyFunc, which should decref pyFunc + current_ref_count = sys.getrefcount(ref[0]()) + #pytest seems to hold an additional reference on inner functions, so we assert here that the refcount + #is what it was when pyFunc was defined. In a non-test environment, pyFunc should be collected and ref[0]() should be None + #at this point + assert current_ref_count == starting_ref_count[0] \ No newline at end of file From 52f144b78b47b51b89a843fe63661d5f3bc30e1a Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 16 Feb 2024 18:09:30 +0000 Subject: [PATCH 0294/1086] ci: try fix `Failed to find an adequate linker` --- .github/workflows/test-and-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 61c37d1d..279360f9 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -44,7 +44,7 @@ jobs: key: spidermonkey115.7.0-${{ runner.os }}-${{ runner.arch }} lookup-only: true # skip download - name: Setup XCode - if: ${{ matrix.os == 'macos-13' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }} + if: ${{ (matrix.os == 'macos-13' || matrix.os == 'macos-14') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }} # SpiderMonkey 115 ESR requires XCode SDK version at least 13.3 # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#installed-sdks run: sudo xcode-select -switch /Applications/Xcode_14.3.app From f05af7c99a5ed61ba1aa95a32833dc4c3988fd19 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 16 Feb 2024 19:10:26 +0000 Subject: [PATCH 0295/1086] test(event-loop): loosen `setTimeout(..., 'str')` timeout to 0.5s --- tests/python/test_event_loop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_event_loop.py b/tests/python/test_event_loop.py index ef823449..c0658e53 100644 --- a/tests/python/test_event_loop.py +++ b/tests/python/test_event_loop.py @@ -46,7 +46,7 @@ def to_raise(msg): with pytest.raises(asyncio.exceptions.TimeoutError): await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, '100'))"), timeout=0.09) # Number("1 second") -> NaN -> delay turns to be 0s - await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, '1 second'))"), timeout=0.05) # won't be precisely 0s + await asyncio.wait_for(pm.eval("new Promise((resolve) => setTimeout(resolve, '1 second'))"), timeout=0.5) # won't be precisely 0s # passing an invalid ID to `clearTimeout` should silently do nothing; no exception is thrown. pm.eval("clearTimeout(NaN)") From 572f3f24c4442862af590be6e28a897e8a33f1be Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Fri, 16 Feb 2024 14:51:25 -0500 Subject: [PATCH 0296/1086] fix(eval): remove the need to permanently root JSFunctions returned by eval. TODO: still need to solve JSStrings being permanently rooted when returned by eval. --- src/modules/pythonmonkey/pythonmonkey.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 58b0ff15..0dd614de 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -373,17 +373,13 @@ static PyObject *eval(PyObject *self, PyObject *args) { return NULL; } - // TODO: Find a better way to destroy the root when necessary (when the returned Python object is GCed). + // TODO: Find a way to root strings for the lifetime of a proxying python string js::ESClass cls = js::ESClass::Other; // placeholder if `rval` is not a JSObject if (rval->isObject()) { JS::GetBuiltinClass(GLOBAL_CX, JS::RootedObject(GLOBAL_CX, &rval->toObject()), &cls); - if (JS_ObjectIsBoundFunction(&rval->toObject())) { - cls = js::ESClass::Function; // In SpiderMonkey 115 ESR, bound function is no longer a JSFunction but a js::BoundFunctionObject. - } } - bool rvalIsFunction = cls == js::ESClass::Function; // function object - bool rvalIsString = rval->isString() || cls == js::ESClass::String; // string primitive or boxed String object - if (!(rvalIsFunction || rvalIsString)) { // rval may be a JS function or string which must be kept alive. + + if (!(rval->isString() || cls == js::ESClass::String)) { // rval may be a string which must be kept alive. delete rval; } From 7a8ac9b071ae9f37f4126c691c99361fceefc4d6 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Mon, 19 Feb 2024 10:23:14 -0500 Subject: [PATCH 0297/1086] chore(PyListProxyHandler): remove unnecessary error check from array_sort --- src/PyListProxyHandler.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 1b27aed9..5286d274 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -1592,9 +1592,6 @@ static int invokeCallBack(PyObject *list, int index, JS::HandleValue leftValue, // Adapted from Kernigan&Ritchie's C book static void quickSort(PyObject *list, int left, int right, JSContext *cx, JS::HandleFunction callBack) { - if (PyErr_Occurred()) { - return; - } if (left >= right) { // base case From 54cb0967edce4c28b99c4171ec22492dedc80d01 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Thu, 22 Feb 2024 11:43:44 -0500 Subject: [PATCH 0298/1086] cleanup --- tests/python/test_dict_methods.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/python/test_dict_methods.py b/tests/python/test_dict_methods.py index dbb46539..f70c3854 100644 --- a/tests/python/test_dict_methods.py +++ b/tests/python/test_dict_methods.py @@ -176,7 +176,6 @@ def test_keys_iter(): result.append(i) assert result == ['a', 'b'] -# TODO causes crash def test_keys_iter_reverse(): obj = pm.eval("({ a: 123, b: 'test' })") result = [] From 7172cff5c80c0576c0af0deef7fdf4d0812f7a06 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Fri, 23 Feb 2024 11:08:40 -0500 Subject: [PATCH 0299/1086] jsObject/jsArray should be persistentrooted --- include/JSArrayProxy.hh | 2 +- include/JSObjectProxy.hh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh index efc53afa..f0e4f2b0 100644 --- a/include/JSArrayProxy.hh +++ b/include/JSArrayProxy.hh @@ -24,7 +24,7 @@ */ typedef struct { PyListObject list; - JS::RootedObject jsArray; + JS::PersistentRootedObject jsArray; } JSArrayProxy; /** diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 1bf8ef49..6386ae0e 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -23,7 +23,7 @@ */ typedef struct { PyDictObject dict; - JS::RootedObject jsObject; + JS::PersistentRootedObject jsObject; } JSObjectProxy; /** @@ -315,7 +315,6 @@ static PyMethodDef JSObjectProxy_methods[] = { {"get", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_get_method, METH_FASTCALL, dict_get__doc__}, {"setdefault", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method, METH_FASTCALL, dict_setdefault__doc__}, {"pop", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method, METH_FASTCALL, dict_pop__doc__}, - // {"popitem", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_popitem_method, METH_NOARGS, ""}, TODO not popular and quite a bit strange {"clear", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method, METH_NOARGS, clear__doc__}, {"copy", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method, METH_NOARGS, copy__doc__}, {"update", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_update_method, METH_VARARGS | METH_KEYWORDS, update__doc__}, From 0506b07572ca98e4f3503affd905c791f740efc7 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Mon, 26 Feb 2024 20:11:47 +0000 Subject: [PATCH 0300/1086] chore(deps): upgrade aiohttp to the current stable version --- poetry.lock | 754 +++++++++++++++++++++++++++---------------------- pyproject.toml | 2 +- 2 files changed, 411 insertions(+), 345 deletions(-) diff --git a/poetry.lock b/poetry.lock index b04e0cf6..fb2e2497 100644 --- a/poetry.lock +++ b/poetry.lock @@ -16,87 +16,87 @@ pycares = ">=4.0.0" [[package]] name = "aiohttp" -version = "3.9.0b1" +version = "3.9.3" description = "Async http client/server framework (asyncio)" optional = false python-versions = ">=3.8" files = [ - {file = "aiohttp-3.9.0b1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:426138a0b49717b631ffb77d5c2321030bbca96f98eb4d96a2bd874553952ae4"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9a921230d92cf7f03481ca9ad25950d7f3b916f18880fac87b878fddfea04014"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f03d008a93904a56e18c78392d3aa1afe83285353a16402104e0155faf200e6a"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ff51142b170bf3d0d988e41f9c736b0a8f095115f6d6a9bb738b5bf9f1b7cad1"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6374c9d191e14729ede73b750fa64b7c3c506bf74458a57b25803937b937a460"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2457a30567f748f96ac0110789f456f4053d28cf82ae8f436a59d7923ba057d2"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a97e65e4a1767a2f91c727ac44fb1ccfb71f6608cbf5a01931fcdd5b64e62ff8"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:97e596803d7417d6809a728058add22885e30f4256bfb6a3fab17a310df94a1f"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:9945821f4644034b9ca50ecb1eac38e186ec57b412ed4d164ada26312a7cd0b0"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a1c4fd2f0b72d88cf1c4d2f22ed33cd1706aa2734452024998a9b4b14f794799"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:cfc900b809dffe5f897cca714f9b49ad45c541a19395eaaab792500116c3a1d6"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:1269715323a2543a08695bc628ef3ee142788c56444b5a3dbea7f57bf324d40b"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b5e13ce90574fb9ea57d150474b7f39d5ef82e338106149a5e600c872437aa5e"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-win32.whl", hash = "sha256:5ab58badc08c2b96b1e5316919dd5ec63f84a9045b2310d2f4a34f8c1b8e217b"}, - {file = "aiohttp-3.9.0b1-cp310-cp310-win_amd64.whl", hash = "sha256:ecbfc86cf057ec3adf474edf3f9cfdc0e83109a1a8452beb0296fc3a00093340"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8c1fd71f282673320aa12b0eccd51c4aebfc45ccb91e0f4236b8c6c4323027c8"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3e78ddc7b21b084e919f44893e3f4fb27d959cfe520f5f644ad054f7cbb404bc"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8113d976c8ae6e501c5643a8307dbe746ccc0eac16e421a3d2c2be76ae7f94f7"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:be7bfd5016572bc1dc358ea9340862f3112f20acd9cb16a1161f470369755e47"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6549b85dc88d9a792695ac838c9a6384cb32b5df9442185a6640c253f9d8f3cd"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd6ea14850d67272abb1021fa60b831e36a119a47097acd89c880700c51a3c7c"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a122b5cc10c8b26c878279faa0c22ee48fb0a6e9b53dbfcf2d3a8d31cef8875"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3410d0a95cfe40e391bfa6cc84c8464a4d0c7a88157f65e9af3af30b20f2137b"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:b50af48cd3d25e8d247ac83d78aadc6d6c8ab51b7623b2ab675ec714f736d9c1"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:cc5d5177ecd7041b726e4936763a36b593cc929a467c698c9e8991b04b6901eb"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:2931638e81d21bf4fc2a04662ce7bf1a73003d7db15797bfe8cbfd555a7073ff"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:e40b5ecf8fc485b084adac8e7cd213111878761f4cb00f5785757e8b9af684e6"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1ad396d02e44c4f25d458ae4defe59ccc9bf6411cc490d82cf80db6ef60e5db2"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-win32.whl", hash = "sha256:d8c51c63ffe2800c2da656c2581b7ce2e27367d93b04997dce48c02493d0721a"}, - {file = "aiohttp-3.9.0b1-cp311-cp311-win_amd64.whl", hash = "sha256:21285b3fa2ff50ec764c2dc6374aaf39e87fc8eaaf9fd5e8ef1e912ad1ba632e"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:14a1067e04a15b78dacc4e828e3ba157a3d43793f1ed6b7608378e664ae66371"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b4116e6325958d2f6ceee4ff549408965bb701a535ab8859d63bab6271efb1bf"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7a2d39b4d69cca2f8d28a8bc8de532949fb2f7fa219927ac72ac56f8a69db6fb"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7b5312f3f2adba2fe46251c2ec0b8ba92d6fda64755c23d5871f28b7c9fba37"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cc2d914bde7d1d2ca1fb44ee1d086dfb51df8fd5fb780ee273af6c9038421569"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:69766ca94a289e273db1378a0f2b3044d95864bed6803c75fe3e0eb3e3432092"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ea3efa3a4c6f030d1cfe038cbc80cfa99977191521e75617ab8933e1690b3e95"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a0fb6a080b3cf848786c17e26167c76326ecdd33066a7b7dda560165a4a401d9"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:84f2fc12457e0a3b05bfbd8a5ce4a9bc4dd7f8df63101097813e8f7fd6092f81"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:049787f93dec6add786571b0bab193937da09c1331f6b4f36bee356b4a77fffd"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:1cb90917981bc3b7fb730635ec0714c1c7e879c0a2c7a30f32f24979bbb4baf5"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:cc3020b7ee936989c997de3ddc9a70beeb929a30cc68dcdef543de492a4562eb"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2d51bf99bd8669f2de4756f0d7a972a8034bb4e68c9c6e6c8346fd1e8115678e"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-win32.whl", hash = "sha256:0c09cea7177881137ae7176ec0cfeea72896a853ce1886334fb00ec3de4c857b"}, - {file = "aiohttp-3.9.0b1-cp312-cp312-win_amd64.whl", hash = "sha256:af46831aa5091d248174484a69e2656903457e283b3f359b10ebd4537e4977b0"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:cd567c0712335bfb1fdba67fcbbe876b6ee0353acdf9862706a0545c364394a7"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b807a101522d77e1d9414ad6bef668fc9f2c9b6cb33e7012657837b1518ae013"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:72cbc48927cbc772f475f1a953e78d853ef99826e171d719fe2a61c92b581939"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4ea269cd10a3482c68b3aa1d1912f7cc6106f30a809666bdc69974cfafc71f7"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a8355801fd18ddee69e3f40a762070027d35091433ff3961e7c475e5672fb94b"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b34251fc6db4912b364900206a2464d489fdcea3e3c6a96270870fd1f08c0eb8"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:767c6807e2d5457abfe77141c0629e1594400659d92d4c11b7720c1469b1b171"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:19a7d9fe4bb1ccac50a0fa22b8b14376adbd85336ef0ddffd27b3a06cacdc53b"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9f52b40c3891884eb8967f9acb6c66903747c2643accc06337f19315e16fe1b0"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:21a172580a23b4ed8b0f6dd5e10e5bbd1814d1623c1baf3fd7c7a2eb97a9fff0"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:61dcbf83148c4e4dbe047dfa1991730813d787813b99d9edaff04605fc907560"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:afa133e82ba42d7066a1545958f38fa3515df2609a44bf456ba03f92f596e73d"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:c16d7535119bd07826830f5104a0752974bf93bbb3ee5b40514f1a52a141a01c"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-win32.whl", hash = "sha256:760091662ea21ef9c73f8d198a8aa4056887a8bd46f4e6709ffd8677a5d062da"}, - {file = "aiohttp-3.9.0b1-cp38-cp38-win_amd64.whl", hash = "sha256:5fb2697b78eb6d339c6488cf371e8b9885d6a02d2d8fc32cbb0d21582e39fe2f"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:91a80a774401068ce0f0be9d8fa9fdb2f9d0a57e9d13bf4fdf63e3d7f50b7322"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:af136826ea2c15ec47d0d43e96dfab2d19f1bb71b3f77a3dcf26d9c89dc92540"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4e55a6b93f9b90a6447a9157ff9f10214b78bcd3d63b9763a6f69a9f524984b4"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8406305cabfa655607d8f0c9ea72c13fff22d8ead055a1c26ac1561067345b6b"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c8745164e738eee604c79dcbabc0317b3758b2487894712e2722fb78f8302a75"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:26dc5b5081c4fa3a9d517d8633b377d394c409182a871ada0105fc7c994ee7d5"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a29fb4399795b903a7c0089752889fb268746a946cb74f38edec231c0945ca3d"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:51a4731c67c90d101eeb778123b9e28da2ee1222a9f17d2175354d10a8c9549d"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c07413a6787273d5b491b102bc903e2eb73472a3442a400c2410025ac0070bcc"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9c316060606ba3efbe1eb56a740c9aebe40c3e2c9d1f8c04cd4aa238e87e6667"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:d22cac2aa48c365612b918ba446441d2b300b8377fa87e7776a00d4857f3eedd"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:17d6b13fd38c0ef853ef1b5485a9029dadbf93d0e772eb1c95feb043594ab8e3"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:581abaee1facdba3f7d69122e9add766b7c02b110b3011e8bc512deb2ff93c12"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-win32.whl", hash = "sha256:fd26813062148d56e46fe3e82b2e4d2dbe202aceb6038fdd06ba9a8dd782bfb4"}, - {file = "aiohttp-3.9.0b1-cp39-cp39-win_amd64.whl", hash = "sha256:3c9ca575572f0914458544180051bbaeeebb0e487e9b069fa844a6a74fd7800f"}, - {file = "aiohttp-3.9.0b1.tar.gz", hash = "sha256:d6e120b08ac168825239c64e0a850a108edb9cd17be247e25bced9b07a14a403"}, + {file = "aiohttp-3.9.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:939677b61f9d72a4fa2a042a5eee2a99a24001a67c13da113b2e30396567db54"}, + {file = "aiohttp-3.9.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1f5cd333fcf7590a18334c90f8c9147c837a6ec8a178e88d90a9b96ea03194cc"}, + {file = "aiohttp-3.9.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:82e6aa28dd46374f72093eda8bcd142f7771ee1eb9d1e223ff0fa7177a96b4a5"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f56455b0c2c7cc3b0c584815264461d07b177f903a04481dfc33e08a89f0c26b"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bca77a198bb6e69795ef2f09a5f4c12758487f83f33d63acde5f0d4919815768"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e083c285857b78ee21a96ba1eb1b5339733c3563f72980728ca2b08b53826ca5"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ab40e6251c3873d86ea9b30a1ac6d7478c09277b32e14745d0d3c6e76e3c7e29"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:df822ee7feaaeffb99c1a9e5e608800bd8eda6e5f18f5cfb0dc7eeb2eaa6bbec"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:acef0899fea7492145d2bbaaaec7b345c87753168589cc7faf0afec9afe9b747"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:cd73265a9e5ea618014802ab01babf1940cecb90c9762d8b9e7d2cc1e1969ec6"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:a78ed8a53a1221393d9637c01870248a6f4ea5b214a59a92a36f18151739452c"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:6b0e029353361f1746bac2e4cc19b32f972ec03f0f943b390c4ab3371840aabf"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7cf5c9458e1e90e3c390c2639f1017a0379a99a94fdfad3a1fd966a2874bba52"}, + {file = "aiohttp-3.9.3-cp310-cp310-win32.whl", hash = "sha256:3e59c23c52765951b69ec45ddbbc9403a8761ee6f57253250c6e1536cacc758b"}, + {file = "aiohttp-3.9.3-cp310-cp310-win_amd64.whl", hash = "sha256:055ce4f74b82551678291473f66dc9fb9048a50d8324278751926ff0ae7715e5"}, + {file = "aiohttp-3.9.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6b88f9386ff1ad91ace19d2a1c0225896e28815ee09fc6a8932fded8cda97c3d"}, + {file = "aiohttp-3.9.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c46956ed82961e31557b6857a5ca153c67e5476972e5f7190015018760938da2"}, + {file = "aiohttp-3.9.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:07b837ef0d2f252f96009e9b8435ec1fef68ef8b1461933253d318748ec1acdc"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad46e6f620574b3b4801c68255492e0159d1712271cc99d8bdf35f2043ec266"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5ed3e046ea7b14938112ccd53d91c1539af3e6679b222f9469981e3dac7ba1ce"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:039df344b45ae0b34ac885ab5b53940b174530d4dd8a14ed8b0e2155b9dddccb"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7943c414d3a8d9235f5f15c22ace69787c140c80b718dcd57caaade95f7cd93b"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84871a243359bb42c12728f04d181a389718710129b36b6aad0fc4655a7647d4"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:5eafe2c065df5401ba06821b9a054d9cb2848867f3c59801b5d07a0be3a380ae"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:9d3c9b50f19704552f23b4eaea1fc082fdd82c63429a6506446cbd8737823da3"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:f033d80bc6283092613882dfe40419c6a6a1527e04fc69350e87a9df02bbc283"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:2c895a656dd7e061b2fd6bb77d971cc38f2afc277229ce7dd3552de8313a483e"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1f5a71d25cd8106eab05f8704cd9167b6e5187bcdf8f090a66c6d88b634802b4"}, + {file = "aiohttp-3.9.3-cp311-cp311-win32.whl", hash = "sha256:50fca156d718f8ced687a373f9e140c1bb765ca16e3d6f4fe116e3df7c05b2c5"}, + {file = "aiohttp-3.9.3-cp311-cp311-win_amd64.whl", hash = "sha256:5fe9ce6c09668063b8447f85d43b8d1c4e5d3d7e92c63173e6180b2ac5d46dd8"}, + {file = "aiohttp-3.9.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:38a19bc3b686ad55804ae931012f78f7a534cce165d089a2059f658f6c91fa60"}, + {file = "aiohttp-3.9.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:770d015888c2a598b377bd2f663adfd947d78c0124cfe7b959e1ef39f5b13869"}, + {file = "aiohttp-3.9.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ee43080e75fc92bf36219926c8e6de497f9b247301bbf88c5c7593d931426679"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52df73f14ed99cee84865b95a3d9e044f226320a87af208f068ecc33e0c35b96"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc9b311743a78043b26ffaeeb9715dc360335e5517832f5a8e339f8a43581e4d"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b955ed993491f1a5da7f92e98d5dad3c1e14dc175f74517c4e610b1f2456fb11"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:504b6981675ace64c28bf4a05a508af5cde526e36492c98916127f5a02354d53"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a6fe5571784af92b6bc2fda8d1925cccdf24642d49546d3144948a6a1ed58ca5"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ba39e9c8627edc56544c8628cc180d88605df3892beeb2b94c9bc857774848ca"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:e5e46b578c0e9db71d04c4b506a2121c0cb371dd89af17a0586ff6769d4c58c1"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:938a9653e1e0c592053f815f7028e41a3062e902095e5a7dc84617c87267ebd5"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:c3452ea726c76e92f3b9fae4b34a151981a9ec0a4847a627c43d71a15ac32aa6"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:ff30218887e62209942f91ac1be902cc80cddb86bf00fbc6783b7a43b2bea26f"}, + {file = "aiohttp-3.9.3-cp312-cp312-win32.whl", hash = "sha256:38f307b41e0bea3294a9a2a87833191e4bcf89bb0365e83a8be3a58b31fb7f38"}, + {file = "aiohttp-3.9.3-cp312-cp312-win_amd64.whl", hash = "sha256:b791a3143681a520c0a17e26ae7465f1b6f99461a28019d1a2f425236e6eedb5"}, + {file = "aiohttp-3.9.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:0ed621426d961df79aa3b963ac7af0d40392956ffa9be022024cd16297b30c8c"}, + {file = "aiohttp-3.9.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7f46acd6a194287b7e41e87957bfe2ad1ad88318d447caf5b090012f2c5bb528"}, + {file = "aiohttp-3.9.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:feeb18a801aacb098220e2c3eea59a512362eb408d4afd0c242044c33ad6d542"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f734e38fd8666f53da904c52a23ce517f1b07722118d750405af7e4123933511"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b40670ec7e2156d8e57f70aec34a7216407848dfe6c693ef131ddf6e76feb672"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fdd215b7b7fd4a53994f238d0f46b7ba4ac4c0adb12452beee724ddd0743ae5d"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:017a21b0df49039c8f46ca0971b3a7fdc1f56741ab1240cb90ca408049766168"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e99abf0bba688259a496f966211c49a514e65afa9b3073a1fcee08856e04425b"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:648056db9a9fa565d3fa851880f99f45e3f9a771dd3ff3bb0c048ea83fb28194"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8aacb477dc26797ee089721536a292a664846489c49d3ef9725f992449eda5a8"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:522a11c934ea660ff8953eda090dcd2154d367dec1ae3c540aff9f8a5c109ab4"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:5bce0dc147ca85caa5d33debc4f4d65e8e8b5c97c7f9f660f215fa74fc49a321"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:4b4af9f25b49a7be47c0972139e59ec0e8285c371049df1a63b6ca81fdd216a2"}, + {file = "aiohttp-3.9.3-cp38-cp38-win32.whl", hash = "sha256:298abd678033b8571995650ccee753d9458dfa0377be4dba91e4491da3f2be63"}, + {file = "aiohttp-3.9.3-cp38-cp38-win_amd64.whl", hash = "sha256:69361bfdca5468c0488d7017b9b1e5ce769d40b46a9f4a2eed26b78619e9396c"}, + {file = "aiohttp-3.9.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:0fa43c32d1643f518491d9d3a730f85f5bbaedcbd7fbcae27435bb8b7a061b29"}, + {file = "aiohttp-3.9.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:835a55b7ca49468aaaac0b217092dfdff370e6c215c9224c52f30daaa735c1c1"}, + {file = "aiohttp-3.9.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:06a9b2c8837d9a94fae16c6223acc14b4dfdff216ab9b7202e07a9a09541168f"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:abf151955990d23f84205286938796c55ff11bbfb4ccfada8c9c83ae6b3c89a3"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:59c26c95975f26e662ca78fdf543d4eeaef70e533a672b4113dd888bd2423caa"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f95511dd5d0e05fd9728bac4096319f80615aaef4acbecb35a990afebe953b0e"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:595f105710293e76b9dc09f52e0dd896bd064a79346234b521f6b968ffdd8e58"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7c8b816c2b5af5c8a436df44ca08258fc1a13b449393a91484225fcb7545533"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f1088fa100bf46e7b398ffd9904f4808a0612e1d966b4aa43baa535d1b6341eb"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f59dfe57bb1ec82ac0698ebfcdb7bcd0e99c255bd637ff613760d5f33e7c81b3"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:361a1026c9dd4aba0109e4040e2aecf9884f5cfe1b1b1bd3d09419c205e2e53d"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:363afe77cfcbe3a36353d8ea133e904b108feea505aa4792dad6585a8192c55a"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8e2c45c208c62e955e8256949eb225bd8b66a4c9b6865729a786f2aa79b72e9d"}, + {file = "aiohttp-3.9.3-cp39-cp39-win32.whl", hash = "sha256:f7217af2e14da0856e082e96ff637f14ae45c10a5714b63c77f26d8884cf1051"}, + {file = "aiohttp-3.9.3-cp39-cp39-win_amd64.whl", hash = "sha256:27468897f628c627230dba07ec65dc8d0db566923c48f29e084ce382119802bc"}, + {file = "aiohttp-3.9.3.tar.gz", hash = "sha256:90842933e5d1ff760fae6caca4b2b3edba53ba8f4b71e95dacf2818a2aca06f7"}, ] [package.dependencies] @@ -140,21 +140,22 @@ files = [ [[package]] name = "attrs" -version = "23.1.0" +version = "23.2.0" description = "Classes Without Boilerplate" optional = false python-versions = ">=3.7" files = [ - {file = "attrs-23.1.0-py3-none-any.whl", hash = "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04"}, - {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, + {file = "attrs-23.2.0-py3-none-any.whl", hash = "sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1"}, + {file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"}, ] [package.extras] cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] -dev = ["attrs[docs,tests]", "pre-commit"] +dev = ["attrs[tests]", "pre-commit"] docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] tests = ["attrs[tests-no-zope]", "zope-interface"] -tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +tests-mypy = ["mypy (>=1.6)", "pytest-mypy-plugins"] +tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "pytest (>=4.3.0)", "pytest-xdist[psutil]"] [[package]] name = "brotli" @@ -364,13 +365,13 @@ files = [ [[package]] name = "exceptiongroup" -version = "1.1.3" +version = "1.2.0" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.1.3-py3-none-any.whl", hash = "sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3"}, - {file = "exceptiongroup-1.1.3.tar.gz", hash = "sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9"}, + {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, + {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, ] [package.extras] @@ -378,83 +379,99 @@ test = ["pytest (>=6)"] [[package]] name = "frozenlist" -version = "1.4.0" +version = "1.4.1" description = "A list-like structure which implements collections.abc.MutableSequence" optional = false python-versions = ">=3.8" files = [ - {file = "frozenlist-1.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:764226ceef3125e53ea2cb275000e309c0aa5464d43bd72abd661e27fffc26ab"}, - {file = "frozenlist-1.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d6484756b12f40003c6128bfcc3fa9f0d49a687e171186c2d85ec82e3758c559"}, - {file = "frozenlist-1.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9ac08e601308e41eb533f232dbf6b7e4cea762f9f84f6357136eed926c15d12c"}, - {file = "frozenlist-1.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d081f13b095d74b67d550de04df1c756831f3b83dc9881c38985834387487f1b"}, - {file = "frozenlist-1.4.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:71932b597f9895f011f47f17d6428252fc728ba2ae6024e13c3398a087c2cdea"}, - {file = "frozenlist-1.4.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:981b9ab5a0a3178ff413bca62526bb784249421c24ad7381e39d67981be2c326"}, - {file = "frozenlist-1.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e41f3de4df3e80de75845d3e743b3f1c4c8613c3997a912dbf0229fc61a8b963"}, - {file = "frozenlist-1.4.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6918d49b1f90821e93069682c06ffde41829c346c66b721e65a5c62b4bab0300"}, - {file = "frozenlist-1.4.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0e5c8764c7829343d919cc2dfc587a8db01c4f70a4ebbc49abde5d4b158b007b"}, - {file = "frozenlist-1.4.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:8d0edd6b1c7fb94922bf569c9b092ee187a83f03fb1a63076e7774b60f9481a8"}, - {file = "frozenlist-1.4.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:e29cda763f752553fa14c68fb2195150bfab22b352572cb36c43c47bedba70eb"}, - {file = "frozenlist-1.4.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:0c7c1b47859ee2cac3846fde1c1dc0f15da6cec5a0e5c72d101e0f83dcb67ff9"}, - {file = "frozenlist-1.4.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:901289d524fdd571be1c7be054f48b1f88ce8dddcbdf1ec698b27d4b8b9e5d62"}, - {file = "frozenlist-1.4.0-cp310-cp310-win32.whl", hash = "sha256:1a0848b52815006ea6596c395f87449f693dc419061cc21e970f139d466dc0a0"}, - {file = "frozenlist-1.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:b206646d176a007466358aa21d85cd8600a415c67c9bd15403336c331a10d956"}, - {file = "frozenlist-1.4.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:de343e75f40e972bae1ef6090267f8260c1446a1695e77096db6cfa25e759a95"}, - {file = "frozenlist-1.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ad2a9eb6d9839ae241701d0918f54c51365a51407fd80f6b8289e2dfca977cc3"}, - {file = "frozenlist-1.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bd7bd3b3830247580de99c99ea2a01416dfc3c34471ca1298bccabf86d0ff4dc"}, - {file = "frozenlist-1.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bdf1847068c362f16b353163391210269e4f0569a3c166bc6a9f74ccbfc7e839"}, - {file = "frozenlist-1.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:38461d02d66de17455072c9ba981d35f1d2a73024bee7790ac2f9e361ef1cd0c"}, - {file = "frozenlist-1.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d5a32087d720c608f42caed0ef36d2b3ea61a9d09ee59a5142d6070da9041b8f"}, - {file = "frozenlist-1.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dd65632acaf0d47608190a71bfe46b209719bf2beb59507db08ccdbe712f969b"}, - {file = "frozenlist-1.4.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:261b9f5d17cac914531331ff1b1d452125bf5daa05faf73b71d935485b0c510b"}, - {file = "frozenlist-1.4.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:b89ac9768b82205936771f8d2eb3ce88503b1556324c9f903e7156669f521472"}, - {file = "frozenlist-1.4.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:008eb8b31b3ea6896da16c38c1b136cb9fec9e249e77f6211d479db79a4eaf01"}, - {file = "frozenlist-1.4.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:e74b0506fa5aa5598ac6a975a12aa8928cbb58e1f5ac8360792ef15de1aa848f"}, - {file = "frozenlist-1.4.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:490132667476f6781b4c9458298b0c1cddf237488abd228b0b3650e5ecba7467"}, - {file = "frozenlist-1.4.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:76d4711f6f6d08551a7e9ef28c722f4a50dd0fc204c56b4bcd95c6cc05ce6fbb"}, - {file = "frozenlist-1.4.0-cp311-cp311-win32.whl", hash = "sha256:a02eb8ab2b8f200179b5f62b59757685ae9987996ae549ccf30f983f40602431"}, - {file = "frozenlist-1.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:515e1abc578dd3b275d6a5114030b1330ba044ffba03f94091842852f806f1c1"}, - {file = "frozenlist-1.4.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:f0ed05f5079c708fe74bf9027e95125334b6978bf07fd5ab923e9e55e5fbb9d3"}, - {file = "frozenlist-1.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ca265542ca427bf97aed183c1676e2a9c66942e822b14dc6e5f42e038f92a503"}, - {file = "frozenlist-1.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:491e014f5c43656da08958808588cc6c016847b4360e327a62cb308c791bd2d9"}, - {file = "frozenlist-1.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:17ae5cd0f333f94f2e03aaf140bb762c64783935cc764ff9c82dff626089bebf"}, - {file = "frozenlist-1.4.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1e78fb68cf9c1a6aa4a9a12e960a5c9dfbdb89b3695197aa7064705662515de2"}, - {file = "frozenlist-1.4.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d5655a942f5f5d2c9ed93d72148226d75369b4f6952680211972a33e59b1dfdc"}, - {file = "frozenlist-1.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c11b0746f5d946fecf750428a95f3e9ebe792c1ee3b1e96eeba145dc631a9672"}, - {file = "frozenlist-1.4.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e66d2a64d44d50d2543405fb183a21f76b3b5fd16f130f5c99187c3fb4e64919"}, - {file = "frozenlist-1.4.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:88f7bc0fcca81f985f78dd0fa68d2c75abf8272b1f5c323ea4a01a4d7a614efc"}, - {file = "frozenlist-1.4.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:5833593c25ac59ede40ed4de6d67eb42928cca97f26feea219f21d0ed0959b79"}, - {file = "frozenlist-1.4.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:fec520865f42e5c7f050c2a79038897b1c7d1595e907a9e08e3353293ffc948e"}, - {file = "frozenlist-1.4.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:b826d97e4276750beca7c8f0f1a4938892697a6bcd8ec8217b3312dad6982781"}, - {file = "frozenlist-1.4.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ceb6ec0a10c65540421e20ebd29083c50e6d1143278746a4ef6bcf6153171eb8"}, - {file = "frozenlist-1.4.0-cp38-cp38-win32.whl", hash = "sha256:2b8bcf994563466db019fab287ff390fffbfdb4f905fc77bc1c1d604b1c689cc"}, - {file = "frozenlist-1.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:a6c8097e01886188e5be3e6b14e94ab365f384736aa1fca6a0b9e35bd4a30bc7"}, - {file = "frozenlist-1.4.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:6c38721585f285203e4b4132a352eb3daa19121a035f3182e08e437cface44bf"}, - {file = "frozenlist-1.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a0c6da9aee33ff0b1a451e867da0c1f47408112b3391dd43133838339e410963"}, - {file = "frozenlist-1.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:93ea75c050c5bb3d98016b4ba2497851eadf0ac154d88a67d7a6816206f6fa7f"}, - {file = "frozenlist-1.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f61e2dc5ad442c52b4887f1fdc112f97caeff4d9e6ebe78879364ac59f1663e1"}, - {file = "frozenlist-1.4.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aa384489fefeb62321b238e64c07ef48398fe80f9e1e6afeff22e140e0850eef"}, - {file = "frozenlist-1.4.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:10ff5faaa22786315ef57097a279b833ecab1a0bfb07d604c9cbb1c4cdc2ed87"}, - {file = "frozenlist-1.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:007df07a6e3eb3e33e9a1fe6a9db7af152bbd8a185f9aaa6ece10a3529e3e1c6"}, - {file = "frozenlist-1.4.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f4f399d28478d1f604c2ff9119907af9726aed73680e5ed1ca634d377abb087"}, - {file = "frozenlist-1.4.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c5374b80521d3d3f2ec5572e05adc94601985cc526fb276d0c8574a6d749f1b3"}, - {file = "frozenlist-1.4.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:ce31ae3e19f3c902de379cf1323d90c649425b86de7bbdf82871b8a2a0615f3d"}, - {file = "frozenlist-1.4.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7211ef110a9194b6042449431e08c4d80c0481e5891e58d429df5899690511c2"}, - {file = "frozenlist-1.4.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:556de4430ce324c836789fa4560ca62d1591d2538b8ceb0b4f68fb7b2384a27a"}, - {file = "frozenlist-1.4.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:7645a8e814a3ee34a89c4a372011dcd817964ce8cb273c8ed6119d706e9613e3"}, - {file = "frozenlist-1.4.0-cp39-cp39-win32.whl", hash = "sha256:19488c57c12d4e8095a922f328df3f179c820c212940a498623ed39160bc3c2f"}, - {file = "frozenlist-1.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:6221d84d463fb110bdd7619b69cb43878a11d51cbb9394ae3105d082d5199167"}, - {file = "frozenlist-1.4.0.tar.gz", hash = "sha256:09163bdf0b2907454042edb19f887c6d33806adc71fbd54afc14908bfdc22251"}, + {file = "frozenlist-1.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f9aa1878d1083b276b0196f2dfbe00c9b7e752475ed3b682025ff20c1c1f51ac"}, + {file = "frozenlist-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:29acab3f66f0f24674b7dc4736477bcd4bc3ad4b896f5f45379a67bce8b96868"}, + {file = "frozenlist-1.4.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:74fb4bee6880b529a0c6560885fce4dc95936920f9f20f53d99a213f7bf66776"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:590344787a90ae57d62511dd7c736ed56b428f04cd8c161fcc5e7232c130c69a"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:068b63f23b17df8569b7fdca5517edef76171cf3897eb68beb01341131fbd2ad"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5c849d495bf5154cd8da18a9eb15db127d4dba2968d88831aff6f0331ea9bd4c"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9750cc7fe1ae3b1611bb8cfc3f9ec11d532244235d75901fb6b8e42ce9229dfe"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9b2de4cf0cdd5bd2dee4c4f63a653c61d2408055ab77b151c1957f221cabf2a"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0633c8d5337cb5c77acbccc6357ac49a1770b8c487e5b3505c57b949b4b82e98"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:27657df69e8801be6c3638054e202a135c7f299267f1a55ed3a598934f6c0d75"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:f9a3ea26252bd92f570600098783d1371354d89d5f6b7dfd87359d669f2109b5"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:4f57dab5fe3407b6c0c1cc907ac98e8a189f9e418f3b6e54d65a718aaafe3950"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e02a0e11cf6597299b9f3bbd3f93d79217cb90cfd1411aec33848b13f5c656cc"}, + {file = "frozenlist-1.4.1-cp310-cp310-win32.whl", hash = "sha256:a828c57f00f729620a442881cc60e57cfcec6842ba38e1b19fd3e47ac0ff8dc1"}, + {file = "frozenlist-1.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:f56e2333dda1fe0f909e7cc59f021eba0d2307bc6f012a1ccf2beca6ba362439"}, + {file = "frozenlist-1.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a0cb6f11204443f27a1628b0e460f37fb30f624be6051d490fa7d7e26d4af3d0"}, + {file = "frozenlist-1.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b46c8ae3a8f1f41a0d2ef350c0b6e65822d80772fe46b653ab6b6274f61d4a49"}, + {file = "frozenlist-1.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fde5bd59ab5357e3853313127f4d3565fc7dad314a74d7b5d43c22c6a5ed2ced"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:722e1124aec435320ae01ee3ac7bec11a5d47f25d0ed6328f2273d287bc3abb0"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2471c201b70d58a0f0c1f91261542a03d9a5e088ed3dc6c160d614c01649c106"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c757a9dd70d72b076d6f68efdbb9bc943665ae954dad2801b874c8c69e185068"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f146e0911cb2f1da549fc58fc7bcd2b836a44b79ef871980d605ec392ff6b0d2"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f9c515e7914626b2a2e1e311794b4c35720a0be87af52b79ff8e1429fc25f19"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:c302220494f5c1ebeb0912ea782bcd5e2f8308037b3c7553fad0e48ebad6ad82"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:442acde1e068288a4ba7acfe05f5f343e19fac87bfc96d89eb886b0363e977ec"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:1b280e6507ea8a4fa0c0a7150b4e526a8d113989e28eaaef946cc77ffd7efc0a"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:fe1a06da377e3a1062ae5fe0926e12b84eceb8a50b350ddca72dc85015873f74"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:db9e724bebd621d9beca794f2a4ff1d26eed5965b004a97f1f1685a173b869c2"}, + {file = "frozenlist-1.4.1-cp311-cp311-win32.whl", hash = "sha256:e774d53b1a477a67838a904131c4b0eef6b3d8a651f8b138b04f748fccfefe17"}, + {file = "frozenlist-1.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:fb3c2db03683b5767dedb5769b8a40ebb47d6f7f45b1b3e3b4b51ec8ad9d9825"}, + {file = "frozenlist-1.4.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:1979bc0aeb89b33b588c51c54ab0161791149f2461ea7c7c946d95d5f93b56ae"}, + {file = "frozenlist-1.4.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:cc7b01b3754ea68a62bd77ce6020afaffb44a590c2289089289363472d13aedb"}, + {file = "frozenlist-1.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c9c92be9fd329ac801cc420e08452b70e7aeab94ea4233a4804f0915c14eba9b"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c3894db91f5a489fc8fa6a9991820f368f0b3cbdb9cd8849547ccfab3392d86"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ba60bb19387e13597fb059f32cd4d59445d7b18b69a745b8f8e5db0346f33480"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8aefbba5f69d42246543407ed2461db31006b0f76c4e32dfd6f42215a2c41d09"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:780d3a35680ced9ce682fbcf4cb9c2bad3136eeff760ab33707b71db84664e3a"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9acbb16f06fe7f52f441bb6f413ebae6c37baa6ef9edd49cdd567216da8600cd"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:23b701e65c7b36e4bf15546a89279bd4d8675faabc287d06bbcfac7d3c33e1e6"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:3e0153a805a98f5ada7e09826255ba99fb4f7524bb81bf6b47fb702666484ae1"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:dd9b1baec094d91bf36ec729445f7769d0d0cf6b64d04d86e45baf89e2b9059b"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:1a4471094e146b6790f61b98616ab8e44f72661879cc63fa1049d13ef711e71e"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5667ed53d68d91920defdf4035d1cdaa3c3121dc0b113255124bcfada1cfa1b8"}, + {file = "frozenlist-1.4.1-cp312-cp312-win32.whl", hash = "sha256:beee944ae828747fd7cb216a70f120767fc9f4f00bacae8543c14a6831673f89"}, + {file = "frozenlist-1.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:64536573d0a2cb6e625cf309984e2d873979709f2cf22839bf2d61790b448ad5"}, + {file = "frozenlist-1.4.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:20b51fa3f588ff2fe658663db52a41a4f7aa6c04f6201449c6c7c476bd255c0d"}, + {file = "frozenlist-1.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:410478a0c562d1a5bcc2f7ea448359fcb050ed48b3c6f6f4f18c313a9bdb1826"}, + {file = "frozenlist-1.4.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:c6321c9efe29975232da3bd0af0ad216800a47e93d763ce64f291917a381b8eb"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:48f6a4533887e189dae092f1cf981f2e3885175f7a0f33c91fb5b7b682b6bab6"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6eb73fa5426ea69ee0e012fb59cdc76a15b1283d6e32e4f8dc4482ec67d1194d"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fbeb989b5cc29e8daf7f976b421c220f1b8c731cbf22b9130d8815418ea45887"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:32453c1de775c889eb4e22f1197fe3bdfe457d16476ea407472b9442e6295f7a"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:693945278a31f2086d9bf3df0fe8254bbeaef1fe71e1351c3bd730aa7d31c41b"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:1d0ce09d36d53bbbe566fe296965b23b961764c0bcf3ce2fa45f463745c04701"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:3a670dc61eb0d0eb7080890c13de3066790f9049b47b0de04007090807c776b0"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:dca69045298ce5c11fd539682cff879cc1e664c245d1c64da929813e54241d11"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:a06339f38e9ed3a64e4c4e43aec7f59084033647f908e4259d279a52d3757d09"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b7f2f9f912dca3934c1baec2e4585a674ef16fe00218d833856408c48d5beee7"}, + {file = "frozenlist-1.4.1-cp38-cp38-win32.whl", hash = "sha256:e7004be74cbb7d9f34553a5ce5fb08be14fb33bc86f332fb71cbe5216362a497"}, + {file = "frozenlist-1.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:5a7d70357e7cee13f470c7883a063aae5fe209a493c57d86eb7f5a6f910fae09"}, + {file = "frozenlist-1.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:bfa4a17e17ce9abf47a74ae02f32d014c5e9404b6d9ac7f729e01562bbee601e"}, + {file = "frozenlist-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b7e3ed87d4138356775346e6845cccbe66cd9e207f3cd11d2f0b9fd13681359d"}, + {file = "frozenlist-1.4.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c99169d4ff810155ca50b4da3b075cbde79752443117d89429595c2e8e37fed8"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edb678da49d9f72c9f6c609fbe41a5dfb9a9282f9e6a2253d5a91e0fc382d7c0"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6db4667b187a6742b33afbbaf05a7bc551ffcf1ced0000a571aedbb4aa42fc7b"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:55fdc093b5a3cb41d420884cdaf37a1e74c3c37a31f46e66286d9145d2063bd0"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82e8211d69a4f4bc360ea22cd6555f8e61a1bd211d1d5d39d3d228b48c83a897"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89aa2c2eeb20957be2d950b85974b30a01a762f3308cd02bb15e1ad632e22dc7"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9d3e0c25a2350080e9319724dede4f31f43a6c9779be48021a7f4ebde8b2d742"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:7268252af60904bf52c26173cbadc3a071cece75f873705419c8681f24d3edea"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:0c250a29735d4f15321007fb02865f0e6b6a41a6b88f1f523ca1596ab5f50bd5"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:96ec70beabbd3b10e8bfe52616a13561e58fe84c0101dd031dc78f250d5128b9"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:23b2d7679b73fe0e5a4560b672a39f98dfc6f60df63823b0a9970525325b95f6"}, + {file = "frozenlist-1.4.1-cp39-cp39-win32.whl", hash = "sha256:a7496bfe1da7fb1a4e1cc23bb67c58fab69311cc7d32b5a99c2007b4b2a0e932"}, + {file = "frozenlist-1.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:e6a20a581f9ce92d389a8c7d7c3dd47c81fd5d6e655c8dddf341e14aa48659d0"}, + {file = "frozenlist-1.4.1-py3-none-any.whl", hash = "sha256:04ced3e6a46b4cfffe20f9ae482818e34eba9b5fb0ce4056e4cc9b6e212d09b7"}, + {file = "frozenlist-1.4.1.tar.gz", hash = "sha256:c037a86e8513059a2613aaba4d817bb90b9d9b6b69aace3ce9c877e8c8ed402b"}, ] [[package]] name = "idna" -version = "3.4" +version = "3.6" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.5" files = [ - {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, - {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, + {file = "idna-3.6-py3-none-any.whl", hash = "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f"}, + {file = "idna-3.6.tar.gz", hash = "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca"}, ] [[package]] @@ -470,85 +487,101 @@ files = [ [[package]] name = "multidict" -version = "6.0.4" +version = "6.0.5" description = "multidict implementation" optional = false python-versions = ">=3.7" files = [ - {file = "multidict-6.0.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0b1a97283e0c85772d613878028fec909f003993e1007eafa715b24b377cb9b8"}, - {file = "multidict-6.0.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:eeb6dcc05e911516ae3d1f207d4b0520d07f54484c49dfc294d6e7d63b734171"}, - {file = "multidict-6.0.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d6d635d5209b82a3492508cf5b365f3446afb65ae7ebd755e70e18f287b0adf7"}, - {file = "multidict-6.0.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c048099e4c9e9d615545e2001d3d8a4380bd403e1a0578734e0d31703d1b0c0b"}, - {file = "multidict-6.0.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ea20853c6dbbb53ed34cb4d080382169b6f4554d394015f1bef35e881bf83547"}, - {file = "multidict-6.0.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:16d232d4e5396c2efbbf4f6d4df89bfa905eb0d4dc5b3549d872ab898451f569"}, - {file = "multidict-6.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:36c63aaa167f6c6b04ef2c85704e93af16c11d20de1d133e39de6a0e84582a93"}, - {file = "multidict-6.0.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:64bdf1086b6043bf519869678f5f2757f473dee970d7abf6da91ec00acb9cb98"}, - {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:43644e38f42e3af682690876cff722d301ac585c5b9e1eacc013b7a3f7b696a0"}, - {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:7582a1d1030e15422262de9f58711774e02fa80df0d1578995c76214f6954988"}, - {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:ddff9c4e225a63a5afab9dd15590432c22e8057e1a9a13d28ed128ecf047bbdc"}, - {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:ee2a1ece51b9b9e7752e742cfb661d2a29e7bcdba2d27e66e28a99f1890e4fa0"}, - {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a2e4369eb3d47d2034032a26c7a80fcb21a2cb22e1173d761a162f11e562caa5"}, - {file = "multidict-6.0.4-cp310-cp310-win32.whl", hash = "sha256:574b7eae1ab267e5f8285f0fe881f17efe4b98c39a40858247720935b893bba8"}, - {file = "multidict-6.0.4-cp310-cp310-win_amd64.whl", hash = "sha256:4dcbb0906e38440fa3e325df2359ac6cb043df8e58c965bb45f4e406ecb162cc"}, - {file = "multidict-6.0.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0dfad7a5a1e39c53ed00d2dd0c2e36aed4650936dc18fd9a1826a5ae1cad6f03"}, - {file = "multidict-6.0.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:64da238a09d6039e3bd39bb3aee9c21a5e34f28bfa5aa22518581f910ff94af3"}, - {file = "multidict-6.0.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ff959bee35038c4624250473988b24f846cbeb2c6639de3602c073f10410ceba"}, - {file = "multidict-6.0.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:01a3a55bd90018c9c080fbb0b9f4891db37d148a0a18722b42f94694f8b6d4c9"}, - {file = "multidict-6.0.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c5cb09abb18c1ea940fb99360ea0396f34d46566f157122c92dfa069d3e0e982"}, - {file = "multidict-6.0.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:666daae833559deb2d609afa4490b85830ab0dfca811a98b70a205621a6109fe"}, - {file = "multidict-6.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:11bdf3f5e1518b24530b8241529d2050014c884cf18b6fc69c0c2b30ca248710"}, - {file = "multidict-6.0.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7d18748f2d30f94f498e852c67d61261c643b349b9d2a581131725595c45ec6c"}, - {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:458f37be2d9e4c95e2d8866a851663cbc76e865b78395090786f6cd9b3bbf4f4"}, - {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:b1a2eeedcead3a41694130495593a559a668f382eee0727352b9a41e1c45759a"}, - {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:7d6ae9d593ef8641544d6263c7fa6408cc90370c8cb2bbb65f8d43e5b0351d9c"}, - {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:5979b5632c3e3534e42ca6ff856bb24b2e3071b37861c2c727ce220d80eee9ed"}, - {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:dcfe792765fab89c365123c81046ad4103fcabbc4f56d1c1997e6715e8015461"}, - {file = "multidict-6.0.4-cp311-cp311-win32.whl", hash = "sha256:3601a3cece3819534b11d4efc1eb76047488fddd0c85a3948099d5da4d504636"}, - {file = "multidict-6.0.4-cp311-cp311-win_amd64.whl", hash = "sha256:81a4f0b34bd92df3da93315c6a59034df95866014ac08535fc819f043bfd51f0"}, - {file = "multidict-6.0.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:67040058f37a2a51ed8ea8f6b0e6ee5bd78ca67f169ce6122f3e2ec80dfe9b78"}, - {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:853888594621e6604c978ce2a0444a1e6e70c8d253ab65ba11657659dcc9100f"}, - {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:39ff62e7d0f26c248b15e364517a72932a611a9b75f35b45be078d81bdb86603"}, - {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:af048912e045a2dc732847d33821a9d84ba553f5c5f028adbd364dd4765092ac"}, - {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1e8b901e607795ec06c9e42530788c45ac21ef3aaa11dbd0c69de543bfb79a9"}, - {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62501642008a8b9871ddfccbf83e4222cf8ac0d5aeedf73da36153ef2ec222d2"}, - {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:99b76c052e9f1bc0721f7541e5e8c05db3941eb9ebe7b8553c625ef88d6eefde"}, - {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:509eac6cf09c794aa27bcacfd4d62c885cce62bef7b2c3e8b2e49d365b5003fe"}, - {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:21a12c4eb6ddc9952c415f24eef97e3e55ba3af61f67c7bc388dcdec1404a067"}, - {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:5cad9430ab3e2e4fa4a2ef4450f548768400a2ac635841bc2a56a2052cdbeb87"}, - {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ab55edc2e84460694295f401215f4a58597f8f7c9466faec545093045476327d"}, - {file = "multidict-6.0.4-cp37-cp37m-win32.whl", hash = "sha256:5a4dcf02b908c3b8b17a45fb0f15b695bf117a67b76b7ad18b73cf8e92608775"}, - {file = "multidict-6.0.4-cp37-cp37m-win_amd64.whl", hash = "sha256:6ed5f161328b7df384d71b07317f4d8656434e34591f20552c7bcef27b0ab88e"}, - {file = "multidict-6.0.4-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5fc1b16f586f049820c5c5b17bb4ee7583092fa0d1c4e28b5239181ff9532e0c"}, - {file = "multidict-6.0.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1502e24330eb681bdaa3eb70d6358e818e8e8f908a22a1851dfd4e15bc2f8161"}, - {file = "multidict-6.0.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b692f419760c0e65d060959df05f2a531945af31fda0c8a3b3195d4efd06de11"}, - {file = "multidict-6.0.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45e1ecb0379bfaab5eef059f50115b54571acfbe422a14f668fc8c27ba410e7e"}, - {file = "multidict-6.0.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ddd3915998d93fbcd2566ddf9cf62cdb35c9e093075f862935573d265cf8f65d"}, - {file = "multidict-6.0.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:59d43b61c59d82f2effb39a93c48b845efe23a3852d201ed2d24ba830d0b4cf2"}, - {file = "multidict-6.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cc8e1d0c705233c5dd0c5e6460fbad7827d5d36f310a0fadfd45cc3029762258"}, - {file = "multidict-6.0.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d6aa0418fcc838522256761b3415822626f866758ee0bc6632c9486b179d0b52"}, - {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6748717bb10339c4760c1e63da040f5f29f5ed6e59d76daee30305894069a660"}, - {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:4d1a3d7ef5e96b1c9e92f973e43aa5e5b96c659c9bc3124acbbd81b0b9c8a951"}, - {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4372381634485bec7e46718edc71528024fcdc6f835baefe517b34a33c731d60"}, - {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:fc35cb4676846ef752816d5be2193a1e8367b4c1397b74a565a9d0389c433a1d"}, - {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:4b9d9e4e2b37daddb5c23ea33a3417901fa7c7b3dee2d855f63ee67a0b21e5b1"}, - {file = "multidict-6.0.4-cp38-cp38-win32.whl", hash = "sha256:e41b7e2b59679edfa309e8db64fdf22399eec4b0b24694e1b2104fb789207779"}, - {file = "multidict-6.0.4-cp38-cp38-win_amd64.whl", hash = "sha256:d6c254ba6e45d8e72739281ebc46ea5eb5f101234f3ce171f0e9f5cc86991480"}, - {file = "multidict-6.0.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:16ab77bbeb596e14212e7bab8429f24c1579234a3a462105cda4a66904998664"}, - {file = "multidict-6.0.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:bc779e9e6f7fda81b3f9aa58e3a6091d49ad528b11ed19f6621408806204ad35"}, - {file = "multidict-6.0.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4ceef517eca3e03c1cceb22030a3e39cb399ac86bff4e426d4fc6ae49052cc60"}, - {file = "multidict-6.0.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:281af09f488903fde97923c7744bb001a9b23b039a909460d0f14edc7bf59706"}, - {file = "multidict-6.0.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:52f2dffc8acaba9a2f27174c41c9e57f60b907bb9f096b36b1a1f3be71c6284d"}, - {file = "multidict-6.0.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b41156839806aecb3641f3208c0dafd3ac7775b9c4c422d82ee2a45c34ba81ca"}, - {file = "multidict-6.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d5e3fc56f88cc98ef8139255cf8cd63eb2c586531e43310ff859d6bb3a6b51f1"}, - {file = "multidict-6.0.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8316a77808c501004802f9beebde51c9f857054a0c871bd6da8280e718444449"}, - {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f70b98cd94886b49d91170ef23ec5c0e8ebb6f242d734ed7ed677b24d50c82cf"}, - {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:bf6774e60d67a9efe02b3616fee22441d86fab4c6d335f9d2051d19d90a40063"}, - {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:e69924bfcdda39b722ef4d9aa762b2dd38e4632b3641b1d9a57ca9cd18f2f83a"}, - {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:6b181d8c23da913d4ff585afd1155a0e1194c0b50c54fcfe286f70cdaf2b7176"}, - {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:52509b5be062d9eafc8170e53026fbc54cf3b32759a23d07fd935fb04fc22d95"}, - {file = "multidict-6.0.4-cp39-cp39-win32.whl", hash = "sha256:27c523fbfbdfd19c6867af7346332b62b586eed663887392cff78d614f9ec313"}, - {file = "multidict-6.0.4-cp39-cp39-win_amd64.whl", hash = "sha256:33029f5734336aa0d4c0384525da0387ef89148dc7191aae00ca5fb23d7aafc2"}, - {file = "multidict-6.0.4.tar.gz", hash = "sha256:3666906492efb76453c0e7b97f2cf459b0682e7402c0489a95484965dbc1da49"}, + {file = "multidict-6.0.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:228b644ae063c10e7f324ab1ab6b548bdf6f8b47f3ec234fef1093bc2735e5f9"}, + {file = "multidict-6.0.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:896ebdcf62683551312c30e20614305f53125750803b614e9e6ce74a96232604"}, + {file = "multidict-6.0.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:411bf8515f3be9813d06004cac41ccf7d1cd46dfe233705933dd163b60e37600"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d147090048129ce3c453f0292e7697d333db95e52616b3793922945804a433c"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:215ed703caf15f578dca76ee6f6b21b7603791ae090fbf1ef9d865571039ade5"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c6390cf87ff6234643428991b7359b5f59cc15155695deb4eda5c777d2b880f"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21fd81c4ebdb4f214161be351eb5bcf385426bf023041da2fd9e60681f3cebae"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3cc2ad10255f903656017363cd59436f2111443a76f996584d1077e43ee51182"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:6939c95381e003f54cd4c5516740faba40cf5ad3eeff460c3ad1d3e0ea2549bf"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:220dd781e3f7af2c2c1053da9fa96d9cf3072ca58f057f4c5adaaa1cab8fc442"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:766c8f7511df26d9f11cd3a8be623e59cca73d44643abab3f8c8c07620524e4a"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:fe5d7785250541f7f5019ab9cba2c71169dc7d74d0f45253f8313f436458a4ef"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c1c1496e73051918fcd4f58ff2e0f2f3066d1c76a0c6aeffd9b45d53243702cc"}, + {file = "multidict-6.0.5-cp310-cp310-win32.whl", hash = "sha256:7afcdd1fc07befad18ec4523a782cde4e93e0a2bf71239894b8d61ee578c1319"}, + {file = "multidict-6.0.5-cp310-cp310-win_amd64.whl", hash = "sha256:99f60d34c048c5c2fabc766108c103612344c46e35d4ed9ae0673d33c8fb26e8"}, + {file = "multidict-6.0.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:f285e862d2f153a70586579c15c44656f888806ed0e5b56b64489afe4a2dbfba"}, + {file = "multidict-6.0.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:53689bb4e102200a4fafa9de9c7c3c212ab40a7ab2c8e474491914d2305f187e"}, + {file = "multidict-6.0.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:612d1156111ae11d14afaf3a0669ebf6c170dbb735e510a7438ffe2369a847fd"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7be7047bd08accdb7487737631d25735c9a04327911de89ff1b26b81745bd4e3"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de170c7b4fe6859beb8926e84f7d7d6c693dfe8e27372ce3b76f01c46e489fcf"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:04bde7a7b3de05732a4eb39c94574db1ec99abb56162d6c520ad26f83267de29"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:85f67aed7bb647f93e7520633d8f51d3cbc6ab96957c71272b286b2f30dc70ed"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:425bf820055005bfc8aa9a0b99ccb52cc2f4070153e34b701acc98d201693733"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d3eb1ceec286eba8220c26f3b0096cf189aea7057b6e7b7a2e60ed36b373b77f"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:7901c05ead4b3fb75113fb1dd33eb1253c6d3ee37ce93305acd9d38e0b5f21a4"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:e0e79d91e71b9867c73323a3444724d496c037e578a0e1755ae159ba14f4f3d1"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:29bfeb0dff5cb5fdab2023a7a9947b3b4af63e9c47cae2a10ad58394b517fddc"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e030047e85cbcedbfc073f71836d62dd5dadfbe7531cae27789ff66bc551bd5e"}, + {file = "multidict-6.0.5-cp311-cp311-win32.whl", hash = "sha256:2f4848aa3baa109e6ab81fe2006c77ed4d3cd1e0ac2c1fbddb7b1277c168788c"}, + {file = "multidict-6.0.5-cp311-cp311-win_amd64.whl", hash = "sha256:2faa5ae9376faba05f630d7e5e6be05be22913782b927b19d12b8145968a85ea"}, + {file = "multidict-6.0.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:51d035609b86722963404f711db441cf7134f1889107fb171a970c9701f92e1e"}, + {file = "multidict-6.0.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:cbebcd5bcaf1eaf302617c114aa67569dd3f090dd0ce8ba9e35e9985b41ac35b"}, + {file = "multidict-6.0.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2ffc42c922dbfddb4a4c3b438eb056828719f07608af27d163191cb3e3aa6cc5"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ceb3b7e6a0135e092de86110c5a74e46bda4bd4fbfeeb3a3bcec79c0f861e450"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:79660376075cfd4b2c80f295528aa6beb2058fd289f4c9252f986751a4cd0496"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e4428b29611e989719874670fd152b6625500ad6c686d464e99f5aaeeaca175a"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d84a5c3a5f7ce6db1f999fb9438f686bc2e09d38143f2d93d8406ed2dd6b9226"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:76c0de87358b192de7ea9649beb392f107dcad9ad27276324c24c91774ca5271"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:79a6d2ba910adb2cbafc95dad936f8b9386e77c84c35bc0add315b856d7c3abb"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:92d16a3e275e38293623ebf639c471d3e03bb20b8ebb845237e0d3664914caef"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:fb616be3538599e797a2017cccca78e354c767165e8858ab5116813146041a24"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:14c2976aa9038c2629efa2c148022ed5eb4cb939e15ec7aace7ca932f48f9ba6"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:435a0984199d81ca178b9ae2c26ec3d49692d20ee29bc4c11a2a8d4514c67eda"}, + {file = "multidict-6.0.5-cp312-cp312-win32.whl", hash = "sha256:9fe7b0653ba3d9d65cbe7698cca585bf0f8c83dbbcc710db9c90f478e175f2d5"}, + {file = "multidict-6.0.5-cp312-cp312-win_amd64.whl", hash = "sha256:01265f5e40f5a17f8241d52656ed27192be03bfa8764d88e8220141d1e4b3556"}, + {file = "multidict-6.0.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:19fe01cea168585ba0f678cad6f58133db2aa14eccaf22f88e4a6dccadfad8b3"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6bf7a982604375a8d49b6cc1b781c1747f243d91b81035a9b43a2126c04766f5"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:107c0cdefe028703fb5dafe640a409cb146d44a6ae201e55b35a4af8e95457dd"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:403c0911cd5d5791605808b942c88a8155c2592e05332d2bf78f18697a5fa15e"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aeaf541ddbad8311a87dd695ed9642401131ea39ad7bc8cf3ef3967fd093b626"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e4972624066095e52b569e02b5ca97dbd7a7ddd4294bf4e7247d52635630dd83"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d946b0a9eb8aaa590df1fe082cee553ceab173e6cb5b03239716338629c50c7a"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b55358304d7a73d7bdf5de62494aaf70bd33015831ffd98bc498b433dfe5b10c"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:a3145cb08d8625b2d3fee1b2d596a8766352979c9bffe5d7833e0503d0f0b5e5"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:d65f25da8e248202bd47445cec78e0025c0fe7582b23ec69c3b27a640dd7a8e3"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:c9bf56195c6bbd293340ea82eafd0071cb3d450c703d2c93afb89f93b8386ccc"}, + {file = "multidict-6.0.5-cp37-cp37m-win32.whl", hash = "sha256:69db76c09796b313331bb7048229e3bee7928eb62bab5e071e9f7fcc4879caee"}, + {file = "multidict-6.0.5-cp37-cp37m-win_amd64.whl", hash = "sha256:fce28b3c8a81b6b36dfac9feb1de115bab619b3c13905b419ec71d03a3fc1423"}, + {file = "multidict-6.0.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:76f067f5121dcecf0d63a67f29080b26c43c71a98b10c701b0677e4a065fbd54"}, + {file = "multidict-6.0.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b82cc8ace10ab5bd93235dfaab2021c70637005e1ac787031f4d1da63d493c1d"}, + {file = "multidict-6.0.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5cb241881eefd96b46f89b1a056187ea8e9ba14ab88ba632e68d7a2ecb7aadf7"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8e94e6912639a02ce173341ff62cc1201232ab86b8a8fcc05572741a5dc7d93"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09a892e4a9fb47331da06948690ae38eaa2426de97b4ccbfafbdcbe5c8f37ff8"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:55205d03e8a598cfc688c71ca8ea5f66447164efff8869517f175ea632c7cb7b"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:37b15024f864916b4951adb95d3a80c9431299080341ab9544ed148091b53f50"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f2a1dee728b52b33eebff5072817176c172050d44d67befd681609b4746e1c2e"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:edd08e6f2f1a390bf137080507e44ccc086353c8e98c657e666c017718561b89"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:60d698e8179a42ec85172d12f50b1668254628425a6bd611aba022257cac1386"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:3d25f19500588cbc47dc19081d78131c32637c25804df8414463ec908631e453"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:4cc0ef8b962ac7a5e62b9e826bd0cd5040e7d401bc45a6835910ed699037a461"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:eca2e9d0cc5a889850e9bbd68e98314ada174ff6ccd1129500103df7a94a7a44"}, + {file = "multidict-6.0.5-cp38-cp38-win32.whl", hash = "sha256:4a6a4f196f08c58c59e0b8ef8ec441d12aee4125a7d4f4fef000ccb22f8d7241"}, + {file = "multidict-6.0.5-cp38-cp38-win_amd64.whl", hash = "sha256:0275e35209c27a3f7951e1ce7aaf93ce0d163b28948444bec61dd7badc6d3f8c"}, + {file = "multidict-6.0.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e7be68734bd8c9a513f2b0cfd508802d6609da068f40dc57d4e3494cefc92929"}, + {file = "multidict-6.0.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1d9ea7a7e779d7a3561aade7d596649fbecfa5c08a7674b11b423783217933f9"}, + {file = "multidict-6.0.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ea1456df2a27c73ce51120fa2f519f1bea2f4a03a917f4a43c8707cf4cbbae1a"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cf590b134eb70629e350691ecca88eac3e3b8b3c86992042fb82e3cb1830d5e1"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5c0631926c4f58e9a5ccce555ad7747d9a9f8b10619621f22f9635f069f6233e"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dce1c6912ab9ff5f179eaf6efe7365c1f425ed690b03341911bf4939ef2f3046"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0868d64af83169e4d4152ec612637a543f7a336e4a307b119e98042e852ad9c"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:141b43360bfd3bdd75f15ed811850763555a251e38b2405967f8e25fb43f7d40"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7df704ca8cf4a073334e0427ae2345323613e4df18cc224f647f251e5e75a527"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6214c5a5571802c33f80e6c84713b2c79e024995b9c5897f794b43e714daeec9"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:cd6c8fca38178e12c00418de737aef1261576bd1b6e8c6134d3e729a4e858b38"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:e02021f87a5b6932fa6ce916ca004c4d441509d33bbdbeca70d05dff5e9d2479"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ebd8d160f91a764652d3e51ce0d2956b38efe37c9231cd82cfc0bed2e40b581c"}, + {file = "multidict-6.0.5-cp39-cp39-win32.whl", hash = "sha256:04da1bb8c8dbadf2a18a452639771951c662c5ad03aefe4884775454be322c9b"}, + {file = "multidict-6.0.5-cp39-cp39-win_amd64.whl", hash = "sha256:d6f6d4f185481c9669b9447bf9d9cf3b95a0e9df9d169bbc17e363b7d5487755"}, + {file = "multidict-6.0.5-py3-none-any.whl", hash = "sha256:0d63c74e3d7ab26de115c49bffc92cc77ed23395303d496eae515d4204a625e7"}, + {file = "multidict-6.0.5.tar.gz", hash = "sha256:f7e301075edaf50500f0b341543c41194d8df3ae5caf4702f2095f3ca73dd8da"}, ] [[package]] @@ -590,43 +623,47 @@ files = [ [[package]] name = "numpy" -version = "1.26.1" +version = "1.26.4" description = "Fundamental package for array computing in Python" optional = false -python-versions = "<3.13,>=3.9" +python-versions = ">=3.9" files = [ - {file = "numpy-1.26.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:82e871307a6331b5f09efda3c22e03c095d957f04bf6bc1804f30048d0e5e7af"}, - {file = "numpy-1.26.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cdd9ec98f0063d93baeb01aad472a1a0840dee302842a2746a7a8e92968f9575"}, - {file = "numpy-1.26.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d78f269e0c4fd365fc2992c00353e4530d274ba68f15e968d8bc3c69ce5f5244"}, - {file = "numpy-1.26.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8ab9163ca8aeb7fd32fe93866490654d2f7dda4e61bc6297bf72ce07fdc02f67"}, - {file = "numpy-1.26.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:78ca54b2f9daffa5f323f34cdf21e1d9779a54073f0018a3094ab907938331a2"}, - {file = "numpy-1.26.1-cp310-cp310-win32.whl", hash = "sha256:d1cfc92db6af1fd37a7bb58e55c8383b4aa1ba23d012bdbba26b4bcca45ac297"}, - {file = "numpy-1.26.1-cp310-cp310-win_amd64.whl", hash = "sha256:d2984cb6caaf05294b8466966627e80bf6c7afd273279077679cb010acb0e5ab"}, - {file = "numpy-1.26.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cd7837b2b734ca72959a1caf3309457a318c934abef7a43a14bb984e574bbb9a"}, - {file = "numpy-1.26.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1c59c046c31a43310ad0199d6299e59f57a289e22f0f36951ced1c9eac3665b9"}, - {file = "numpy-1.26.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d58e8c51a7cf43090d124d5073bc29ab2755822181fcad978b12e144e5e5a4b3"}, - {file = "numpy-1.26.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6081aed64714a18c72b168a9276095ef9155dd7888b9e74b5987808f0dd0a974"}, - {file = "numpy-1.26.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:97e5d6a9f0702c2863aaabf19f0d1b6c2628fbe476438ce0b5ce06e83085064c"}, - {file = "numpy-1.26.1-cp311-cp311-win32.whl", hash = "sha256:b9d45d1dbb9de84894cc50efece5b09939752a2d75aab3a8b0cef6f3a35ecd6b"}, - {file = "numpy-1.26.1-cp311-cp311-win_amd64.whl", hash = "sha256:3649d566e2fc067597125428db15d60eb42a4e0897fc48d28cb75dc2e0454e53"}, - {file = "numpy-1.26.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:1d1bd82d539607951cac963388534da3b7ea0e18b149a53cf883d8f699178c0f"}, - {file = "numpy-1.26.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:afd5ced4e5a96dac6725daeb5242a35494243f2239244fad10a90ce58b071d24"}, - {file = "numpy-1.26.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a03fb25610ef560a6201ff06df4f8105292ba56e7cdd196ea350d123fc32e24e"}, - {file = "numpy-1.26.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcfaf015b79d1f9f9c9fd0731a907407dc3e45769262d657d754c3a028586124"}, - {file = "numpy-1.26.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:e509cbc488c735b43b5ffea175235cec24bbc57b227ef1acc691725beb230d1c"}, - {file = "numpy-1.26.1-cp312-cp312-win32.whl", hash = "sha256:af22f3d8e228d84d1c0c44c1fbdeb80f97a15a0abe4f080960393a00db733b66"}, - {file = "numpy-1.26.1-cp312-cp312-win_amd64.whl", hash = "sha256:9f42284ebf91bdf32fafac29d29d4c07e5e9d1af862ea73686581773ef9e73a7"}, - {file = "numpy-1.26.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:bb894accfd16b867d8643fc2ba6c8617c78ba2828051e9a69511644ce86ce83e"}, - {file = "numpy-1.26.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e44ccb93f30c75dfc0c3aa3ce38f33486a75ec9abadabd4e59f114994a9c4617"}, - {file = "numpy-1.26.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9696aa2e35cc41e398a6d42d147cf326f8f9d81befcb399bc1ed7ffea339b64e"}, - {file = "numpy-1.26.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a5b411040beead47a228bde3b2241100454a6abde9df139ed087bd73fc0a4908"}, - {file = "numpy-1.26.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1e11668d6f756ca5ef534b5be8653d16c5352cbb210a5c2a79ff288e937010d5"}, - {file = "numpy-1.26.1-cp39-cp39-win32.whl", hash = "sha256:d1d2c6b7dd618c41e202c59c1413ef9b2c8e8a15f5039e344af64195459e3104"}, - {file = "numpy-1.26.1-cp39-cp39-win_amd64.whl", hash = "sha256:59227c981d43425ca5e5c01094d59eb14e8772ce6975d4b2fc1e106a833d5ae2"}, - {file = "numpy-1.26.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:06934e1a22c54636a059215d6da99e23286424f316fddd979f5071093b648668"}, - {file = "numpy-1.26.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76ff661a867d9272cd2a99eed002470f46dbe0943a5ffd140f49be84f68ffc42"}, - {file = "numpy-1.26.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:6965888d65d2848e8768824ca8288db0a81263c1efccec881cb35a0d805fcd2f"}, - {file = "numpy-1.26.1.tar.gz", hash = "sha256:c8c6c72d4a9f831f328efb1312642a1cafafaa88981d9ab76368d50d07d93cbe"}, + {file = "numpy-1.26.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9ff0f4f29c51e2803569d7a51c2304de5554655a60c5d776e35b4a41413830d0"}, + {file = "numpy-1.26.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2e4ee3380d6de9c9ec04745830fd9e2eccb3e6cf790d39d7b98ffd19b0dd754a"}, + {file = "numpy-1.26.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d209d8969599b27ad20994c8e41936ee0964e6da07478d6c35016bc386b66ad4"}, + {file = "numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ffa75af20b44f8dba823498024771d5ac50620e6915abac414251bd971b4529f"}, + {file = "numpy-1.26.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:62b8e4b1e28009ef2846b4c7852046736bab361f7aeadeb6a5b89ebec3c7055a"}, + {file = "numpy-1.26.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a4abb4f9001ad2858e7ac189089c42178fcce737e4169dc61321660f1a96c7d2"}, + {file = "numpy-1.26.4-cp310-cp310-win32.whl", hash = "sha256:bfe25acf8b437eb2a8b2d49d443800a5f18508cd811fea3181723922a8a82b07"}, + {file = "numpy-1.26.4-cp310-cp310-win_amd64.whl", hash = "sha256:b97fe8060236edf3662adfc2c633f56a08ae30560c56310562cb4f95500022d5"}, + {file = "numpy-1.26.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4c66707fabe114439db9068ee468c26bbdf909cac0fb58686a42a24de1760c71"}, + {file = "numpy-1.26.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:edd8b5fe47dab091176d21bb6de568acdd906d1887a4584a15a9a96a1dca06ef"}, + {file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ab55401287bfec946ced39700c053796e7cc0e3acbef09993a9ad2adba6ca6e"}, + {file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:666dbfb6ec68962c033a450943ded891bed2d54e6755e35e5835d63f4f6931d5"}, + {file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:96ff0b2ad353d8f990b63294c8986f1ec3cb19d749234014f4e7eb0112ceba5a"}, + {file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:60dedbb91afcbfdc9bc0b1f3f402804070deed7392c23eb7a7f07fa857868e8a"}, + {file = "numpy-1.26.4-cp311-cp311-win32.whl", hash = "sha256:1af303d6b2210eb850fcf03064d364652b7120803a0b872f5211f5234b399f20"}, + {file = "numpy-1.26.4-cp311-cp311-win_amd64.whl", hash = "sha256:cd25bcecc4974d09257ffcd1f098ee778f7834c3ad767fe5db785be9a4aa9cb2"}, + {file = "numpy-1.26.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b3ce300f3644fb06443ee2222c2201dd3a89ea6040541412b8fa189341847218"}, + {file = "numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:03a8c78d01d9781b28a6989f6fa1bb2c4f2d51201cf99d3dd875df6fbd96b23b"}, + {file = "numpy-1.26.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9fad7dcb1aac3c7f0584a5a8133e3a43eeb2fe127f47e3632d43d677c66c102b"}, + {file = "numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:675d61ffbfa78604709862923189bad94014bef562cc35cf61d3a07bba02a7ed"}, + {file = "numpy-1.26.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ab47dbe5cc8210f55aa58e4805fe224dac469cde56b9f731a4c098b91917159a"}, + {file = "numpy-1.26.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:1dda2e7b4ec9dd512f84935c5f126c8bd8b9f2fc001e9f54af255e8c5f16b0e0"}, + {file = "numpy-1.26.4-cp312-cp312-win32.whl", hash = "sha256:50193e430acfc1346175fcbdaa28ffec49947a06918b7b92130744e81e640110"}, + {file = "numpy-1.26.4-cp312-cp312-win_amd64.whl", hash = "sha256:08beddf13648eb95f8d867350f6a018a4be2e5ad54c8d8caed89ebca558b2818"}, + {file = "numpy-1.26.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7349ab0fa0c429c82442a27a9673fc802ffdb7c7775fad780226cb234965e53c"}, + {file = "numpy-1.26.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:52b8b60467cd7dd1e9ed082188b4e6bb35aa5cdd01777621a1658910745b90be"}, + {file = "numpy-1.26.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d5241e0a80d808d70546c697135da2c613f30e28251ff8307eb72ba696945764"}, + {file = "numpy-1.26.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f870204a840a60da0b12273ef34f7051e98c3b5961b61b0c2c1be6dfd64fbcd3"}, + {file = "numpy-1.26.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:679b0076f67ecc0138fd2ede3a8fd196dddc2ad3254069bcb9faf9a79b1cebcd"}, + {file = "numpy-1.26.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:47711010ad8555514b434df65f7d7b076bb8261df1ca9bb78f53d3b2db02e95c"}, + {file = "numpy-1.26.4-cp39-cp39-win32.whl", hash = "sha256:a354325ee03388678242a4d7ebcd08b5c727033fcff3b2f536aea978e15ee9e6"}, + {file = "numpy-1.26.4-cp39-cp39-win_amd64.whl", hash = "sha256:3373d5d70a5fe74a2c1bb6d2cfd9609ecf686d47a2d7b1d37a8f3b6bf6003aea"}, + {file = "numpy-1.26.4-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:afedb719a9dcfc7eaf2287b839d8198e06dcd4cb5d276a3df279231138e83d30"}, + {file = "numpy-1.26.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95a7476c59002f2f6c590b9b7b998306fba6a5aa646b1e22ddfeaf8f78c3a29c"}, + {file = "numpy-1.26.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7e50d0a0cc3189f9cb0aeb3a6a6af18c16f59f004b866cd2be1c14b36134a4a0"}, + {file = "numpy-1.26.4.tar.gz", hash = "sha256:2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4912010"}, ] [[package]] @@ -642,30 +679,43 @@ files = [ [[package]] name = "pip" -version = "23.3.1" +version = "23.3.2" description = "The PyPA recommended tool for installing Python packages." optional = false python-versions = ">=3.7" files = [ - {file = "pip-23.3.1-py3-none-any.whl", hash = "sha256:55eb67bb6171d37447e82213be585b75fe2b12b359e993773aca4de9247a052b"}, - {file = "pip-23.3.1.tar.gz", hash = "sha256:1fcaa041308d01f14575f6d0d2ea4b75a3e2871fe4f9c694976f908768e14174"}, + {file = "pip-23.3.2-py3-none-any.whl", hash = "sha256:5052d7889c1f9d05224cd41741acb7c5d6fa735ab34e339624a614eaaa7e7d76"}, + {file = "pip-23.3.2.tar.gz", hash = "sha256:7fd9972f96db22c8077a1ee2691b172c8089b17a5652a44494a9ecb0d78f9149"}, ] [[package]] name = "pluggy" -version = "1.3.0" +version = "1.4.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" files = [ - {file = "pluggy-1.3.0-py3-none-any.whl", hash = "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7"}, - {file = "pluggy-1.3.0.tar.gz", hash = "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12"}, + {file = "pluggy-1.4.0-py3-none-any.whl", hash = "sha256:7db9f7b503d67d1c5b95f59773ebb58a8c1c288129a88665838012cfb07b8981"}, + {file = "pluggy-1.4.0.tar.gz", hash = "sha256:8c85c2876142a764e5b7548e7d9a0e0ddb46f5185161049a79b7e974454223be"}, ] [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] +[[package]] +name = "pminit" +version = "0.3.1.dev37+f1e980c" +description = "Post-install hook for PythonMonkey" +optional = false +python-versions = "^3.8" +files = [] +develop = true + +[package.source] +type = "directory" +url = "python/pminit" + [[package]] name = "pycares" version = "4.4.0" @@ -756,13 +806,13 @@ files = [ [[package]] name = "pytest" -version = "7.4.3" +version = "7.4.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-7.4.3-py3-none-any.whl", hash = "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac"}, - {file = "pytest-7.4.3.tar.gz", hash = "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5"}, + {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, + {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, ] [package.dependencies] @@ -789,85 +839,101 @@ files = [ [[package]] name = "yarl" -version = "1.9.2" +version = "1.9.4" description = "Yet another URL library" optional = false python-versions = ">=3.7" files = [ - {file = "yarl-1.9.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:8c2ad583743d16ddbdf6bb14b5cd76bf43b0d0006e918809d5d4ddf7bde8dd82"}, - {file = "yarl-1.9.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:82aa6264b36c50acfb2424ad5ca537a2060ab6de158a5bd2a72a032cc75b9eb8"}, - {file = "yarl-1.9.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c0c77533b5ed4bcc38e943178ccae29b9bcf48ffd1063f5821192f23a1bd27b9"}, - {file = "yarl-1.9.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ee4afac41415d52d53a9833ebae7e32b344be72835bbb589018c9e938045a560"}, - {file = "yarl-1.9.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9bf345c3a4f5ba7f766430f97f9cc1320786f19584acc7086491f45524a551ac"}, - {file = "yarl-1.9.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2a96c19c52ff442a808c105901d0bdfd2e28575b3d5f82e2f5fd67e20dc5f4ea"}, - {file = "yarl-1.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:891c0e3ec5ec881541f6c5113d8df0315ce5440e244a716b95f2525b7b9f3608"}, - {file = "yarl-1.9.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c3a53ba34a636a256d767c086ceb111358876e1fb6b50dfc4d3f4951d40133d5"}, - {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:566185e8ebc0898b11f8026447eacd02e46226716229cea8db37496c8cdd26e0"}, - {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:2b0738fb871812722a0ac2154be1f049c6223b9f6f22eec352996b69775b36d4"}, - {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:32f1d071b3f362c80f1a7d322bfd7b2d11e33d2adf395cc1dd4df36c9c243095"}, - {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:e9fdc7ac0d42bc3ea78818557fab03af6181e076a2944f43c38684b4b6bed8e3"}, - {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:56ff08ab5df8429901ebdc5d15941b59f6253393cb5da07b4170beefcf1b2528"}, - {file = "yarl-1.9.2-cp310-cp310-win32.whl", hash = "sha256:8ea48e0a2f931064469bdabca50c2f578b565fc446f302a79ba6cc0ee7f384d3"}, - {file = "yarl-1.9.2-cp310-cp310-win_amd64.whl", hash = "sha256:50f33040f3836e912ed16d212f6cc1efb3231a8a60526a407aeb66c1c1956dde"}, - {file = "yarl-1.9.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:646d663eb2232d7909e6601f1a9107e66f9791f290a1b3dc7057818fe44fc2b6"}, - {file = "yarl-1.9.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:aff634b15beff8902d1f918012fc2a42e0dbae6f469fce134c8a0dc51ca423bb"}, - {file = "yarl-1.9.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a83503934c6273806aed765035716216cc9ab4e0364f7f066227e1aaea90b8d0"}, - {file = "yarl-1.9.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b25322201585c69abc7b0e89e72790469f7dad90d26754717f3310bfe30331c2"}, - {file = "yarl-1.9.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:22a94666751778629f1ec4280b08eb11815783c63f52092a5953faf73be24191"}, - {file = "yarl-1.9.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ec53a0ea2a80c5cd1ab397925f94bff59222aa3cf9c6da938ce05c9ec20428d"}, - {file = "yarl-1.9.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:159d81f22d7a43e6eabc36d7194cb53f2f15f498dbbfa8edc8a3239350f59fe7"}, - {file = "yarl-1.9.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:832b7e711027c114d79dffb92576acd1bd2decc467dec60e1cac96912602d0e6"}, - {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:95d2ecefbcf4e744ea952d073c6922e72ee650ffc79028eb1e320e732898d7e8"}, - {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:d4e2c6d555e77b37288eaf45b8f60f0737c9efa3452c6c44626a5455aeb250b9"}, - {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:783185c75c12a017cc345015ea359cc801c3b29a2966c2655cd12b233bf5a2be"}, - {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:b8cc1863402472f16c600e3e93d542b7e7542a540f95c30afd472e8e549fc3f7"}, - {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:822b30a0f22e588b32d3120f6d41e4ed021806418b4c9f0bc3048b8c8cb3f92a"}, - {file = "yarl-1.9.2-cp311-cp311-win32.whl", hash = "sha256:a60347f234c2212a9f0361955007fcf4033a75bf600a33c88a0a8e91af77c0e8"}, - {file = "yarl-1.9.2-cp311-cp311-win_amd64.whl", hash = "sha256:be6b3fdec5c62f2a67cb3f8c6dbf56bbf3f61c0f046f84645cd1ca73532ea051"}, - {file = "yarl-1.9.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:38a3928ae37558bc1b559f67410df446d1fbfa87318b124bf5032c31e3447b74"}, - {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac9bb4c5ce3975aeac288cfcb5061ce60e0d14d92209e780c93954076c7c4367"}, - {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3da8a678ca8b96c8606bbb8bfacd99a12ad5dd288bc6f7979baddd62f71c63ef"}, - {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:13414591ff516e04fcdee8dc051c13fd3db13b673c7a4cb1350e6b2ad9639ad3"}, - {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf74d08542c3a9ea97bb8f343d4fcbd4d8f91bba5ec9d5d7f792dbe727f88938"}, - {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6e7221580dc1db478464cfeef9b03b95c5852cc22894e418562997df0d074ccc"}, - {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:494053246b119b041960ddcd20fd76224149cfea8ed8777b687358727911dd33"}, - {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:52a25809fcbecfc63ac9ba0c0fb586f90837f5425edfd1ec9f3372b119585e45"}, - {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:e65610c5792870d45d7b68c677681376fcf9cc1c289f23e8e8b39c1485384185"}, - {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:1b1bba902cba32cdec51fca038fd53f8beee88b77efc373968d1ed021024cc04"}, - {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:662e6016409828ee910f5d9602a2729a8a57d74b163c89a837de3fea050c7582"}, - {file = "yarl-1.9.2-cp37-cp37m-win32.whl", hash = "sha256:f364d3480bffd3aa566e886587eaca7c8c04d74f6e8933f3f2c996b7f09bee1b"}, - {file = "yarl-1.9.2-cp37-cp37m-win_amd64.whl", hash = "sha256:6a5883464143ab3ae9ba68daae8e7c5c95b969462bbe42e2464d60e7e2698368"}, - {file = "yarl-1.9.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5610f80cf43b6202e2c33ba3ec2ee0a2884f8f423c8f4f62906731d876ef4fac"}, - {file = "yarl-1.9.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b9a4e67ad7b646cd6f0938c7ebfd60e481b7410f574c560e455e938d2da8e0f4"}, - {file = "yarl-1.9.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:83fcc480d7549ccebe9415d96d9263e2d4226798c37ebd18c930fce43dfb9574"}, - {file = "yarl-1.9.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5fcd436ea16fee7d4207c045b1e340020e58a2597301cfbcfdbe5abd2356c2fb"}, - {file = "yarl-1.9.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:84e0b1599334b1e1478db01b756e55937d4614f8654311eb26012091be109d59"}, - {file = "yarl-1.9.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3458a24e4ea3fd8930e934c129b676c27452e4ebda80fbe47b56d8c6c7a63a9e"}, - {file = "yarl-1.9.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:838162460b3a08987546e881a2bfa573960bb559dfa739e7800ceeec92e64417"}, - {file = "yarl-1.9.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f4e2d08f07a3d7d3e12549052eb5ad3eab1c349c53ac51c209a0e5991bbada78"}, - {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:de119f56f3c5f0e2fb4dee508531a32b069a5f2c6e827b272d1e0ff5ac040333"}, - {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:149ddea5abf329752ea5051b61bd6c1d979e13fbf122d3a1f9f0c8be6cb6f63c"}, - {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:674ca19cbee4a82c9f54e0d1eee28116e63bc6fd1e96c43031d11cbab8b2afd5"}, - {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:9b3152f2f5677b997ae6c804b73da05a39daa6a9e85a512e0e6823d81cdad7cc"}, - {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5415d5a4b080dc9612b1b63cba008db84e908b95848369aa1da3686ae27b6d2b"}, - {file = "yarl-1.9.2-cp38-cp38-win32.whl", hash = "sha256:f7a3d8146575e08c29ed1cd287068e6d02f1c7bdff8970db96683b9591b86ee7"}, - {file = "yarl-1.9.2-cp38-cp38-win_amd64.whl", hash = "sha256:63c48f6cef34e6319a74c727376e95626f84ea091f92c0250a98e53e62c77c72"}, - {file = "yarl-1.9.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:75df5ef94c3fdc393c6b19d80e6ef1ecc9ae2f4263c09cacb178d871c02a5ba9"}, - {file = "yarl-1.9.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c027a6e96ef77d401d8d5a5c8d6bc478e8042f1e448272e8d9752cb0aff8b5c8"}, - {file = "yarl-1.9.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f3b078dbe227f79be488ffcfc7a9edb3409d018e0952cf13f15fd6512847f3f7"}, - {file = "yarl-1.9.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:59723a029760079b7d991a401386390c4be5bfec1e7dd83e25a6a0881859e716"}, - {file = "yarl-1.9.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b03917871bf859a81ccb180c9a2e6c1e04d2f6a51d953e6a5cdd70c93d4e5a2a"}, - {file = "yarl-1.9.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c1012fa63eb6c032f3ce5d2171c267992ae0c00b9e164efe4d73db818465fac3"}, - {file = "yarl-1.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a74dcbfe780e62f4b5a062714576f16c2f3493a0394e555ab141bf0d746bb955"}, - {file = "yarl-1.9.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8c56986609b057b4839968ba901944af91b8e92f1725d1a2d77cbac6972b9ed1"}, - {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:2c315df3293cd521033533d242d15eab26583360b58f7ee5d9565f15fee1bef4"}, - {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:b7232f8dfbd225d57340e441d8caf8652a6acd06b389ea2d3222b8bc89cbfca6"}, - {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:53338749febd28935d55b41bf0bcc79d634881195a39f6b2f767870b72514caf"}, - {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:066c163aec9d3d073dc9ffe5dd3ad05069bcb03fcaab8d221290ba99f9f69ee3"}, - {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8288d7cd28f8119b07dd49b7230d6b4562f9b61ee9a4ab02221060d21136be80"}, - {file = "yarl-1.9.2-cp39-cp39-win32.whl", hash = "sha256:b124e2a6d223b65ba8768d5706d103280914d61f5cae3afbc50fc3dfcc016623"}, - {file = "yarl-1.9.2-cp39-cp39-win_amd64.whl", hash = "sha256:61016e7d582bc46a5378ffdd02cd0314fb8ba52f40f9cf4d9a5e7dbef88dee18"}, - {file = "yarl-1.9.2.tar.gz", hash = "sha256:04ab9d4b9f587c06d801c2abfe9317b77cdf996c65a90d5e84ecc45010823571"}, + {file = "yarl-1.9.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a8c1df72eb746f4136fe9a2e72b0c9dc1da1cbd23b5372f94b5820ff8ae30e0e"}, + {file = "yarl-1.9.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a3a6ed1d525bfb91b3fc9b690c5a21bb52de28c018530ad85093cc488bee2dd2"}, + {file = "yarl-1.9.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c38c9ddb6103ceae4e4498f9c08fac9b590c5c71b0370f98714768e22ac6fa66"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d9e09c9d74f4566e905a0b8fa668c58109f7624db96a2171f21747abc7524234"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8477c1ee4bd47c57d49621a062121c3023609f7a13b8a46953eb6c9716ca392"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d5ff2c858f5f6a42c2a8e751100f237c5e869cbde669a724f2062d4c4ef93551"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:357495293086c5b6d34ca9616a43d329317feab7917518bc97a08f9e55648455"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:54525ae423d7b7a8ee81ba189f131054defdb122cde31ff17477951464c1691c"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:801e9264d19643548651b9db361ce3287176671fb0117f96b5ac0ee1c3530d53"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e516dc8baf7b380e6c1c26792610230f37147bb754d6426462ab115a02944385"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:7d5aaac37d19b2904bb9dfe12cdb08c8443e7ba7d2852894ad448d4b8f442863"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:54beabb809ffcacbd9d28ac57b0db46e42a6e341a030293fb3185c409e626b8b"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bac8d525a8dbc2a1507ec731d2867025d11ceadcb4dd421423a5d42c56818541"}, + {file = "yarl-1.9.4-cp310-cp310-win32.whl", hash = "sha256:7855426dfbddac81896b6e533ebefc0af2f132d4a47340cee6d22cac7190022d"}, + {file = "yarl-1.9.4-cp310-cp310-win_amd64.whl", hash = "sha256:848cd2a1df56ddbffeb375535fb62c9d1645dde33ca4d51341378b3f5954429b"}, + {file = "yarl-1.9.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:35a2b9396879ce32754bd457d31a51ff0a9d426fd9e0e3c33394bf4b9036b099"}, + {file = "yarl-1.9.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4c7d56b293cc071e82532f70adcbd8b61909eec973ae9d2d1f9b233f3d943f2c"}, + {file = "yarl-1.9.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d8a1c6c0be645c745a081c192e747c5de06e944a0d21245f4cf7c05e457c36e0"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4b3c1ffe10069f655ea2d731808e76e0f452fc6c749bea04781daf18e6039525"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:549d19c84c55d11687ddbd47eeb348a89df9cb30e1993f1b128f4685cd0ebbf8"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a7409f968456111140c1c95301cadf071bd30a81cbd7ab829169fb9e3d72eae9"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e23a6d84d9d1738dbc6e38167776107e63307dfc8ad108e580548d1f2c587f42"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d8b889777de69897406c9fb0b76cdf2fd0f31267861ae7501d93003d55f54fbe"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:03caa9507d3d3c83bca08650678e25364e1843b484f19986a527630ca376ecce"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:4e9035df8d0880b2f1c7f5031f33f69e071dfe72ee9310cfc76f7b605958ceb9"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:c0ec0ed476f77db9fb29bca17f0a8fcc7bc97ad4c6c1d8959c507decb22e8572"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:ee04010f26d5102399bd17f8df8bc38dc7ccd7701dc77f4a68c5b8d733406958"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:49a180c2e0743d5d6e0b4d1a9e5f633c62eca3f8a86ba5dd3c471060e352ca98"}, + {file = "yarl-1.9.4-cp311-cp311-win32.whl", hash = "sha256:81eb57278deb6098a5b62e88ad8281b2ba09f2f1147c4767522353eaa6260b31"}, + {file = "yarl-1.9.4-cp311-cp311-win_amd64.whl", hash = "sha256:d1d2532b340b692880261c15aee4dc94dd22ca5d61b9db9a8a361953d36410b1"}, + {file = "yarl-1.9.4-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0d2454f0aef65ea81037759be5ca9947539667eecebca092733b2eb43c965a81"}, + {file = "yarl-1.9.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:44d8ffbb9c06e5a7f529f38f53eda23e50d1ed33c6c869e01481d3fafa6b8142"}, + {file = "yarl-1.9.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:aaaea1e536f98754a6e5c56091baa1b6ce2f2700cc4a00b0d49eca8dea471074"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3777ce5536d17989c91696db1d459574e9a9bd37660ea7ee4d3344579bb6f129"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9fc5fc1eeb029757349ad26bbc5880557389a03fa6ada41703db5e068881e5f2"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ea65804b5dc88dacd4a40279af0cdadcfe74b3e5b4c897aa0d81cf86927fee78"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa102d6d280a5455ad6a0f9e6d769989638718e938a6a0a2ff3f4a7ff8c62cc4"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09efe4615ada057ba2d30df871d2f668af661e971dfeedf0c159927d48bbeff0"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:008d3e808d03ef28542372d01057fd09168419cdc8f848efe2804f894ae03e51"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:6f5cb257bc2ec58f437da2b37a8cd48f666db96d47b8a3115c29f316313654ff"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:992f18e0ea248ee03b5a6e8b3b4738850ae7dbb172cc41c966462801cbf62cf7"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:0e9d124c191d5b881060a9e5060627694c3bdd1fe24c5eecc8d5d7d0eb6faabc"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:3986b6f41ad22988e53d5778f91855dc0399b043fc8946d4f2e68af22ee9ff10"}, + {file = "yarl-1.9.4-cp312-cp312-win32.whl", hash = "sha256:4b21516d181cd77ebd06ce160ef8cc2a5e9ad35fb1c5930882baff5ac865eee7"}, + {file = "yarl-1.9.4-cp312-cp312-win_amd64.whl", hash = "sha256:a9bd00dc3bc395a662900f33f74feb3e757429e545d831eef5bb280252631984"}, + {file = "yarl-1.9.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:63b20738b5aac74e239622d2fe30df4fca4942a86e31bf47a81a0e94c14df94f"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7d7f7de27b8944f1fee2c26a88b4dabc2409d2fea7a9ed3df79b67277644e17"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c74018551e31269d56fab81a728f683667e7c28c04e807ba08f8c9e3bba32f14"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ca06675212f94e7a610e85ca36948bb8fc023e458dd6c63ef71abfd482481aa5"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5aef935237d60a51a62b86249839b51345f47564208c6ee615ed2a40878dccdd"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2b134fd795e2322b7684155b7855cc99409d10b2e408056db2b93b51a52accc7"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d25039a474c4c72a5ad4b52495056f843a7ff07b632c1b92ea9043a3d9950f6e"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:f7d6b36dd2e029b6bcb8a13cf19664c7b8e19ab3a58e0fefbb5b8461447ed5ec"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:957b4774373cf6f709359e5c8c4a0af9f6d7875db657adb0feaf8d6cb3c3964c"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:d7eeb6d22331e2fd42fce928a81c697c9ee2d51400bd1a28803965883e13cead"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:6a962e04b8f91f8c4e5917e518d17958e3bdee71fd1d8b88cdce74dd0ebbf434"}, + {file = "yarl-1.9.4-cp37-cp37m-win32.whl", hash = "sha256:f3bc6af6e2b8f92eced34ef6a96ffb248e863af20ef4fde9448cc8c9b858b749"}, + {file = "yarl-1.9.4-cp37-cp37m-win_amd64.whl", hash = "sha256:ad4d7a90a92e528aadf4965d685c17dacff3df282db1121136c382dc0b6014d2"}, + {file = "yarl-1.9.4-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ec61d826d80fc293ed46c9dd26995921e3a82146feacd952ef0757236fc137be"}, + {file = "yarl-1.9.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8be9e837ea9113676e5754b43b940b50cce76d9ed7d2461df1af39a8ee674d9f"}, + {file = "yarl-1.9.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:bef596fdaa8f26e3d66af846bbe77057237cb6e8efff8cd7cc8dff9a62278bbf"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2d47552b6e52c3319fede1b60b3de120fe83bde9b7bddad11a69fb0af7db32f1"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:84fc30f71689d7fc9168b92788abc977dc8cefa806909565fc2951d02f6b7d57"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4aa9741085f635934f3a2583e16fcf62ba835719a8b2b28fb2917bb0537c1dfa"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:206a55215e6d05dbc6c98ce598a59e6fbd0c493e2de4ea6cc2f4934d5a18d130"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07574b007ee20e5c375a8fe4a0789fad26db905f9813be0f9fef5a68080de559"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5a2e2433eb9344a163aced6a5f6c9222c0786e5a9e9cac2c89f0b28433f56e23"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:6ad6d10ed9b67a382b45f29ea028f92d25bc0bc1daf6c5b801b90b5aa70fb9ec"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:6fe79f998a4052d79e1c30eeb7d6c1c1056ad33300f682465e1b4e9b5a188b78"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:a825ec844298c791fd28ed14ed1bffc56a98d15b8c58a20e0e08c1f5f2bea1be"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8619d6915b3b0b34420cf9b2bb6d81ef59d984cb0fde7544e9ece32b4b3043c3"}, + {file = "yarl-1.9.4-cp38-cp38-win32.whl", hash = "sha256:686a0c2f85f83463272ddffd4deb5e591c98aac1897d65e92319f729c320eece"}, + {file = "yarl-1.9.4-cp38-cp38-win_amd64.whl", hash = "sha256:a00862fb23195b6b8322f7d781b0dc1d82cb3bcac346d1e38689370cc1cc398b"}, + {file = "yarl-1.9.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:604f31d97fa493083ea21bd9b92c419012531c4e17ea6da0f65cacdcf5d0bd27"}, + {file = "yarl-1.9.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:8a854227cf581330ffa2c4824d96e52ee621dd571078a252c25e3a3b3d94a1b1"}, + {file = "yarl-1.9.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ba6f52cbc7809cd8d74604cce9c14868306ae4aa0282016b641c661f981a6e91"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a6327976c7c2f4ee6816eff196e25385ccc02cb81427952414a64811037bbc8b"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8397a3817d7dcdd14bb266283cd1d6fc7264a48c186b986f32e86d86d35fbac5"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e0381b4ce23ff92f8170080c97678040fc5b08da85e9e292292aba67fdac6c34"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:23d32a2594cb5d565d358a92e151315d1b2268bc10f4610d098f96b147370136"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ddb2a5c08a4eaaba605340fdee8fc08e406c56617566d9643ad8bf6852778fc7"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:26a1dc6285e03f3cc9e839a2da83bcbf31dcb0d004c72d0730e755b33466c30e"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:18580f672e44ce1238b82f7fb87d727c4a131f3a9d33a5e0e82b793362bf18b4"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:29e0f83f37610f173eb7e7b5562dd71467993495e568e708d99e9d1944f561ec"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:1f23e4fe1e8794f74b6027d7cf19dc25f8b63af1483d91d595d4a07eca1fb26c"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:db8e58b9d79200c76956cefd14d5c90af54416ff5353c5bfd7cbe58818e26ef0"}, + {file = "yarl-1.9.4-cp39-cp39-win32.whl", hash = "sha256:c7224cab95645c7ab53791022ae77a4509472613e839dab722a72abe5a684575"}, + {file = "yarl-1.9.4-cp39-cp39-win_amd64.whl", hash = "sha256:824d6c50492add5da9374875ce72db7a0733b29c2394890aef23d533106e2b15"}, + {file = "yarl-1.9.4-py3-none-any.whl", hash = "sha256:928cecb0ef9d5a7946eb6ff58417ad2fe9375762382f1bf5c55e61645f2c43ad"}, + {file = "yarl-1.9.4.tar.gz", hash = "sha256:566db86717cf8080b99b58b083b773a908ae40f06681e87e589a976faf8246bf"}, ] [package.dependencies] @@ -877,4 +943,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "c18a4a3a6c279206c5402fa1737b197296454be8d002b65421e245150b9807e8" +content-hash = "d44163aa8190bc28b1dc5993526c8eb03a36f2d72be9eab2b4dc6be3af3f4b3d" diff --git a/pyproject.toml b/pyproject.toml index 80d64bfe..575d373f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ include = [ [tool.poetry.dependencies] python = "^3.8" pyreadline3 = { version = "^3.4.1", platform = "win32" } -aiohttp = { version = "^3.9.0b1", allow-prereleases = true, extras = ["speedups"] } +aiohttp = { version = "^3.9.3", extras = ["speedups"] } pminit = { version = "*", allow-prereleases = true } From 28fd039e3e0226dd7c11797505c698061cfdd527 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Mon, 26 Feb 2024 15:33:23 -0500 Subject: [PATCH 0301/1086] cleanup unused methods --- include/pyTypeFactory.hh | 14 -------------- src/pyTypeFactory.cc | 38 -------------------------------------- 2 files changed, 52 deletions(-) diff --git a/include/pyTypeFactory.hh b/include/pyTypeFactory.hh index c122161b..8c15b866 100644 --- a/include/pyTypeFactory.hh +++ b/include/pyTypeFactory.hh @@ -17,14 +17,6 @@ #include -/** @brief Function that takes an arbitrary PyObject* and returns a corresponding PyType* object - - @author Caleb Aikens - @date August 2022 - - @param object - Pointer to the PyObject who's type and value we wish to encapsulate - */ -PyType *pyTypeFactory(PyObject *object); /** * @brief Function that takes a JS::Value and returns a corresponding PyType* object, doing shared memory management when necessary @@ -36,10 +28,4 @@ PyType *pyTypeFactory(PyObject *object); */ PyType *pyTypeFactory(JSContext *cx, JS::HandleObject thisObj, JS::HandleValue rval); -/** - * @brief same to pyTypeFactory, but it's guaranteed that no error would be set on the Python error stack, instead - * returning `pythonmonkey.null` on error - */ -PyType *pyTypeFactorySafe(JSContext *cx, JS::HandleObject thisObj, JS::HandleValue rval); - #endif \ No newline at end of file diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index 576bf95d..323be613 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -39,33 +39,6 @@ #include -PyType *pyTypeFactory(PyObject *object) { - PyType *pyType; - - if (PyLong_Check(object)) { - pyType = new IntType(object); - } - else if (PyUnicode_Check(object)) { - pyType = new StrType(object); - } - else if (PyFunction_Check(object)) { - pyType = new FuncType(object); - } - else if (PyDict_Check(object)) { - pyType = new DictType(object); - } - else if (PyList_Check(object)) { - pyType = new ListType(object); - } - else if (PyTuple_Check(object)) { - pyType = new TupleType(object); - } - else { - return nullptr; - } - - return pyType; -} PyType *pyTypeFactory(JSContext *cx, JS::HandleObject thisObj, JS::HandleValue rval) { if (rval.isUndefined()) { @@ -177,15 +150,4 @@ PyType *pyTypeFactory(JSContext *cx, JS::HandleObject thisObj, JS::HandleValue r errorString += JS_EncodeStringToUTF8(cx, str).get(); PyErr_SetString(PyExc_TypeError, errorString.c_str()); return NULL; -} - -PyType *pyTypeFactorySafe(JSContext *cx, JS::HandleObject thisObj, JS::HandleValue rval) { - PyType *v = pyTypeFactory(cx, thisObj, rval); - if (PyErr_Occurred()) { - // Clear Python error - PyErr_Clear(); - // Return `pythonmonkey.null` on error - return new NullType(); - } - return v; } \ No newline at end of file From b0a8e0f4d9623b89aedd14f40fed3aafe11beb43 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Mon, 26 Feb 2024 16:03:23 -0500 Subject: [PATCH 0302/1086] cleanup and minor improvements --- src/JobQueue.cc | 16 ++++++++-------- src/PromiseType.cc | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/JobQueue.cc b/src/JobQueue.cc index 799c5678..9aab22c3 100644 --- a/src/JobQueue.cc +++ b/src/JobQueue.cc @@ -33,12 +33,13 @@ bool JobQueue::enqueuePromiseJob(JSContext *cx, JS::RootedValue jobv(cx, JS::ObjectValue(*job)); PyObject *callback = pyTypeFactory(cx, global, jobv)->getPyObject(); - // Inform the JS runtime that the job queue is no longer empty - JS::JobQueueMayNotBeEmpty(cx); - // Send job to the running Python event-loop PyEventLoop loop = PyEventLoop::getRunningLoop(); if (!loop.initialized()) return false; + + // Inform the JS runtime that the job queue is no longer empty + JS::JobQueueMayNotBeEmpty(cx); + loop.enqueue(callback); return true; @@ -54,8 +55,7 @@ bool JobQueue::empty() const { } js::UniquePtr JobQueue::saveJobQueue(JSContext *cx) { - auto saved = js::MakeUnique(); - return saved; + return js::MakeUnique(); } bool JobQueue::init(JSContext *cx) { @@ -74,7 +74,7 @@ static PyObject *callDispatchFunc(PyObject *dispatchFuncTuple, PyObject *Py_UNUS static PyMethodDef callDispatchFuncDef = {"JsDispatchCallable", callDispatchFunc, METH_NOARGS, NULL}; bool JobQueue::dispatchToEventLoop(void *closure, JS::Dispatchable *dispatchable) { - JSContext *cx = (JSContext *)closure; // `closure` is provided in `JS::InitDispatchToEventLoop` call + JSContext *cx = (JSContext *)closure; // The `dispatchToEventLoop` function is running in a helper thread, so // we must acquire the Python GIL (global interpreter lock) @@ -84,11 +84,11 @@ bool JobQueue::dispatchToEventLoop(void *closure, JS::Dispatchable *dispatchable PyObject *dispatchFuncTuple = PyTuple_Pack(2, PyLong_FromVoidPtr(cx), PyLong_FromVoidPtr(dispatchable)); PyObject *pyFunc = PyCFunction_New(&callDispatchFuncDef, dispatchFuncTuple); - // Avoid using the JS helper thread to send jobs to event-loop as it may cause deadlock + // Avoid using the current, JS helper thread to send jobs to event-loop as it may cause deadlock PyThread_start_new_thread((void (*)(void *)) &sendJobToMainLoop, pyFunc); PyGILState_Release(gstate); - return true; // dispatchable must eventually run + return true; } bool sendJobToMainLoop(PyObject *pyFunc) { diff --git a/src/PromiseType.cc b/src/PromiseType.cc index d34202d2..e6014622 100644 --- a/src/PromiseType.cc +++ b/src/PromiseType.cc @@ -31,7 +31,7 @@ static bool onResolvedCb(JSContext *cx, unsigned argc, JS::Value *vp) { // Get the Promise state JS::Value promiseObjVal = js::GetFunctionNativeReserved(&args.callee(), PROMISE_OBJ_SLOT); - JS::RootedObject promise = JS::RootedObject(cx, &promiseObjVal.toObject()); + JS::RootedObject promise(cx, &promiseObjVal.toObject()); JS::PromiseState state = JS::GetPromiseState(promise); // Convert the Promise's result (either fulfilled resolution or rejection reason) to a Python object @@ -77,7 +77,7 @@ PromiseType::PromiseType(JSContext *cx, JS::HandleObject promise) { // Callbacks to settle the Python asyncio.Future once the JS Promise is resolved JS::RootedObject onResolved = JS::RootedObject(cx, (JSObject *)js::NewFunctionWithReserved(cx, onResolvedCb, 1, 0, NULL)); - js::SetFunctionNativeReserved(onResolved, PY_FUTURE_OBJ_SLOT, JS::PrivateValue(future.getFutureObject())); // put the address of the Python object in private slot so we can access it later + js::SetFunctionNativeReserved(onResolved, PY_FUTURE_OBJ_SLOT, JS::PrivateValue(future.getFutureObject())); js::SetFunctionNativeReserved(onResolved, PROMISE_OBJ_SLOT, JS::ObjectValue(*promise)); AddPromiseReactions(cx, promise, onResolved, onResolved); @@ -87,7 +87,7 @@ PromiseType::PromiseType(JSContext *cx, JS::HandleObject promise) { // Callback to resolve or reject the JS Promise when the Future is done static PyObject *futureOnDoneCallback(PyObject *futureCallbackTuple, PyObject *args) { JSContext *cx = (JSContext *)PyLong_AsVoidPtr(PyTuple_GetItem(futureCallbackTuple, 0)); - auto rootedPtr = (JS::PersistentRooted *)PyLong_AsVoidPtr(PyTuple_GetItem(futureCallbackTuple, 1)); + JS::PersistentRootedObject *rootedPtr = (JS::PersistentRootedObject *)PyLong_AsVoidPtr(PyTuple_GetItem(futureCallbackTuple, 1)); JS::HandleObject promise = *rootedPtr; PyObject *futureObj = PyTuple_GetItem(args, 0); // the callback is called with the Future object as its only argument // see https://docs.python.org/3.9/library/asyncio-future.html#asyncio.Future.add_done_callback From 593da2219e62ad6587fcb1764d317741d93abfeb Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Mon, 26 Feb 2024 16:41:05 -0500 Subject: [PATCH 0303/1086] dict conversion no longer needed now that we have proxies --- python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py index 7ab5ed24..6477de47 100644 --- a/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py +++ b/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py @@ -58,7 +58,6 @@ async def write(self, writer) -> None: body = bytes(body, "utf-8") # set default headers - headers=dict(headers) headers.setdefault("user-agent", f"Python/{platform.python_version()} PythonMonkey/{pm.__version__}") if timeoutMs > 0: From f7875789883a1d54092a2d020a0f8cc48dfc9e15 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Tue, 27 Feb 2024 12:54:50 -0500 Subject: [PATCH 0304/1086] improved setdefault performance --- include/JSObjectProxy.hh | 2 +- src/JSObjectProxy.cc | 48 ++++++++++++++++++++++++++-------------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 6386ae0e..3a2b0504 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -311,9 +311,9 @@ static PyNumberMethods JSObjectProxy_number_methods = { * */ static PyMethodDef JSObjectProxy_methods[] = { + {"setdefault", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method, METH_FASTCALL, dict_setdefault__doc__}, {"__getitem__", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_get, METH_O | METH_COEXIST, getitem__doc__}, {"get", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_get_method, METH_FASTCALL, dict_get__doc__}, - {"setdefault", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method, METH_FASTCALL, dict_setdefault__doc__}, {"pop", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method, METH_FASTCALL, dict_pop__doc__}, {"clear", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method, METH_NOARGS, clear__doc__}, {"copy", (PyCFunction)JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method, METH_NOARGS, copy__doc__}, diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 24c76406..a7baed14 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -63,14 +63,7 @@ Py_ssize_t JSObjectProxyMethodDefinitions::JSObjectProxy_length(JSObjectProxy *s return props.length(); } -PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, PyObject *key) -{ - JS::RootedId id(GLOBAL_CX); - if (!keyToId(key, &id)) { - // TODO (Caleb Aikens): raise exception here - return NULL; // key is not a str or int - } - +static inline PyObject *getKey(JSObjectProxy *self, PyObject *key, JS::HandleId id) { // look through the methods for dispatch for (size_t index = 0;; index++) { const char *methodName = JSObjectProxyType.tp_methods[index].ml_name; @@ -88,6 +81,17 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, } } +PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get(JSObjectProxy *self, PyObject *key) +{ + JS::RootedId id(GLOBAL_CX); + if (!keyToId(key, &id)) { + // TODO (Caleb Aikens): raise exception here + return NULL; // key is not a str or int + } + + return getKey(self, key, id); +} + int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, PyObject *key) { JS::RootedId id(GLOBAL_CX); @@ -100,6 +104,16 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, return value->isUndefined() ? 0 : 1; } +static inline void assignKeyValue(JSObjectProxy *self, PyObject *key, JS::HandleId id, PyObject *value) { + if (value) { // we are setting a value + JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); + JS_SetPropertyById(GLOBAL_CX, self->jsObject, id, jValue); + } else { // we are deleting a value + JS::ObjectOpResult ignoredResult; + JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); + } +} + int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, PyObject *key, PyObject *value) { JS::RootedId id(GLOBAL_CX); @@ -108,13 +122,7 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, Py return -1; } - if (value) { // we are setting a value - JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); - JS_SetPropertyById(GLOBAL_CX, self->jsObject, id, jValue); - } else { // we are deleting a value - JS::ObjectOpResult ignoredResult; - JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); - } + assignKeyValue(self, key, id, value); return 0; } @@ -531,9 +539,15 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method(JSObje skip_optional: - PyObject* value = JSObjectProxy_get(self, key); + JS::RootedId id(GLOBAL_CX); + if (!keyToId(key, &id)) { // invalid key + // TODO (Caleb Aikens): raise exception here + return NULL; + } + + PyObject *value = getKey(self, key, id); if (value == Py_None) { - JSObjectProxy_assign(self, key, default_value); + assignKeyValue(self, key, id, default_value); Py_XINCREF(default_value); return default_value; } From e248b4458a1c01e896b706f508ff6b9dccef5a84 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Tue, 27 Feb 2024 16:14:38 -0500 Subject: [PATCH 0305/1086] decref the result of python calls. Rooted type simplifications --- src/PyListProxyHandler.cc | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 73d8316a..745c840f 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -75,6 +75,7 @@ static bool array_pop(JSContext *cx, unsigned argc, JS::Value *vp) { } args.rval().set(jsTypeFactory(cx, result)); + Py_DECREF(result); return true; } @@ -206,6 +207,7 @@ static bool array_slice(JSContext *cx, unsigned argc, JS::Value *vp) { } args.rval().set(jsTypeFactory(cx, result)); + Py_DECREF(result); return true; } @@ -263,6 +265,7 @@ static bool array_indexOf(JSContext *cx, unsigned argc, JS::Value *vp) { } args.rval().set(jsTypeFactory(cx, result)); + Py_DECREF(result); return true; } @@ -345,6 +348,7 @@ static bool array_splice(JSContext *cx, unsigned argc, JS::Value *vp) { } args.rval().set(jsTypeFactory(cx, deleted)); + Py_DECREF(deleted); return true; } @@ -560,6 +564,7 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { } args.rval().set(jsTypeFactory(cx, result)); + Py_DECREF(result); return true; } @@ -906,35 +911,33 @@ static bool array_reduceRight(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedValue callBack(cx, callbackfn); JS::Rooted> jArgs(cx); - JS::RootedValue *accumulator; + JS::RootedValue accumulator(cx); Py_ssize_t len = PyList_GET_SIZE(self); if (args.length() > 1) { - accumulator = new JS::RootedValue(cx, args[1].get()); + accumulator.set(args[1].get()); } else { if (len == 0) { JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_EMPTY_ARRAY_REDUCE); return false; } - accumulator = new JS::RootedValue(cx, jsTypeFactory(cx, PyList_GetItem(self, len - 1))); + accumulator.set(jsTypeFactory(cx, PyList_GetItem(self, len - 1))); } for (int64_t index = args.length() > 1 ? len - 1 : len - 2; index >= 0; index--) { - jArgs[0].set(*accumulator); + jArgs[0].set(accumulator); jArgs[1].set(jsTypeFactory(cx, PyList_GetItem(self, index))); jArgs[2].setInt32(index); jArgs[3].set(selfValue); - if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, accumulator)) { - delete accumulator; + if (!JS_CallFunctionValue(cx, nullptr, callBack, jArgs, &accumulator)) { return false; } } - args.rval().set(accumulator->get()); - delete accumulator; + args.rval().set(accumulator.get()); return true; } @@ -1436,12 +1439,12 @@ static bool array_join(JSContext *cx, unsigned argc, JS::Value *vp) { return true; } - JS::RootedString *rootedSeparator; + JS::RootedString rootedSeparator(cx); if (args.hasDefined(0)) { - rootedSeparator = new JS::RootedString(cx, JS::ToString(cx, args[0])); + rootedSeparator.set(JS::ToString(cx, args[0])); } else { - rootedSeparator = new JS::RootedString(cx, JS_NewStringCopyZ(cx, ",")); + rootedSeparator.set(JS_NewStringCopyZ(cx, ",")); } JSString *writer = JS_NewStringCopyZ(cx, ""); @@ -1450,7 +1453,7 @@ static bool array_join(JSContext *cx, unsigned argc, JS::Value *vp) { for (Py_ssize_t index = 0; index < selfLength; index++) { rootedWriter.set(writer); if (index > 0) { - writer = JS_ConcatStrings(cx, rootedWriter, *rootedSeparator); + writer = JS_ConcatStrings(cx, rootedWriter, rootedSeparator); rootedWriter.set(writer); } @@ -1461,12 +1464,10 @@ static bool array_join(JSContext *cx, unsigned argc, JS::Value *vp) { JS::RootedObject retObject(cx); if (!JS_ValueToObject(cx, element, &retObject)) { - delete rootedSeparator; return false; } if (!JS_CallFunctionName(cx, retObject, "toString", JS::HandleValueArray::empty(), &rval)) { - delete rootedSeparator; return false; } @@ -1475,8 +1476,6 @@ static bool array_join(JSContext *cx, unsigned argc, JS::Value *vp) { } } - delete rootedSeparator; - args.rval().setString(writer); return true; } From 943bb1d9a3caf06bf88956a057e52b531784a664 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Tue, 27 Feb 2024 16:33:56 -0500 Subject: [PATCH 0306/1086] fix file header attributions --- include/JSObjectProxy.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 3a2b0504..e1b2e9d7 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -1,6 +1,6 @@ /** * @file JSObjectProxy.hh - * @author Caleb Aikens (caleb@distributive.network) & Tom Tang (xmader@distributive.network) + * @author Caleb Aikens (caleb@distributive.network), Tom Tang (xmader@distributive.network) and Philippe Laporte (philippe@distributive.network) * @brief JSObjectProxy is a custom C-implemented python type that derives from dict. It acts as a proxy for JSObjects from Spidermonkey, and behaves like a dict would. * @date 2023-06-26 * From 118c8ca18a7b9dc2bd81451bb327e1577d66da8e Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Tue, 27 Feb 2024 16:43:12 -0500 Subject: [PATCH 0307/1086] feat(PyListProxyHandler): implement and add tests for Array methods that take a thisArg argument for a callback --- src/PyListProxyHandler.cc | 55 +++- tests/python/test_arrays.py | 630 ++++++++++++++++++++++++++++-------- 2 files changed, 546 insertions(+), 139 deletions(-) diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 5286d274..35aa5e1a 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -30,7 +30,28 @@ const char PyListProxyHandler::family = 0; +// private util +// if function is a proxy for a python method, mutate it into a new python method bound to thisObject +static bool makeNewPyMethod(JSContext *cx, JS::MutableHandleValue function, JS::HandleObject thisObject) { + if (!JS_IsNativeFunction(&(function.toObject()), callPyFunc)) { + return true; // we don't need to mutate function if it is not a proxy for a python function + } + PyObject *method = (PyObject *)js::GetFunctionNativeReserved(&(function.toObject()), 0).toPrivate(); + if (!PyMethod_Check(method)) { + PyErr_Format(PyExc_TypeError, "unbound python functions do not have a 'self' to bind"); + return false; + } + + PyObject *func = PyMethod_Function(method); + JS::RootedObject global(cx, JS::CurrentGlobalOrNull(cx)); + JS::RootedValue thisValue(cx); + thisValue.setObject(*thisObject); + PyObject *newSelf = pyTypeFactory(cx, &global, &thisValue)->getPyObject(); + function.set(jsTypeFactory(cx, PyMethod_New(func, newSelf))); + + return true; +} static bool array_reverse(JSContext *cx, unsigned argc, JS::Value *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -667,15 +688,19 @@ static bool array_forEach(JSContext *cx, unsigned argc, JS::Value *vp) { Py_ssize_t len = PyList_GET_SIZE(self); JS::RootedObject rootedThisArg(cx); + if (args.length() > 1) { JS::Value thisArg = args[1].get(); if (!thisArg.isObjectOrNull()) { JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, JSMSG_NOT_OBJORNULL, "'this' argument"); return false; } - // TODO support null, currently gets TypeError rootedThisArg.set(thisArg.toObjectOrNull()); + // check if callback is a PyMethod, need to make a new method bound to thisArg + if (!makeNewPyMethod(cx, &callBack, rootedThisArg)) { + return false; + } } else { rootedThisArg.set(nullptr); @@ -737,6 +762,10 @@ static bool array_map(JSContext *cx, unsigned argc, JS::Value *vp) { // TODO support null, currently gets TypeError rootedThisArg.set(thisArg.toObjectOrNull()); + // check if callback is a PyMethod, need to make a new method bound to thisArg + if (!makeNewPyMethod(cx, &callBack, rootedThisArg)) { + return false; + } } else { rootedThisArg.set(nullptr); @@ -796,6 +825,10 @@ static bool array_filter(JSContext *cx, unsigned argc, JS::Value *vp) { // TODO support null, currently gets TypeError rootedThisArg.set(thisArg.toObjectOrNull()); + // check if callback is a PyMethod, need to make a new method bound to thisArg + if (!makeNewPyMethod(cx, &callBack, rootedThisArg)) { + return false; + } } else { rootedThisArg.set(nullptr); @@ -974,6 +1007,10 @@ static bool array_some(JSContext *cx, unsigned argc, JS::Value *vp) { // TODO support null, currently gets TypeError rootedThisArg.set(thisArg.toObjectOrNull()); + // check if callback is a PyMethod, need to make a new method bound to thisArg + if (!makeNewPyMethod(cx, &callBack, rootedThisArg)) { + return false; + } } else { rootedThisArg.set(nullptr); @@ -1035,6 +1072,10 @@ static bool array_every(JSContext *cx, unsigned argc, JS::Value *vp) { // TODO support null, currently gets TypeError rootedThisArg.set(thisArg.toObjectOrNull()); + // check if callback is a PyMethod, need to make a new method bound to thisArg + if (!makeNewPyMethod(cx, &callBack, rootedThisArg)) { + return false; + } } else { rootedThisArg.set(nullptr); @@ -1096,6 +1137,10 @@ static bool array_find(JSContext *cx, unsigned argc, JS::Value *vp) { // TODO support null, currently gets TypeError rootedThisArg.set(thisArg.toObjectOrNull()); + // check if callback is a PyMethod, need to make a new method bound to thisArg + if (!makeNewPyMethod(cx, &callBack, rootedThisArg)) { + return false; + } } else { rootedThisArg.set(nullptr); @@ -1158,6 +1203,10 @@ static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { // TODO support null, currently gets TypeError rootedThisArg.set(thisArg.toObjectOrNull()); + // check if callback is a PyMethod, need to make a new method bound to thisArg + if (!makeNewPyMethod(cx, &callBack, rootedThisArg)) { + return false; + } } else { rootedThisArg.set(nullptr); @@ -1409,6 +1458,10 @@ static bool array_flatMap(JSContext *cx, unsigned argc, JS::Value *vp) { // TODO support null, currently gets TypeError rootedThisArg.set(thisArg.toObjectOrNull()); + // check if callback is a PyMethod, need to make a new method bound to thisArg + if (!makeNewPyMethod(cx, &callBack, rootedThisArg)) { + return false; + } } else { rootedThisArg.set(nullptr); diff --git a/tests/python/test_arrays.py b/tests/python/test_arrays.py index 442471ce..2ee5ebd0 100644 --- a/tests/python/test_arrays.py +++ b/tests/python/test_arrays.py @@ -860,34 +860,67 @@ def test_forEach_check_this_arg_wrong_type(): # TODO python function support -# this one does not get the result into items -#def test_forEach_with_python_function(): -# def func(element, index, array): -# return "to each his own" -# items = ['Four', 'Three', 'One'] -# returnResult = [0] -# pm.eval("(returnResult, arr, func) => {returnResult[0] = arr.forEach(func)}")(returnResult, items, func) -# assert items == ['to each his own', 'to each his own', 'to each his own'] -# assert returnResult == [None] - -#def test_forEach_self(): -# items = ['Four', 'Three', 'One'] -# class Counter: -# def __init__(self): -# self.count = 0 -# def increment(self): -# self.count += 1 +def test_forEach_with_python_function(): + def func(element, index, array): + array[int(index)] = "to each his own" + items = ['Four', 'Three', 'One'] + returnResult = [0] + pm.eval("(returnResult, arr, func) => {returnResult[0] = arr.forEach(func)}")(returnResult, items, func) + assert items == ['to each his own', 'to each his own', 'to each his own'] + assert returnResult == [None] + +def test_forEach_self_pymethod(): + items = ['Four', 'Three', 'One'] + class Counter: + def __init__(self): + self.count = 0 + def increment(self, element, index, array): + self.count += 1 -# obj = Counter() -# result = pm.eval(""" -# (arr, increment, result) => { -# let jsObj = {count: 0} -# arr.forEach(increment, jsObj); -# return jsObj.count; -# } -# """)(items, obj.increment) -# assert result == 3 + obj = Counter() + assert obj.count == 0 + result = pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.forEach(increment, jsObj); + return jsObj.count; + } + """)(items, obj.increment) + assert obj.count == 0 + assert result == 3 + +def test_forEach_self_pyfunction(): + items = ['Four', 'Three', 'One'] + def increment(self, element, index, array): + self.count += 1 + + try: + pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.forEach(increment, jsObj); + return jsObj.count; + } + """)(items, increment) + assert False + except Exception as e: + assert type(e) is TypeError + assert str(e).__contains__("unbound python functions do not have a 'self' to bind") +def test_forEach_self_jsfunction(): + items = ['Four', 'Three', 'One'] + + result = pm.eval(""" + (arr) => { + function increment(element, index, array) { + this.count++ + } + let jsObj = {count: 0} + arr.forEach(increment, jsObj); + return jsObj.count; + } + """)(items) + assert result == 3 # TODO should not pass def test_forEach_check_this_arg_null(): @@ -979,23 +1012,68 @@ def test_map_check_array_mutation(): assert result[0] == ['Ten', 'Three', 'One'] assert items == ['Ten', 'Three', 'One'] -#def test_map_self(): -# items = ['Four', 'Three', 'One'] -# class Counter: -# def __init__(self): -# self.count = 0 -# def increment(self): -# self.count += 1 +def test_map_with_python_function(): + def func(element, index, array): + array[int(index)] = "to each his own" + return 42 + items = ['Four', 'Three', 'One'] + returnResult = [0] + pm.eval("(returnResult, arr, func) => {returnResult[0] = arr.map(func)}")(returnResult, items, func) + assert items == ['to each his own', 'to each his own', 'to each his own'] + assert returnResult == [[42.0, 42.0, 42.0]] + +def test_map_self_pymethod(): + items = ['Four', 'Three', 'One'] + class Counter: + def __init__(self): + self.count = 0 + def increment(self, element, index, array): + self.count += 1 + + obj = Counter() + assert obj.count == 0 + result = pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.map(increment, jsObj); + return jsObj.count; + } + """)(items, obj.increment) + assert obj.count == 0 + assert result == 3 + +def test_map_self_pyfunction(): + items = ['Four', 'Three', 'One'] + def increment(self, element, index, array): + self.count += 1 + + try: + pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.map(increment, jsObj); + return jsObj.count; + } + """)(items, increment) + assert False + except Exception as e: + assert type(e) is TypeError + assert str(e).__contains__("unbound python functions do not have a 'self' to bind") + +def test_map_self_jsfunction(): + items = ['Four', 'Three', 'One'] -# obj = Counter() -# result = pm.eval(""" -# (arr, increment, result) => { -# let jsObj = {count: 0} -# arr.map(increment, jsObj); -# return jsObj.count; -# } -# """)(items, obj.increment) -# assert result == 3 + result = pm.eval(""" + (arr) => { + function increment(element, index, array) { + this.count++ + } + let jsObj = {count: 0} + arr.map(increment, jsObj); + return jsObj.count; + } + """)(items) + assert result == 3 #filter def test_filter(): @@ -1051,23 +1129,67 @@ def test_filter_too_few_args(): assert str(type(e)) == "" assert str(e).__contains__("TypeError: filter: At least 1 argument required, but only 0 passed") -#def test_filter_self(): -# items = ['Four', 'Three', 'One'] -# class Counter: -# def __init__(self): -# self.count = 0 -# def increment(self): -# self.count += 1 +def test_filter_python_function(): + def func(element, index, array): + array[int(index)] = "to each his own" + items = ['Four', 'Three', 'One'] + returnResult = [0] + pm.eval("(returnResult, arr, func) => {returnResult[0] = arr.filter(func)}")(returnResult, items, func) + assert items == ['to each his own', 'to each his own', 'to each his own'] + assert returnResult == [[]] + +def test_filter_self_pymethod(): + items = ['Four', 'Three', 'One'] + class Counter: + def __init__(self): + self.count = 0 + def increment(self, element, index, array): + self.count += 1 + + obj = Counter() + assert obj.count == 0 + result = pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.filter(increment, jsObj); + return jsObj.count; + } + """)(items, obj.increment) + assert obj.count == 0 + assert result == 3 + +def test_filter_self_pyfunction(): + items = ['Four', 'Three', 'One'] + def increment(self, element, index, array): + self.count += 1 + + try: + pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.filter(increment, jsObj); + return jsObj.count; + } + """)(items, increment) + assert False + except Exception as e: + assert type(e) is TypeError + assert str(e).__contains__("unbound python functions do not have a 'self' to bind") + +def test_filter_self_jsfunction(): + items = ['Four', 'Three', 'One'] -# obj = Counter() -# result = pm.eval(""" -# (arr, increment, result) => { -# let jsObj = {count: 0} -# arr.filter(increment, jsObj); -# return jsObj.count; -# } -# """)(items, obj.increment) -# assert result == 3 + result = pm.eval(""" + (arr) => { + function increment(element, index, array) { + this.count++ + } + let jsObj = {count: 0} + arr.filter(increment, jsObj); + return jsObj.count; + } + """)(items) + assert result == 3 #reduce def test_reduce(): @@ -1242,23 +1364,71 @@ def test_some_truthy_conversion(): """)(result) assert result[0] == True -#def test_some_self(): -# items = ['Four', 'Three', 'One'] -# class Counter: -# def __init__(self): -# self.count = 0 -# def increment(self): -# self.count += 1 +def test_some_with_python_function(): + def func(element, index, array): + array[int(index)] = "to each his own" + return False + items = ['Four', 'Three', 'One'] + returnResult = [0] + pm.eval("(returnResult, arr, func) => {returnResult[0] = arr.some(func)}")(returnResult, items, func) + assert items == ['to each his own', 'to each his own', 'to each his own'] + assert returnResult == [False] + +def test_some_self_pymethod(): + items = ['Four', 'Three', 'One'] + class Counter: + def __init__(self): + self.count = 0 + def increment(self, element, index, array): + self.count += 1 + return False + + obj = Counter() + assert obj.count == 0 + result = pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.some(increment, jsObj); + return jsObj.count; + } + """)(items, obj.increment) + assert obj.count == 0 + assert result == 3 + +def test_some_self_pyfunction(): + items = ['Four', 'Three', 'One'] + def increment(self, element, index, array): + self.count += 1 + return False + + try: + pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.some(increment, jsObj); + return jsObj.count; + } + """)(items, increment) + assert False + except Exception as e: + assert type(e) is TypeError + assert str(e).__contains__("unbound python functions do not have a 'self' to bind") + +def test_some_self_jsfunction(): + items = ['Four', 'Three', 'One'] -# obj = Counter() -# result = pm.eval(""" -# (arr, increment, result) => { -# let jsObj = {count: 0} -# arr.some(increment, jsObj); -# return jsObj.count; -# } -# """)(items, obj.increment) -# assert result == 3 + result = pm.eval(""" + (arr) => { + function increment(element, index, array) { + this.count++; + return false; + } + let jsObj = {count: 0} + arr.some(increment, jsObj); + return jsObj.count; + } + """)(items) + assert result == 3 #every def test_every_true(): @@ -1311,23 +1481,70 @@ class Counter { )(result, items) assert result == [1] -#def test_every_self(): -# items = ['Four', 'Three', 'One'] -# class Counter: -# def __init__(self): -# self.count = 0 -# def increment(self): -# self.count += 1 +def test_every_with_python_function(): + def func(element, index, array): + array[int(index)] = "to each his own" + return True + items = ['Four', 'Three', 'One'] + returnResult = [0] + pm.eval("(returnResult, arr, func) => {returnResult[0] = arr.every(func)}")(returnResult, items, func) + assert items == ['to each his own', 'to each his own', 'to each his own'] + assert returnResult == [True] + +def test_every_self_pymethod(): + items = ['Four', 'Three', 'One'] + class Counter: + def __init__(self): + self.count = 0 + def increment(self, element, index, array): + self.count += 1 + return True -# obj = Counter() -# result = pm.eval(""" -# (arr, increment, result) => { -# let jsObj = {count: 0} -# arr.every(increment, jsObj); -# return jsObj.count; -# } -# """)(items, obj.increment) -# assert result == 3 + obj = Counter() + assert obj.count == 0 + result = pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.every(increment, jsObj); + return jsObj.count; + } + """)(items, obj.increment) + assert obj.count == 0 + assert result == 3 + +def test_every_self_pyfunction(): + items = ['Four', 'Three', 'One'] + def increment(self, element, index, array): + self.count += 1 + + try: + pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.every(increment, jsObj); + return jsObj.count; + } + """)(items, increment) + assert False + except Exception as e: + assert type(e) is TypeError + assert str(e).__contains__("unbound python functions do not have a 'self' to bind") + +def test_every_self_jsfunction(): + items = ['Four', 'Three', 'One'] + + result = pm.eval(""" + (arr) => { + function increment(element, index, array) { + this.count++ + return true; + } + let jsObj = {count: 0} + arr.every(increment, jsObj); + return jsObj.count; + } + """)(items) + assert result == 3 #find def test_find_found_once(): @@ -1386,23 +1603,71 @@ class Counter { )(result, items) assert result == [3] -#def test_find_self(): -# items = ['Four', 'Three', 'One'] -# class Counter: -# def __init__(self): -# self.count = 0 -# def increment(self): -# self.count += 1 +def test_find_with_python_function(): + def func(element, index, array): + array[int(index)] = "to each his own" + return False + items = ['Four', 'Three', 'One'] + returnResult = [0] + pm.eval("(returnResult, arr, func) => {returnResult[0] = arr.find(func)}")(returnResult, items, func) + assert items == ['to each his own', 'to each his own', 'to each his own'] + assert returnResult == [None] + +def test_find_self_pymethod(): + items = ['Four', 'Three', 'One'] + class Counter: + def __init__(self): + self.count = 0 + def increment(self, element, index, array): + self.count += 1 + return False + + obj = Counter() + assert obj.count == 0 + result = pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.find(increment, jsObj); + return jsObj.count; + } + """)(items, obj.increment) + assert obj.count == 0 + assert result == 3 + +def test_find_self_pyfunction(): + items = ['Four', 'Three', 'One'] + def increment(self, element, index, array): + self.count += 1 + return False + + try: + pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.find(increment, jsObj); + return jsObj.count; + } + """)(items, increment) + assert False + except Exception as e: + assert type(e) is TypeError + assert str(e).__contains__("unbound python functions do not have a 'self' to bind") + +def test_find_self_jsfunction(): + items = ['Four', 'Three', 'One'] -# obj = Counter() -# result = pm.eval(""" -# (arr, increment, result) => { -# let jsObj = {count: 0} -# arr.find(increment, jsObj); -# return jsObj.count; -# } -# """)(items, obj.increment) -# assert result == 3 + result = pm.eval(""" + (arr) => { + function increment(element, index, array) { + this.count++; + return false; + } + let jsObj = {count: 0} + arr.find(increment, jsObj); + return jsObj.count; + } + """)(items) + assert result == 3 #findIndex def test_findIndex_found_once(): @@ -1461,23 +1726,67 @@ class Counter { )(result, items) assert result == [3] -#def test_findIndex_self(): -# items = ['Four', 'Three', 'One'] -# class Counter: -# def __init__(self): -# self.count = 0 -# def increment(self): -# self.count += 1 +def test_findIndex_with_python_function(): + def func(element, index, array): + array[int(index)] = "to each his own" + items = ['Four', 'Three', 'One'] + returnResult = [0] + pm.eval("(returnResult, arr, func) => {returnResult[0] = arr.findIndex(func)}")(returnResult, items, func) + assert items == ['to each his own', 'to each his own', 'to each his own'] + assert returnResult == [-1] + +def test_findIndex_self_pymethod(): + items = ['Four', 'Three', 'One'] + class Counter: + def __init__(self): + self.count = 0 + def increment(self, element, index, array): + self.count += 1 -# obj = Counter() -# result = pm.eval(""" -# (arr, increment, result) => { -# let jsObj = {count: 0} -# arr.findIndex(increment, jsObj); -# return jsObj.count; -# } -# """)(items, obj.increment) -# assert result == 3 + obj = Counter() + assert obj.count == 0 + result = pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.findIndex(increment, jsObj); + return jsObj.count; + } + """)(items, obj.increment) + assert obj.count == 0 + assert result == 3 + +def test_findIndex_self_pyfunction(): + items = ['Four', 'Three', 'One'] + def increment(self, element, index, array): + self.count += 1 + + try: + pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.findIndex(increment, jsObj); + return jsObj.count; + } + """)(items, increment) + assert False + except Exception as e: + assert type(e) is TypeError + assert str(e).__contains__("unbound python functions do not have a 'self' to bind") + +def test_findIndex_self_jsfunction(): + items = ['Four', 'Three', 'One'] + + result = pm.eval(""" + (arr) => { + function increment(element, index, array) { + this.count++ + } + let jsObj = {count: 0} + arr.findIndex(increment, jsObj); + return jsObj.count; + } + """)(items) + assert result == 3 #flat def test_flat(): @@ -1594,23 +1903,68 @@ class Counter { )(result, items) assert result == [3] -#def test_flatMap_self(): -# items = ['Four', 'Three', 'One'] -# class Counter: -# def __init__(self): -# self.count = 0 -# def increment(self): -# self.count += 1 +def test_flatMap_with_python_function(): + def func(element, index, array): + array[int(index)] = "to each his own" + return 42 + items = ['Four', 'Three', 'One'] + returnResult = [0] + pm.eval("(returnResult, arr, func) => {returnResult[0] = arr.flatMap(func)}")(returnResult, items, func) + assert items == ['to each his own', 'to each his own', 'to each his own'] + assert returnResult == [[42.0, 42.0, 42.0]] + +def test_flatMap_self_pymethod(): + items = ['Four', 'Three', 'One'] + class Counter: + def __init__(self): + self.count = 0 + def increment(self, element, index, array): + self.count += 1 -# obj = Counter() -# result = pm.eval(""" -# (arr, increment, result) => { -# let jsObj = {count: 0} -# arr.flatMap(increment, jsObj); -# return jsObj.count; -# } -# """)(items, obj.increment) -# assert result == 3 + obj = Counter() + assert obj.count == 0 + result = pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.flatMap(increment, jsObj); + return jsObj.count; + } + """)(items, obj.increment) + assert obj.count == 0 + assert result == 3 + +def test_flatMap_self_pyfunction(): + items = ['Four', 'Three', 'One'] + def increment(self, element, index, array): + self.count += 1 + + try: + pm.eval(""" + (arr, increment, result) => { + let jsObj = {count: 0} + arr.flatMap(increment, jsObj); + return jsObj.count; + } + """)(items, increment) + assert False + except Exception as e: + assert type(e) is TypeError + assert str(e).__contains__("unbound python functions do not have a 'self' to bind") + +def test_flatMap_self_jsfunction(): + items = ['Four', 'Three', 'One'] + + result = pm.eval(""" + (arr) => { + function increment(element, index, array) { + this.count++ + } + let jsObj = {count: 0} + arr.flatMap(increment, jsObj); + return jsObj.count; + } + """)(items) + assert result == 3 #valueOf def test_valueOf(): From 850508c4f0a470a2bb759e22bc89d56257f38835 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Tue, 27 Feb 2024 17:37:50 -0500 Subject: [PATCH 0308/1086] improved clear methods and related naming, variable folding --- include/JSArrayProxy.hh | 6 +++--- src/JSArrayProxy.cc | 6 +++--- src/JSObjectProxy.cc | 4 +--- src/modules/pythonmonkey/pythonmonkey.cc | 17 ++++++----------- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh index f0e4f2b0..f6875954 100644 --- a/include/JSArrayProxy.hh +++ b/include/JSArrayProxy.hh @@ -162,7 +162,7 @@ public: * @param self - The JSArrayProxy * @return None */ - static PyObject *JSArrayProxy_clear(JSArrayProxy *self); + static PyObject *JSArrayProxy_clear_method(JSArrayProxy *self); /** * @brief .tp_clear method @@ -170,7 +170,7 @@ public: * @param self - The JSArrayProxy * @return 0 on success */ - static int JSArrayProxy_clear_slot(JSArrayProxy *self); + static int JSArrayProxy_clear(JSArrayProxy *self); /** * @brief .tp_traverse method @@ -393,7 +393,7 @@ PyDoc_STRVAR(list___reversed____doc__, */ static PyMethodDef JSArrayProxy_methods[] = { {"__reversed__", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_iter_reverse, METH_NOARGS, list___reversed____doc__}, - {"clear", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_clear, METH_NOARGS, py_list_clear__doc__}, + {"clear", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_clear_method, METH_NOARGS, py_list_clear__doc__}, {"copy", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_copy, METH_NOARGS, list_copy__doc__}, {"append", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_append, METH_O, list_append__doc__}, {"insert", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_insert, METH_FASTCALL, list_insert__doc__}, diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 3162b8a9..9a18d185 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -734,13 +734,13 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat(JSArrayProx return (PyObject *)self; } -PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_clear(JSArrayProxy *self) { +PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_clear_method(JSArrayProxy *self) { JS::SetArrayLength(GLOBAL_CX, self->jsArray, 0); Py_RETURN_NONE; } -int JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot(JSArrayProxy *self) { - JSArrayProxyMethodDefinitions::JSArrayProxy_clear(self); +int JSArrayProxyMethodDefinitions::JSArrayProxy_clear(JSArrayProxy *self) { + // Nothing to be done return 0; } diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index a7baed14..49af3d1e 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -133,9 +133,7 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_traverse(JSObjectProxy *self, } int JSObjectProxyMethodDefinitions::JSObjectProxy_clear(JSObjectProxy *self) { - if (!JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method(self)) { - return -1; - } + // Nothing to be done return 0; } diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index e99cf366..cb88845d 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -145,7 +145,7 @@ PyTypeObject JSArrayProxyType = { .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_LIST_SUBCLASS | Py_TPFLAGS_HAVE_GC, .tp_doc = PyDoc_STR("Javascript Array proxy list"), .tp_traverse = (traverseproc)JSArrayProxyMethodDefinitions::JSArrayProxy_traverse, - .tp_clear = (inquiry)JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot, + .tp_clear = (inquiry)JSArrayProxyMethodDefinitions::JSArrayProxy_clear, .tp_richcompare = (richcmpfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare, .tp_iter = (getiterfunc)JSArrayProxyMethodDefinitions::JSArrayProxy_iter, .tp_methods = JSArrayProxy_methods, @@ -257,27 +257,21 @@ static PyObject *collect(PyObject *self, PyObject *args) { } static bool getEvalOption(PyObject *evalOptions, const char *optionName, const char **s_p) { - PyObject *value; - - value = PyDict_GetItemString(evalOptions, optionName); + PyObject *value = PyDict_GetItemString(evalOptions, optionName); if (value) *s_p = PyUnicode_AsUTF8(value); return value != NULL; } static bool getEvalOption(PyObject *evalOptions, const char *optionName, unsigned long *l_p) { - PyObject *value; - - value = PyDict_GetItemString(evalOptions, optionName); + PyObject *value = PyDict_GetItemString(evalOptions, optionName); if (value) *l_p = PyLong_AsUnsignedLong(value); return value != NULL; } static bool getEvalOption(PyObject *evalOptions, const char *optionName, bool *b_p) { - PyObject *value; - - value = PyDict_GetItemString(evalOptions, optionName); + PyObject *value = PyDict_GetItemString(evalOptions, optionName); if (value) *b_p = PyObject_IsTrue(value) == 1 ? true : false; return value != NULL; @@ -340,7 +334,8 @@ static PyObject *eval(PyObject *self, PyObject *args) { } /* filename */ } /* fromPythonFrame */ } /* eval options */ - // initialize JS context + + // initialize JS context JS::SourceText source; if (!source.init(GLOBAL_CX, code->getValue(), strlen(code->getValue()), JS::SourceOwnership::Borrowed)) { setSpiderMonkeyException(GLOBAL_CX); From 66448e2e0538035bd2decff62414226ebfbde827 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Tue, 27 Feb 2024 18:22:23 -0500 Subject: [PATCH 0309/1086] docs(JSMethodProxy): write docs describing how to use JSMethodProxy to implement methods on python classes --- README.md | 1 + python/pythonmonkey/pythonmonkey.pyi | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/README.md b/README.md index 2ac8db92..4c727c31 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,7 @@ These methods are exported from the pythonmonkey module. * bigint(int) * `SpiderMonkeyError` * `JSObjectProxy` +* `JSMethodProxy` * `null` See definitions in [python/pythonmonkey/pythonmonkey.pyi](https://github.com/Distributive-Network/PythonMonkey/blob/main/python/pythonmonkey/pythonmonkey.pyi). diff --git a/python/pythonmonkey/pythonmonkey.pyi b/python/pythonmonkey/pythonmonkey.pyi index 15bed09d..a9db3bc2 100644 --- a/python/pythonmonkey/pythonmonkey.pyi +++ b/python/pythonmonkey/pythonmonkey.pyi @@ -66,6 +66,31 @@ class JSObjectProxy(dict): """ def __init__(self) -> None: ... +class JSFunctionProxy(): + """ + JavaScript Function proxy + """ +class JSMethodProxy(JSFunctionProxy, object): + """ + JavaScript Method proxy + This constructs a callable object based on the first argument, bound to the second argument + Useful when you wish to implement a method on a class object with JavaScript + Example: + import pythonmonkey as pm + + jsFunc = pm.eval("(function(value) { this.value = value})") + class Class: + def __init__(self): + self.value = 0 + self.setValue = pm.JSMethodProxy(jsFunc, self) #setValue will be bound to self, so `this` will always be `self` + + myObject = Class() + print(myObject.value) # 0 + myObject.setValue(42) + print(myObject.value) # 42.0 + """ + def __init__(self) -> None: ... + null = _typing.Annotated[ _typing.NewType("pythonmonkey.null", object), "Representing the JS null type in Python using a singleton object", From 763bd44819c4985122e7094d4b5d1a97e866cebf Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Tue, 27 Feb 2024 18:52:36 -0500 Subject: [PATCH 0310/1086] fix on clear method, incref in object.get --- src/JSArrayProxy.cc | 4 ++-- src/JSObjectProxy.cc | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 9a18d185..0dfa8afe 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -210,7 +210,7 @@ static int list_ass_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihigh, if (selfLength + d == 0) { Py_XDECREF(v_as_SF); - JSArrayProxyMethodDefinitions::JSArrayProxy_clear(self); + JSArrayProxyMethodDefinitions::JSArrayProxy_clear_method(self); return 0; } @@ -709,7 +709,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat(JSArrayProx } if (n < 1) { - JSArrayProxy_clear(self); + JSArrayProxy_clear_method(self); Py_INCREF(self); return (PyObject *)self; } diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 49af3d1e..bac8cf73 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -71,7 +71,9 @@ static inline PyObject *getKey(JSObjectProxy *self, PyObject *key, JS::HandleId JS::RootedValue value(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); JS::RootedObject thisObj(GLOBAL_CX, self->jsObject); - return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); + PyObject *ret = pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); + Py_INCREF(ret); + return ret; } else { if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { @@ -550,7 +552,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method(JSObje return default_value; } - Py_XINCREF(value); + // no need to incref since done in getKey return value; } From 0c9b4e15eaa8bcc79b06610452c5a495a9a8643b Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Wed, 28 Feb 2024 15:22:50 +0000 Subject: [PATCH 0311/1086] fix(console): console methods should return undefined instead of a number --- .../pythonmonkey/builtin_modules/console.js | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/console.js b/python/pythonmonkey/builtin_modules/console.js index 7bf6e2b4..34bed66a 100644 --- a/python/pythonmonkey/builtin_modules/console.js +++ b/python/pythonmonkey/builtin_modules/console.js @@ -3,7 +3,7 @@ * @author Tom Tang * @date June 2023 */ -const { customInspectSymbol, format } = require("util"); +const { customInspectSymbol, format } = require('util'); /** @typedef {(str: string) => void} WriteFn */ /** @typedef {{ write: WriteFn }} IOWriter */ @@ -12,7 +12,8 @@ const { customInspectSymbol, format } = require("util"); * @see https://developer.mozilla.org/en-US/docs/Web/API/Console_API */ // TODO (Tom Tang): adhere https://console.spec.whatwg.org/ -class Console { +class Console +{ /** @type {WriteFn} */ #writeToStdout; /** @type {WriteFn} */ @@ -51,18 +52,19 @@ class Console { this.#writeToStdout = options.stdout.write; this.#writeToStderr = options.stderr.write; - this.log = (...args) => this.#writeToStdout(this.#formatToStr(...args)); - this.debug = (...args) => this.#writeToStdout(this.#formatToStr(...args)); - this.info = (...args) => this.#writeToStdout(this.#formatToStr(...args)); - this.warn = (...args) => this.#writeToStderr(this.#formatToStr(...args)); - this.error = (...args) => this.#writeToStderr(this.#formatToStr(...args)); + this.log = (...args) => void this.#writeToStdout(this.#formatToStr(...args)); + this.debug = (...args) => void this.#writeToStdout(this.#formatToStr(...args)); + this.info = (...args) => void this.#writeToStdout(this.#formatToStr(...args)); + this.warn = (...args) => void this.#writeToStderr(this.#formatToStr(...args)); + this.error = (...args) => void this.#writeToStderr(this.#formatToStr(...args)); } /** * @return {string} */ - #formatToStr(...args) { - return format(...args) + "\n" + #formatToStr(...args) + { + return format(...args) + '\n'; } // TODO (Tom Tang): implement more methods @@ -70,8 +72,9 @@ class Console { /** * Re-export the `Console` constructor as global `console.Console`, like in Node.js */ - get Console() { - return Console + get Console() + { + return Console; } /** @@ -80,7 +83,8 @@ class Console { static customInspectSymbol = customInspectSymbol; } -if (!globalThis.console) { +if (!globalThis.console) +{ globalThis.console = new Console( python.stdout /* sys.stdout */, python.stderr /* sys.stderr */ From ee5c7383194a77446d01b8e16388c8ef689eaae3 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 28 Feb 2024 11:53:32 -0500 Subject: [PATCH 0312/1086] heap-allocated root should be persistent --- include/JSObjectIterProxy.hh | 2 +- src/JSObjectItemsProxy.cc | 4 ++-- src/JSObjectKeysProxy.cc | 4 ++-- src/JSObjectProxy.cc | 9 +++------ src/JSObjectValuesProxy.cc | 4 ++-- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/include/JSObjectIterProxy.hh b/include/JSObjectIterProxy.hh index d8f46075..37b1876c 100644 --- a/include/JSObjectIterProxy.hh +++ b/include/JSObjectIterProxy.hh @@ -28,7 +28,7 @@ typedef struct { PyObject_HEAD - JS::RootedIdVector *props; // not conceptually the best use of the Rooted type but it works. There is no easy inter-operation with a JS::Heap type + JS::PersistentRootedIdVector *props; int it_index; bool reversed; int kind; diff --git a/src/JSObjectItemsProxy.cc b/src/JSObjectItemsProxy.cc index 117b7d4c..fcc47b0c 100644 --- a/src/JSObjectItemsProxy.cc +++ b/src/JSObjectItemsProxy.cc @@ -56,7 +56,7 @@ PyObject *JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_iter(JSObjectI iterator->it.kind = KIND_ITEMS; Py_INCREF(self->dv.dv_dict); iterator->it.di_dict = self->dv.dv_dict; - iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { return NULL; @@ -75,7 +75,7 @@ PyObject *JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_iter_reverse(J iterator->it.kind = KIND_ITEMS; Py_INCREF(self->dv.dv_dict); iterator->it.di_dict = self->dv.dv_dict; - iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { return NULL; diff --git a/src/JSObjectKeysProxy.cc b/src/JSObjectKeysProxy.cc index ddb6d2b0..cb2f6a51 100644 --- a/src/JSObjectKeysProxy.cc +++ b/src/JSObjectKeysProxy.cc @@ -167,7 +167,7 @@ PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_iter(JSObjectKey iterator->it.kind = KIND_KEYS; Py_INCREF(self->dv.dv_dict); iterator->it.di_dict = self->dv.dv_dict; - iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { return NULL; @@ -186,7 +186,7 @@ PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_iter_reverse(JSO iterator->it.kind = KIND_KEYS; Py_INCREF(self->dv.dv_dict); iterator->it.di_dict = self->dv.dv_dict; - iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { return NULL; diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index bac8cf73..f251dc40 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -71,9 +71,7 @@ static inline PyObject *getKey(JSObjectProxy *self, PyObject *key, JS::HandleId JS::RootedValue value(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); JS::RootedObject thisObj(GLOBAL_CX, self->jsObject); - PyObject *ret = pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); - Py_INCREF(ret); - return ret; + return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); } else { if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { @@ -236,7 +234,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_iter(JSObjectProxy *self iterator->it.kind = KIND_KEYS; Py_INCREF(self); iterator->it.di_dict = (PyDictObject *)self; - iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, iterator->it.props)) { return NULL; @@ -519,7 +517,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_get_method(JSObjectProxy if (value == Py_None) { value = default_value; } - Py_XINCREF(value); + return value; } @@ -552,7 +550,6 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_setdefault_method(JSObje return default_value; } - // no need to incref since done in getKey return value; } diff --git a/src/JSObjectValuesProxy.cc b/src/JSObjectValuesProxy.cc index ef83492f..86ab3220 100644 --- a/src/JSObjectValuesProxy.cc +++ b/src/JSObjectValuesProxy.cc @@ -95,7 +95,7 @@ PyObject *JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_iter(JSObjec iterator->it.kind = KIND_VALUES; Py_INCREF(self->dv.dv_dict); iterator->it.di_dict = self->dv.dv_dict; - iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { return NULL; @@ -114,7 +114,7 @@ PyObject *JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_iter_reverse iterator->it.kind = KIND_VALUES; Py_INCREF(self->dv.dv_dict); iterator->it.di_dict = self->dv.dv_dict; - iterator->it.props = new JS::RootedIdVector(GLOBAL_CX); + iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { return NULL; From 0af763cd9276f252a0aaac49047a3b123695a3de Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Wed, 28 Feb 2024 12:42:55 -0500 Subject: [PATCH 0313/1086] Revert "chore(meta): update all top-of-file comments" This reverts commit 5ab92c8b771726a8b5f19d8a30314d596b83f0fb. --- .vscode/c_cpp_properties.json | 3 +-- CMakeLists.txt | 2 +- LICENSE | 2 +- cmake/externals/autopep8/CMakeLists.txt | 2 +- cmake/externals/uncrustify/CMakeLists.txt | 2 +- cmake/format/CMakeLists.txt | 2 +- cmake/format/uncrustify.cfg | 2 +- include/BoolType.hh | 3 ++- include/BufferType.hh | 3 ++- include/DateType.hh | 3 ++- include/DictType.hh | 3 ++- include/ExceptionType.hh | 3 ++- include/FloatType.hh | 3 ++- include/FuncType.hh | 3 ++- include/IntType.hh | 3 ++- include/JSArrayIterProxy.hh | 3 ++- include/JSArrayProxy.hh | 3 ++- include/JSFunctionProxy.hh | 3 ++- include/JSMethodProxy.hh | 3 ++- include/JSObjectItemsProxy.hh | 3 ++- include/JSObjectIterProxy.hh | 3 ++- include/JSObjectKeysProxy.hh | 3 ++- include/JSObjectProxy.hh | 3 ++- include/JSObjectValuesProxy.hh | 3 ++- include/JSStringProxy.hh | 3 ++- include/JobQueue.hh | 3 ++- include/ListType.hh | 3 ++- include/NoneType.hh | 3 ++- include/NullType.hh | 3 ++- include/PromiseType.hh | 3 ++- include/PyBaseProxyHandler.hh | 3 ++- include/PyDictProxyHandler.hh | 2 +- include/PyEventLoop.hh | 3 ++- include/PyListProxyHandler.hh | 3 ++- include/PyObjectProxyHandler.hh | 3 ++- include/PyType.hh | 3 ++- include/StrType.hh | 3 ++- include/TupleType.hh | 3 ++- include/TypeEnum.hh | 3 ++- include/internalBinding.hh | 3 ++- include/jsTypeFactory.hh | 3 ++- include/modules/pythonmonkey/pythonmonkey.hh | 3 ++- include/pyTypeFactory.hh | 3 ++- include/setSpiderMonkeyException.hh | 3 ++- peter-jr | 2 +- src/BufferType.cc | 3 ++- src/JSArrayIterProxy.cc | 2 +- src/JSArrayProxy.cc | 3 ++- src/JSFunctionProxy.cc | 3 ++- src/JSMethodProxy.cc | 3 ++- src/JSObjectItemsProxy.cc | 3 ++- src/JSObjectIterProxy.cc | 2 +- src/JSObjectKeysProxy.cc | 3 ++- src/JSObjectProxy.cc | 3 ++- src/JSObjectValuesProxy.cc | 3 ++- src/NoneType.cc | 3 ++- src/NullType.cc | 3 ++- src/PromiseType.cc | 3 ++- src/PyBaseProxyHandler.cc | 2 +- src/PyDictProxyHandler.cc | 2 +- src/PyListProxyHandler.cc | 2 +- src/PyObjectProxyHandler.cc | 3 ++- src/TupleType.cc | 3 ++- src/internalBinding.cc | 3 +-- src/jsTypeFactory.cc | 3 ++- src/modules/pythonmonkey/pythonmonkey.cc | 2 +- src/pyTypeFactory.cc | 3 ++- src/setSpiderMonkeyException.cc | 3 ++- 68 files changed, 120 insertions(+), 70 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index a3eea6a2..d1ac024f 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -3,8 +3,7 @@ { "name": "Linux", "includePath": [ - "${workspaceFolder}/include/**", - "/usr/include/python3.11" + "${workspaceFolder}/include/**" ], "defines": [], "compilerPath": "/usr/bin/clang", diff --git a/CMakeLists.txt b/CMakeLists.txt index f9ec11f5..3cbe02d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Distributive Corp. All Rights Reserved. +# Copyright (c) 2022 Distributive Inc. All Rights Reserved. cmake_minimum_required(VERSION 3.25) # Set minimum cmake version diff --git a/LICENSE b/LICENSE index 94696de0..085d2547 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022-2024 Distributive Corp. +Copyright (c) 2023-2024 Distributive Corp. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/externals/autopep8/CMakeLists.txt b/cmake/externals/autopep8/CMakeLists.txt index 092d07db..ebc95787 100644 --- a/cmake/externals/autopep8/CMakeLists.txt +++ b/cmake/externals/autopep8/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Distributive Corp. All Rights Reserved. +# Copyright (c) 2022 Distributive Inc. All Rights Reserved. set(AUTOPEP8_ROOT "${CMAKE_CURRENT_BINARY_DIR}/install" CACHE PATH "The autopep8 root directory." diff --git a/cmake/externals/uncrustify/CMakeLists.txt b/cmake/externals/uncrustify/CMakeLists.txt index 080f93b6..ba95422b 100644 --- a/cmake/externals/uncrustify/CMakeLists.txt +++ b/cmake/externals/uncrustify/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Distributive Corp. All Rights Reserved. +# Copyright (c) 2022 Distributive Inc. All Rights Reserved. set(UNCRUSTIFY_ROOT "${CMAKE_CURRENT_BINARY_DIR}/install" CACHE PATH "The Uncrustify root directory." diff --git a/cmake/format/CMakeLists.txt b/cmake/format/CMakeLists.txt index 24e34517..19d8c7ce 100644 --- a/cmake/format/CMakeLists.txt +++ b/cmake/format/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Distributive Corp. All Rights Reserved. +# Copyright (c) 2022 Distributive Inc. All Rights Reserved. if(NOT UNCRUSTIFY_EXECUTABLE) if(UNCRUSTIFY_ROOT STREQUAL "") diff --git a/cmake/format/uncrustify.cfg b/cmake/format/uncrustify.cfg index 5de0790b..56d94610 100644 --- a/cmake/format/uncrustify.cfg +++ b/cmake/format/uncrustify.cfg @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Distributive Corp. All Rights Reserved. +# Copyright (c) 2019 Kings Distributed Systems. All Rights Reserved. file_ext CPP .cc .hh diff --git a/include/BoolType.hh b/include/BoolType.hh index 951bbf5e..5e2cc05c 100644 --- a/include/BoolType.hh +++ b/include/BoolType.hh @@ -2,9 +2,10 @@ * @file BoolType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing python bools + * @version 0.1 * @date 2022-12-02 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2022 * */ diff --git a/include/BufferType.hh b/include/BufferType.hh index 73fc5483..ea2bd954 100644 --- a/include/BufferType.hh +++ b/include/BufferType.hh @@ -2,9 +2,10 @@ * @file BufferType.hh * @author Tom Tang (xmader@distributive.network) * @brief Struct for representing ArrayBuffers + * @version 0.1 * @date 2023-04-27 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/DateType.hh b/include/DateType.hh index f7830ede..23f59707 100644 --- a/include/DateType.hh +++ b/include/DateType.hh @@ -2,9 +2,10 @@ * @file DateType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing python dates + * @version 0.1 * @date 2022-12-21 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2022 * */ diff --git a/include/DictType.hh b/include/DictType.hh index 27d6e413..780a0e73 100644 --- a/include/DictType.hh +++ b/include/DictType.hh @@ -2,9 +2,10 @@ * @file DictType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct representing python dictionaries + * @version 0.1 * @date 2022-08-10 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2022 * */ diff --git a/include/ExceptionType.hh b/include/ExceptionType.hh index bb71e2d7..86045e8f 100644 --- a/include/ExceptionType.hh +++ b/include/ExceptionType.hh @@ -2,9 +2,10 @@ * @file ExceptionType.hh * @author Tom Tang (xmader@distributive.network) * @brief Struct for representing Python Exception objects from a corresponding JS Error object + * @version 0.1 * @date 2023-04-11 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2023 * */ diff --git a/include/FloatType.hh b/include/FloatType.hh index 499b2bc6..2544c251 100644 --- a/include/FloatType.hh +++ b/include/FloatType.hh @@ -2,9 +2,10 @@ * @file FloatType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing python floats + * @version 0.1 * @date 2022-12-02 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2022 * */ diff --git a/include/FuncType.hh b/include/FuncType.hh index 391d5bfc..af2d2dfb 100644 --- a/include/FuncType.hh +++ b/include/FuncType.hh @@ -2,9 +2,10 @@ * @file FuncType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct representing python functions + * @version 0.1 * @date 2022-08-08 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2022 * */ #ifndef PythonMonkey_FuncType_ diff --git a/include/IntType.hh b/include/IntType.hh index efbb431e..81111216 100644 --- a/include/IntType.hh +++ b/include/IntType.hh @@ -2,9 +2,10 @@ * @file IntType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) & Tom Tang (xmader@distributive.network) * @brief Struct for representing python ints + * @version 0.2 * @date 2023-03-16 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2023 * */ diff --git a/include/JSArrayIterProxy.hh b/include/JSArrayIterProxy.hh index fc4a93f7..a4a9e660 100644 --- a/include/JSArrayIterProxy.hh +++ b/include/JSArrayIterProxy.hh @@ -2,9 +2,10 @@ * @file JSArrayIterProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSArrayIterProxy is a custom C-implemented python type that derives from PyListIter + * @version 0.1 * @date 2024-01-15 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh index ce4ce26e..911e5edf 100644 --- a/include/JSArrayProxy.hh +++ b/include/JSArrayProxy.hh @@ -2,9 +2,10 @@ * @file JSArrayProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSArrayProxy is a custom C-implemented python type that derives from list. It acts as a proxy for JSArrays from Spidermonkey, and behaves like a list would. + * @version 0.1 * @date 2023-11-22 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/JSFunctionProxy.hh b/include/JSFunctionProxy.hh index a46980ef..a73ae6ea 100644 --- a/include/JSFunctionProxy.hh +++ b/include/JSFunctionProxy.hh @@ -2,9 +2,10 @@ * @file JSFunctionProxy.hh * @author Caleb Aikens (caleb@distributive.network) * @brief JSFunctionProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a function would. + * @version 0.1 * @date 2023-09-28 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/JSMethodProxy.hh b/include/JSMethodProxy.hh index 009229fb..f08bd81b 100644 --- a/include/JSMethodProxy.hh +++ b/include/JSMethodProxy.hh @@ -2,9 +2,10 @@ * @file JSMethodProxy.hh * @author Caleb Aikens (caleb@distributive.network) * @brief JSMethodProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a method would, treating `self` as `this`. + * @version 0.1 * @date 2023-11-14 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/JSObjectItemsProxy.hh b/include/JSObjectItemsProxy.hh index 480a48ae..91c8bc72 100644 --- a/include/JSObjectItemsProxy.hh +++ b/include/JSObjectItemsProxy.hh @@ -2,9 +2,10 @@ * @file JSObjectItemsProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectItemsProxy is a custom C-implemented python type that derives from dict items + * @version 0.1 * @date 2024-01-19 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSObjectIterProxy.hh b/include/JSObjectIterProxy.hh index d8f46075..d6fb1452 100644 --- a/include/JSObjectIterProxy.hh +++ b/include/JSObjectIterProxy.hh @@ -2,9 +2,10 @@ * @file JSObjectIterProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectIterProxy is a custom C-implemented python type that derives from PyDictIterKey + * @version 0.1 * @date 2024-01-17 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSObjectKeysProxy.hh b/include/JSObjectKeysProxy.hh index 2564bb3f..1dea37be 100644 --- a/include/JSObjectKeysProxy.hh +++ b/include/JSObjectKeysProxy.hh @@ -2,9 +2,10 @@ * @file JSObjectKeysProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectKeysProxy is a custom C-implemented python type that derives from dict keys + * @version 0.1 * @date 2024-01-16 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index 54eb38f2..920a03d5 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -2,9 +2,10 @@ * @file JSObjectProxy.hh * @author Caleb Aikens (caleb@distributive.network) & Tom Tang (xmader@distributive.network) * @brief JSObjectProxy is a custom C-implemented python type that derives from dict. It acts as a proxy for JSObjects from Spidermonkey, and behaves like a dict would. + * @version 0.1 * @date 2023-06-26 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/JSObjectValuesProxy.hh b/include/JSObjectValuesProxy.hh index c2b3be59..238d3066 100644 --- a/include/JSObjectValuesProxy.hh +++ b/include/JSObjectValuesProxy.hh @@ -2,9 +2,10 @@ * @file JSObjectValuesProxy.hh * @author Philippe Laporte (philippe@distributive.network) * @brief JSObjectValuesProxy is a custom C-implemented python type that derives from dict values + * @version 0.1 * @date 2023-06-26 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/JSStringProxy.hh b/include/JSStringProxy.hh index 8c82374c..135eac6f 100644 --- a/include/JSStringProxy.hh +++ b/include/JSStringProxy.hh @@ -2,9 +2,10 @@ * @file JSStringProxy.hh * @author Caleb Aikens (caleb@distributive.network) * @brief JSStringProxy is a custom C-implemented python type that derives from str. It acts as a proxy for JSStrings from Spidermonkey, and behaves like a str would. + * @version 0.1 * @date 2024-01-03 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2024 Distributive Corp. * */ diff --git a/include/JobQueue.hh b/include/JobQueue.hh index 183bcf9f..5d10e9a7 100644 --- a/include/JobQueue.hh +++ b/include/JobQueue.hh @@ -2,9 +2,10 @@ * @file JobQueue.hh * @author Tom Tang (xmader@distributive.network) * @brief Implement the ECMAScript Job Queue + * @version 0.1 * @date 2023-04-03 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2023 * */ diff --git a/include/ListType.hh b/include/ListType.hh index d5112057..df5ba9ac 100644 --- a/include/ListType.hh +++ b/include/ListType.hh @@ -2,9 +2,10 @@ * @file ListType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct for representing python lists + * @version 0.1 * @date 2022-08-18 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2022 * */ diff --git a/include/NoneType.hh b/include/NoneType.hh index abfbacd2..a2f7a82d 100644 --- a/include/NoneType.hh +++ b/include/NoneType.hh @@ -2,9 +2,10 @@ * @file NoneType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing None + * @version 0.1 * @date 2023-02-22 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2023 * */ diff --git a/include/NullType.hh b/include/NullType.hh index 9dbf68c0..80b91e20 100644 --- a/include/NullType.hh +++ b/include/NullType.hh @@ -2,9 +2,10 @@ * @file NullType.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Struct for representing JS null in a python object + * @version 0.1 * @date 2023-02-22 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2023 * */ diff --git a/include/PromiseType.hh b/include/PromiseType.hh index e2c7bc3e..cc8381f1 100644 --- a/include/PromiseType.hh +++ b/include/PromiseType.hh @@ -2,9 +2,10 @@ * @file PromiseType.hh * @author Tom Tang (xmader@distributive.network) * @brief Struct for representing Promises + * @version 0.1 * @date 2023-03-29 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2023 * */ diff --git a/include/PyBaseProxyHandler.hh b/include/PyBaseProxyHandler.hh index 353973be..08bc0203 100644 --- a/include/PyBaseProxyHandler.hh +++ b/include/PyBaseProxyHandler.hh @@ -2,9 +2,10 @@ * @file PyBaseProxyHandler.hh * @author Caleb Aikens (caleb@distributive.network) and Philippe Laporte (philippe@distributive.network) * @brief Structs for creating JS proxy objects. + * @version 0.1 * @date 2023-04-20 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2023-2024 Distributive Corp. * */ diff --git a/include/PyDictProxyHandler.hh b/include/PyDictProxyHandler.hh index 36b4d82f..3784076e 100644 --- a/include/PyDictProxyHandler.hh +++ b/include/PyDictProxyHandler.hh @@ -4,7 +4,7 @@ * @brief Structs for creating JS proxy objects. Used by DictType for object coercion * @date 2023-04-20 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2023-2024 Distributive Corp. * */ diff --git a/include/PyEventLoop.hh b/include/PyEventLoop.hh index 8c623479..36fdb03c 100644 --- a/include/PyEventLoop.hh +++ b/include/PyEventLoop.hh @@ -2,9 +2,10 @@ * @file PyEventLoop.hh * @author Tom Tang (xmader@distributive.network) * @brief Send jobs to the Python event-loop + * @version 0.1 * @date 2023-04-05 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2023 * */ diff --git a/include/PyListProxyHandler.hh b/include/PyListProxyHandler.hh index 18ed3aec..bc1f82b7 100644 --- a/include/PyListProxyHandler.hh +++ b/include/PyListProxyHandler.hh @@ -2,9 +2,10 @@ * @file PyListProxyHandler.hh * @author Philippe Laporte (philippe@distributive.network) * @brief Structs for creating JS proxy objects. Used by ListType for List coercion + * @version 0.1 * @date 2023-12-01 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2023-2024 Distributive Corp. * */ diff --git a/include/PyObjectProxyHandler.hh b/include/PyObjectProxyHandler.hh index bfd54fee..9e71b18d 100644 --- a/include/PyObjectProxyHandler.hh +++ b/include/PyObjectProxyHandler.hh @@ -2,9 +2,10 @@ * @file PyObjectProxyHandler.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Structs for creating JS proxy objects. Used for default object coercion + * @version 0.1 * @date 2024-01-25 * - * @copyright Copyright (c) 2024 Distributive Corp. + * Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/PyType.hh b/include/PyType.hh index 382c4729..b75d7f1b 100644 --- a/include/PyType.hh +++ b/include/PyType.hh @@ -2,9 +2,10 @@ * @file PyType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct representing python types + * @version 0.1 * @date 2022-07-27 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2022 * */ diff --git a/include/StrType.hh b/include/StrType.hh index af67ca71..b6f5e16c 100644 --- a/include/StrType.hh +++ b/include/StrType.hh @@ -2,9 +2,10 @@ * @file StrType.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Struct for representing python strings + * @version 0.1 * @date 2022-08-08 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2022 * */ diff --git a/include/TupleType.hh b/include/TupleType.hh index 783b8549..c1209cb4 100644 --- a/include/TupleType.hh +++ b/include/TupleType.hh @@ -2,9 +2,10 @@ * @file TupleType.hh * @author Giovanni Tedesco (giovanni@distributive.network) * @brief Struct for representing python tuples + * @version 0.1 * @date 2022-08-19 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2022 * */ diff --git a/include/TypeEnum.hh b/include/TypeEnum.hh index 580bf6f7..a2d2c875 100644 --- a/include/TypeEnum.hh +++ b/include/TypeEnum.hh @@ -2,9 +2,10 @@ * @file TypeEnum.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) & Tom Tang (xmader@distributive.network) * @brief Enum for every PyType + * @version 0.1 * @date 2022-08-08 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/internalBinding.hh b/include/internalBinding.hh index c29aa79b..24c00082 100644 --- a/include/internalBinding.hh +++ b/include/internalBinding.hh @@ -2,9 +2,10 @@ * @file internalBinding.hh * @author Tom Tang (xmader@distributive.network) * @brief + * @version 0.1 * @date 2023-05-16 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2023 Distributive Corp. * */ diff --git a/include/jsTypeFactory.hh b/include/jsTypeFactory.hh index 6150ceaa..6ec68412 100644 --- a/include/jsTypeFactory.hh +++ b/include/jsTypeFactory.hh @@ -2,9 +2,10 @@ * @file jsTypeFactory.hh * @author Caleb Aikens (caleb@distributive.network) * @brief + * @version 0.1 * @date 2023-02-15 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2023 * */ diff --git a/include/modules/pythonmonkey/pythonmonkey.hh b/include/modules/pythonmonkey/pythonmonkey.hh index 3e8c9424..7f964bce 100644 --- a/include/modules/pythonmonkey/pythonmonkey.hh +++ b/include/modules/pythonmonkey/pythonmonkey.hh @@ -2,9 +2,10 @@ * @file pythonmonkey.hh * @author Caleb Aikens (caleb@kingsds.network) * @brief This file defines the pythonmonkey module, along with its various functions. + * @version 0.1 * @date 2022-09-06 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2022 * */ #ifndef PythonMonkey_Module_PythonMonkey diff --git a/include/pyTypeFactory.hh b/include/pyTypeFactory.hh index c2d0353e..3b79cbdd 100644 --- a/include/pyTypeFactory.hh +++ b/include/pyTypeFactory.hh @@ -2,9 +2,10 @@ * @file pyTypeFactory.hh * @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) * @brief Function for wrapping arbitrary PyObjects into the appropriate PyType class, and coercing JS types to python types + * @version 0.1 * @date 2022-08-08 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2022 * */ diff --git a/include/setSpiderMonkeyException.hh b/include/setSpiderMonkeyException.hh index fcaf8141..f838e5e4 100644 --- a/include/setSpiderMonkeyException.hh +++ b/include/setSpiderMonkeyException.hh @@ -2,9 +2,10 @@ * @file setSpiderMonkeyException.hh * @author Caleb Aikens (caleb@distributive.network) * @brief Call this function whenever a JS_* function call fails in order to set an appropriate python exception (remember to also return NULL) + * @version 0.1 * @date 2023-02-28 * - * @copyright Copyright (c) 2024 Distributive Corp. + * @copyright Copyright (c) 2023 * */ diff --git a/peter-jr b/peter-jr index 1bdbcfe9..873a85f6 100755 --- a/peter-jr +++ b/peter-jr @@ -27,7 +27,7 @@ if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then cat < Date: Wed, 28 Feb 2024 13:25:47 -0500 Subject: [PATCH 0314/1086] remove unused second parameter to pyTypeFactory --- include/pyTypeFactory.hh | 3 +- src/JSArrayIterProxy.cc | 6 +-- src/JSArrayProxy.cc | 58 ++++++++---------------- src/JSFunctionProxy.cc | 2 +- src/JSMethodProxy.cc | 3 +- src/JSObjectIterProxy.cc | 6 +-- src/JSObjectProxy.cc | 19 +++----- src/JobQueue.cc | 3 +- src/PromiseType.cc | 4 +- src/PyDictProxyHandler.cc | 3 +- src/PyListProxyHandler.cc | 53 ++++++++-------------- src/PyObjectProxyHandler.cc | 3 +- src/internalBinding.cc | 3 +- src/internalBinding/timers.cc | 3 +- src/jsTypeFactory.cc | 5 +- src/modules/pythonmonkey/pythonmonkey.cc | 2 +- src/pyTypeFactory.cc | 4 +- 17 files changed, 63 insertions(+), 117 deletions(-) diff --git a/include/pyTypeFactory.hh b/include/pyTypeFactory.hh index 8c15b866..fc8afe7a 100644 --- a/include/pyTypeFactory.hh +++ b/include/pyTypeFactory.hh @@ -22,10 +22,9 @@ * @brief Function that takes a JS::Value and returns a corresponding PyType* object, doing shared memory management when necessary * * @param cx - Pointer to the javascript context of the JS::Value - * @param thisObj - The JS `this` object for the value's scope * @param rval - The JS::Value who's type and value we wish to encapsulate * @return PyType* - Pointer to a PyType object corresponding to the JS::Value */ -PyType *pyTypeFactory(JSContext *cx, JS::HandleObject thisObj, JS::HandleValue rval); +PyType *pyTypeFactory(JSContext *cx, JS::HandleValue rval); #endif \ No newline at end of file diff --git a/src/JSArrayIterProxy.cc b/src/JSArrayIterProxy.cc index 6d5923da..f6da0719 100644 --- a/src/JSArrayIterProxy.cc +++ b/src/JSArrayIterProxy.cc @@ -47,18 +47,16 @@ PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_next(JSArrayIterPr if (self->it.reversed) { if (self->it.it_index >= 0) { - JS::RootedObject thisObj(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray); JS::RootedValue elementVal(GLOBAL_CX); JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index--, &elementVal); - return pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); } } else { if (self->it.it_index < JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)seq)) { - JS::RootedObject thisObj(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray); JS::RootedValue elementVal(GLOBAL_CX); JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index++, &elementVal); - return pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); } } diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index 3fcb7c9b..aa27fb05 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -53,8 +53,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py if (methodName == NULL || !PyUnicode_Check(key)) { // reached end of list JS::RootedValue value(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, &value); - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); - return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, value)->getPyObject(); } else { if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { @@ -75,8 +74,7 @@ static PyObject *list_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihig PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); - return pyTypeFactory(GLOBAL_CX, thisObj, jReturnedArray)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, jReturnedArray)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy *self, PyObject *key) @@ -104,8 +102,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy JS::RootedValue value(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, &value); - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); - return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, value)->getPyObject(); } else if (PySlice_Check(key)) { Py_ssize_t start, stop, step, slicelength, index; @@ -134,8 +131,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy JS::RootedValue jCombinedArrayValue(GLOBAL_CX); jCombinedArrayValue.setObjectOrNull(jCombinedArray); - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); - return pyTypeFactory(GLOBAL_CX, thisObj, jCombinedArrayValue)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, jCombinedArrayValue)->getPyObject(); } } else { @@ -435,18 +431,17 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * } JS::RootedValue elementVal(GLOBAL_CX); - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); Py_ssize_t index; /* Search for the first index where items are different */ for (index = 0; index < selfLength && index < otherLength; index++) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *leftItem = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); + PyObject *leftItem = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); PyObject *rightItem; if (PyObject_TypeCheck(other, &JSArrayProxyType)) { JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)other)->jsArray, index, &elementVal); - rightItem = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); + rightItem = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); } else { rightItem = ((PyListObject *)other)->ob_item[index]; } @@ -483,7 +478,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); /* Compare the final item again using the proper operator */ - return PyObject_RichCompare(pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(), ((PyListObject *)other)->ob_item[index], op); + return PyObject_RichCompare(pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(), ((PyListObject *)other)->ob_item[index], op); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { @@ -506,7 +501,6 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { writer.min_length = 1 + 1 + (2 + 1) * (selfLength - 1) + 1; JS::RootedValue elementVal(GLOBAL_CX); - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); if (_PyUnicodeWriter_WriteChar(&writer, '[') < 0) { goto error; @@ -526,7 +520,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { if (&elementVal.toObject() == self->jsArray.get()) { s = PyObject_Repr((PyObject *)self); } else { - s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject()); + s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject()); } if (s == NULL) { goto error; @@ -631,8 +625,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_concat(JSArrayProxy *self, JS::RootedValue jCombinedArrayValue(GLOBAL_CX); jCombinedArrayValue.setObjectOrNull(jCombinedArray); - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); - return pyTypeFactory(GLOBAL_CX, thisObj, jCombinedArrayValue)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, jCombinedArrayValue)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, Py_ssize_t n) { @@ -659,8 +652,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, JS::RootedValue jCombinedArrayValue(GLOBAL_CX); jCombinedArrayValue.setObjectOrNull(jCombinedArray); - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); - return pyTypeFactory(GLOBAL_CX, thisObj, jCombinedArrayValue)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, jCombinedArrayValue)->getPyObject(); } int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyObject *element) { @@ -670,10 +662,9 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyO Py_ssize_t numElements = JSArrayProxy_length(self); JS::RootedValue elementVal(GLOBAL_CX); - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); for (index = 0, cmp = 0; cmp == 0 && index < numElements; ++index) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *item = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); + PyObject *item = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); Py_INCREF(item); cmp = PyObject_RichCompareBool(item, element, Py_EQ); Py_DECREF(item); @@ -758,8 +749,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); - return pyTypeFactory(GLOBAL_CX, thisObj, jReturnedArray)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, jReturnedArray)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_append(JSArrayProxy *self, PyObject *value) { @@ -936,18 +926,16 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_pop(JSArrayProxy *self, Py JS::RootedValue elementVal(GLOBAL_CX); JS_GetElement(GLOBAL_CX, rootedReturnedArray, 0, &elementVal); - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); - return pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self, PyObject *value) { Py_ssize_t selfSize = JSArrayProxy_length(self); JS::RootedValue elementVal(GLOBAL_CX); - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); for (Py_ssize_t index = 0; index < selfSize; index++) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); + PyObject *obj = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1010,10 +998,9 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_index(JSArrayProxy *self, } JS::RootedValue elementVal(GLOBAL_CX); - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); for (Py_ssize_t index = start; index < stop && index < selfSize; index++) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); + PyObject *obj = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1034,10 +1021,9 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_count(JSArrayProxy *self, Py_ssize_t length = JSArrayProxy_length(self); JS::RootedValue elementVal(GLOBAL_CX); - JS::RootedObject thisObj(GLOBAL_CX, self->jsArray); for (Py_ssize_t index = 0; index < length; index++) { JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - PyObject *obj = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); + PyObject *obj = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); Py_DECREF(obj); @@ -1083,17 +1069,15 @@ static bool sort_compare_key_func(JSContext *cx, unsigned argc, JS::Value *vp) { } bool reverse = reverseValue.toBoolean(); - JS::RootedObject thisObj(cx, JS::GetNonCCWObjectGlobal(&args.callee())); - JS::RootedValue elementVal0(cx, args[0]); - PyObject *args_0 = pyTypeFactory(cx, thisObj, elementVal0)->getPyObject(); + PyObject *args_0 = pyTypeFactory(cx, elementVal0)->getPyObject(); PyObject *args_0_result = PyObject_CallFunction(keyfunc, "O", args_0); if (!args_0_result) { return false; } JS::RootedValue elementVal1(cx, args[1]); - PyObject *args_1 = pyTypeFactory(cx, thisObj, elementVal1)->getPyObject(); + PyObject *args_1 = pyTypeFactory(cx, elementVal1)->getPyObject(); PyObject *args_1_result = PyObject_CallFunction(keyfunc, "O", args_1); if (!args_1_result) { return false; @@ -1133,13 +1117,11 @@ static bool sort_compare_default(JSContext *cx, unsigned argc, JS::Value *vp) { } bool reverse = reverseValue.toBoolean(); - JS::RootedObject thisObj(cx, JS::GetNonCCWObjectGlobal(&args.callee())); - JS::RootedValue elementVal0(cx, args[0]); - PyObject *args_0 = pyTypeFactory(cx, thisObj, elementVal0)->getPyObject(); + PyObject *args_0 = pyTypeFactory(cx, elementVal0)->getPyObject(); JS::RootedValue elementVal1(cx, args[1]); - PyObject *args_1 = pyTypeFactory(cx, thisObj, elementVal1)->getPyObject(); + PyObject *args_1 = pyTypeFactory(cx, elementVal1)->getPyObject(); int cmp = PyObject_RichCompareBool(args_0, args_1, Py_LT); if (cmp > 0) { diff --git a/src/JSFunctionProxy.cc b/src/JSFunctionProxy.cc index db63e147..be660abc 100644 --- a/src/JSFunctionProxy.cc +++ b/src/JSFunctionProxy.cc @@ -59,5 +59,5 @@ PyObject *JSFunctionProxyMethodDefinitions::JSFunctionProxy_call(PyObject *self, return NULL; } - return pyTypeFactory(cx, thisObj, jsReturnVal)->getPyObject(); + return pyTypeFactory(cx, jsReturnVal)->getPyObject(); } \ No newline at end of file diff --git a/src/JSMethodProxy.cc b/src/JSMethodProxy.cc index 679c04b8..5ce05bd1 100644 --- a/src/JSMethodProxy.cc +++ b/src/JSMethodProxy.cc @@ -70,6 +70,5 @@ PyObject *JSMethodProxyMethodDefinitions::JSMethodProxy_call(PyObject *self, PyO return NULL; } - JS::RootedObject globalObj(cx, JS::CurrentGlobalOrNull(cx)); - return pyTypeFactory(cx, globalObj, jsReturnVal)->getPyObject(); + return pyTypeFactory(cx, jsReturnVal)->getPyObject(); } \ No newline at end of file diff --git a/src/JSObjectIterProxy.cc b/src/JSObjectIterProxy.cc index 02c5f602..a8bc1c9c 100644 --- a/src/JSObjectIterProxy.cc +++ b/src/JSObjectIterProxy.cc @@ -57,10 +57,9 @@ PyObject *JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_nextkey(JSObject PyObject *value; if (self->it.kind != KIND_KEYS) { - JS::RootedObject thisObj(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject); JS::RootedValue jsVal(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, &jsVal); - value = pyTypeFactory(GLOBAL_CX, thisObj, jsVal)->getPyObject(); + value = pyTypeFactory(GLOBAL_CX, jsVal)->getPyObject(); } PyObject *ret; @@ -84,10 +83,9 @@ PyObject *JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_nextkey(JSObject PyObject *value; if (self->it.kind != KIND_KEYS) { - JS::RootedObject thisObj(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject); JS::RootedValue jsVal(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, &jsVal); - value = pyTypeFactory(GLOBAL_CX, thisObj, jsVal)->getPyObject(); + value = pyTypeFactory(GLOBAL_CX, jsVal)->getPyObject(); } PyObject *ret; diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 920563d8..1cefdc84 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -70,7 +70,6 @@ static inline PyObject *getKey(JSObjectProxy *self, PyObject *key, JS::HandleId if (methodName == NULL || !PyUnicode_Check(key)) { JS::RootedValue value(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); - JS::RootedObject thisObj(GLOBAL_CX, self->jsObject); // if value is a JSFunction, bind `this` to self /* (Caleb Aikens) its potentially problematic to bind it like this since if the function * ever gets assigned to another object like so: @@ -78,7 +77,7 @@ static inline PyObject *getKey(JSObjectProxy *self, PyObject *key, JS::HandleId * jsObjA.func = jsObjB.func * jsObjA.func() # `this` will be jsObjB not jsObjA * - * it will be bound to the wrong object, however I can't find a better way to do this, + * It will be bound to the wrong object, however I can't find a better way to do this, * and even pyodide works this way weirdly enough: * https://github.com/pyodide/pyodide/blob/ee863a7f7907dfb6ee4948bde6908453c9d7ac43/src/core/jsproxy.c#L388 * @@ -99,7 +98,7 @@ static inline PyObject *getKey(JSObjectProxy *self, PyObject *key, JS::HandleId } } - return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, value)->getPyObject(); } else { if (strcmp(methodName, PyUnicode_AsUTF8(key)) == 0) { @@ -224,8 +223,7 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr JS::RootedValue key(GLOBAL_CX); key.setString(id.toString()); - JS::RootedObject thisObj(GLOBAL_CX, self->jsObject); - PyObject *pyKey = pyTypeFactory(GLOBAL_CX, thisObj, key)->getPyObject(); + PyObject *pyKey = pyTypeFactory(GLOBAL_CX, key)->getPyObject(); PyObject *pyVal1 = PyObject_GetItem((PyObject *)self, pyKey); PyObject *pyVal2 = PyObject_GetItem((PyObject *)other, pyKey); if (!pyVal2) { // if other.key is NULL then not equal @@ -294,8 +292,6 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self PyObject *key = NULL, *value = NULL; - JS::RootedObject thisObj(GLOBAL_CX, self->jsObject); - JS::RootedIdVector props(GLOBAL_CX); if (_PyUnicodeWriter_WriteChar(&writer, '{') < 0) { @@ -344,7 +340,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self if (&elementVal.toObject() == self->jsObject.get()) { value = (PyObject *)self; } else { - value = pyTypeFactory(GLOBAL_CX, thisObj, elementVal)->getPyObject(); + value = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); } Py_INCREF(value); @@ -488,7 +484,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, rootedObject, ret)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, ret)->getPyObject(); } } @@ -615,8 +611,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy JS::ObjectOpResult ignoredResult; JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); - JS::RootedObject thisObj(GLOBAL_CX, self->jsObject); - return pyTypeFactory(GLOBAL_CX, thisObj, value)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, value)->getPyObject(); } } @@ -657,7 +652,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProx PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; } - return pyTypeFactory(GLOBAL_CX, rootedObject, ret)->getPyObject(); + return pyTypeFactory(GLOBAL_CX, ret)->getPyObject(); } PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_update_method(JSObjectProxy *self, PyObject *args, PyObject *kwds) { diff --git a/src/JobQueue.cc b/src/JobQueue.cc index 9aab22c3..c88ed589 100644 --- a/src/JobQueue.cc +++ b/src/JobQueue.cc @@ -29,9 +29,8 @@ bool JobQueue::enqueuePromiseJob(JSContext *cx, JS::HandleObject incumbentGlobal) { // Convert the `job` JS function to a Python function for event-loop callback - JS::RootedObject global(cx, incumbentGlobal); JS::RootedValue jobv(cx, JS::ObjectValue(*job)); - PyObject *callback = pyTypeFactory(cx, global, jobv)->getPyObject(); + PyObject *callback = pyTypeFactory(cx, jobv)->getPyObject(); // Send job to the running Python event-loop PyEventLoop loop = PyEventLoop::getRunningLoop(); diff --git a/src/PromiseType.cc b/src/PromiseType.cc index e6014622..224b9141 100644 --- a/src/PromiseType.cc +++ b/src/PromiseType.cc @@ -36,10 +36,8 @@ static bool onResolvedCb(JSContext *cx, unsigned argc, JS::Value *vp) { // Convert the Promise's result (either fulfilled resolution or rejection reason) to a Python object // The result might be another JS function, so we must keep them alive - JS::RootedObject thisv(cx); - args.computeThis(cx, &thisv); // thisv is the global object, not the promise JS::RootedValue resultArg(cx, args[0]); - PyObject *result = pyTypeFactory(cx, thisv, resultArg)->getPyObject(); + PyObject *result = pyTypeFactory(cx, resultArg)->getPyObject(); if (state == JS::PromiseState::Rejected && !PyExceptionInstance_Check(result)) { // Wrap the result object into a SpiderMonkeyError object // because only *Exception objects can be thrown in Python `raise` statement and alike diff --git a/src/PyDictProxyHandler.cc b/src/PyDictProxyHandler.cc index 25fc0628..ae47c238 100644 --- a/src/PyDictProxyHandler.cc +++ b/src/PyDictProxyHandler.cc @@ -68,9 +68,8 @@ bool PyDictProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::HandleId JS::RootedValue rootedV(cx, v); PyObject *attrName = idToKey(cx, id); - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - if (PyDict_SetItem(self, attrName, pyTypeFactory(cx, *global, rootedV)->getPyObject())) { + if (PyDict_SetItem(self, attrName, pyTypeFactory(cx, rootedV)->getPyObject())) { return result.failCantSetInterposed(); // raises JS exception } return result.succeed(); diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 3036d5cd..2e69f111 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -44,10 +44,9 @@ static bool makeNewPyMethod(JSContext *cx, JS::MutableHandleValue function, JS:: } PyObject *func = PyMethod_Function(method); - JS::RootedObject global(cx, JS::CurrentGlobalOrNull(cx)); JS::RootedValue thisValue(cx); thisValue.setObject(*thisObject); - PyObject *newSelf = pyTypeFactory(cx, global, thisValue)->getPyObject(); + PyObject *newSelf = pyTypeFactory(cx, thisValue)->getPyObject(); function.set(jsTypeFactory(cx, PyMethod_New(func, newSelf))); return true; @@ -109,12 +108,11 @@ static bool array_push(JSContext *cx, unsigned argc, JS::Value *vp) { // surely } PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - JS::RootedObject thisObj(cx, proxy); unsigned numArgs = args.length(); JS::RootedValue elementVal(cx); for (unsigned index = 0; index < numArgs; index++) { elementVal.set(args[index].get()); - if (PyList_Append(self, pyTypeFactory(cx, thisObj, elementVal)->getPyObject()) < 0) { + if (PyList_Append(self, pyTypeFactory(cx, elementVal)->getPyObject()) < 0) { return false; } } @@ -160,11 +158,10 @@ static bool array_unshift(JSContext *cx, unsigned argc, JS::Value *vp) { // sure } PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - JS::RootedObject thisObj(cx, proxy); JS::RootedValue elementVal(cx); for (int index = args.length() - 1; index >= 0; index--) { elementVal.set(args[index].get()); - if (PyList_Insert(self, 0, pyTypeFactory(cx, thisObj, elementVal)->getPyObject()) < 0) { + if (PyList_Insert(self, 0, pyTypeFactory(cx, elementVal)->getPyObject()) < 0) { return false; } } @@ -275,9 +272,8 @@ static bool array_indexOf(JSContext *cx, unsigned argc, JS::Value *vp) { } } - JS::RootedObject thisObj(cx, proxy); JS::RootedValue elementVal(cx, args[0].get()); - PyObject *result = PyObject_CallMethod(self, "index", "Oi", pyTypeFactory(cx, thisObj, elementVal)->getPyObject(), start); + PyObject *result = PyObject_CallMethod(self, "index", "Oi", pyTypeFactory(cx, elementVal)->getPyObject(), start); if (!result) { PyErr_Clear(); @@ -356,10 +352,9 @@ static bool array_splice(JSContext *cx, unsigned argc, JS::Value *vp) { } JS::RootedValue elementVal(cx); - JS::RootedObject thisObj(cx, proxy); for (int index = 0; index < insertCount; index++) { elementVal.set(args[index + 2].get()); - if (PyList_SetItem(inserted, index, pyTypeFactory(cx, thisObj, elementVal)->getPyObject()) < 0) { + if (PyList_SetItem(inserted, index, pyTypeFactory(cx, elementVal)->getPyObject()) < 0) { return false; } } @@ -422,9 +417,8 @@ static bool array_fill(JSContext *cx, unsigned argc, JS::Value *vp) { actualEnd = uint64_t(std::min(double(relativeEnd), double(selfLength))); } - JS::RootedObject thisObj(cx, proxy); JS::RootedValue fillValue(cx, args[0].get()); - PyObject *fillValueItem = pyTypeFactory(cx, thisObj, fillValue)->getPyObject(); + PyObject *fillValueItem = pyTypeFactory(cx, fillValue)->getPyObject(); for (int index = actualStart; index < actualEnd; index++) { if (PyList_SetItem(self, index, fillValueItem) < 0) { return false; @@ -540,8 +534,6 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { } PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - JS::RootedObject thisObj(cx, proxy); - Py_ssize_t selfSize = PyList_GET_SIZE(self); PyObject *result = PyList_New(selfSize); @@ -555,7 +547,7 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { for (unsigned index = 0; index < numArgs; index++) { elementVal.set(args[index].get()); - PyObject *item = pyTypeFactory(cx, thisObj, elementVal)->getPyObject(); + PyObject *item = pyTypeFactory(cx, elementVal)->getPyObject(); if (PyObject_TypeCheck(item, &JSArrayProxyType)) { // flatten the array only a depth 1 Py_ssize_t itemLength = JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)item); @@ -563,7 +555,7 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { if (!JS_GetElement(cx, ((JSArrayProxy *)item)->jsArray, flatIndex, &elementVal)) { return false; } - if (PyList_Append(result, pyTypeFactory(cx, thisObj, elementVal)->getPyObject()) < 0) { + if (PyList_Append(result, pyTypeFactory(cx, elementVal)->getPyObject()) < 0) { return false; } } @@ -578,7 +570,7 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { } } else { - if (PyList_Append(result, pyTypeFactory(cx, thisObj, elementVal)->getPyObject()) < 0) { + if (PyList_Append(result, pyTypeFactory(cx, elementVal)->getPyObject()) < 0) { return false; } } @@ -628,9 +620,8 @@ static bool array_lastIndexOf(JSContext *cx, unsigned argc, JS::Value *vp) { } } - JS::RootedObject thisObj(cx, proxy); JS::RootedValue elementVal(cx, args[0].get()); - PyObject *element = pyTypeFactory(cx, thisObj, elementVal)->getPyObject(); + PyObject *element = pyTypeFactory(cx, elementVal)->getPyObject(); for (int64_t index = start; index >= 0; index--) { PyObject *item = PyList_GetItem(self, index); Py_INCREF(item); @@ -1236,7 +1227,7 @@ static bool array_findIndex(JSContext *cx, unsigned argc, JS::Value *vp) { } // private -static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject thisObj, +static uint32_t FlattenIntoArray(JSContext *cx, JSObject *retArray, PyObject *source, Py_ssize_t sourceLen, uint32_t start, uint32_t depth) { @@ -1253,7 +1244,7 @@ static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject thisObj, elementVal.set(jsTypeFactory(cx, PyList_GetItem(source, sourceIndex))); } - PyObject *element = pyTypeFactory(cx, thisObj, elementVal)->getPyObject(); + PyObject *element = pyTypeFactory(cx, elementVal)->getPyObject(); bool shouldFlatten; if (depth > 0) { @@ -1271,7 +1262,7 @@ static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject thisObj, elementLen = PyList_GET_SIZE(element); } - targetIndex = FlattenIntoArray(cx, thisObj, + targetIndex = FlattenIntoArray(cx, retArray, element, elementLen, @@ -1298,7 +1289,7 @@ static uint32_t FlattenIntoArray(JSContext *cx, JS::HandleObject thisObj, } // private -static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject thisObj, +static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JSObject *retArray, PyObject *source, Py_ssize_t sourceLen, uint32_t start, uint32_t depth, JS::HandleValue callBack, JS::HandleObject thisArg) { @@ -1325,7 +1316,7 @@ static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject thi return false; } - PyObject *element = pyTypeFactory(cx, thisObj, retVal)->getPyObject(); + PyObject *element = pyTypeFactory(cx, retVal)->getPyObject(); bool shouldFlatten; if (depth > 0) { @@ -1343,7 +1334,7 @@ static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::HandleObject thi } if (shouldFlatten) { - targetIndex = FlattenIntoArrayWithCallBack(cx, thisObj, + targetIndex = FlattenIntoArrayWithCallBack(cx, retArray, element, elementLen, @@ -1413,11 +1404,9 @@ static bool array_flat(JSContext *cx, unsigned argc, JS::Value *vp) { depthNum = 1; } - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - JSObject *retArray = JS::NewArrayObject(cx, sourceLen); // min end length - FlattenIntoArray(cx, *global, retArray, self, sourceLen, 0, depthNum); + FlattenIntoArray(cx, retArray, self, sourceLen, 0, depthNum); args.rval().setObject(*retArray); return true; @@ -1466,11 +1455,9 @@ static bool array_flatMap(JSContext *cx, unsigned argc, JS::Value *vp) { rootedThisArg.set(nullptr); } - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); - JSObject *retArray = JS::NewArrayObject(cx, sourceLen); // min end length - FlattenIntoArrayWithCallBack(cx, *global, retArray, self, sourceLen, 0, 1, callBack, rootedThisArg); + FlattenIntoArrayWithCallBack(cx, retArray, self, sourceLen, 0, 1, callBack, rootedThisArg); args.rval().setObject(*retArray); return true; @@ -2103,10 +2090,8 @@ bool PyListProxyHandler::defineProperty( return result.failInvalidDescriptor(); } - // FIXME (Tom Tang): memory leak - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); JS::RootedValue itemV(cx, desc.value()); - PyObject *item = pyTypeFactory(cx, *global, itemV)->getPyObject(); + PyObject *item = pyTypeFactory(cx, itemV)->getPyObject(); PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); if (PyList_SetItem(self, index, item) < 0) { // we are out-of-bounds and need to expand diff --git a/src/PyObjectProxyHandler.cc b/src/PyObjectProxyHandler.cc index 93f21072..593187ea 100644 --- a/src/PyObjectProxyHandler.cc +++ b/src/PyObjectProxyHandler.cc @@ -78,9 +78,8 @@ bool PyObjectProxyHandler::set(JSContext *cx, JS::HandleObject proxy, JS::Handle JS::RootedValue rootedV(cx, v); PyObject *attrName = idToKey(cx, id); - JS::RootedObject *global = new JS::RootedObject(cx, JS::GetNonCCWObjectGlobal(proxy)); PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - if (PyObject_SetAttr(self, attrName, pyTypeFactory(cx, *global, rootedV)->getPyObject())) { + if (PyObject_SetAttr(self, attrName, pyTypeFactory(cx, rootedV)->getPyObject())) { return result.failCantSetInterposed(); // raises JS exception } return result.succeed(); diff --git a/src/internalBinding.cc b/src/internalBinding.cc index bf789fa2..41b13ff1 100644 --- a/src/internalBinding.cc +++ b/src/internalBinding.cc @@ -59,7 +59,6 @@ PyObject *getInternalBindingPyFn(JSContext *cx) { JSObject *jsFn = (JSObject *)createInternalBinding(cx); // Convert to a Python function - JS::RootedObject thisObj(cx, nullptr); JS::RootedValue jsFnVal(cx, JS::ObjectValue(*jsFn)); - return pyTypeFactory(cx, thisObj, jsFnVal)->getPyObject(); + return pyTypeFactory(cx, jsFnVal)->getPyObject(); } \ No newline at end of file diff --git a/src/internalBinding/timers.cc b/src/internalBinding/timers.cc index 0ffa3e72..63ac9b45 100644 --- a/src/internalBinding/timers.cc +++ b/src/internalBinding/timers.cc @@ -23,9 +23,8 @@ static bool enqueueWithDelay(JSContext *cx, unsigned argc, JS::Value *vp) { double delaySeconds = args.get(1).toNumber(); // Convert to a Python function - JS::RootedObject thisv(cx, nullptr); JS::RootedValue jobArg(cx, jobArgVal); - PyObject *job = pyTypeFactory(cx, thisv, jobArg)->getPyObject(); + PyObject *job = pyTypeFactory(cx, jobArg)->getPyObject(); // Schedule job to the running Python event-loop PyEventLoop loop = PyEventLoop::getRunningLoop(); diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 100e847c..97322297 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -281,9 +281,6 @@ bool callPyFunc(JSContext *cx, unsigned int argc, JS::Value *vp) { JS::Value pyFuncVal = js::GetFunctionNativeReserved(&(callargs.callee()), 0); PyObject *pyFunc = (PyObject *)(pyFuncVal.toPrivate()); - JS::RootedObject thisv(cx); - JS_ValueToObject(cx, callargs.thisv(), &thisv); - unsigned int callArgsLength = callargs.length(); if (!callArgsLength) { @@ -304,7 +301,7 @@ bool callPyFunc(JSContext *cx, unsigned int argc, JS::Value *vp) { PyObject *pyArgs = PyTuple_New(callArgsLength); for (size_t i = 0; i < callArgsLength; i++) { JS::RootedValue jsArg(cx, callargs[i]); - PyType *pyArg = pyTypeFactory(cx, thisv, jsArg); + PyType *pyArg = pyTypeFactory(cx, jsArg); if (!pyArg) return false; // error occurred PyObject *pyArgObj = pyArg->getPyObject(); if (!pyArgObj) return false; // error occurred diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 8ae8e075..ee1458d0 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -360,7 +360,7 @@ static PyObject *eval(PyObject *self, PyObject *args) { } // translate to the proper python type - PyType *returnValue = pyTypeFactory(GLOBAL_CX, *global, *rval); + PyType *returnValue = pyTypeFactory(GLOBAL_CX, *rval); if (PyErr_Occurred()) { return NULL; } diff --git a/src/pyTypeFactory.cc b/src/pyTypeFactory.cc index ab772496..e9aa3a14 100644 --- a/src/pyTypeFactory.cc +++ b/src/pyTypeFactory.cc @@ -40,7 +40,7 @@ #include -PyType *pyTypeFactory(JSContext *cx, JS::HandleObject thisObj, JS::HandleValue rval) { +PyType *pyTypeFactory(JSContext *cx, JS::HandleValue rval) { if (rval.isUndefined()) { return new NoneType(); } @@ -89,7 +89,7 @@ PyType *pyTypeFactory(JSContext *cx, JS::HandleObject thisObj, JS::HandleValue r case js::ESClass::BigInt: case js::ESClass::String: js::Unbox(cx, obj, &unboxed); - return pyTypeFactory(cx, thisObj, unboxed); + return pyTypeFactory(cx, unboxed); case js::ESClass::Date: return new DateType(cx, obj); case js::ESClass::Promise: From 4ba97f7cdedb77493fe55135abd52b971ed62abe Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 28 Feb 2024 13:52:06 -0500 Subject: [PATCH 0315/1086] increment firefox version --- .github/workflows/test-and-publish.yaml | 6 +++--- setup.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 279360f9..71d2d4e1 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -41,7 +41,7 @@ jobs: with: path: | ./_spidermonkey_install/* - key: spidermonkey115.7.0-${{ runner.os }}-${{ runner.arch }} + key: spidermonkey115.8.0-${{ runner.os }}-${{ runner.arch }} lookup-only: true # skip download - name: Setup XCode if: ${{ (matrix.os == 'macos-13' || matrix.os == 'macos-14') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }} @@ -61,7 +61,7 @@ jobs: with: path: | ./_spidermonkey_install/* - key: spidermonkey115.7.0-${{ runner.os }}-${{ runner.arch }} + key: spidermonkey115.8.0-${{ runner.os }}-${{ runner.arch }} lookup-only: true # skip download - name: Install dependencies if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }} @@ -142,7 +142,7 @@ jobs: with: path: | ./_spidermonkey_install/* - key: spidermonkey115.7.0-${{ runner.os }}-${{ runner.arch }} + key: spidermonkey115.8.0-${{ runner.os }}-${{ runner.arch }} fail-on-cache-miss: true # SpiderMonkey is expected to be cached in its dedicated job - name: Build pminit run: | diff --git a/setup.sh b/setup.sh index b148d583..93d13ccc 100755 --- a/setup.sh +++ b/setup.sh @@ -39,9 +39,9 @@ $POETRY_BIN self add 'poetry-dynamic-versioning[plugin]' echo "Done installing dependencies" echo "Downloading spidermonkey source code" -wget -c -q https://ftp.mozilla.org/pub/firefox/releases/115.7.0esr/source/firefox-115.7.0esr.source.tar.xz +wget -c -q https://ftp.mozilla.org/pub/firefox/releases/115.8.0esr/source/firefox-115.8.0esr.source.tar.xz mkdir -p firefox-source -tar xf firefox-115.7.0esr.source.tar.xz -C firefox-source --strip-components=1 # strip the root folder +tar xf firefox-115.8.0esr.source.tar.xz -C firefox-source --strip-components=1 # strip the root folder echo "Done downloading spidermonkey source code" echo "Building spidermonkey" From 4df71eeca88a4b42732c358ba45958afd0979a64 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Wed, 28 Feb 2024 14:08:12 -0500 Subject: [PATCH 0316/1086] version update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2f8f7e4..3013dfb5 100644 --- a/README.md +++ b/README.md @@ -396,7 +396,7 @@ List of commands: ```console $ pmjs -Welcome to PythonMonkey v0.3.0. +Welcome to PythonMonkey v0.3.1. Type ".help" for more information. > .python import sys > .python sys.path From 7eb9f7fc48a82cd43910ca5b94acacdb1211e9b9 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Wed, 28 Feb 2024 19:27:19 +0000 Subject: [PATCH 0317/1086] feat(console): implement proper `console.trace` method --- python/pythonmonkey/builtin_modules/console.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/python/pythonmonkey/builtin_modules/console.js b/python/pythonmonkey/builtin_modules/console.js index 34bed66a..8902a112 100644 --- a/python/pythonmonkey/builtin_modules/console.js +++ b/python/pythonmonkey/builtin_modules/console.js @@ -57,6 +57,19 @@ class Console this.info = (...args) => void this.#writeToStdout(this.#formatToStr(...args)); this.warn = (...args) => void this.#writeToStderr(this.#formatToStr(...args)); this.error = (...args) => void this.#writeToStderr(this.#formatToStr(...args)); + + this.trace = (...args) => // implement console.trace using new Error().stack + { + const header = args.length > 0 + ? `Trace: ${this.#formatToStr(...args)}` // already has a \n at the end + : 'Trace:\n'; + const stacks = new Error().stack + .split('\n') + .filter(s => s !== '') // filter out empty lines + .map(s => ' '+s) // add indent + .join('\n'); + this.#writeToStderr(header + stacks); + }; } /** From 750d32831ec12451517c59c9e46e87da8eacbd19 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Wed, 28 Feb 2024 19:41:28 +0000 Subject: [PATCH 0318/1086] fix(console): fix `console.trace` header to match Node.js's --- python/pythonmonkey/builtin_modules/console.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/console.js b/python/pythonmonkey/builtin_modules/console.js index 8902a112..7d74a568 100644 --- a/python/pythonmonkey/builtin_modules/console.js +++ b/python/pythonmonkey/builtin_modules/console.js @@ -61,8 +61,8 @@ class Console this.trace = (...args) => // implement console.trace using new Error().stack { const header = args.length > 0 - ? `Trace: ${this.#formatToStr(...args)}` // already has a \n at the end - : 'Trace:\n'; + ? `Trace: ${format(...args)}\n` + : 'Trace\n'; const stacks = new Error().stack .split('\n') .filter(s => s !== '') // filter out empty lines From 1688c9bc84cab2de7d3c8770e5f96340a8f406a6 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Wed, 28 Feb 2024 20:22:51 +0000 Subject: [PATCH 0319/1086] feat(console): implement `console.count`/`console.countReset` methods --- .../pythonmonkey/builtin_modules/console.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/python/pythonmonkey/builtin_modules/console.js b/python/pythonmonkey/builtin_modules/console.js index 7d74a568..75fbbfb4 100644 --- a/python/pythonmonkey/builtin_modules/console.js +++ b/python/pythonmonkey/builtin_modules/console.js @@ -19,6 +19,12 @@ class Console /** @type {WriteFn} */ #writeToStderr; + /** + * @type {{ [label: string]: number; }} + * @see https://console.spec.whatwg.org/#counting + */ + #countMap = {}; + /** * Console constructor, form 1 * @overload @@ -70,6 +76,24 @@ class Console .join('\n'); this.#writeToStderr(header + stacks); }; + + // Counting + // @see https://console.spec.whatwg.org/#count + this.count = (label = 'default') => + { + if (this.#countMap[label]) + this.#countMap[label] += 1; + else + this.#countMap[label] = 1; + this.#writeToStdout(`${label}: ${this.#countMap[label]}\n`); + }; + this.countReset = (label = 'default') => + { + if (this.#countMap[label]) + this.#countMap[label] = 0; + else + this.#writeToStderr(`Counter for '${label}' does not exist.\n`); + }; } /** From f3c73f723cf1349eb0b0d3767a1cd5bc1fbf7107 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Wed, 28 Feb 2024 20:56:25 +0000 Subject: [PATCH 0320/1086] feat(console): implement `console.clear` --- python/pythonmonkey/builtin_modules/console.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/pythonmonkey/builtin_modules/console.js b/python/pythonmonkey/builtin_modules/console.js index 75fbbfb4..913c38bd 100644 --- a/python/pythonmonkey/builtin_modules/console.js +++ b/python/pythonmonkey/builtin_modules/console.js @@ -64,6 +64,8 @@ class Console this.warn = (...args) => void this.#writeToStderr(this.#formatToStr(...args)); this.error = (...args) => void this.#writeToStderr(this.#formatToStr(...args)); + this.clear = () => this.log('\x1bc'); // clear the terminal, see https://stackoverflow.com/questions/47503734 + this.trace = (...args) => // implement console.trace using new Error().stack { const header = args.length > 0 From 334fa2a777641d8f8a77600d1b421842583f934f Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Wed, 28 Feb 2024 21:13:05 +0000 Subject: [PATCH 0321/1086] feat(console): implement `console.assert` method --- .../pythonmonkey/builtin_modules/console.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/python/pythonmonkey/builtin_modules/console.js b/python/pythonmonkey/builtin_modules/console.js index 913c38bd..196a3757 100644 --- a/python/pythonmonkey/builtin_modules/console.js +++ b/python/pythonmonkey/builtin_modules/console.js @@ -65,7 +65,24 @@ class Console this.error = (...args) => void this.#writeToStderr(this.#formatToStr(...args)); this.clear = () => this.log('\x1bc'); // clear the terminal, see https://stackoverflow.com/questions/47503734 - + + this.assert = (condition, ...data) => // See https://console.spec.whatwg.org/#assert + { + if (condition) return; // step 1 + + const message = 'Assertion failed'; // step 2 + if (data.length === 0) // step 3 + data.push(message); + else // step 4 + { + const first = data[0]; // step 4.1 + if (typeof first !== 'string') data.unshift(message); // step 4.2 + else data[0] = `${message}: ${first}`; // step 4.3 + } + + return this.error(...data); // print out + }; + this.trace = (...args) => // implement console.trace using new Error().stack { const header = args.length > 0 From d43178101066d6d93a3d739f723038b1a94003e6 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Wed, 28 Feb 2024 21:17:30 +0000 Subject: [PATCH 0322/1086] feat(console): implement other console methods as aliases to console.log --- python/pythonmonkey/builtin_modules/console.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/console.js b/python/pythonmonkey/builtin_modules/console.js index 196a3757..cb3c0808 100644 --- a/python/pythonmonkey/builtin_modules/console.js +++ b/python/pythonmonkey/builtin_modules/console.js @@ -76,7 +76,7 @@ class Console else // step 4 { const first = data[0]; // step 4.1 - if (typeof first !== 'string') data.unshift(message); // step 4.2 + if (typeof first !== 'string') data.unshift(message+':'); // step 4.2 else data[0] = `${message}: ${first}`; // step 4.3 } @@ -96,6 +96,11 @@ class Console this.#writeToStderr(header + stacks); }; + // TODO (Tom Tang): implement those properly instead of aliases to console.log + this.dir = this.log; + this.dirxml = this.log; + this.table = this.log; + // Counting // @see https://console.spec.whatwg.org/#count this.count = (label = 'default') => @@ -123,8 +128,6 @@ class Console return format(...args) + '\n'; } - // TODO (Tom Tang): implement more methods - /** * Re-export the `Console` constructor as global `console.Console`, like in Node.js */ From 4d52d4094a3df2c87c86aeb53ee88fba80c850c5 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Wed, 28 Feb 2024 21:40:37 +0000 Subject: [PATCH 0323/1086] feat(console): implement console timing methods --- .../pythonmonkey/builtin_modules/console.js | 46 +++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/console.js b/python/pythonmonkey/builtin_modules/console.js index cb3c0808..8ad4e2e9 100644 --- a/python/pythonmonkey/builtin_modules/console.js +++ b/python/pythonmonkey/builtin_modules/console.js @@ -25,6 +25,12 @@ class Console */ #countMap = {}; + /** + * @type {{ [label: string]: number; }} + * @see https://console.spec.whatwg.org/#timing + */ + #timerTable = {}; + /** * Console constructor, form 1 * @overload @@ -101,7 +107,7 @@ class Console this.dirxml = this.log; this.table = this.log; - // Counting + // Counting functions // @see https://console.spec.whatwg.org/#count this.count = (label = 'default') => { @@ -109,14 +115,48 @@ class Console this.#countMap[label] += 1; else this.#countMap[label] = 1; - this.#writeToStdout(`${label}: ${this.#countMap[label]}\n`); + this.info(`${label}: ${this.#countMap[label]}`); }; + this.countReset = (label = 'default') => { if (this.#countMap[label]) this.#countMap[label] = 0; else - this.#writeToStderr(`Counter for '${label}' does not exist.\n`); + this.warn(`Counter for '${label}' does not exist.`); + }; + + // Timing functions + // @see https://console.spec.whatwg.org/#timing + this.time = (label = 'default') => + { + if (this.#timerTable[label]) + this.warn(`Label '${label}' already exists for console.time()`); + else + this.#timerTable[label] = Date.now(); + }; + + this.timeLog = (label = 'default', ...data) => + { + if (!this.#timerTable[label]) + return this.warn(`No such label '${label}' for console.timeLog()`); + + const duration = Date.now() - this.#timerTable[label]; + data.unshift(`${label}: ${duration}ms`); + + return this.log(...data); + }; + + this.timeEnd = (label = 'default') => + { + if (!this.#timerTable[label]) + return this.warn(`No such label '${label}' for console.timeEnd()`); + + const startTime = this.#timerTable[label]; + delete this.#timerTable[label]; + + const duration = Date.now() - startTime; + return this.info(`${label}: ${duration}ms`); }; } From 413f17ae39c1b00d34ba04427f4ff15df514b590 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Wed, 28 Feb 2024 22:15:13 +0000 Subject: [PATCH 0324/1086] feat(console): implement `console.group` & printing with appropriate grouping levels --- .../pythonmonkey/builtin_modules/console.js | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/python/pythonmonkey/builtin_modules/console.js b/python/pythonmonkey/builtin_modules/console.js index 8ad4e2e9..9b22f191 100644 --- a/python/pythonmonkey/builtin_modules/console.js +++ b/python/pythonmonkey/builtin_modules/console.js @@ -10,8 +10,8 @@ const { customInspectSymbol, format } = require('util'); /** * @see https://developer.mozilla.org/en-US/docs/Web/API/Console_API + * @see https://console.spec.whatwg.org/ */ -// TODO (Tom Tang): adhere https://console.spec.whatwg.org/ class Console { /** @type {WriteFn} */ @@ -25,6 +25,8 @@ class Console */ #countMap = {}; + #groupLevel = 0; + /** * @type {{ [label: string]: number; }} * @see https://console.spec.whatwg.org/#timing @@ -99,7 +101,7 @@ class Console .filter(s => s !== '') // filter out empty lines .map(s => ' '+s) // add indent .join('\n'); - this.#writeToStderr(header + stacks); + return this.debug(header + stacks); }; // TODO (Tom Tang): implement those properly instead of aliases to console.log @@ -126,6 +128,23 @@ class Console this.warn(`Counter for '${label}' does not exist.`); }; + // Grouping functions + // @see https://console.spec.whatwg.org/#grouping + this.group = (...data) => + { + if (data.length > 0) + this.log(...data); + this.#groupLevel++; + }; + this.groupCollapsed = this.group; + + this.groupEnd = () => + { + this.#groupLevel--; + if (this.#groupLevel < 0) + this.#groupLevel = 0; + }; + // Timing functions // @see https://console.spec.whatwg.org/#timing this.time = (label = 'default') => @@ -161,11 +180,13 @@ class Console } /** + * Format with appropriate grouping level * @return {string} */ #formatToStr(...args) { - return format(...args) + '\n'; + const msg = format(...args) + '\n'; + return msg.split('\n').map(s => '│ '.repeat(this.#groupLevel) + s).join('\n'); } /** From 85dd1eeffdef782eac05a3ce1ee9b5a187a1ab6b Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Thu, 29 Feb 2024 10:53:34 -0500 Subject: [PATCH 0325/1086] chore(PyDictOrObjectProxyHandler): remove blank line --- src/PyDictOrObjectProxyHandler.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/PyDictOrObjectProxyHandler.cc b/src/PyDictOrObjectProxyHandler.cc index 3b41b5a4..4e835fed 100644 --- a/src/PyDictOrObjectProxyHandler.cc +++ b/src/PyDictOrObjectProxyHandler.cc @@ -107,7 +107,6 @@ void PyDictOrObjectProxyHandler::handleFinalize(JSObject *proxy) { // Then, when shutting down, there is only on reference left, and we don't need // to free the object since the entire process memory is being released. PyObject *self = JS::GetMaybePtrFromReservedSlot(proxy, PyObjectSlot); - if (Py_REFCNT(self) > 1) { Py_DECREF(self); } From c4afd1029ed0090947976fa8caf2b695ceeb884b Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Thu, 29 Feb 2024 11:03:59 -0500 Subject: [PATCH 0326/1086] refactor(PyDictOrObjectProxyHandler): refactor the finalize method out to the parent class since its identical for both child classes --- include/PyDictOrObjectProxyHandler.hh | 8 +++++++- include/PyDictProxyHandler.hh | 7 ------- include/PyObjectProxyHandler.hh | 7 ------- src/PyDictOrObjectProxyHandler.cc | 2 +- src/PyDictProxyHandler.cc | 4 ---- src/PyObjectProxyHandler.cc | 4 ---- 6 files changed, 8 insertions(+), 24 deletions(-) diff --git a/include/PyDictOrObjectProxyHandler.hh b/include/PyDictOrObjectProxyHandler.hh index a41d81ad..0cb340eb 100644 --- a/include/PyDictOrObjectProxyHandler.hh +++ b/include/PyDictOrObjectProxyHandler.hh @@ -45,7 +45,13 @@ struct PyDictOrObjectProxyHandler : public PyBaseProxyHandler { static bool handleGetOwnPropertyDescriptor(JSContext *cx, JS::HandleId id, JS::MutableHandle> desc, PyObject *item); - static void handleFinalize(JSObject *proxy); + /** + * @brief Handles python object reference count when JS Proxy object is finalized + * + * @param gcx pointer to JS::GCContext + * @param proxy the proxy object being finalized + */ + void finalize(JS::GCContext *gcx, JSObject *proxy) const override; /** * @brief Helper function used by dicts and objects to convert dict/object to String diff --git a/include/PyDictProxyHandler.hh b/include/PyDictProxyHandler.hh index 3784076e..7ddac82b 100644 --- a/include/PyDictProxyHandler.hh +++ b/include/PyDictProxyHandler.hh @@ -115,13 +115,6 @@ public: bool getOwnEnumerablePropertyKeys( JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override; - /** - * @brief Handles python object reference count when JS Proxy object is finalized - * - * @param gcx pointer to JS::GCContext - * @param proxy the proxy object being finalized - */ - void finalize(JS::GCContext *gcx, JSObject *proxy) const override; bool getOwnPropertyDescriptor( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, diff --git a/include/PyObjectProxyHandler.hh b/include/PyObjectProxyHandler.hh index 9e71b18d..0cb83eee 100644 --- a/include/PyObjectProxyHandler.hh +++ b/include/PyObjectProxyHandler.hh @@ -114,13 +114,6 @@ public: bool getOwnEnumerablePropertyKeys( JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override; - /** - * @brief Handles python object reference count when JS Proxy object is finalized - * - * @param gcx pointer to JS::GCContext - * @param proxy the proxy object being finalized - */ - void finalize(JS::GCContext *gcx, JSObject *proxy) const override; bool getOwnPropertyDescriptor( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, diff --git a/src/PyDictOrObjectProxyHandler.cc b/src/PyDictOrObjectProxyHandler.cc index 4e835fed..cf7bbcb7 100644 --- a/src/PyDictOrObjectProxyHandler.cc +++ b/src/PyDictOrObjectProxyHandler.cc @@ -102,7 +102,7 @@ bool PyDictOrObjectProxyHandler::handleGetOwnPropertyDescriptor(JSContext *cx, J return true; } -void PyDictOrObjectProxyHandler::handleFinalize(JSObject *proxy) { +void PyDictOrObjectProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { // We cannot call Py_DECREF here when shutting down as the thread state is gone. // Then, when shutting down, there is only on reference left, and we don't need // to free the object since the entire process memory is being released. diff --git a/src/PyDictProxyHandler.cc b/src/PyDictProxyHandler.cc index 146f9af2..e9807f4a 100644 --- a/src/PyDictProxyHandler.cc +++ b/src/PyDictProxyHandler.cc @@ -94,10 +94,6 @@ bool PyDictProxyHandler::getOwnEnumerablePropertyKeys( return this->ownPropertyKeys(cx, proxy, props); } -void PyDictProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { - return handleFinalize(proxy); -} - bool PyDictProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::Handle desc, diff --git a/src/PyObjectProxyHandler.cc b/src/PyObjectProxyHandler.cc index 9a287858..005090d0 100644 --- a/src/PyObjectProxyHandler.cc +++ b/src/PyObjectProxyHandler.cc @@ -105,10 +105,6 @@ bool PyObjectProxyHandler::getOwnEnumerablePropertyKeys( return this->ownPropertyKeys(cx, proxy, props); } -void PyObjectProxyHandler::finalize(JS::GCContext *gcx, JSObject *proxy) const { - return handleFinalize(proxy); -} - bool PyObjectProxyHandler::defineProperty(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::Handle desc, From edb9f69765557b6a77a01be4c205a409deb5bb32 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Thu, 29 Feb 2024 11:14:36 -0500 Subject: [PATCH 0327/1086] chore(PyProxyHandlers): remove TODO comments about proxy object traps, as their implementations are correct. --- include/PyDictProxyHandler.hh | 30 +++++++++++++----------------- include/PyObjectProxyHandler.hh | 26 +++++++++++++------------- 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/include/PyDictProxyHandler.hh b/include/PyDictProxyHandler.hh index 7ddac82b..35351ee5 100644 --- a/include/PyDictProxyHandler.hh +++ b/include/PyDictProxyHandler.hh @@ -40,7 +40,7 @@ public: * @param cx - pointer to JSContext * @param proxy - The proxy object who's property we wish to delete * @param id - The key we wish to delete - * @param result - @TODO (Caleb Aikens) read up on JS::ObjectOpResult + * @param result - whether the call succeeded or not * @return true - call succeeded * @return false - call failed and an exception has been raised */ @@ -64,8 +64,8 @@ public: * @param proxy The proxy object who's property we wish to set * @param id Key of the property we wish to set * @param v Value that we wish to set the property to - * @param receiver @TODO (Caleb Aikens) read ECMAScript docs about this - * @param result @TODO (Caleb Aikens) read ECMAScript docs about this + * @param receiver The `this` value to use when executing any code + * @param result whether or not the call succeeded * @return true call succeed * @return false call failed and an exception has been raised */ @@ -79,17 +79,15 @@ public: * @param proxy - The proxy object who's keys we output * @param props - out-parameter of object IDsoverride; - // @TODO (Caleb Aikens) The following are Spidermonkey-unique extensions, need to read into them more - /** + /** * @return true - call succeeded * @return false - call failed and an exception has been raised */ bool enumerate(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override; - // @TODO (Caleb Aikens) The following are Spidermonkey-unique extensions, need to read into them more /** - * @brief @TODO (Caleb Aikens) read up on what this trap does exactly + * @brief Returns true if `id` is in `proxy`, false otherwise * * @param cx pointer to JSContext * @param proxy The proxy object who's property we wish to check @@ -100,17 +98,15 @@ public: */ bool hasOwn(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp) const override; - /** - * @brief @TODO (Caleb Aikens) read up on what this trap does exactly - * - * @param cx - pointer to JSContext - * @param proxy - The proxy object who's keys we outputoverride; - // @TODO (Caleb Aikens) The following are Spidermonkey-unique extensions, need to read into them more - /** - * @param props - out-parameter of object IDs - * @return true - call succeeded - * @return false - call failed and an exception has been raised + /** + * @brief Returns vector of proxy's own keys + * + * @param cx - Pointer to the JSContext + * @param proxy - the proxy object + * @param props - out parameter, the vector of proxy's own keys + * @return true - the call succeeded + * @return false - the call failed and an exception has been raised */ bool getOwnEnumerablePropertyKeys( JSContext *cx, JS::HandleObject proxy, diff --git a/include/PyObjectProxyHandler.hh b/include/PyObjectProxyHandler.hh index 0cb83eee..460caded 100644 --- a/include/PyObjectProxyHandler.hh +++ b/include/PyObjectProxyHandler.hh @@ -44,7 +44,7 @@ public: * @param cx - pointer to JSContext * @param proxy - The proxy object who's property we wish to delete * @param id - The key we wish to delete - * @param result - @TODO (Caleb Aikens) read up on JS::ObjectOpResult + * @param result - whether the call succeeded or not * @return true - call succeeded * @return false - call failed and an exception has been raised */ @@ -69,8 +69,8 @@ public: * @param proxy The proxy object who's property we wish to set * @param id Key of the property we wish to set * @param v Value that we wish to set the property to - * @param receiver @TODO (Caleb Aikens) read ECMAScript docs about this - * @param result @TODO (Caleb Aikens) read ECMAScript docs about this + * @param receiver The `this` value to use when executing any code + * @param result whether or not the call succeeded * @return true call succeed * @return false call failed and an exception has been raised */ @@ -89,9 +89,8 @@ public: bool enumerate(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleIdVector props) const override; - // @TODO (Caleb Aikens) The following are Spidermonkey-unique extensions, need to read into them more /** - * @brief @TODO (Caleb Aikens) read up on what this trap does exactly + * @brief Returns true if `id` is in `proxy`, false otherwise * * @param cx pointer to JSContext * @param proxy The proxy object who's property we wish to check @@ -102,14 +101,15 @@ public: */ bool hasOwn(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp) const override; - /** - * @brief @TODO (Caleb Aikens) read up on what this trap does exactly - * - * @param cx - pointer to JSContext - * @param proxy - The proxy object who's keys we output - * @param props - out-parameter of object IDs - * @return true - call succeeded - * @return false - call failed and an exception has been raised + + /** + * @brief Returns vector of proxy's own keys + * + * @param cx - Pointer to the JSContext + * @param proxy - the proxy object + * @param props - out parameter, the vector of proxy's own keys + * @return true - the call succeeded + * @return false - the call failed and an exception has been raised */ bool getOwnEnumerablePropertyKeys( JSContext *cx, JS::HandleObject proxy, From 61b2875ae4a43cecd1e54b7c7e50fe396d4683c0 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Thu, 29 Feb 2024 11:18:14 -0500 Subject: [PATCH 0328/1086] chore(tests): remove extra empty lines from test_objects.py --- tests/python/test_objects.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/python/test_objects.py b/tests/python/test_objects.py index 3e487554..8256c243 100644 --- a/tests/python/test_objects.py +++ b/tests/python/test_objects.py @@ -133,6 +133,4 @@ def __init__(self): self.a = 42 o = MyClass() - assert '[object Object]' == pm.eval("(obj) => { return obj.toLocaleString(); }")(o) - - \ No newline at end of file + assert '[object Object]' == pm.eval("(obj) => { return obj.toLocaleString(); }")(o) \ No newline at end of file From ba1afb88494620d9bf603770f5d3ac1be63f18b0 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Thu, 29 Feb 2024 11:18:59 -0500 Subject: [PATCH 0329/1086] use PersistentRooted pointer instead of inline in struct for Object and Array proxies --- include/JSArrayProxy.hh | 2 +- include/JSObjectProxy.hh | 2 +- src/DictType.cc | 3 +- src/JSArrayIterProxy.cc | 4 +- src/JSArrayProxy.cc | 114 +++++++++++++++++++------------------ src/JSObjectItemsProxy.cc | 4 +- src/JSObjectIterProxy.cc | 4 +- src/JSObjectKeysProxy.cc | 4 +- src/JSObjectProxy.cc | 59 ++++++++++--------- src/JSObjectValuesProxy.cc | 4 +- src/ListType.cc | 3 +- src/PyListProxyHandler.cc | 8 +-- src/jsTypeFactory.cc | 12 +++- 13 files changed, 119 insertions(+), 104 deletions(-) diff --git a/include/JSArrayProxy.hh b/include/JSArrayProxy.hh index f6875954..592778d7 100644 --- a/include/JSArrayProxy.hh +++ b/include/JSArrayProxy.hh @@ -24,7 +24,7 @@ */ typedef struct { PyListObject list; - JS::PersistentRootedObject jsArray; + JS::PersistentRootedObject *jsArray; } JSArrayProxy; /** diff --git a/include/JSObjectProxy.hh b/include/JSObjectProxy.hh index e1b2e9d7..d54c8867 100644 --- a/include/JSObjectProxy.hh +++ b/include/JSObjectProxy.hh @@ -23,7 +23,7 @@ */ typedef struct { PyDictObject dict; - JS::PersistentRootedObject jsObject; + JS::PersistentRootedObject *jsObject; } JSObjectProxy; /** diff --git a/src/DictType.cc b/src/DictType.cc index c24eabf8..b5b36d30 100644 --- a/src/DictType.cc +++ b/src/DictType.cc @@ -31,7 +31,8 @@ DictType::DictType(JSContext *cx, JS::Handle jsObject) { if (proxy != NULL) { JS::RootedObject obj(cx); JS_ValueToObject(cx, jsObject, &obj); - proxy->jsObject.set(obj); + proxy->jsObject = new JS::PersistentRootedObject(cx); + proxy->jsObject->set(obj); this->pyObject = (PyObject *)proxy; } } \ No newline at end of file diff --git a/src/JSArrayIterProxy.cc b/src/JSArrayIterProxy.cc index f6da0719..8d090571 100644 --- a/src/JSArrayIterProxy.cc +++ b/src/JSArrayIterProxy.cc @@ -48,14 +48,14 @@ PyObject *JSArrayIterProxyMethodDefinitions::JSArrayIterProxy_next(JSArrayIterPr if (self->it.reversed) { if (self->it.it_index >= 0) { JS::RootedValue elementVal(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index--, &elementVal); + JS_GetElement(GLOBAL_CX, *(((JSArrayProxy *)seq)->jsArray), self->it.it_index--, &elementVal); return pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); } } else { if (self->it.it_index < JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)seq)) { JS::RootedValue elementVal(GLOBAL_CX); - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)seq)->jsArray, self->it.it_index++, &elementVal); + JS_GetElement(GLOBAL_CX, *(((JSArrayProxy *)seq)->jsArray), self->it.it_index++, &elementVal); return pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); } } diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index aa27fb05..d552f4be 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -27,7 +27,8 @@ void JSArrayProxyMethodDefinitions::JSArrayProxy_dealloc(JSArrayProxy *self) { - self->jsArray.set(nullptr); + self->jsArray->set(nullptr); + delete self->jsArray; PyObject_GC_UnTrack(self); Py_TYPE(self)->tp_free((PyObject *)self); } @@ -35,7 +36,7 @@ void JSArrayProxyMethodDefinitions::JSArrayProxy_dealloc(JSArrayProxy *self) Py_ssize_t JSArrayProxyMethodDefinitions::JSArrayProxy_length(JSArrayProxy *self) { uint32_t length; - JS::GetArrayLength(GLOBAL_CX, self->jsArray, &length); + JS::GetArrayLength(GLOBAL_CX, *(self->jsArray), &length); return (Py_ssize_t)length; } @@ -52,7 +53,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py const char *methodName = JSArrayProxyType.tp_methods[index].ml_name; if (methodName == NULL || !PyUnicode_Check(key)) { // reached end of list JS::RootedValue value(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, &value); + JS_GetPropertyById(GLOBAL_CX, *(self->jsArray), id, &value); return pyTypeFactory(GLOBAL_CX, value)->getPyObject(); } else { @@ -70,7 +71,7 @@ static PyObject *list_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihig jArgs[0].setInt32(ilow); jArgs[1].setInt32(ihigh); JS::RootedValue jReturnedArray(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "slice", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, *(self->jsArray), "slice", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -100,7 +101,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy JS_IndexToId(GLOBAL_CX, index, &id); JS::RootedValue value(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsArray, id, &value); + JS_GetPropertyById(GLOBAL_CX, *(self->jsArray), id, &value); return pyTypeFactory(GLOBAL_CX, value)->getPyObject(); } @@ -124,7 +125,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get_subscript(JSArrayProxy JS::RootedValue elementVal(GLOBAL_CX); for (size_t cur = start, index = 0; index < slicelength; cur += (size_t)step, index++) { - JS_GetElement(GLOBAL_CX, self->jsArray, cur, &elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), cur, &elementVal); JS_SetElement(GLOBAL_CX, jCombinedArray, index, elementVal); } @@ -213,30 +214,30 @@ static int list_ass_slice(JSArrayProxy *self, Py_ssize_t ilow, Py_ssize_t ihigh, if (d < 0) { /* Delete -d items */ JS::RootedValue elementVal(GLOBAL_CX); for (size_t index = ihigh, count = 0; count < selfLength - ihigh; index++, count++) { - JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - JS_SetElement(GLOBAL_CX, self->jsArray, index+d, elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), index, &elementVal); + JS_SetElement(GLOBAL_CX, *(self->jsArray), index+d, elementVal); } - JS::SetArrayLength(GLOBAL_CX, self->jsArray, selfLength + d); + JS::SetArrayLength(GLOBAL_CX, *(self->jsArray), selfLength + d); } else if (d > 0) { /* Insert d items */ k = selfLength; - JS::SetArrayLength(GLOBAL_CX, self->jsArray, k + d); + JS::SetArrayLength(GLOBAL_CX, *(self->jsArray), k + d); selfLength = k + d; JS::RootedValue elementVal(GLOBAL_CX); for (size_t index = ihigh, count = 0; count < k - ihigh; index++, count++) { - JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - JS_SetElement(GLOBAL_CX, self->jsArray, index+d, elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), index, &elementVal); + JS_SetElement(GLOBAL_CX, *(self->jsArray), index+d, elementVal); } } JS::RootedValue elementVal(GLOBAL_CX); for (k = 0; k < n; k++, ilow++) { elementVal.set(jsTypeFactory(GLOBAL_CX, vitem[k])); - JS_SetElement(GLOBAL_CX, self->jsArray, ilow, elementVal); + JS_SetElement(GLOBAL_CX, *(self->jsArray), ilow, elementVal); } result = 0; @@ -269,10 +270,10 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key(JSArrayProxy *self, P if (value) { // we are setting a value JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); - JS_SetPropertyById(GLOBAL_CX, self->jsArray, id, jValue); + JS_SetPropertyById(GLOBAL_CX, *(self->jsArray), id, jValue); } else { // we are deleting a value JS::ObjectOpResult ignoredResult; - JS_DeletePropertyById(GLOBAL_CX, self->jsArray, id, ignoredResult); + JS_DeletePropertyById(GLOBAL_CX, *(self->jsArray), id, ignoredResult); } return 0; @@ -328,8 +329,8 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key(JSArrayProxy *self, P } for (size_t index = cur, count = 0; count < lim; index++, count++) { - JS_GetElement(GLOBAL_CX, self->jsArray, index + 1, &elementVal); - JS_SetElement(GLOBAL_CX, self->jsArray, index - i, elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), index + 1, &elementVal); + JS_SetElement(GLOBAL_CX, *(self->jsArray), index - i, elementVal); } } @@ -337,12 +338,12 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key(JSArrayProxy *self, P if (cur < (size_t)selfSize) { for (size_t index = cur, count = 0; count < selfSize - cur; index++, count++) { - JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); - JS_SetElement(GLOBAL_CX, self->jsArray, index - slicelength, elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), index, &elementVal); + JS_SetElement(GLOBAL_CX, *(self->jsArray), index - slicelength, elementVal); } } - JS::SetArrayLength(GLOBAL_CX, self->jsArray, selfSize - slicelength); + JS::SetArrayLength(GLOBAL_CX, *(self->jsArray), selfSize - slicelength); return 0; } @@ -382,7 +383,7 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_assign_key(JSArrayProxy *self, P JS::RootedValue elementVal(GLOBAL_CX); for (cur = start, i = 0; i < slicelength; cur += (size_t)step, i++) { elementVal.set(jsTypeFactory(GLOBAL_CX, seqitems[i])); - JS_SetElement(GLOBAL_CX, self->jsArray, cur, elementVal); + JS_SetElement(GLOBAL_CX, *(self->jsArray), cur, elementVal); } Py_DECREF(seq); @@ -435,12 +436,12 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * Py_ssize_t index; /* Search for the first index where items are different */ for (index = 0; index < selfLength && index < otherLength; index++) { - JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), index, &elementVal); PyObject *leftItem = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); PyObject *rightItem; if (PyObject_TypeCheck(other, &JSArrayProxyType)) { - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)other)->jsArray, index, &elementVal); + JS_GetElement(GLOBAL_CX, *(((JSArrayProxy *)other)->jsArray), index, &elementVal); rightItem = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); } else { rightItem = ((PyListObject *)other)->ob_item[index]; @@ -476,7 +477,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy * Py_RETURN_TRUE; } - JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), index, &elementVal); /* Compare the final item again using the proper operator */ return PyObject_RichCompare(pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(), ((PyListObject *)other)->ob_item[index], op); } @@ -514,10 +515,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) { } } - JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), index, &elementVal); PyObject *s; - if (&elementVal.toObject() == self->jsArray.get()) { + if (&elementVal.toObject() == (*(self->jsArray)).get()) { s = PyObject_Repr((PyObject *)self); } else { s = PyObject_Repr(pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject()); @@ -605,13 +606,13 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_concat(JSArrayProxy *self, JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t inputIdx = 0; inputIdx < sizeSelf; inputIdx++) { - JS_GetElement(GLOBAL_CX, self->jsArray, inputIdx, &elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), inputIdx, &elementVal); JS_SetElement(GLOBAL_CX, jCombinedArray, inputIdx, elementVal); } if (PyObject_TypeCheck(value, &JSArrayProxyType)) { for (Py_ssize_t inputIdx = 0; inputIdx < sizeValue; inputIdx++) { - JS_GetElement(GLOBAL_CX, ((JSArrayProxy *)value)->jsArray, inputIdx, &elementVal); + JS_GetElement(GLOBAL_CX, *(((JSArrayProxy *)value)->jsArray), inputIdx, &elementVal); JS_SetElement(GLOBAL_CX, jCombinedArray, sizeSelf + inputIdx, elementVal); } } else { @@ -643,7 +644,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repeat(JSArrayProxy *self, // one might think of using copyWithin but in SpiderMonkey it's implemented in JS! JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t inputIdx = 0; inputIdx < input_size; inputIdx++) { - JS_GetElement(GLOBAL_CX, self->jsArray, inputIdx, &elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), inputIdx, &elementVal); for (Py_ssize_t repeatIdx = 0; repeatIdx < n; repeatIdx++) { JS_SetElement(GLOBAL_CX, jCombinedArray, repeatIdx * input_size + inputIdx, elementVal); } @@ -663,7 +664,7 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyO JS::RootedValue elementVal(GLOBAL_CX); for (index = 0, cmp = 0; cmp == 0 && index < numElements; ++index) { - JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), index, &elementVal); PyObject *item = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); Py_INCREF(item); cmp = PyObject_RichCompareBool(item, element, Py_EQ); @@ -677,7 +678,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_concat(JSArrayProx Py_ssize_t valueLength = Py_SIZE(value); // allocate extra spacePy_SIZE - JS::SetArrayLength(GLOBAL_CX, self->jsArray, selfLength + valueLength); + JS::SetArrayLength(GLOBAL_CX, *(self->jsArray), selfLength + valueLength); JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); JS::RootedObject jRootedValue = JS::RootedObject(GLOBAL_CX, jValue.toObjectOrNull()); @@ -685,7 +686,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_concat(JSArrayProx JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t inputIdx = 0; inputIdx < valueLength; inputIdx++) { JS_GetElement(GLOBAL_CX, jRootedValue, inputIdx, &elementVal); - JS_SetElement(GLOBAL_CX, self->jsArray, selfLength + inputIdx, elementVal); + JS_SetElement(GLOBAL_CX, *(self->jsArray), selfLength + inputIdx, elementVal); } Py_INCREF(self); @@ -709,15 +710,15 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat(JSArrayProx return PyErr_NoMemory(); } - JS::SetArrayLength(GLOBAL_CX, self->jsArray, input_size * n); + JS::SetArrayLength(GLOBAL_CX, *(self->jsArray), input_size * n); // repeat within self // one might think of using copyWithin but in SpiderMonkey it's implemented in JS! JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t inputIdx = 0; inputIdx < input_size; inputIdx++) { - JS_GetElement(GLOBAL_CX, self->jsArray, inputIdx, &elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), inputIdx, &elementVal); for (Py_ssize_t repeatIdx = 0; repeatIdx < n; repeatIdx++) { - JS_SetElement(GLOBAL_CX, self->jsArray, repeatIdx * input_size + inputIdx, elementVal); + JS_SetElement(GLOBAL_CX, *(self->jsArray), repeatIdx * input_size + inputIdx, elementVal); } } @@ -726,17 +727,18 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_inplace_repeat(JSArrayProx } PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_clear_method(JSArrayProxy *self) { - JS::SetArrayLength(GLOBAL_CX, self->jsArray, 0); + JS::SetArrayLength(GLOBAL_CX, *(self->jsArray), 0); Py_RETURN_NONE; } int JSArrayProxyMethodDefinitions::JSArrayProxy_clear(JSArrayProxy *self) { - // Nothing to be done + JS::SetArrayLength(GLOBAL_CX, *(self->jsArray), 0); return 0; } int JSArrayProxyMethodDefinitions::JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg) { // Nothing to be done + // TODO do we need to iterate through the list and call traverse on proxied PyObjects? return 0; } @@ -745,7 +747,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) { jArgs[0].setInt32(0); jArgs[1].setInt32(JSArrayProxy_length(self)); JS::RootedValue jReturnedArray(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "slice", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, *(self->jsArray), "slice", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -755,9 +757,9 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_copy(JSArrayProxy *self) { PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_append(JSArrayProxy *self, PyObject *value) { Py_ssize_t len = JSArrayProxy_length(self); - JS::SetArrayLength(GLOBAL_CX, self->jsArray, len + 1); + JS::SetArrayLength(GLOBAL_CX, *(self->jsArray), len + 1); JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); - JS_SetElement(GLOBAL_CX, self->jsArray, len, jValue); + JS_SetElement(GLOBAL_CX, *(self->jsArray), len, jValue); Py_RETURN_NONE; } @@ -804,7 +806,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_insert(JSArrayProxy *self, jArgs[2].set(jsTypeFactory(GLOBAL_CX, value)); JS::RootedValue jReturnedArray(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "splice", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, *(self->jsArray), "splice", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -827,14 +829,14 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_extend(JSArrayProxy *self, Py_ssize_t m = JSArrayProxy_length(self); - JS::SetArrayLength(GLOBAL_CX, self->jsArray, m + n); + JS::SetArrayLength(GLOBAL_CX, *(self->jsArray), m + n); // populate the end of self with iterable's items. PyObject **src = PySequence_Fast_ITEMS(iterable); for (Py_ssize_t i = 0; i < n; i++) { PyObject *o = src[i]; JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, o)); - JS_SetElement(GLOBAL_CX, self->jsArray, m + i, jValue); + JS_SetElement(GLOBAL_CX, *(self->jsArray), m + i, jValue); } Py_DECREF(iterable); @@ -863,9 +865,9 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_extend(JSArrayProxy *self, break; } - JS::SetArrayLength(GLOBAL_CX, self->jsArray, len + 1); + JS::SetArrayLength(GLOBAL_CX, *(self->jsArray), len + 1); JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, item)); - JS_SetElement(GLOBAL_CX, self->jsArray, len, jValue); + JS_SetElement(GLOBAL_CX, *(self->jsArray), len, jValue); len++; } @@ -916,7 +918,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_pop(JSArrayProxy *self, Py jArgs[1].setInt32(1); JS::RootedValue jReturnedArray(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "splice", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, *(self->jsArray), "splice", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -934,7 +936,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self, JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t index = 0; index < selfSize; index++) { - JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), index, &elementVal); PyObject *obj = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); @@ -944,7 +946,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self, jArgs[0].setInt32(index); jArgs[1].setInt32(1); JS::RootedValue jReturnedArray(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "splice", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, *(self->jsArray), "splice", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -999,7 +1001,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_index(JSArrayProxy *self, JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t index = start; index < stop && index < selfSize; index++) { - JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), index, &elementVal); PyObject *obj = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); @@ -1022,7 +1024,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_count(JSArrayProxy *self, Py_ssize_t length = JSArrayProxy_length(self); JS::RootedValue elementVal(GLOBAL_CX); for (Py_ssize_t index = 0; index < length; index++) { - JS_GetElement(GLOBAL_CX, self->jsArray, index, &elementVal); + JS_GetElement(GLOBAL_CX, *(self->jsArray), index, &elementVal); PyObject *obj = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); Py_INCREF(obj); int cmp = PyObject_RichCompareBool(obj, value, Py_EQ); @@ -1040,7 +1042,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_count(JSArrayProxy *self, PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_reverse(JSArrayProxy *self) { if (JSArrayProxy_length(self) > 1) { JS::RootedValue jReturnedArray(GLOBAL_CX); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "reverse", JS::HandleValueArray::empty(), &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, *(self->jsArray), "reverse", JS::HandleValueArray::empty(), &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -1225,7 +1227,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].setObject(*funObj); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, *(self->jsArray), "sort", jArgs, &jReturnedArray)) { if (!PyErr_Occurred()) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); } @@ -1247,7 +1249,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P // two-arg js-style JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].set(jsTypeFactory(GLOBAL_CX, keyfunc)); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, *(self->jsArray), "sort", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -1260,7 +1262,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P else if (PyObject_TypeCheck(keyfunc, &JSFunctionProxyType)) { JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].setObject(**((JSFunctionProxy *)keyfunc)->jsFunc); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, *(self->jsArray), "sort", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } @@ -1287,7 +1289,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].setObject(*funObj); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, *(self->jsArray), "sort", jArgs, &jReturnedArray)) { if (!PyErr_Occurred()) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); } @@ -1313,7 +1315,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_sort(JSArrayProxy *self, P JS::Rooted> jArgs(GLOBAL_CX); jArgs[0].setObject(*funObj); - if (!JS_CallFunctionName(GLOBAL_CX, self->jsArray, "sort", jArgs, &jReturnedArray)) { + if (!JS_CallFunctionName(GLOBAL_CX, *(self->jsArray), "sort", jArgs, &jReturnedArray)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSArrayProxyType.tp_name); return NULL; } diff --git a/src/JSObjectItemsProxy.cc b/src/JSObjectItemsProxy.cc index fcc47b0c..0a500213 100644 --- a/src/JSObjectItemsProxy.cc +++ b/src/JSObjectItemsProxy.cc @@ -58,7 +58,7 @@ PyObject *JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_iter(JSObjectI iterator->it.di_dict = self->dv.dv_dict; iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties - if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { + if (!js::GetPropertyKeys(GLOBAL_CX, *(((JSObjectProxy *)(self->dv.dv_dict))->jsObject), JSITER_OWNONLY, iterator->it.props)) { return NULL; } PyObject_GC_Track(iterator); @@ -77,7 +77,7 @@ PyObject *JSObjectItemsProxyMethodDefinitions::JSObjectItemsProxy_iter_reverse(J iterator->it.di_dict = self->dv.dv_dict; iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties - if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { + if (!js::GetPropertyKeys(GLOBAL_CX, *(((JSObjectProxy *)(self->dv.dv_dict))->jsObject), JSITER_OWNONLY, iterator->it.props)) { return NULL; } PyObject_GC_Track(iterator); diff --git a/src/JSObjectIterProxy.cc b/src/JSObjectIterProxy.cc index a8bc1c9c..4c900d4f 100644 --- a/src/JSObjectIterProxy.cc +++ b/src/JSObjectIterProxy.cc @@ -58,7 +58,7 @@ PyObject *JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_nextkey(JSObject if (self->it.kind != KIND_KEYS) { JS::RootedValue jsVal(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, &jsVal); + JS_GetPropertyById(GLOBAL_CX, *(((JSObjectProxy *)(self->it.di_dict))->jsObject), id, &jsVal); value = pyTypeFactory(GLOBAL_CX, jsVal)->getPyObject(); } @@ -84,7 +84,7 @@ PyObject *JSObjectIterProxyMethodDefinitions::JSObjectIterProxy_nextkey(JSObject if (self->it.kind != KIND_KEYS) { JS::RootedValue jsVal(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, ((JSObjectProxy *)(self->it.di_dict))->jsObject, id, &jsVal); + JS_GetPropertyById(GLOBAL_CX, *(((JSObjectProxy *)(self->it.di_dict))->jsObject), id, &jsVal); value = pyTypeFactory(GLOBAL_CX, jsVal)->getPyObject(); } diff --git a/src/JSObjectKeysProxy.cc b/src/JSObjectKeysProxy.cc index cb2f6a51..5168d9ad 100644 --- a/src/JSObjectKeysProxy.cc +++ b/src/JSObjectKeysProxy.cc @@ -169,7 +169,7 @@ PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_iter(JSObjectKey iterator->it.di_dict = self->dv.dv_dict; iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties - if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { + if (!js::GetPropertyKeys(GLOBAL_CX, *(((JSObjectProxy *)(self->dv.dv_dict))->jsObject), JSITER_OWNONLY, iterator->it.props)) { return NULL; } PyObject_GC_Track(iterator); @@ -188,7 +188,7 @@ PyObject *JSObjectKeysProxyMethodDefinitions::JSObjectKeysProxy_iter_reverse(JSO iterator->it.di_dict = self->dv.dv_dict; iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties - if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { + if (!js::GetPropertyKeys(GLOBAL_CX, *(((JSObjectProxy *)(self->dv.dv_dict))->jsObject), JSITER_OWNONLY, iterator->it.props)) { return NULL; } PyObject_GC_Track(iterator); diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 1cefdc84..384cfb4d 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -47,7 +47,8 @@ bool keyToId(PyObject *key, JS::MutableHandleId idp) { void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) { - self->jsObject.set(nullptr); + self->jsObject->set(nullptr); + delete self->jsObject; PyObject_GC_UnTrack(self); Py_TYPE(self)->tp_free((PyObject *)self); } @@ -55,7 +56,7 @@ void JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc(JSObjectProxy *self) Py_ssize_t JSObjectProxyMethodDefinitions::JSObjectProxy_length(JSObjectProxy *self) { JS::RootedIdVector props(GLOBAL_CX); - if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) + if (!js::GetPropertyKeys(GLOBAL_CX, *(self->jsObject), JSITER_OWNONLY, &props)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return -1; @@ -69,7 +70,7 @@ static inline PyObject *getKey(JSObjectProxy *self, PyObject *key, JS::HandleId const char *methodName = JSObjectProxyType.tp_methods[index].ml_name; if (methodName == NULL || !PyUnicode_Check(key)) { JS::RootedValue value(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); + JS_GetPropertyById(GLOBAL_CX, *(self->jsObject), id, &value); // if value is a JSFunction, bind `this` to self /* (Caleb Aikens) its potentially problematic to bind it like this since if the function * ever gets assigned to another object like so: @@ -91,9 +92,12 @@ static inline PyObject *getKey(JSObjectProxy *self, PyObject *key, JS::HandleId JS::GetBuiltinClass(GLOBAL_CX, valueObject, &cls); if (cls == js::ESClass::Function) { JS::Rooted> args(GLOBAL_CX); - args[0].setObject(*(self->jsObject)); - JS::Rooted boundFunction(GLOBAL_CX); - JS_CallFunctionName(GLOBAL_CX, valueObject, "bind", args, &boundFunction); + args[0].setObject(*((*(self->jsObject)).get())); + JS::RootedValue boundFunction(GLOBAL_CX); + if (!JS_CallFunctionName(GLOBAL_CX, valueObject, "bind", args, &boundFunction)) { + PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); + return NULL; + } value.set(boundFunction); } } @@ -127,17 +131,17 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_contains(JSObjectProxy *self, return -1; } JS::RootedValue *value = new JS::RootedValue(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, value); + JS_GetPropertyById(GLOBAL_CX, *(self->jsObject), id, value); return value->isUndefined() ? 0 : 1; } static inline void assignKeyValue(JSObjectProxy *self, PyObject *key, JS::HandleId id, PyObject *value) { if (value) { // we are setting a value JS::RootedValue jValue(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, value)); - JS_SetPropertyById(GLOBAL_CX, self->jsObject, id, jValue); + JS_SetPropertyById(GLOBAL_CX, *(self->jsObject), id, jValue); } else { // we are deleting a value JS::ObjectOpResult ignoredResult; - JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); + JS_DeletePropertyById(GLOBAL_CX, *(self->jsObject), id, ignoredResult); } } @@ -156,11 +160,12 @@ int JSObjectProxyMethodDefinitions::JSObjectProxy_assign(JSObjectProxy *self, Py int JSObjectProxyMethodDefinitions::JSObjectProxy_traverse(JSObjectProxy *self, visitproc visit, void *arg) { // Nothing to be done + // TODO do we need to iterate through the dict and call traverse on proxied PyObjects? return 0; } int JSObjectProxyMethodDefinitions::JSObjectProxy_clear(JSObjectProxy *self) { - // Nothing to be done + JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method(self); return 0; } @@ -200,8 +205,8 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr visited.insert({{(PyObject *)self, other}}); if (Py_TYPE((PyObject *)self) == Py_TYPE(other)) { - JS::RootedValue selfVal(GLOBAL_CX, JS::ObjectValue(*self->jsObject)); - JS::RootedValue otherVal(GLOBAL_CX, JS::ObjectValue(*(*(JSObjectProxy *)other).jsObject)); + JS::RootedValue selfVal(GLOBAL_CX, JS::ObjectValue(**(self->jsObject))); + JS::RootedValue otherVal(GLOBAL_CX, JS::ObjectValue(**(*(JSObjectProxy *)other).jsObject)); if (selfVal.asRawBits() == otherVal.asRawBits()) { return true; } @@ -209,7 +214,7 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr } JS::RootedIdVector props(GLOBAL_CX); - if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) + if (!js::GetPropertyKeys(GLOBAL_CX, *(self->jsObject), JSITER_OWNONLY, &props)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; @@ -262,7 +267,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_iter(JSObjectProxy *self iterator->it.di_dict = (PyDictObject *)self; iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties - if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, iterator->it.props)) { + if (!js::GetPropertyKeys(GLOBAL_CX, *(self->jsObject), JSITER_OWNONLY, iterator->it.props)) { return NULL; } PyObject_GC_Track(iterator); @@ -301,7 +306,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self /* Do repr() on each key+value pair, and insert ": " between them. Note that repr may mutate the dict. */ // Get **enumerable** own properties - if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) { + if (!js::GetPropertyKeys(GLOBAL_CX, *(self->jsObject), JSITER_OWNONLY, &props)) { return NULL; } @@ -335,9 +340,9 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self } JS::RootedValue elementVal(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &elementVal); + JS_GetPropertyById(GLOBAL_CX, *(self->jsObject), id, &elementVal); - if (&elementVal.toObject() == self->jsObject.get()) { + if (&elementVal.toObject() == (*(self->jsObject)).get()) { value = (PyObject *)self; } else { value = pyTypeFactory(GLOBAL_CX, elementVal)->getPyObject(); @@ -464,11 +469,11 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, else { JS::Rooted> args(GLOBAL_CX); args[0].setObjectOrNull(JS_NewPlainObject(GLOBAL_CX)); - args[1].setObjectOrNull(self->jsObject); // this is null is left operand is real dict + args[1].setObjectOrNull(*(self->jsObject)); // this is null is left operand is real dict JS::RootedValue jValueOther(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, other)); args[2].setObject(jValueOther.toObject()); - JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(*(self->jsObject))); // call Object.assign JS::RootedValue Object(GLOBAL_CX); @@ -491,11 +496,11 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_or(JSObjectProxy *self, PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_ior(JSObjectProxy *self, PyObject *other) { if (PyDict_Check(other)) { JS::Rooted> args(GLOBAL_CX); - args[0].setObjectOrNull(self->jsObject); + args[0].setObjectOrNull(*(self->jsObject)); JS::RootedValue jValueOther(GLOBAL_CX, jsTypeFactory(GLOBAL_CX, other)); args[1].setObject(jValueOther.toObject()); - JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(*(self->jsObject))); // call Object.assign JS::RootedValue Object(GLOBAL_CX); @@ -598,7 +603,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy } JS::RootedValue value(GLOBAL_CX); - JS_GetPropertyById(GLOBAL_CX, self->jsObject, id, &value); + JS_GetPropertyById(GLOBAL_CX, *(self->jsObject), id, &value); if (value.isUndefined()) { if (default_value != NULL) { Py_INCREF(default_value); @@ -609,7 +614,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy } else { JS::ObjectOpResult ignoredResult; - JS_DeletePropertyById(GLOBAL_CX, self->jsObject, id, ignoredResult); + JS_DeletePropertyById(GLOBAL_CX, *(self->jsObject), id, ignoredResult); return pyTypeFactory(GLOBAL_CX, value)->getPyObject(); } @@ -617,7 +622,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_pop_method(JSObjectProxy PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method(JSObjectProxy *self) { JS::RootedIdVector props(GLOBAL_CX); - if (!js::GetPropertyKeys(GLOBAL_CX, self->jsObject, JSITER_OWNONLY, &props)) + if (!js::GetPropertyKeys(GLOBAL_CX, *(self->jsObject), JSITER_OWNONLY, &props)) { PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name); return NULL; @@ -626,7 +631,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method(JSObjectPro JS::ObjectOpResult ignoredResult; size_t length = props.length(); for (size_t index = 0; index < length; index++) { - JS_DeletePropertyById(GLOBAL_CX, self->jsObject, props[index], ignoredResult); + JS_DeletePropertyById(GLOBAL_CX, *(self->jsObject), props[index], ignoredResult); } Py_RETURN_NONE; @@ -635,9 +640,9 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_clear_method(JSObjectPro PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_copy_method(JSObjectProxy *self) { JS::Rooted> args(GLOBAL_CX); args[0].setObjectOrNull(JS_NewPlainObject(GLOBAL_CX)); - args[1].setObjectOrNull(self->jsObject); + args[1].setObjectOrNull(*(self->jsObject)); - JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(self->jsObject)); + JS::RootedObject global(GLOBAL_CX, JS::GetNonCCWObjectGlobal(*(self->jsObject))); // call Object.assign JS::RootedValue Object(GLOBAL_CX); diff --git a/src/JSObjectValuesProxy.cc b/src/JSObjectValuesProxy.cc index 86ab3220..5196f403 100644 --- a/src/JSObjectValuesProxy.cc +++ b/src/JSObjectValuesProxy.cc @@ -97,7 +97,7 @@ PyObject *JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_iter(JSObjec iterator->it.di_dict = self->dv.dv_dict; iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties - if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { + if (!js::GetPropertyKeys(GLOBAL_CX, *(((JSObjectProxy *)(self->dv.dv_dict))->jsObject), JSITER_OWNONLY, iterator->it.props)) { return NULL; } PyObject_GC_Track(iterator); @@ -116,7 +116,7 @@ PyObject *JSObjectValuesProxyMethodDefinitions::JSObjectValuesProxy_iter_reverse iterator->it.di_dict = self->dv.dv_dict; iterator->it.props = new JS::PersistentRootedIdVector(GLOBAL_CX); // Get **enumerable** own properties - if (!js::GetPropertyKeys(GLOBAL_CX, ((JSObjectProxy *)(self->dv.dv_dict))->jsObject, JSITER_OWNONLY, iterator->it.props)) { + if (!js::GetPropertyKeys(GLOBAL_CX, *(((JSObjectProxy *)(self->dv.dv_dict))->jsObject), JSITER_OWNONLY, iterator->it.props)) { return NULL; } PyObject_GC_Track(iterator); diff --git a/src/ListType.cc b/src/ListType.cc index f5f8df67..7cdea586 100644 --- a/src/ListType.cc +++ b/src/ListType.cc @@ -23,7 +23,8 @@ ListType::ListType(PyObject *object) : PyType(object) {} ListType::ListType(JSContext *cx, JS::HandleObject jsArrayObj) { JSArrayProxy *proxy = (JSArrayProxy *)PyObject_CallObject((PyObject *)&JSArrayProxyType, NULL); if (proxy != NULL) { - proxy->jsArray.set(jsArrayObj); + proxy->jsArray = new JS::PersistentRootedObject(cx); + proxy->jsArray->set(jsArrayObj); this->pyObject = (PyObject *)proxy; } } \ No newline at end of file diff --git a/src/PyListProxyHandler.cc b/src/PyListProxyHandler.cc index 2e69f111..2eb1ba27 100644 --- a/src/PyListProxyHandler.cc +++ b/src/PyListProxyHandler.cc @@ -552,7 +552,7 @@ static bool array_concat(JSContext *cx, unsigned argc, JS::Value *vp) { // flatten the array only a depth 1 Py_ssize_t itemLength = JSArrayProxyMethodDefinitions::JSArrayProxy_length((JSArrayProxy *)item); for (Py_ssize_t flatIndex = 0; flatIndex < itemLength; flatIndex++) { - if (!JS_GetElement(cx, ((JSArrayProxy *)item)->jsArray, flatIndex, &elementVal)) { + if (!JS_GetElement(cx, *(((JSArrayProxy *)item)->jsArray), flatIndex, &elementVal)) { return false; } if (PyList_Append(result, pyTypeFactory(cx, elementVal)->getPyObject()) < 0) { @@ -1238,7 +1238,7 @@ static uint32_t FlattenIntoArray(JSContext *cx, for (uint32_t sourceIndex = 0; sourceIndex < sourceLen; sourceIndex++) { if (PyObject_TypeCheck(source, &JSArrayProxyType)) { - JS_GetElement(cx, ((JSArrayProxy *)source)->jsArray, sourceIndex, &elementVal); + JS_GetElement(cx, *(((JSArrayProxy *)source)->jsArray), sourceIndex, &elementVal); } else if (PyObject_TypeCheck(source, &PyList_Type)) { elementVal.set(jsTypeFactory(cx, PyList_GetItem(source, sourceIndex))); @@ -1303,7 +1303,7 @@ static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, for (uint32_t sourceIndex = 0; sourceIndex < sourceLen; sourceIndex++) { if (PyObject_TypeCheck(source, &JSArrayProxyType)) { - JS_GetElement(cx, ((JSArrayProxy *)source)->jsArray, sourceIndex, &elementVal); + JS_GetElement(cx, *(((JSArrayProxy *)source)->jsArray), sourceIndex, &elementVal); } else if (PyObject_TypeCheck(source, &PyList_Type)) { elementVal.set(jsTypeFactory(cx, PyList_GetItem(source, sourceIndex))); @@ -1355,7 +1355,7 @@ static uint32_t FlattenIntoArrayWithCallBack(JSContext *cx, JS::RootedValue elementIndexVal(cx); for (uint32_t elementIndex = 0; elementIndex < elementLen; elementIndex++, targetIndex++) { if (PyObject_TypeCheck(element, &JSArrayProxyType)) { - JS_GetElement(cx, ((JSArrayProxy *)element)->jsArray, elementIndex, &elementIndexVal); + JS_GetElement(cx, *(((JSArrayProxy *)element)->jsArray), elementIndex, &elementIndexVal); } else { elementIndexVal.set(jsTypeFactory(cx, PyList_GetItem(element, elementIndex))); diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 97322297..a4621708 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -55,7 +55,13 @@ std::unordered_map charToPyObjectMap; // a map of char16 struct PythonExternalString : public JSExternalStringCallbacks { void finalize(char16_t *chars) const override { - Py_DECREF(charToPyObjectMap[chars]); + // We cannot call Py_DECREF here when shutting down as the thread state is gone. + // Then, when shutting down, there is only on reference left, and we don't need + // to free the object since the entire process memory is being released. + PyObject *object = charToPyObjectMap[chars]; + if (Py_REFCNT(object) > 1) { + Py_DECREF(object); + } } size_t sizeOfBuffer(const char16_t *chars, mozilla::MallocSizeOf mallocSizeOf) const override { return 0; @@ -180,7 +186,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { returnType.setObjectOrNull(typedArray); } else if (PyObject_TypeCheck(object, &JSObjectProxyType)) { - returnType.setObject(*((JSObjectProxy *)object)->jsObject); + returnType.setObject(**((JSObjectProxy *)object)->jsObject); } else if (PyObject_TypeCheck(object, &JSMethodProxyType)) { JS::RootedObject func(cx, *((JSMethodProxy *)object)->jsFunc); @@ -204,7 +210,7 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { returnType.setObject(**((JSFunctionProxy *)object)->jsFunc); } else if (PyObject_TypeCheck(object, &JSArrayProxyType)) { - returnType.setObject(*((JSArrayProxy *)object)->jsArray); + returnType.setObject(**((JSArrayProxy *)object)->jsArray); } else if (PyDict_Check(object) || PyList_Check(object)) { JS::RootedValue v(cx); From a0fea0c8a8e20eacdd581e62d1f633db5940948e Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Thu, 29 Feb 2024 11:21:45 -0500 Subject: [PATCH 0330/1086] chore(jsTypeFactory): remove extra blank lines from jsTypeFactory --- src/jsTypeFactory.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index 8e322f28..a72a73a7 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -50,8 +50,6 @@ static PyDictProxyHandler pyDictProxyHandler; static PyObjectProxyHandler pyObjectProxyHandler; static PyListProxyHandler pyListProxyHandler; - - std::unordered_map charToPyObjectMap; // a map of char16_t buffers to their corresponding PyObjects, used when finalizing JSExternalStrings struct PythonExternalString : public JSExternalStringCallbacks { From ccbd1c558e15b54dea1dde651ca39c3b417cf8cb Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Thu, 29 Feb 2024 11:39:18 -0500 Subject: [PATCH 0331/1086] chore(FinalizationRegistry): change jsFunctionRegistry from a pointer to an object, and initialize it in PyInit_pythonmonkey --- include/PyDictProxyHandler.hh | 4 ++-- include/PyObjectProxyHandler.hh | 6 +++--- include/modules/pythonmonkey/pythonmonkey.hh | 2 +- src/jsTypeFactory.cc | 6 ++++-- src/modules/pythonmonkey/pythonmonkey.cc | 7 +++---- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/PyDictProxyHandler.hh b/include/PyDictProxyHandler.hh index 35351ee5..0e3128d1 100644 --- a/include/PyDictProxyHandler.hh +++ b/include/PyDictProxyHandler.hh @@ -79,7 +79,7 @@ public: * @param proxy - The proxy object who's keys we output * @param props - out-parameter of object IDsoverride; - /** + /** * @return true - call succeeded * @return false - call failed and an exception has been raised */ @@ -101,7 +101,7 @@ public: /** * @brief Returns vector of proxy's own keys - * + * * @param cx - Pointer to the JSContext * @param proxy - the proxy object * @param props - out parameter, the vector of proxy's own keys diff --git a/include/PyObjectProxyHandler.hh b/include/PyObjectProxyHandler.hh index 460caded..acefa531 100644 --- a/include/PyObjectProxyHandler.hh +++ b/include/PyObjectProxyHandler.hh @@ -101,10 +101,10 @@ public: */ bool hasOwn(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, bool *bp) const override; - - /** + + /** * @brief Returns vector of proxy's own keys - * + * * @param cx - Pointer to the JSContext * @param proxy - the proxy object * @param props - out parameter, the vector of proxy's own keys diff --git a/include/modules/pythonmonkey/pythonmonkey.hh b/include/modules/pythonmonkey/pythonmonkey.hh index 7f964bce..3b3a51e3 100644 --- a/include/modules/pythonmonkey/pythonmonkey.hh +++ b/include/modules/pythonmonkey/pythonmonkey.hh @@ -24,7 +24,7 @@ #define PythonMonkey_BigInt PyObject_GetAttrString(PyState_FindModule(&pythonmonkey), "bigint") /**< macro for pythonmonkey.bigint class object */ extern JSContext *GLOBAL_CX; /**< pointer to PythonMonkey's JSContext */ -extern JS::PersistentRootedObject *jsFunctionRegistry; /** *global; /**< pointer to the global object of PythonMonkey's JSContext */ static JSAutoRealm *autoRealm; /**< pointer to PythonMonkey's AutoRealm */ static JobQueue *JOB_QUEUE; /**< pointer to PythonMonkey's event-loop job queue */ diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index a72a73a7..a5b89cfc 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -164,7 +164,8 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { registerArgs[0].setObject(*jsFuncObject); registerArgs[1].setPrivate(object); JS::RootedValue ignoredOutVal(GLOBAL_CX); - JS_CallFunctionName(GLOBAL_CX, *jsFunctionRegistry, "register", registerArgs, &ignoredOutVal); + JS::RootedObject registry(GLOBAL_CX, jsFunctionRegistry); + JS_CallFunctionName(GLOBAL_CX, registry, "register", registerArgs, &ignoredOutVal); } else if (PyExceptionInstance_Check(object)) { JSObject *error = ExceptionType(object).toJsError(cx); @@ -196,7 +197,8 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { registerArgs[0].set(boundFunction); registerArgs[1].setPrivate(object); JS::RootedValue ignoredOutVal(GLOBAL_CX); - JS_CallFunctionName(GLOBAL_CX, *jsFunctionRegistry, "register", registerArgs, &ignoredOutVal); + JS::RootedObject registry(GLOBAL_CX, jsFunctionRegistry); + JS_CallFunctionName(GLOBAL_CX, registry, "register", registerArgs, &ignoredOutVal); Py_INCREF(object); } diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index e4a0ba28..e99c2e0a 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -48,7 +48,7 @@ #include #include -JS::PersistentRootedObject *jsFunctionRegistry; +JS::PersistentRootedObject jsFunctionRegistry; bool functionRegistryCallback(JSContext *cx, unsigned int argc, JS::Value *vp) { JS::CallArgs callargs = JS::CallArgsFromVp(argc, vp); @@ -255,7 +255,6 @@ PyTypeObject JSObjectItemsProxyType = { }; static void cleanup() { - delete jsFunctionRegistry; delete autoRealm; delete global; delete JOB_QUEUE; @@ -647,8 +646,8 @@ PyMODINIT_FUNC PyInit_pythonmonkey(void) setSpiderMonkeyException(GLOBAL_CX); return NULL; } - jsFunctionRegistry = new JS::PersistentRootedObject(GLOBAL_CX); - jsFunctionRegistry->set(registryObject); + jsFunctionRegistry.init(GLOBAL_CX); + jsFunctionRegistry.set(registryObject); JS::SetHostCleanupFinalizationRegistryCallback(GLOBAL_CX, cleanupFinalizationRegistry, NULL); From b4d33b435747a371260d7341af294d0c8b129ed6 Mon Sep 17 00:00:00 2001 From: Caleb Aikens Date: Thu, 29 Feb 2024 11:43:16 -0500 Subject: [PATCH 0332/1086] feat(jsTypeFactory): correctly check the result of JS_CallFunctionName to see if an exception should be raised --- src/jsTypeFactory.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/jsTypeFactory.cc b/src/jsTypeFactory.cc index a5b89cfc..65b4ebac 100644 --- a/src/jsTypeFactory.cc +++ b/src/jsTypeFactory.cc @@ -29,6 +29,7 @@ #include "include/DateType.hh" #include "include/ExceptionType.hh" #include "include/BufferType.hh" +#include "include/setSpiderMonkeyException.hh" #include #include @@ -165,7 +166,10 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { registerArgs[1].setPrivate(object); JS::RootedValue ignoredOutVal(GLOBAL_CX); JS::RootedObject registry(GLOBAL_CX, jsFunctionRegistry); - JS_CallFunctionName(GLOBAL_CX, registry, "register", registerArgs, &ignoredOutVal); + if (!JS_CallFunctionName(GLOBAL_CX, registry, "register", registerArgs, &ignoredOutVal)) { + setSpiderMonkeyException(GLOBAL_CX); + return returnType; + } } else if (PyExceptionInstance_Check(object)) { JSObject *error = ExceptionType(object).toJsError(cx); @@ -190,7 +194,10 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { JS::Rooted> args(cx); args[0].set(jsTypeFactory(cx, self)); JS::Rooted boundFunction(cx); - JS_CallFunctionName(cx, func, "bind", args, &boundFunction); + if (!JS_CallFunctionName(cx, func, "bind", args, &boundFunction)) { + setSpiderMonkeyException(GLOBAL_CX); + return returnType; + } returnType.set(boundFunction); // add function to jsFunctionRegistry, to DECREF the PyObject when the JSFunction is finalized JS::RootedValueArray<2> registerArgs(GLOBAL_CX); @@ -198,7 +205,10 @@ JS::Value jsTypeFactory(JSContext *cx, PyObject *object) { registerArgs[1].setPrivate(object); JS::RootedValue ignoredOutVal(GLOBAL_CX); JS::RootedObject registry(GLOBAL_CX, jsFunctionRegistry); - JS_CallFunctionName(GLOBAL_CX, registry, "register", registerArgs, &ignoredOutVal); + if (!JS_CallFunctionName(GLOBAL_CX, registry, "register", registerArgs, &ignoredOutVal)) { + setSpiderMonkeyException(GLOBAL_CX); + return returnType; + } Py_INCREF(object); } From 30c120d17b847d313ef726fc3ffb72dd8355a1af Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 29 Feb 2024 12:31:05 -0500 Subject: [PATCH 0333/1086] tp_name must be same as that of super type --- src/JSArrayProxy.cc | 5 +++++ src/JSObjectProxy.cc | 4 ++++ src/modules/pythonmonkey/pythonmonkey.cc | 4 ++-- tests/python/test_dicts.py | 7 ++++++- tests/python/test_lists.py | 7 ++++++- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/JSArrayProxy.cc b/src/JSArrayProxy.cc index d552f4be..a3caa54a 100644 --- a/src/JSArrayProxy.cc +++ b/src/JSArrayProxy.cc @@ -54,6 +54,11 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_get(JSArrayProxy *self, Py if (methodName == NULL || !PyUnicode_Check(key)) { // reached end of list JS::RootedValue value(GLOBAL_CX); JS_GetPropertyById(GLOBAL_CX, *(self->jsArray), id, &value); + if (value.isUndefined()) { + if (strcmp("__class__", PyUnicode_AsUTF8(key)) == 0) { + return PyObject_GenericGetAttr((PyObject *)self, key); + } + } return pyTypeFactory(GLOBAL_CX, value)->getPyObject(); } else { diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 384cfb4d..5a788aeb 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -100,6 +100,10 @@ static inline PyObject *getKey(JSObjectProxy *self, PyObject *key, JS::HandleId } value.set(boundFunction); } + } else if (value.isUndefined()) { + if (strcmp("__class__", PyUnicode_AsUTF8(key)) == 0) { + return PyObject_GenericGetAttr((PyObject *)self, key); + } } return pyTypeFactory(GLOBAL_CX, value)->getPyObject(); diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index ee1458d0..81d821f0 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -88,7 +88,7 @@ static PyTypeObject BigIntType = { PyTypeObject JSObjectProxyType = { .ob_base = PyVarObject_HEAD_INIT(NULL, 0) - .tp_name = "pythonmonkey.JSObjectProxy", + .tp_name = PyDict_Type.tp_name, .tp_basicsize = sizeof(JSObjectProxy), .tp_itemsize = 0, .tp_dealloc = (destructor)JSObjectProxyMethodDefinitions::JSObjectProxy_dealloc, @@ -143,7 +143,7 @@ PyTypeObject JSMethodProxyType = { PyTypeObject JSArrayProxyType = { .ob_base = PyVarObject_HEAD_INIT(NULL, 0) - .tp_name = "pythonmonkey.JSArrayProxy", + .tp_name = PyList_Type.tp_name, .tp_basicsize = sizeof(JSArrayProxy), .tp_itemsize = 0, .tp_dealloc = (destructor)JSArrayProxyMethodDefinitions::JSArrayProxy_dealloc, diff --git a/tests/python/test_dicts.py b/tests/python/test_dicts.py index df7efbb2..b09849cb 100644 --- a/tests/python/test_dicts.py +++ b/tests/python/test_dicts.py @@ -325,4 +325,9 @@ def test_repr_max_recursion_depth(): except Exception as e: assert str(type(e)) == "" assert str(e) == "maximum recursion depth exceeded while getting the repr of an object" - subprocess.check_call('npm uninstall crypto-js', shell=True) \ No newline at end of file + subprocess.check_call('npm uninstall crypto-js', shell=True) + +#__class__ +def test___class__attribute(): + items = pm.eval("({'a': 10})") + assert repr(items.__class__) == "" \ No newline at end of file diff --git a/tests/python/test_lists.py b/tests/python/test_lists.py index 6cf817b7..42671dc6 100644 --- a/tests/python/test_lists.py +++ b/tests/python/test_lists.py @@ -1050,4 +1050,9 @@ def test_slice_assign_pm_array_step_2(): a = pm.eval("([1,2,3,4,5,6])") b = pm.eval("([1,2,3])") a[0:10:2] = b - assert a == [1, 2, 2, 4, 3, 6] \ No newline at end of file + assert a == [1, 2, 2, 4, 3, 6] + +#__class__ +def test___class__attribute(): + items = pm.eval("([1,2,3,4,5,6])") + assert repr(items.__class__) == "" \ No newline at end of file From f8a12175b3b34e0259f4a579e16c9870b624f19f Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 29 Feb 2024 14:40:28 -0500 Subject: [PATCH 0334/1086] finished details of JSObjectProxy.repr: skip over the $super key to avoid infinite recur --- src/JSObjectProxy.cc | 5 +++++ tests/python/test_dicts.py | 9 ++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/JSObjectProxy.cc b/src/JSObjectProxy.cc index 5a788aeb..75b9d817 100644 --- a/src/JSObjectProxy.cc +++ b/src/JSObjectProxy.cc @@ -324,6 +324,11 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self JS::HandleId id = props[index]; key = idToKey(GLOBAL_CX, id); + // escape infinite recur on superclass reference + if (strcmp(PyUnicode_AsUTF8(key), "$super") == 0) { + continue; + } + // Prevent repr from deleting key or value during key format. Py_INCREF(key); diff --git a/tests/python/test_dicts.py b/tests/python/test_dicts.py index b09849cb..65112e4b 100644 --- a/tests/python/test_dicts.py +++ b/tests/python/test_dicts.py @@ -319,13 +319,8 @@ def test_toLocaleString(): def test_repr_max_recursion_depth(): subprocess.check_call('npm install crypto-js', shell=True) CryptoJS = pm.require('crypto-js') - try: - repr(CryptoJS) - assert (False) - except Exception as e: - assert str(type(e)) == "" - assert str(e) == "maximum recursion depth exceeded while getting the repr of an object" - subprocess.check_call('npm uninstall crypto-js', shell=True) + assert str(CryptoJS).__contains__("{'lib': {'Base': {'extend':") + #__class__ def test___class__attribute(): From d19e8b76e8035aed53c7180cfb41507024fd133a Mon Sep 17 00:00:00 2001 From: Wes Garland Date: Thu, 29 Feb 2024 20:25:54 +0000 Subject: [PATCH 0335/1086] update package-lock.json to v3 lockfile; bump browserify-sign version due to npm audit --- python/pminit/pythonmonkey/package-lock.json | 339 ++++++++++++------- 1 file changed, 209 insertions(+), 130 deletions(-) diff --git a/python/pminit/pythonmonkey/package-lock.json b/python/pminit/pythonmonkey/package-lock.json index 9a36949a..54aca4dd 100644 --- a/python/pminit/pythonmonkey/package-lock.json +++ b/python/pminit/pythonmonkey/package-lock.json @@ -1,47 +1,68 @@ { "name": "pythonmonkey", "version": "0.0.1", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "asn1.js": { + "packages": { + "": { + "name": "pythonmonkey", + "version": "0.0.1", + "license": "MIT", + "dependencies": { + "core-js": "^3.35.1", + "ctx-module": "^1.0.14" + } + }, + "node_modules/asn1.js": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", - "requires": { + "dependencies": { "bn.js": "^4.0.0", "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0", "safer-buffer": "^2.1.0" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - } } }, - "base64-js": { + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "bn.js": { + "node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, - "brorand": { + "node_modules/brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" }, - "browserify-aes": { + "node_modules/browserify-aes": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "requires": { + "dependencies": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", "create-hash": "^1.1.0", @@ -50,101 +71,121 @@ "safe-buffer": "^5.0.1" } }, - "browserify-cipher": { + "node_modules/browserify-cipher": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "requires": { + "dependencies": { "browserify-aes": "^1.0.4", "browserify-des": "^1.0.0", "evp_bytestokey": "^1.0.0" } }, - "browserify-des": { + "node_modules/browserify-des": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "requires": { + "dependencies": { "cipher-base": "^1.0.1", "des.js": "^1.0.0", "inherits": "^2.0.1", "safe-buffer": "^5.1.2" } }, - "browserify-rsa": { + "node_modules/browserify-rsa": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", - "requires": { + "dependencies": { "bn.js": "^5.0.0", "randombytes": "^2.0.1" } }, - "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", - "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", + "node_modules/browserify-sign": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.2.tgz", + "integrity": "sha512-1rudGyeYY42Dk6texmv7c4VcQ0EsvVbLwZkA+AQB7SxvXxmcD93jcHie8bzecJ+ChDlmAm2Qyu0+Ccg5uhZXCg==", + "dependencies": { + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", + "elliptic": "^6.5.4", "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "parse-asn1": "^5.1.6", + "readable-stream": "^3.6.2", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 4" } }, - "buffer": { + "node_modules/buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "requires": { + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, - "buffer-xor": { + "node_modules/buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" }, - "cipher-base": { + "node_modules/cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "requires": { + "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" } }, - "core-js": { + "node_modules/core-js": { "version": "3.35.1", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.35.1.tgz", - "integrity": "sha512-IgdsbxNyMskrTFxa9lWHyMwAJU5gXOPP+1yO+K59d50VLVAIDAbs7gIv705KzALModfK3ZrSZTPNpC0PQgIZuw==" + "integrity": "sha512-IgdsbxNyMskrTFxa9lWHyMwAJU5gXOPP+1yO+K59d50VLVAIDAbs7gIv705KzALModfK3ZrSZTPNpC0PQgIZuw==", + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } }, - "create-ecdh": { + "node_modules/create-ecdh": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", - "requires": { + "dependencies": { "bn.js": "^4.1.0", "elliptic": "^6.5.3" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - } } }, - "create-hash": { + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "requires": { + "dependencies": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", "md5.js": "^1.3.4", @@ -152,11 +193,11 @@ "sha.js": "^2.4.0" } }, - "create-hmac": { + "node_modules/create-hmac": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "requires": { + "dependencies": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", "inherits": "^2.0.1", @@ -165,11 +206,11 @@ "sha.js": "^2.4.8" } }, - "crypto-browserify": { + "node_modules/crypto-browserify": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "requires": { + "dependencies": { "browserify-cipher": "^1.0.0", "browserify-sign": "^4.0.0", "create-ecdh": "^4.0.0", @@ -181,48 +222,49 @@ "public-encrypt": "^4.0.0", "randombytes": "^2.0.0", "randomfill": "^1.0.3" + }, + "engines": { + "node": "*" } }, - "ctx-module": { + "node_modules/ctx-module": { "version": "1.0.14", "resolved": "https://registry.npmjs.org/ctx-module/-/ctx-module-1.0.14.tgz", "integrity": "sha512-eH4h/bv64YuzCHMUZs93j57/4zNJHyQWOIz5CPAs1gJ/4yznPD9HoCLCXjQlST2AxOLOKNvV67n+A8dALtLA+Q==", - "requires": { + "dependencies": { "buffer": "^6.0.3", "crypto-browserify": "^3.12.0" } }, - "des.js": { + "node_modules/des.js": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", - "requires": { + "dependencies": { "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" } }, - "diffie-hellman": { + "node_modules/diffie-hellman": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "requires": { + "dependencies": { "bn.js": "^4.1.0", "miller-rabin": "^4.0.0", "randombytes": "^2.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - } } }, - "elliptic": { + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/elliptic": { "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "requires": { + "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", "hash.js": "^1.0.0", @@ -230,104 +272,120 @@ "inherits": "^2.0.4", "minimalistic-assert": "^1.0.1", "minimalistic-crypto-utils": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - } } }, - "evp_bytestokey": { + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "requires": { + "dependencies": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" } }, - "hash-base": { + "node_modules/hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "requires": { + "dependencies": { "inherits": "^2.0.4", "readable-stream": "^3.6.0", "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" } }, - "hash.js": { + "node_modules/hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "requires": { + "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" } }, - "hmac-drbg": { + "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "requires": { + "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", "minimalistic-crypto-utils": "^1.0.1" } }, - "ieee754": { + "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "inherits": { + "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "md5.js": { + "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "requires": { + "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1", "safe-buffer": "^5.1.2" } }, - "miller-rabin": { + "node_modules/miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "requires": { + "dependencies": { "bn.js": "^4.0.0", "brorand": "^1.0.1" }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - } + "bin": { + "miller-rabin": "bin/miller-rabin" } }, - "minimalistic-assert": { + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" }, - "minimalistic-crypto-utils": { + "node_modules/minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" }, - "parse-asn1": { + "node_modules/parse-asn1": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", - "requires": { + "dependencies": { "asn1.js": "^5.2.0", "browserify-aes": "^1.0.0", "evp_bytestokey": "^1.0.0", @@ -335,102 +393,123 @@ "safe-buffer": "^5.1.1" } }, - "pbkdf2": { + "node_modules/pbkdf2": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "requires": { + "dependencies": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", "ripemd160": "^2.0.1", "safe-buffer": "^5.0.1", "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" } }, - "public-encrypt": { + "node_modules/public-encrypt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "requires": { + "dependencies": { "bn.js": "^4.1.0", "browserify-rsa": "^4.0.0", "create-hash": "^1.1.0", "parse-asn1": "^5.0.0", "randombytes": "^2.0.1", "safe-buffer": "^5.1.2" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - } } }, - "randombytes": { + "node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "requires": { + "dependencies": { "safe-buffer": "^5.1.0" } }, - "randomfill": { + "node_modules/randomfill": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "requires": { + "dependencies": { "randombytes": "^2.0.5", "safe-buffer": "^5.1.0" } }, - "readable-stream": { + "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "requires": { + "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" } }, - "ripemd160": { + "node_modules/ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "requires": { + "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1" } }, - "safe-buffer": { + "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==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "safer-buffer": { + "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "sha.js": { + "node_modules/sha.js": { "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "requires": { + "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" } }, - "string_decoder": { + "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { + "dependencies": { "safe-buffer": "~5.2.0" } }, - "util-deprecate": { + "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" From 97339020de7c784e2896223bd70337e54ba00d4a Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Thu, 29 Feb 2024 15:34:21 -0500 Subject: [PATCH 0336/1086] next version will be 0.4.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3013dfb5..a8c8cca2 100644 --- a/README.md +++ b/README.md @@ -396,7 +396,7 @@ List of commands: ```console $ pmjs -Welcome to PythonMonkey v0.3.1. +Welcome to PythonMonkey v0.4.0. Type ".help" for more information. > .python import sys > .python sys.path From 479bcbf7667df24115a6c0db12fe0cd332953614 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Mar 2024 16:07:18 +0000 Subject: [PATCH 0337/1086] fix(console): `console.clear` should not print a trailing \n --- python/pythonmonkey/builtin_modules/console.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pythonmonkey/builtin_modules/console.js b/python/pythonmonkey/builtin_modules/console.js index 9b22f191..ba1fc9ec 100644 --- a/python/pythonmonkey/builtin_modules/console.js +++ b/python/pythonmonkey/builtin_modules/console.js @@ -72,7 +72,7 @@ class Console this.warn = (...args) => void this.#writeToStderr(this.#formatToStr(...args)); this.error = (...args) => void this.#writeToStderr(this.#formatToStr(...args)); - this.clear = () => this.log('\x1bc'); // clear the terminal, see https://stackoverflow.com/questions/47503734 + this.clear = () => void this.#writeToStdout('\x1bc'); // clear the terminal, see https://stackoverflow.com/questions/47503734 this.assert = (condition, ...data) => // See https://console.spec.whatwg.org/#assert { From eae475d264a67278060c83756215fdf60e42b3fc Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Mar 2024 16:30:13 +0000 Subject: [PATCH 0338/1086] test(console): add tests for newly added console methods --- tests/js/console-methods.simple | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 tests/js/console-methods.simple diff --git a/tests/js/console-methods.simple b/tests/js/console-methods.simple new file mode 100644 index 00000000..f68db2db --- /dev/null +++ b/tests/js/console-methods.simple @@ -0,0 +1,57 @@ +/** + * @file console-methods.simple + * + * Test methods in the console API other than simple logging functions. + * + * @author Tom Tang (xmader@distributive.network) + * @date February 2024 + */ +/* eslint-disable no-control-regex */ + +const { Console } = require('console'); + +/** + * @param {'stdout' | 'stderr'} type + * @param {string | RegExp} expected + * @param {(console: Console) => void} callback + * @param {boolean} expectMatch + */ +function expectOutput (type, expected, callback, expectMatch = true) +{ + const _console = new Console({ + stdout: { write: () => undefined }, // noop + stderr: { write: () => undefined }, // noop + [type]: { // overrides one of the above + write(str) + { + const match = str.match(expected); + if (expectMatch) + { + if (!match) + { + console.log([str]); + throw new Error(`Expected "${expected}" but got "${str}"`); + } + } + else + { + if (match) + { + console.log([str]); + throw new Error(`The output should not be "${str}"`); + } + } + } + }, + }); + callback(_console); +} + +expectOutput('stdout', '123\n', (console) => console.log('123')); +expectOutput('stdout', '1234\n', (console) => console.log('123'), false); + +expectOutput('stdout', /^\033c$/, (console) => console.clear()); + +expectOutput('stdout', /^Trace\n/, (console) => console.trace()); +expectOutput('stdout', /^Trace: \x1b\[90mundefined\x1b\[39m\n/, (console) => console.trace(undefined)); +expectOutput('stdout', /^Trace: \x1b\[33m123\x1b\[39m\n/, (console) => console.trace(123)); From c4dc2bd4896daab07b9425f74a7922cb26e36985 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 1 Mar 2024 16:20:32 -0500 Subject: [PATCH 0339/1086] hash not implemented entry not required --- src/modules/pythonmonkey/pythonmonkey.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/pythonmonkey/pythonmonkey.cc b/src/modules/pythonmonkey/pythonmonkey.cc index 165246e1..239a6a4b 100644 --- a/src/modules/pythonmonkey/pythonmonkey.cc +++ b/src/modules/pythonmonkey/pythonmonkey.cc @@ -96,7 +96,6 @@ PyTypeObject JSObjectProxyType = { .tp_as_number = &JSObjectProxy_number_methods, .tp_as_sequence = &JSObjectProxy_sequence_methods, .tp_as_mapping = &JSObjectProxy_mapping_methods, - .tp_hash = PyObject_HashNotImplemented, .tp_getattro = (getattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_get, .tp_setattro = (setattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_assign, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DICT_SUBCLASS | Py_TPFLAGS_HAVE_GC, From 40bdbb35e6b2a723f79bb6310391f3f6bf2d5857 Mon Sep 17 00:00:00 2001 From: Philippe Laporte Date: Fri, 1 Mar 2024 16:20:39 -0500 Subject: [PATCH 0340/1086] test fix --- tests/python/test_list_array.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_list_array.py b/tests/python/test_list_array.py index 476c3adf..20f80c87 100644 --- a/tests/python/test_list_array.py +++ b/tests/python/test_list_array.py @@ -7,7 +7,7 @@ def test_eval_array_is_list(): # extra nice but not necessary def test_eval_array_is_list_type_string(): pythonListTypeString = str(type(pm.eval('[]'))) - assert pythonListTypeString == "" + assert pythonListTypeString == "" def test_eval_list_is_array(): items = [1, 2, 3] From 5c60dfe5a5317303e5e41dd27ab8c4d045f8d332 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Mar 2024 22:03:29 +0000 Subject: [PATCH 0341/1086] test(console): add tests for newly added console methods --- tests/js/console-methods.simple | 34 +++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/tests/js/console-methods.simple b/tests/js/console-methods.simple index f68db2db..08c23efc 100644 --- a/tests/js/console-methods.simple +++ b/tests/js/console-methods.simple @@ -19,27 +19,21 @@ const { Console } = require('console'); function expectOutput (type, expected, callback, expectMatch = true) { const _console = new Console({ - stdout: { write: () => undefined }, // noop - stderr: { write: () => undefined }, // noop + stdout: { write() { throw new Error('should not print to stdout'); } }, + stderr: { write() { throw new Error('should not print to stderr'); } }, [type]: { // overrides one of the above write(str) { const match = str.match(expected); - if (expectMatch) + if (expectMatch && !match) { - if (!match) - { - console.log([str]); - throw new Error(`Expected "${expected}" but got "${str}"`); - } + console.log([str]); + throw new Error(`Expected "${expected}" but got "${str}"`); } - else + else if (!expectMatch && match) { - if (match) - { - console.log([str]); - throw new Error(`The output should not be "${str}"`); - } + console.log([str]); + throw new Error(`The output should not be "${str}"`); } } }, @@ -52,6 +46,18 @@ expectOutput('stdout', '1234\n', (console) => console.log('123'), false); expectOutput('stdout', /^\033c$/, (console) => console.clear()); +// console.assert() +// +// Nothing should be printed if the condition evals to true +expectOutput('stdout', '', (console) => console.assert(true, 'abc')); +expectOutput('stderr', '', (console) => console.assert(1 > 0, 'abc')); +// Print 'Assertion failed' if false +expectOutput('stderr', /^Assertion failed$/m, (console) => console.assert(false)); +expectOutput('stderr', /^Assertion failed: abc$/m, (console) => console.assert(false, 'abc')); +expectOutput('stderr', /^Assertion failed: \[ \x1b\[33m1\x1b\[39m, \x1b\[33m2\x1b\[39m \]$/m, (console) => console.assert(false, [1, 2])); +expectOutput('stderr', /^Assertion failed: abc undefined$/m, (console) => console.assert(false, 'abc', undefined)); + +// console.trace() expectOutput('stdout', /^Trace\n/, (console) => console.trace()); expectOutput('stdout', /^Trace: \x1b\[90mundefined\x1b\[39m\n/, (console) => console.trace(undefined)); expectOutput('stdout', /^Trace: \x1b\[33m123\x1b\[39m\n/, (console) => console.trace(123)); From 496cf688e2ad4ac932d1424d7ee67fd83ce06ff3 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Mar 2024 22:37:36 +0000 Subject: [PATCH 0342/1086] test(console): add tests for newly added console methods --- tests/js/console-methods.simple | 61 +++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/tests/js/console-methods.simple b/tests/js/console-methods.simple index 08c23efc..7f617698 100644 --- a/tests/js/console-methods.simple +++ b/tests/js/console-methods.simple @@ -10,34 +10,45 @@ const { Console } = require('console'); +let _temp = []; + /** * @param {'stdout' | 'stderr'} type * @param {string | RegExp} expected * @param {(console: Console) => void} callback - * @param {boolean} expectMatch + * @param {Console} _console reuse previous console object */ -function expectOutput (type, expected, callback, expectMatch = true) +function expectOutput (type, expected, callback, expectMatch = true, _console = undefined) { - const _console = new Console({ - stdout: { write() { throw new Error('should not print to stdout'); } }, - stderr: { write() { throw new Error('should not print to stderr'); } }, - [type]: { // overrides one of the above - write(str) - { - const match = str.match(expected); - if (expectMatch && !match) - { - console.log([str]); - throw new Error(`Expected "${expected}" but got "${str}"`); - } - else if (!expectMatch && match) + _temp = [type, expected]; // update the match string even if a previous console object is reused + if (!_console) + { + const opts = {}; + ['stdout', 'stderr'].forEach(selfType => ( + opts[selfType] = { + write(str) { - console.log([str]); - throw new Error(`The output should not be "${str}"`); + [type, expected] = _temp; + if (type !== selfType) + throw new Error(`should not print to ${selfType}`); + + const match = str.match(expected); + if (expectMatch && !match) + { + console.log([str]); + throw new Error(`Expected "${expected}" but got "${str}"`); + } + else if (!expectMatch && match) + { + console.log([str]); + throw new Error(`The output should not be "${str}"`); + } } } - }, - }); + )); + _console = new Console(opts); + } + callback(_console); } @@ -61,3 +72,15 @@ expectOutput('stderr', /^Assertion failed: abc undefined$/m, (console) => consol expectOutput('stdout', /^Trace\n/, (console) => console.trace()); expectOutput('stdout', /^Trace: \x1b\[90mundefined\x1b\[39m\n/, (console) => console.trace(undefined)); expectOutput('stdout', /^Trace: \x1b\[33m123\x1b\[39m\n/, (console) => console.trace(123)); + +// console.count() +let keptConsole; +expectOutput('stdout', '', (console) => (keptConsole = console)); +expectOutput('stderr', 'Counter for \'default\' does not exist.', (console) => console.countReset(), true, keptConsole); +expectOutput('stderr', 'Counter for \'abc\' does not exist.', (console) => console.countReset('abc'), true, keptConsole); +expectOutput('stdout', 'default: 1', (console) => console.count(), true, keptConsole); +expectOutput('stdout', 'default: 2', (console) => console.count(), true, keptConsole); +expectOutput('stdout', 'default: 3', (console) => console.count(), true, keptConsole); +expectOutput('stdout', 'abc: 1', (console) => console.count('abc'), true, keptConsole); +expectOutput('stdout', 'NaN: 1', (console) => console.count(NaN), true, keptConsole); + From 3cf8cc63087617d506471dc002cad528aa539be2 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Mar 2024 22:41:07 +0000 Subject: [PATCH 0343/1086] test(console): add tests for newly added console methods --- tests/js/console-methods.simple | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/js/console-methods.simple b/tests/js/console-methods.simple index 7f617698..da721c62 100644 --- a/tests/js/console-methods.simple +++ b/tests/js/console-methods.simple @@ -16,11 +16,12 @@ let _temp = []; * @param {'stdout' | 'stderr'} type * @param {string | RegExp} expected * @param {(console: Console) => void} callback + * @param {boolean} expectMatch * @param {Console} _console reuse previous console object */ function expectOutput (type, expected, callback, expectMatch = true, _console = undefined) { - _temp = [type, expected]; // update the match string even if a previous console object is reused + _temp = [type, expected, expectMatch]; // update the match string even if a previous console object is reused if (!_console) { const opts = {}; @@ -28,7 +29,7 @@ function expectOutput (type, expected, callback, expectMatch = true, _console = opts[selfType] = { write(str) { - [type, expected] = _temp; + [type, expected, expectMatch] = _temp; if (type !== selfType) throw new Error(`should not print to ${selfType}`); @@ -78,9 +79,13 @@ let keptConsole; expectOutput('stdout', '', (console) => (keptConsole = console)); expectOutput('stderr', 'Counter for \'default\' does not exist.', (console) => console.countReset(), true, keptConsole); expectOutput('stderr', 'Counter for \'abc\' does not exist.', (console) => console.countReset('abc'), true, keptConsole); + expectOutput('stdout', 'default: 1', (console) => console.count(), true, keptConsole); expectOutput('stdout', 'default: 2', (console) => console.count(), true, keptConsole); expectOutput('stdout', 'default: 3', (console) => console.count(), true, keptConsole); +expectOutput('stderr', '', (console) => console.countReset(), false, keptConsole); // counter resets to 1 +expectOutput('stdout', 'default: 1', (console) => console.count(), true, keptConsole); + expectOutput('stdout', 'abc: 1', (console) => console.count('abc'), true, keptConsole); expectOutput('stdout', 'NaN: 1', (console) => console.count(NaN), true, keptConsole); From 1616fa4ca51e9aa76215e2f3a74d4bb9716797c8 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Mar 2024 22:48:21 +0000 Subject: [PATCH 0344/1086] test(console): add tests for console grouping methods --- tests/js/console-methods.simple | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/js/console-methods.simple b/tests/js/console-methods.simple index da721c62..7ceb9fe7 100644 --- a/tests/js/console-methods.simple +++ b/tests/js/console-methods.simple @@ -89,3 +89,11 @@ expectOutput('stdout', 'default: 1', (console) => console.count(), true, keptCon expectOutput('stdout', 'abc: 1', (console) => console.count('abc'), true, keptConsole); expectOutput('stdout', 'NaN: 1', (console) => console.count(NaN), true, keptConsole); +// console.group() +expectOutput('stdout', '', (console) => (keptConsole = console)); +expectOutput('stdout', /^abc$/m, (console) => console.group('abc'), true, keptConsole); +expectOutput('stdout', /^│ {3}d$/m, (console) => console.log('d'), true, keptConsole); // grouping level 1 +expectOutput('stdout', /^│ {3}e$/m, (console) => console.group('e'), true, keptConsole); +expectOutput('stdout', /^│ {3}│ {3}f$/m, (console) => console.log('f'), true, keptConsole); // level 2 +expectOutput('stdout', /^$/, (console) => console.groupEnd(), true, keptConsole); +expectOutput('stdout', /^│ {3}g$/m, (console) => console.log('g'), true, keptConsole); // back to level 1 From 797c4c244f5403ec14b3644469dec99d92a373c0 Mon Sep 17 00:00:00 2001 From: Tom Tang Date: Fri, 1 Mar 2024 22:55:46 +0000 Subject: [PATCH 0345/1086] test(console): add tests for console timing methods --- tests/js/console-methods.simple | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/js/console-methods.simple b/tests/js/console-methods.simple index 7ceb9fe7..4c52923e 100644 --- a/tests/js/console-methods.simple +++ b/tests/js/console-methods.simple @@ -97,3 +97,19 @@ expectOutput('stdout', /^│ {3}e$/m, (console) => console.group('e'), true, kep expectOutput('stdout', /^│ {3}│ {3}f$/m, (console) => console.log('f'), true, keptConsole); // level 2 expectOutput('stdout', /^$/, (console) => console.groupEnd(), true, keptConsole); expectOutput('stdout', /^│ {3}g$/m, (console) => console.log('g'), true, keptConsole); // back to level 1 + +// console.time() +expectOutput('stdout', '', (console) => (keptConsole = console)); +expectOutput('stderr', /^No such label 'default' for console\.timeLog/m, (console) => console.timeLog(), true, keptConsole); +expectOutput('stderr', /^No such label 'default' for console\.timeEnd/m, (console) => console.timeEnd(), true, keptConsole); +expectOutput('stdout', '', (console) => console.time(), true, keptConsole); +expectOutput('stderr', /^Label 'default' already exists for console\.time/m, (console) => console.time(), true, keptConsole); +expectOutput('stdout', /^default: \d+ms$/m, (console) => console.timeLog(), true, keptConsole); +expectOutput('stdout', /^default: \d+ms$/m, (console) => console.timeEnd(), true, keptConsole); +expectOutput('stderr', /^No such label 'default' for console\.timeLog/m, (console) => console.timeLog(), true, keptConsole); // timer cleared +expectOutput('stderr', /^No such label 'default' for console\.timeEnd/m, (console) => console.timeEnd(), true, keptConsole); + +expectOutput('stderr', /^No such label 'abc' for console\.timeLog/m, (console) => console.timeLog('abc'), true, keptConsole); +expectOutput('stdout', '', (console) => console.time('abc'), true, keptConsole); +expectOutput('stdout', /^abc: \d+ms$/m, (console) => console.timeLog('abc'), true, keptConsole); +expectOutput('stdout', /^abc: \d+ms$/m, (console) => console.timeEnd('abc'), true, keptConsole); From 9fd9cd80acfd4ec85fcf0317fa648327e4753f12 Mon Sep 17 00:00:00 2001 From: philippedistributive Date: Mon, 4 Mar 2024 15:04:24 -0500 Subject: [PATCH 0346/1086] dcp client files --- dcp-client-bundle.js | 6358 +++++++++++++++++ dcp-support.py | 31 + fs-basic.py | 46 + main.py | 110 + .../XMLHttpRequest-internal.py | 37 + .../builtin_modules/XMLHttpRequest.js | 32 + 6 files changed, 6614 insertions(+) create mode 100644 dcp-client-bundle.js create mode 100644 dcp-support.py create mode 100644 fs-basic.py create mode 100644 main.py diff --git a/dcp-client-bundle.js b/dcp-client-bundle.js new file mode 100644 index 00000000..72638828 --- /dev/null +++ b/dcp-client-bundle.js @@ -0,0 +1,6358 @@ +(function dcpClientBundleIIFE() { + let currentScript = typeof document !== 'undefined' && document.currentScript; + let bundleExports = false; +/* + * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). + * This devtool is neither made for production nor for readable output files. + * It uses "eval()" calls to create a separate source file in the browser devtools. + * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) + * or disable the default devtool with "devtool: false". + * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). + */ +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./node_modules/@bitauth/libauth/build/module/index.js": +/*!*************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/index.js ***! + \*************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _lib_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/lib */ \"./node_modules/@bitauth/libauth/build/module/lib/lib.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _lib_lib__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== \"default\") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _lib_lib__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/index.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/address/address.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/address/address.js ***! + \***************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AddressType: () => (/* reexport safe */ _locking_bytecode__WEBPACK_IMPORTED_MODULE_3__.AddressType),\n/* harmony export */ Base58AddressError: () => (/* reexport safe */ _base58_address__WEBPACK_IMPORTED_MODULE_0__.Base58AddressError),\n/* harmony export */ Base58AddressFormatVersion: () => (/* reexport safe */ _base58_address__WEBPACK_IMPORTED_MODULE_0__.Base58AddressFormatVersion),\n/* harmony export */ Bech32DecodingError: () => (/* reexport safe */ _bech32__WEBPACK_IMPORTED_MODULE_1__.Bech32DecodingError),\n/* harmony export */ BitRegroupingError: () => (/* reexport safe */ _bech32__WEBPACK_IMPORTED_MODULE_1__.BitRegroupingError),\n/* harmony export */ CashAddressCorrectionError: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.CashAddressCorrectionError),\n/* harmony export */ CashAddressDecodingError: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.CashAddressDecodingError),\n/* harmony export */ CashAddressEncodingError: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.CashAddressEncodingError),\n/* harmony export */ CashAddressNetworkPrefix: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.CashAddressNetworkPrefix),\n/* harmony export */ CashAddressType: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.CashAddressType),\n/* harmony export */ CashAddressVersionByte: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.CashAddressVersionByte),\n/* harmony export */ CashAddressVersionByteDecodingError: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.CashAddressVersionByteDecodingError),\n/* harmony export */ LockingBytecodeEncodingError: () => (/* reexport safe */ _locking_bytecode__WEBPACK_IMPORTED_MODULE_3__.LockingBytecodeEncodingError),\n/* harmony export */ addressContentsToLockingBytecode: () => (/* reexport safe */ _locking_bytecode__WEBPACK_IMPORTED_MODULE_3__.addressContentsToLockingBytecode),\n/* harmony export */ attemptCashAddressFormatErrorCorrection: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.attemptCashAddressFormatErrorCorrection),\n/* harmony export */ base58AddressToLockingBytecode: () => (/* reexport safe */ _locking_bytecode__WEBPACK_IMPORTED_MODULE_3__.base58AddressToLockingBytecode),\n/* harmony export */ bech32CharacterSet: () => (/* reexport safe */ _bech32__WEBPACK_IMPORTED_MODULE_1__.bech32CharacterSet),\n/* harmony export */ bech32CharacterSetIndex: () => (/* reexport safe */ _bech32__WEBPACK_IMPORTED_MODULE_1__.bech32CharacterSetIndex),\n/* harmony export */ bech32PaddedToBin: () => (/* reexport safe */ _bech32__WEBPACK_IMPORTED_MODULE_1__.bech32PaddedToBin),\n/* harmony export */ binToBech32Padded: () => (/* reexport safe */ _bech32__WEBPACK_IMPORTED_MODULE_1__.binToBech32Padded),\n/* harmony export */ cashAddressBitToSize: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.cashAddressBitToSize),\n/* harmony export */ cashAddressChecksumToUint5Array: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.cashAddressChecksumToUint5Array),\n/* harmony export */ cashAddressPolynomialModulo: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.cashAddressPolynomialModulo),\n/* harmony export */ cashAddressPolynomialToCashAddress: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.cashAddressPolynomialToCashAddress),\n/* harmony export */ cashAddressSizeToBit: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.cashAddressSizeToBit),\n/* harmony export */ cashAddressToLockingBytecode: () => (/* reexport safe */ _locking_bytecode__WEBPACK_IMPORTED_MODULE_3__.cashAddressToLockingBytecode),\n/* harmony export */ decodeBase58Address: () => (/* reexport safe */ _base58_address__WEBPACK_IMPORTED_MODULE_0__.decodeBase58Address),\n/* harmony export */ decodeBase58AddressFormat: () => (/* reexport safe */ _base58_address__WEBPACK_IMPORTED_MODULE_0__.decodeBase58AddressFormat),\n/* harmony export */ decodeBech32: () => (/* reexport safe */ _bech32__WEBPACK_IMPORTED_MODULE_1__.decodeBech32),\n/* harmony export */ decodeCashAddress: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.decodeCashAddress),\n/* harmony export */ decodeCashAddressFormat: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.decodeCashAddressFormat),\n/* harmony export */ decodeCashAddressFormatWithoutPrefix: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.decodeCashAddressFormatWithoutPrefix),\n/* harmony export */ decodeCashAddressVersionByte: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.decodeCashAddressVersionByte),\n/* harmony export */ encodeBase58Address: () => (/* reexport safe */ _base58_address__WEBPACK_IMPORTED_MODULE_0__.encodeBase58Address),\n/* harmony export */ encodeBase58AddressFormat: () => (/* reexport safe */ _base58_address__WEBPACK_IMPORTED_MODULE_0__.encodeBase58AddressFormat),\n/* harmony export */ encodeBech32: () => (/* reexport safe */ _bech32__WEBPACK_IMPORTED_MODULE_1__.encodeBech32),\n/* harmony export */ encodeCashAddress: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.encodeCashAddress),\n/* harmony export */ encodeCashAddressFormat: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.encodeCashAddressFormat),\n/* harmony export */ encodeCashAddressVersionByte: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.encodeCashAddressVersionByte),\n/* harmony export */ isBech32CharacterSet: () => (/* reexport safe */ _bech32__WEBPACK_IMPORTED_MODULE_1__.isBech32CharacterSet),\n/* harmony export */ lockingBytecodeToAddressContents: () => (/* reexport safe */ _locking_bytecode__WEBPACK_IMPORTED_MODULE_3__.lockingBytecodeToAddressContents),\n/* harmony export */ lockingBytecodeToBase58Address: () => (/* reexport safe */ _locking_bytecode__WEBPACK_IMPORTED_MODULE_3__.lockingBytecodeToBase58Address),\n/* harmony export */ lockingBytecodeToCashAddress: () => (/* reexport safe */ _locking_bytecode__WEBPACK_IMPORTED_MODULE_3__.lockingBytecodeToCashAddress),\n/* harmony export */ maskCashAddressPrefix: () => (/* reexport safe */ _cash_address__WEBPACK_IMPORTED_MODULE_2__.maskCashAddressPrefix),\n/* harmony export */ regroupBits: () => (/* reexport safe */ _bech32__WEBPACK_IMPORTED_MODULE_1__.regroupBits)\n/* harmony export */ });\n/* harmony import */ var _base58_address__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base58-address */ \"./node_modules/@bitauth/libauth/build/module/lib/address/base58-address.js\");\n/* harmony import */ var _bech32__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bech32 */ \"./node_modules/@bitauth/libauth/build/module/lib/address/bech32.js\");\n/* harmony import */ var _cash_address__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cash-address */ \"./node_modules/@bitauth/libauth/build/module/lib/address/cash-address.js\");\n/* harmony import */ var _locking_bytecode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./locking-bytecode */ \"./node_modules/@bitauth/libauth/build/module/lib/address/locking-bytecode.js\");\n\n\n\n\n//# sourceMappingURL=address.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/address/address.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/address/base58-address.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/address/base58-address.js ***! + \**********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Base58AddressError: () => (/* binding */ Base58AddressError),\n/* harmony export */ Base58AddressFormatVersion: () => (/* binding */ Base58AddressFormatVersion),\n/* harmony export */ decodeBase58Address: () => (/* binding */ decodeBase58Address),\n/* harmony export */ decodeBase58AddressFormat: () => (/* binding */ decodeBase58AddressFormat),\n/* harmony export */ encodeBase58Address: () => (/* binding */ encodeBase58Address),\n/* harmony export */ encodeBase58AddressFormat: () => (/* binding */ encodeBase58AddressFormat)\n/* harmony export */ });\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/base-convert.js\");\n\n/**\n * Base58 version byte values for common Base58Address format versions.\n */\nvar Base58AddressFormatVersion;\n(function (Base58AddressFormatVersion) {\n /**\n * A Pay to Public Key Hash (P2PKH) address – base58 encodes to a leading `1`.\n *\n * Hex: `0x00`\n */\n Base58AddressFormatVersion[Base58AddressFormatVersion[\"p2pkh\"] = 0] = \"p2pkh\";\n /**\n * A Pay to Script Hash (P2SH) address – base58 encodes to a leading `3`.\n *\n * Hex: `0x05`\n */\n Base58AddressFormatVersion[Base58AddressFormatVersion[\"p2sh\"] = 5] = \"p2sh\";\n /**\n * A private key in Wallet Import Format. For private keys used with\n * uncompressed public keys, the payload is 32 bytes and causes the version\n * to be encoded as a `5`. For private keys used with compressed public keys,\n * a final `0x01` byte is appended to the private key, increasing the payload\n * to 33 bytes, and causing the version to be encoded as a `K` or `L`.\n *\n * Hex: `0x80`\n */\n Base58AddressFormatVersion[Base58AddressFormatVersion[\"wif\"] = 128] = \"wif\";\n /**\n * A testnet Pay to Public Key Hash (P2PKH) address – base58 encodes to a\n * leading `m` or `n`.\n *\n * Hex: `0x6f`\n */\n Base58AddressFormatVersion[Base58AddressFormatVersion[\"p2pkhTestnet\"] = 111] = \"p2pkhTestnet\";\n /**\n * A testnet Pay to Script Hash (P2SH) address – base58 encodes to a leading\n * `2`.\n *\n * Hex: `0xc4`\n */\n Base58AddressFormatVersion[Base58AddressFormatVersion[\"p2shTestnet\"] = 196] = \"p2shTestnet\";\n /**\n * A private key in Wallet Import Format intended for testnet use. For private\n * keys used with uncompressed public keys, the payload is 32 bytes and causes\n * the version to be encoded as a `9`. For private keys used with compressed\n * public keys, a final `0x01` byte is appended to the private key, increasing\n * the payload to 33 bytes, and causing the version to be encoded as a `c`.\n *\n * Hex: `0xef`\n */\n Base58AddressFormatVersion[Base58AddressFormatVersion[\"wifTestnet\"] = 239] = \"wifTestnet\";\n /**\n * A Pay to Public Key Hash (P2PKH) address intended for use on the Bitcoin\n * Cash network – base58 encodes to a leading `C`. This version was\n * temporarily used by the Copay project before the CashAddress format was\n * standardized.\n *\n * Hex: `0x1c`\n */\n Base58AddressFormatVersion[Base58AddressFormatVersion[\"p2pkhCopayBCH\"] = 28] = \"p2pkhCopayBCH\";\n /**\n * A Pay to Script Hash (P2SH) address intended for use on the Bitcoin\n * Cash network – base58 encodes to a leading `H`. This version was\n * temporarily used by the Copay project before the CashAddress format was\n * standardized.\n *\n * Hex: `0x28`\n */\n Base58AddressFormatVersion[Base58AddressFormatVersion[\"p2shCopayBCH\"] = 40] = \"p2shCopayBCH\";\n})(Base58AddressFormatVersion || (Base58AddressFormatVersion = {}));\n/**\n * Encode a payload using the Base58Address format, the original address format\n * used by the Satoshi implementation.\n *\n * Note, this method does not enforce error handling via the type system. The\n * returned string will not be a valid Base58Address if `hash` is not exactly 20\n * bytes. If needed, validate the length of `hash` before calling this method.\n *\n * @remarks\n * A Base58Address includes a 1-byte prefix to indicate the address version, a\n * variable-length payload, and a 4-byte checksum:\n *\n * `[version: 1 byte] [payload: variable length] [checksum: 4 bytes]`\n *\n * The checksum is the first 4 bytes of the double-SHA256 hash of the version\n * byte followed by the payload.\n *\n * @param sha256 - an implementation of sha256 (a universal implementation is\n * available via `instantiateSha256`)\n * @param version - the address version byte (see `Base58Version`)\n * @param payload - the Uint8Array payload to encode\n */\nconst encodeBase58AddressFormat = (sha256, version, payload) => {\n const checksumBytes = 4;\n const content = Uint8Array.from([version, ...payload]);\n const checksum = sha256.hash(sha256.hash(content)).slice(0, checksumBytes);\n const bin = (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.flattenBinArray)([content, checksum]);\n return (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.binToBase58)(bin);\n};\n/**\n * Encode a hash as a Base58Address.\n *\n * Note, this method does not enforce error handling via the type system. The\n * returned string will not be a valid Base58Address if `hash` is not exactly 20\n * bytes. If needed, validate the length of `hash` before calling this method.\n *\n * For other standards which use the Base58Address format but have other version\n * or length requirements, use `encodeCashAddressFormat`.\n *\n * @param sha256 - an implementation of sha256 (a universal implementation is\n * available via `instantiateSha256`)\n * @param type - the type of address to encode: `p2pkh`, `p2sh`,\n * `p2pkh-testnet`, or `p2sh-testnet`\n * @param hash - the 20-byte hash to encode\n * (`RIPEMD160(SHA256(public key or bytecode))`)\n */\nconst encodeBase58Address = (sha256, type, payload) => encodeBase58AddressFormat(sha256, {\n p2pkh: Base58AddressFormatVersion.p2pkh,\n 'p2pkh-copay-bch': Base58AddressFormatVersion.p2pkhCopayBCH,\n 'p2pkh-testnet': Base58AddressFormatVersion.p2pkhTestnet,\n p2sh: Base58AddressFormatVersion.p2sh,\n 'p2sh-copay-bch': Base58AddressFormatVersion.p2shCopayBCH,\n 'p2sh-testnet': Base58AddressFormatVersion.p2shTestnet,\n}[type], payload);\nvar Base58AddressError;\n(function (Base58AddressError) {\n Base58AddressError[\"unknownCharacter\"] = \"Base58Address error: address may only contain valid base58 characters.\";\n Base58AddressError[\"tooShort\"] = \"Base58Address error: address is too short to be valid.\";\n Base58AddressError[\"invalidChecksum\"] = \"Base58Address error: address has an invalid checksum.\";\n Base58AddressError[\"unknownAddressVersion\"] = \"Base58Address error: address uses an unknown address version.\";\n Base58AddressError[\"incorrectLength\"] = \"Base58Address error: the encoded payload is not the correct length (20 bytes).\";\n})(Base58AddressError || (Base58AddressError = {}));\n/**\n * Attempt to decode a Base58Address-formatted string. This is more lenient than\n * `decodeCashAddress`, which also validates the address version.\n *\n * Returns the contents of the address or an error message as a string.\n *\n * @param sha256 - an implementation of sha256 (a universal implementation is\n * available via `instantiateSha256`)\n * @param address - the string to decode as a base58 address\n */\nconst decodeBase58AddressFormat = (sha256, address) => {\n const checksumBytes = 4;\n const bin = (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.base58ToBin)(address);\n if (bin === _format_format__WEBPACK_IMPORTED_MODULE_1__.BaseConversionError.unknownCharacter) {\n return Base58AddressError.unknownCharacter;\n }\n const minimumBase58AddressLength = 5;\n if (bin.length < minimumBase58AddressLength) {\n return Base58AddressError.tooShort;\n }\n const content = bin.slice(0, -checksumBytes);\n const checksum = bin.slice(-checksumBytes);\n const expectedChecksum = sha256\n .hash(sha256.hash(content))\n .slice(0, checksumBytes);\n if (!checksum.every((value, i) => value === expectedChecksum[i])) {\n return Base58AddressError.invalidChecksum;\n }\n return {\n payload: content.slice(1),\n version: content[0],\n };\n};\n/**\n * Decode and validate a Base58Address, strictly checking the version and\n * payload length.\n *\n * For other address-like standards which closely follow the Base58Address\n * format (but have alternative version byte requirements), use\n * `decodeBase58AddressFormat`.\n *\n * @remarks\n * Because the Wallet Import Format (WIF) private key serialization format uses\n * the Base58Address format, some libraries allow WIF key decoding via the same\n * method as base58 address decoding. This method strictly accepts only\n * Base58Address types, but WIF keys can be decoded with `decodePrivateKeyWif`.\n *\n * @param sha256 - an implementation of sha256 (a universal implementation is\n * available via `instantiateSha256`)\n * @param address - the string to decode as a base58 address\n */\nconst decodeBase58Address = (sha256, address) => {\n const decoded = decodeBase58AddressFormat(sha256, address);\n if (typeof decoded === 'string')\n return decoded;\n if (![\n Base58AddressFormatVersion.p2pkh,\n Base58AddressFormatVersion.p2sh,\n Base58AddressFormatVersion.p2pkhTestnet,\n Base58AddressFormatVersion.p2shTestnet,\n Base58AddressFormatVersion.p2pkhCopayBCH,\n Base58AddressFormatVersion.p2shCopayBCH,\n ].includes(decoded.version)) {\n return Base58AddressError.unknownAddressVersion;\n }\n const hash160Length = 20;\n if (decoded.payload.length !== hash160Length) {\n return Base58AddressError.incorrectLength;\n }\n return decoded;\n};\n//# sourceMappingURL=base58-address.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/address/base58-address.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/address/bech32.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/address/bech32.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Bech32DecodingError: () => (/* binding */ Bech32DecodingError),\n/* harmony export */ BitRegroupingError: () => (/* binding */ BitRegroupingError),\n/* harmony export */ bech32CharacterSet: () => (/* binding */ bech32CharacterSet),\n/* harmony export */ bech32CharacterSetIndex: () => (/* binding */ bech32CharacterSetIndex),\n/* harmony export */ bech32PaddedToBin: () => (/* binding */ bech32PaddedToBin),\n/* harmony export */ binToBech32Padded: () => (/* binding */ binToBech32Padded),\n/* harmony export */ decodeBech32: () => (/* binding */ decodeBech32),\n/* harmony export */ encodeBech32: () => (/* binding */ encodeBech32),\n/* harmony export */ isBech32CharacterSet: () => (/* binding */ isBech32CharacterSet),\n/* harmony export */ regroupBits: () => (/* binding */ regroupBits)\n/* harmony export */ });\n/**\n * The list of 32 symbols used in Bech32 encoding.\n */\n// cspell: disable-next-line\nconst bech32CharacterSet = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l';\n/**\n * An object mapping each of the 32 symbols used in Bech32 encoding to their respective index in the character set.\n */\n// prettier-ignore\nconst bech32CharacterSetIndex = { q: 0, p: 1, z: 2, r: 3, y: 4, '9': 5, x: 6, '8': 7, g: 8, f: 9, '2': 10, t: 11, v: 12, d: 13, w: 14, '0': 15, s: 16, '3': 17, j: 18, n: 19, '5': 20, '4': 21, k: 22, h: 23, c: 24, e: 25, '6': 26, m: 27, u: 28, a: 29, '7': 30, l: 31 }; // eslint-disable-line sort-keys\nvar BitRegroupingError;\n(function (BitRegroupingError) {\n BitRegroupingError[\"integerOutOfRange\"] = \"An integer provided in the source array is out of the range of the specified source word length.\";\n BitRegroupingError[\"hasDisallowedPadding\"] = \"Encountered padding when padding was disallowed.\";\n BitRegroupingError[\"requiresDisallowedPadding\"] = \"Encoding requires padding while padding is disallowed.\";\n})(BitRegroupingError || (BitRegroupingError = {}));\n/* eslint-disable functional/no-let, no-bitwise, functional/no-expression-statement, functional/no-conditional-statement, complexity */\n/**\n * Given an array of integers, regroup bits from `sourceWordLength` to\n * `resultWordLength`, returning a new array of integers between 0 and\n * toWordLength^2.\n *\n * Note, if `bin` is within the range of `sourceWordLength` and `padding` is\n * `true`, this method will never error.\n *\n * A.K.A. `convertbits`\n *\n * @param bin - an array of numbers representing the bits to regroup. Each item\n * must be a number within the range of `sourceWordLength`\n * @param sourceWordLength - the bit-length of each number in `bin`, e.g. to\n * regroup bits from a `Uint8Array`, use `8` (must be a positive integer)\n * @param resultWordLength - the bit-length of each number in the desired result\n * array, e.g. to regroup bits into 4-bit numbers, use `4` (must be a positive\n * integer)\n * @param allowPadding - whether to allow the use of padding for `bin` values\n * where the provided number of bits cannot be directly mapped to an equivalent\n * result array (remaining bits are filled with `0`), defaults to `true`\n * @privateRemarks\n * Derived from: https://github.com/sipa/bech32\n */\nconst regroupBits = ({ bin, sourceWordLength, resultWordLength, allowPadding = true, }) => {\n let accumulator = 0;\n let bits = 0;\n const result = [];\n const maxResultInt = (1 << resultWordLength) - 1;\n // eslint-disable-next-line functional/no-loop-statement, @typescript-eslint/prefer-for-of, no-plusplus\n for (let p = 0; p < bin.length; ++p) {\n const value = bin[p];\n if (value < 0 || value >> sourceWordLength !== 0) {\n return BitRegroupingError.integerOutOfRange;\n }\n accumulator = (accumulator << sourceWordLength) | value;\n bits += sourceWordLength;\n // eslint-disable-next-line functional/no-loop-statement\n while (bits >= resultWordLength) {\n bits -= resultWordLength;\n // eslint-disable-next-line functional/immutable-data\n result.push((accumulator >> bits) & maxResultInt);\n }\n }\n if (allowPadding) {\n if (bits > 0) {\n // eslint-disable-next-line functional/immutable-data\n result.push((accumulator << (resultWordLength - bits)) & maxResultInt);\n }\n }\n else if (bits >= sourceWordLength) {\n return BitRegroupingError.hasDisallowedPadding;\n }\n else if (((accumulator << (resultWordLength - bits)) & maxResultInt) > 0) {\n return BitRegroupingError.requiresDisallowedPadding;\n }\n return result;\n};\n/* eslint-enable functional/no-let, no-bitwise, functional/no-expression-statement, functional/no-conditional-statement, complexity */\n/**\n * Encode an array of numbers as a base32 string using the Bech32 character set.\n *\n * Note, this method always completes. For a valid result, all items in\n * `base32IntegerArray` must be between `0` and `32`.\n *\n * @param base32IntegerArray - the array of 5-bit integers to encode\n */\nconst encodeBech32 = (base32IntegerArray) => {\n // eslint-disable-next-line functional/no-let\n let result = '';\n // eslint-disable-next-line @typescript-eslint/prefer-for-of, functional/no-let, functional/no-loop-statement, no-plusplus\n for (let i = 0; i < base32IntegerArray.length; i++) {\n // eslint-disable-next-line functional/no-expression-statement\n result += bech32CharacterSet[base32IntegerArray[i]];\n }\n return result;\n};\n/**\n * Decode a Bech32-encoded string into an array of 5-bit integers.\n *\n * Note, this method always completes. If `validBech32` is not valid bech32,\n * an incorrect result will be returned. If `validBech32` is potentially\n * malformed, check it with `isBech32` before calling this method.\n *\n * @param validBech32 - the bech32-encoded string to decode\n */\nconst decodeBech32 = (validBech32) => {\n const result = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of, functional/no-let, functional/no-loop-statement, no-plusplus\n for (let i = 0; i < validBech32.length; i++) {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n result.push(bech32CharacterSetIndex[validBech32[i]]);\n }\n return result;\n};\nconst nonBech32Characters = new RegExp(`[^${bech32CharacterSet}]`, 'u');\nconst base32WordLength = 5;\nconst base256WordLength = 8;\n/**\n * Validate that a string uses only characters from the bech32 character set.\n *\n * @param maybeBech32 - a string to test for valid Bech32 encoding\n */\nconst isBech32CharacterSet = (maybeBech32) => !nonBech32Characters.test(maybeBech32);\nvar Bech32DecodingError;\n(function (Bech32DecodingError) {\n Bech32DecodingError[\"notBech32CharacterSet\"] = \"Bech32 decoding error: input contains characters outside of the Bech32 character set.\";\n})(Bech32DecodingError || (Bech32DecodingError = {}));\n/**\n * Convert a padded bech32-encoded string (without checksum) to a Uint8Array,\n * removing the padding. If the string is not valid Bech32, or if the array of\n * 5-bit integers would require padding to be regrouped into 8-bit bytes, this\n * method returns an error message.\n *\n * This method is the reverse of `binToBech32Padded`.\n *\n * @param bech32Padded - the padded bech32-encoded string to decode\n */\nconst bech32PaddedToBin = (bech32Padded) => {\n const result = isBech32CharacterSet(bech32Padded)\n ? regroupBits({\n allowPadding: false,\n bin: decodeBech32(bech32Padded),\n resultWordLength: base256WordLength,\n sourceWordLength: base32WordLength,\n })\n : Bech32DecodingError.notBech32CharacterSet;\n return typeof result === 'string' ? result : Uint8Array.from(result);\n};\n/**\n * Convert a Uint8Array to a padded bech32-encoded string (without a checksum),\n * adding padding bits as necessary to convert all bytes to 5-bit integers.\n *\n * This method is the reverse of `bech32PaddedToBin`.\n *\n * @param bytes - the Uint8Array to bech32 encode\n */\nconst binToBech32Padded = (bytes) => encodeBech32(regroupBits({\n bin: bytes,\n resultWordLength: base32WordLength,\n sourceWordLength: base256WordLength,\n}));\n//# sourceMappingURL=bech32.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/address/bech32.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/address/cash-address.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/address/cash-address.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CashAddressCorrectionError: () => (/* binding */ CashAddressCorrectionError),\n/* harmony export */ CashAddressDecodingError: () => (/* binding */ CashAddressDecodingError),\n/* harmony export */ CashAddressEncodingError: () => (/* binding */ CashAddressEncodingError),\n/* harmony export */ CashAddressNetworkPrefix: () => (/* binding */ CashAddressNetworkPrefix),\n/* harmony export */ CashAddressType: () => (/* binding */ CashAddressType),\n/* harmony export */ CashAddressVersionByte: () => (/* binding */ CashAddressVersionByte),\n/* harmony export */ CashAddressVersionByteDecodingError: () => (/* binding */ CashAddressVersionByteDecodingError),\n/* harmony export */ attemptCashAddressFormatErrorCorrection: () => (/* binding */ attemptCashAddressFormatErrorCorrection),\n/* harmony export */ cashAddressBitToSize: () => (/* binding */ cashAddressBitToSize),\n/* harmony export */ cashAddressChecksumToUint5Array: () => (/* binding */ cashAddressChecksumToUint5Array),\n/* harmony export */ cashAddressPolynomialModulo: () => (/* binding */ cashAddressPolynomialModulo),\n/* harmony export */ cashAddressPolynomialToCashAddress: () => (/* binding */ cashAddressPolynomialToCashAddress),\n/* harmony export */ cashAddressSizeToBit: () => (/* binding */ cashAddressSizeToBit),\n/* harmony export */ decodeCashAddress: () => (/* binding */ decodeCashAddress),\n/* harmony export */ decodeCashAddressFormat: () => (/* binding */ decodeCashAddressFormat),\n/* harmony export */ decodeCashAddressFormatWithoutPrefix: () => (/* binding */ decodeCashAddressFormatWithoutPrefix),\n/* harmony export */ decodeCashAddressVersionByte: () => (/* binding */ decodeCashAddressVersionByte),\n/* harmony export */ encodeCashAddress: () => (/* binding */ encodeCashAddress),\n/* harmony export */ encodeCashAddressFormat: () => (/* binding */ encodeCashAddressFormat),\n/* harmony export */ encodeCashAddressVersionByte: () => (/* binding */ encodeCashAddressVersionByte),\n/* harmony export */ maskCashAddressPrefix: () => (/* binding */ maskCashAddressPrefix)\n/* harmony export */ });\n/* harmony import */ var _bech32__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bech32 */ \"./node_modules/@bitauth/libauth/build/module/lib/address/bech32.js\");\n\nvar CashAddressNetworkPrefix;\n(function (CashAddressNetworkPrefix) {\n CashAddressNetworkPrefix[\"mainnet\"] = \"bitcoincash\";\n CashAddressNetworkPrefix[\"testnet\"] = \"bchtest\";\n CashAddressNetworkPrefix[\"regtest\"] = \"bchreg\";\n})(CashAddressNetworkPrefix || (CashAddressNetworkPrefix = {}));\nconst cashAddressBitToSize = {\n 0: 160,\n 1: 192,\n 2: 224,\n 3: 256,\n 4: 320,\n 5: 384,\n 6: 448,\n 7: 512,\n};\nconst cashAddressSizeToBit = {\n 160: 0,\n 192: 1,\n 224: 2,\n 256: 3,\n 320: 4,\n 384: 5,\n 448: 6,\n 512: 7,\n};\n/**\n * The CashAddress specification standardizes the format of the version byte:\n * - Most significant bit: reserved, must be `0`\n * - next 4 bits: Address Type\n * - 3 least significant bits: Hash Size\n *\n * Only two Address Type values are currently standardized:\n * - 0 (`0b0000`): P2PKH\n * - 1 (`0b0001`): P2SH\n *\n * While both P2PKH and P2SH addresses always use 160 bit hashes, the\n * CashAddress specification standardizes other sizes for future use (or use by\n * other systems), see `CashAddressSizeBit`.\n *\n * With these constraints, only two version byte values are currently standard.\n */\nvar CashAddressVersionByte;\n(function (CashAddressVersionByte) {\n /**\n * Pay to Public Key Hash (P2PKH): `0b00000000`\n *\n * - Most significant bit: `0` (reserved)\n * - Address Type bits: `0000` (P2PKH)\n * - Size bits: `000` (160 bits)\n */\n CashAddressVersionByte[CashAddressVersionByte[\"P2PKH\"] = 0] = \"P2PKH\";\n /**\n * Pay to Script Hash (P2SH): `0b00001000`\n *\n * - Most significant bit: `0` (reserved)\n * - Address Type bits: `0001` (P2SH)\n * - Size bits: `000` (160 bits)\n */\n CashAddressVersionByte[CashAddressVersionByte[\"P2SH\"] = 8] = \"P2SH\";\n})(CashAddressVersionByte || (CashAddressVersionByte = {}));\n/**\n * The address types currently defined in the CashAddress specification. See\n * also: `CashAddressVersionByte`.\n */\nvar CashAddressType;\n(function (CashAddressType) {\n /**\n * Pay to Public Key Hash (P2PKH)\n */\n CashAddressType[CashAddressType[\"P2PKH\"] = 0] = \"P2PKH\";\n /**\n * Pay to Script Hash (P2SH)\n */\n CashAddressType[CashAddressType[\"P2SH\"] = 1] = \"P2SH\";\n})(CashAddressType || (CashAddressType = {}));\nconst cashAddressTypeBitShift = 3;\n/**\n * Encode a CashAddress version byte for the given address type and hash length.\n * See `CashAddressVersionByte` for more information.\n *\n * The `type` parameter must be a number between `0` and `15`, and `bitLength`\n * must be one of the standardized lengths. To use the contents of a variable,\n * cast it to `CashAddressType` or `CashAddressSize` respectively, e.g.:\n * ```ts\n * const type = 3 as CashAddressType;\n * const size = 160 as CashAddressSize;\n * getCashAddressVersionByte(type, size);\n * ```\n * @param type - the address type of the hash being encoded\n * @param bitLength - the bit length of the hash being encoded\n */\nconst encodeCashAddressVersionByte = (type, bitLength\n// eslint-disable-next-line no-bitwise\n) => (type << cashAddressTypeBitShift) | cashAddressSizeToBit[bitLength];\nconst cashAddressReservedBitMask = 0b10000000;\nconst cashAddressTypeBits = 0b1111;\nconst cashAddressSizeBits = 0b111;\nconst empty = 0;\nvar CashAddressVersionByteDecodingError;\n(function (CashAddressVersionByteDecodingError) {\n CashAddressVersionByteDecodingError[\"reservedBitSet\"] = \"Reserved bit is set.\";\n})(CashAddressVersionByteDecodingError || (CashAddressVersionByteDecodingError = {}));\n/**\n * Decode a CashAddress version byte.\n * @param version - the version byte to decode\n */\nconst decodeCashAddressVersionByte = (version) => \n// eslint-disable-next-line no-negated-condition, no-bitwise\n(version & cashAddressReservedBitMask) !== empty\n ? CashAddressVersionByteDecodingError.reservedBitSet\n : {\n bitLength: cashAddressBitToSize[\n // eslint-disable-next-line no-bitwise\n (version & cashAddressSizeBits)],\n // eslint-disable-next-line no-bitwise\n type: (version >>> cashAddressTypeBitShift) & cashAddressTypeBits,\n };\n/**\n * In ASCII, each pair of upper and lower case characters share the same 5 least\n * significant bits.\n */\nconst asciiCaseInsensitiveBits = 0b11111;\n/**\n * Convert a string into an array of 5-bit numbers, representing the\n * characters in a case-insensitive way.\n * @param prefix - the prefix to mask\n */\nconst maskCashAddressPrefix = (prefix) => {\n const result = [];\n // eslint-disable-next-line functional/no-let, functional/no-loop-statement, no-plusplus\n for (let i = 0; i < prefix.length; i++) {\n // eslint-disable-next-line functional/no-expression-statement, no-bitwise, functional/immutable-data\n result.push(prefix.charCodeAt(i) & asciiCaseInsensitiveBits);\n }\n return result;\n};\n// prettier-ignore\nconst bech32GeneratorMostSignificantByte = [0x98, 0x79, 0xf3, 0xae, 0x1e]; // eslint-disable-line @typescript-eslint/no-magic-numbers\n// prettier-ignore\nconst bech32GeneratorRemainingBytes = [0xf2bc8e61, 0xb76d99e2, 0x3e5fb3c4, 0x2eabe2a8, 0x4f43e470]; // eslint-disable-line @typescript-eslint/no-magic-numbers\n/**\n * Perform the CashAddress polynomial modulo operation, which is based on the\n * Bech32 polynomial modulo operation, but the returned checksum is 40 bits,\n * rather than 30.\n *\n * A.K.A. `PolyMod`\n *\n * @remarks\n * Notes from Bitcoin ABC:\n * This function will compute what 8 5-bit values to XOR into the last 8 input\n * values, in order to make the checksum 0. These 8 values are packed together\n * in a single 40-bit integer. The higher bits correspond to earlier values.\n *\n * The input is interpreted as a list of coefficients of a polynomial over F\n * = GF(32), with an implicit 1 in front. If the input is [v0,v1,v2,v3,v4],\n * that polynomial is v(x) = 1*x^5 + v0*x^4 + v1*x^3 + v2*x^2 + v3*x + v4.\n * The implicit 1 guarantees that [v0,v1,v2,...] has a distinct checksum\n * from [0,v0,v1,v2,...].\n *\n * The output is a 40-bit integer whose 5-bit groups are the coefficients of\n * the remainder of v(x) mod g(x), where g(x) is the cashaddr generator, x^8\n * + [19]*x^7 + [3]*x^6 + [25]*x^5 + [11]*x^4 + [25]*x^3 + [3]*x^2 + [19]*x\n * + [1]. g(x) is chosen in such a way that the resulting code is a BCH\n * code, guaranteeing detection of up to 4 errors within a window of 1025\n * characters. Among the various possible BCH codes, one was selected to in\n * fact guarantee detection of up to 5 errors within a window of 160\n * characters and 6 errors within a window of 126 characters. In addition,\n * the code guarantee the detection of a burst of up to 8 errors.\n *\n * Note that the coefficients are elements of GF(32), here represented as\n * decimal numbers between []. In this finite field, addition is just XOR of\n * the corresponding numbers. For example, [27] + [13] = [27 ^ 13] = [22].\n * Multiplication is more complicated, and requires treating the bits of\n * values themselves as coefficients of a polynomial over a smaller field,\n * GF(2), and multiplying those polynomials mod a^5 + a^3 + 1. For example,\n * [5] * [26] = (a^2 + 1) * (a^4 + a^3 + a) = (a^4 + a^3 + a) * a^2 + (a^4 +\n * a^3 + a) = a^6 + a^5 + a^4 + a = a^3 + 1 (mod a^5 + a^3 + 1) = [9].\n *\n * During the course of the loop below, `c` contains the bit-packed\n * coefficients of the polynomial constructed from just the values of v that\n * were processed so far, mod g(x). In the above example, `c` initially\n * corresponds to 1 mod (x), and after processing 2 inputs of v, it\n * corresponds to x^2 + v0*x + v1 mod g(x). As 1 mod g(x) = 1, that is the\n * starting value for `c`.\n *\n * @privateRemarks\n * Derived from the `bitcore-lib-cash` implementation, which does not require\n * BigInt: https://github.com/bitpay/bitcore\n *\n * @param v - Array of 5-bit integers over which the checksum is to be computed\n */\nconst cashAddressPolynomialModulo = (v) => {\n /* eslint-disable functional/no-let, functional/no-loop-statement, functional/no-expression-statement, no-bitwise, @typescript-eslint/no-magic-numbers */\n let mostSignificantByte = 0;\n let lowerBytes = 1;\n let c = 0;\n // eslint-disable-next-line @typescript-eslint/prefer-for-of, no-plusplus\n for (let j = 0; j < v.length; j++) {\n c = mostSignificantByte >>> 3;\n mostSignificantByte &= 0x07;\n mostSignificantByte <<= 5;\n mostSignificantByte |= lowerBytes >>> 27;\n lowerBytes &= 0x07ffffff;\n lowerBytes <<= 5;\n lowerBytes ^= v[j];\n // eslint-disable-next-line no-plusplus\n for (let i = 0; i < bech32GeneratorMostSignificantByte.length; ++i) {\n // eslint-disable-next-line functional/no-conditional-statement\n if (c & (1 << i)) {\n mostSignificantByte ^= bech32GeneratorMostSignificantByte[i];\n lowerBytes ^= bech32GeneratorRemainingBytes[i];\n }\n }\n }\n lowerBytes ^= 1;\n // eslint-disable-next-line functional/no-conditional-statement\n if (lowerBytes < 0) {\n lowerBytes ^= 1 << 31;\n lowerBytes += (1 << 30) * 2;\n }\n return mostSignificantByte * (1 << 30) * 4 + lowerBytes;\n /* eslint-enable functional/no-let, functional/no-loop-statement, functional/no-expression-statement, no-bitwise, @typescript-eslint/no-magic-numbers */\n};\nconst base32WordLength = 5;\nconst base256WordLength = 8;\n/**\n * Convert the checksum returned by `cashAddressPolynomialModulo` to an array of\n * 5-bit positive integers which can be Base32 encoded.\n * @param checksum - a 40 bit checksum returned by `cashAddressPolynomialModulo`\n */\nconst cashAddressChecksumToUint5Array = (checksum) => {\n const result = [];\n // eslint-disable-next-line functional/no-let, functional/no-loop-statement, no-plusplus\n for (let i = 0; i < base256WordLength; ++i) {\n // eslint-disable-next-line functional/no-expression-statement, no-bitwise, @typescript-eslint/no-magic-numbers, functional/immutable-data\n result.push(checksum & 31);\n // eslint-disable-next-line functional/no-expression-statement, @typescript-eslint/no-magic-numbers, no-param-reassign\n checksum /= 32;\n }\n // eslint-disable-next-line functional/immutable-data\n return result.reverse();\n};\nconst payloadSeparator = 0;\n/**\n * Encode a hash as a CashAddress-like string using the CashAddress format.\n *\n * To encode a standard CashAddress, use `encodeCashAddress`.\n *\n * @param prefix - a valid prefix indicating the network for which to encode the\n * address – must be only lowercase letters\n * @param version - a single byte indicating the version of this address\n * @param hash - the hash to encode\n */\nconst encodeCashAddressFormat = (prefix, version, hash) => {\n const checksum40BitPlaceholder = [0, 0, 0, 0, 0, 0, 0, 0];\n const payloadContents = (0,_bech32__WEBPACK_IMPORTED_MODULE_0__.regroupBits)({\n bin: Uint8Array.from([version, ...hash]),\n resultWordLength: base32WordLength,\n sourceWordLength: base256WordLength,\n });\n const checksumContents = [\n ...maskCashAddressPrefix(prefix),\n payloadSeparator,\n ...payloadContents,\n ...checksum40BitPlaceholder,\n ];\n const checksum = cashAddressPolynomialModulo(checksumContents);\n const payload = [\n ...payloadContents,\n ...cashAddressChecksumToUint5Array(checksum),\n ];\n return `${prefix}:${(0,_bech32__WEBPACK_IMPORTED_MODULE_0__.encodeBech32)(payload)}`;\n};\nvar CashAddressEncodingError;\n(function (CashAddressEncodingError) {\n CashAddressEncodingError[\"unsupportedHashLength\"] = \"CashAddress encoding error: a hash of this length can not be encoded as a valid CashAddress.\";\n})(CashAddressEncodingError || (CashAddressEncodingError = {}));\nconst isValidBitLength = (bitLength) => cashAddressSizeToBit[bitLength] !== undefined;\n/**\n * Encode a hash as a CashAddress.\n *\n * Note, this method does not enforce error handling via the type system. The\n * returned string may be a `CashAddressEncodingError.unsupportedHashLength`\n * if `hash` is not a valid length. Check the result if the input is potentially\n * malformed.\n *\n * For other address standards which closely follow the CashAddress\n * specification (but have alternative version byte requirements), use\n * `encodeCashAddressFormat`.\n *\n * @param prefix - a valid prefix indicating the network for which to encode the\n * address (usually a `CashAddressNetworkPrefix`) – must be only lowercase\n * letters\n * @param type - the `CashAddressType` to encode in the version byte – usually a\n * `CashAddressType`\n * @param hash - the hash to encode (for P2PKH, the public key hash; for P2SH,\n * the redeeming bytecode hash)\n */\nconst encodeCashAddress = (prefix, type, hash) => {\n const bitLength = hash.length * base256WordLength;\n if (!isValidBitLength(bitLength)) {\n return CashAddressEncodingError.unsupportedHashLength;\n }\n return encodeCashAddressFormat(prefix, encodeCashAddressVersionByte(type, bitLength), hash);\n};\nvar CashAddressDecodingError;\n(function (CashAddressDecodingError) {\n CashAddressDecodingError[\"improperPadding\"] = \"CashAddress decoding error: the payload is improperly padded.\";\n CashAddressDecodingError[\"invalidCharacters\"] = \"CashAddress decoding error: the payload contains non-bech32 characters.\";\n CashAddressDecodingError[\"invalidChecksum\"] = \"CashAddress decoding error: invalid checksum \\u2013 please review the address for errors.\";\n CashAddressDecodingError[\"invalidFormat\"] = \"CashAddress decoding error: CashAddresses should be of the form \\\"prefix:payload\\\".\";\n CashAddressDecodingError[\"mismatchedHashLength\"] = \"CashAddress decoding error: mismatched hash length for specified address version.\";\n CashAddressDecodingError[\"reservedByte\"] = \"CashAddress decoding error: unknown CashAddress version, reserved byte set.\";\n})(CashAddressDecodingError || (CashAddressDecodingError = {}));\n/**\n * Decode and validate a string using the CashAddress format. This is more\n * lenient than `decodeCashAddress`, which also validates the contents of the\n * version byte.\n *\n * Note, this method requires `address` to include a network prefix. To\n * decode a string with an unknown prefix, try\n * `decodeCashAddressFormatWithoutPrefix`.\n *\n * @param address - the CashAddress-like string to decode\n */\n// eslint-disable-next-line complexity\nconst decodeCashAddressFormat = (address) => {\n const parts = address.toLowerCase().split(':');\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n if (parts.length !== 2 || parts[0] === '' || parts[1] === '') {\n return CashAddressDecodingError.invalidFormat;\n }\n const [prefix, payload] = parts;\n if (!(0,_bech32__WEBPACK_IMPORTED_MODULE_0__.isBech32CharacterSet)(payload)) {\n return CashAddressDecodingError.invalidCharacters;\n }\n const decodedPayload = (0,_bech32__WEBPACK_IMPORTED_MODULE_0__.decodeBech32)(payload);\n const polynomial = [\n ...maskCashAddressPrefix(prefix),\n payloadSeparator,\n ...decodedPayload,\n ];\n if (cashAddressPolynomialModulo(polynomial) !== 0) {\n return CashAddressDecodingError.invalidChecksum;\n }\n const checksum40BitPlaceholderLength = 8;\n const payloadContents = (0,_bech32__WEBPACK_IMPORTED_MODULE_0__.regroupBits)({\n allowPadding: false,\n bin: decodedPayload.slice(0, -checksum40BitPlaceholderLength),\n resultWordLength: base256WordLength,\n sourceWordLength: base32WordLength,\n });\n if (typeof payloadContents === 'string') {\n return CashAddressDecodingError.improperPadding;\n }\n const [version, ...hashContents] = payloadContents;\n const hash = Uint8Array.from(hashContents);\n return { hash, prefix, version };\n};\n/**\n * Decode and validate a CashAddress, strictly checking the version byte\n * according to the CashAddress specification. This is important for error\n * detection in CashAddresses.\n *\n * For other address-like standards which closely follow the CashAddress\n * specification (but have alternative version byte requirements), use\n * `decodeCashAddressFormat`.\n *\n * Note, this method requires that CashAddresses include a network prefix. To\n * decode an address with an unknown prefix, try\n * `decodeCashAddressFormatWithoutPrefix`.\n *\n * @param address - the CashAddress to decode\n */\nconst decodeCashAddress = (address) => {\n const decoded = decodeCashAddressFormat(address);\n if (typeof decoded === 'string') {\n return decoded;\n }\n const info = decodeCashAddressVersionByte(decoded.version);\n if (info === CashAddressVersionByteDecodingError.reservedBitSet) {\n return CashAddressDecodingError.reservedByte;\n }\n if (decoded.hash.length * base256WordLength !== info.bitLength) {\n return CashAddressDecodingError.mismatchedHashLength;\n }\n return {\n hash: decoded.hash,\n prefix: decoded.prefix,\n type: info.type,\n };\n};\n/**\n * Attempt to decode and validate a CashAddress against a list of possible\n * prefixes. If the correct prefix is known, use `decodeCashAddress`.\n *\n * @param address - the CashAddress to decode\n * @param possiblePrefixes - the network prefixes to try\n */\n// decodeCashAddressWithoutPrefix\nconst decodeCashAddressFormatWithoutPrefix = (address, possiblePrefixes = [\n CashAddressNetworkPrefix.mainnet,\n CashAddressNetworkPrefix.testnet,\n CashAddressNetworkPrefix.regtest,\n]) => {\n // eslint-disable-next-line functional/no-loop-statement\n for (const prefix of possiblePrefixes) {\n const attempt = decodeCashAddressFormat(`${prefix}:${address}`);\n if (attempt !== CashAddressDecodingError.invalidChecksum) {\n return attempt;\n }\n }\n return CashAddressDecodingError.invalidChecksum;\n};\nconst asciiLowerCaseStart = 96;\n/**\n * Convert a CashAddress polynomial to CashAddress string format.\n *\n * @remarks\n * CashAddress polynomials take the form:\n *\n * `[lowest 5 bits of each prefix character] 0 [payload + checksum]`\n *\n * This method remaps the 5-bit integers in the prefix location to the matching\n * ASCII lowercase characters, replaces the separator with `:`, and then Bech32\n * encodes the remaining payload and checksum.\n *\n * @param polynomial - an array of 5-bit integers representing the terms of a\n * CashAddress polynomial\n */\nconst cashAddressPolynomialToCashAddress = (polynomial) => {\n const separatorPosition = polynomial.indexOf(0);\n const prefix = polynomial\n .slice(0, separatorPosition)\n .map((integer) => String.fromCharCode(asciiLowerCaseStart + integer))\n .join('');\n const contents = (0,_bech32__WEBPACK_IMPORTED_MODULE_0__.encodeBech32)(polynomial.slice(separatorPosition + 1));\n return `${prefix}:${contents}`;\n};\nvar CashAddressCorrectionError;\n(function (CashAddressCorrectionError) {\n CashAddressCorrectionError[\"tooManyErrors\"] = \"This address has more than 2 errors and cannot be corrected.\";\n})(CashAddressCorrectionError || (CashAddressCorrectionError = {}));\nconst finiteFieldOrder = 32;\n/**\n * Attempt to correct up to 2 errors in a CashAddress. The CashAddress must be\n * properly formed (include a prefix and only contain Bech32 characters).\n *\n * ## **Improper use of this method carries the risk of lost funds.**\n *\n * It is strongly advised that this method only be used under explicit user\n * control. With enough errors, this method is likely to find a plausible\n * correction for any address (but for which no private key exists). This is\n * effectively equivalent to burning the funds.\n *\n * Only 2 substitution errors can be corrected (or a single swap) – deletions\n * and insertions (errors which shift many other characters and change the\n * length of the payload) can never be safely corrected and will produce an\n * error.\n *\n * Errors can be corrected in both the prefix and the payload, but attempting to\n * correct errors in the prefix prior to this method can improve results, e.g.\n * for `bchtest:qq2azmyyv6dtgczexyalqar70q036yund53jvfde0x`, the string\n * `bchtest:qq2azmyyv6dtgczexyalqar70q036yund53jvfdecc` can be corrected, while\n * `typo:qq2azmyyv6dtgczexyalqar70q036yund53jvfdecc` can not.\n *\n * @privateRemarks\n * Derived from: https://github.com/deadalnix/cashaddressed\n *\n * @param address - the CashAddress on which to attempt error correction\n */\n// eslint-disable-next-line complexity\nconst attemptCashAddressFormatErrorCorrection = (address) => {\n const parts = address.toLowerCase().split(':');\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n if (parts.length !== 2 || parts[0] === '' || parts[1] === '') {\n return CashAddressDecodingError.invalidFormat;\n }\n const [prefix, payload] = parts;\n if (!(0,_bech32__WEBPACK_IMPORTED_MODULE_0__.isBech32CharacterSet)(payload)) {\n return CashAddressDecodingError.invalidCharacters;\n }\n const decodedPayload = (0,_bech32__WEBPACK_IMPORTED_MODULE_0__.decodeBech32)(payload);\n const polynomial = [...maskCashAddressPrefix(prefix), 0, ...decodedPayload];\n const originalChecksum = cashAddressPolynomialModulo(polynomial);\n if (originalChecksum === 0) {\n return {\n address: cashAddressPolynomialToCashAddress(polynomial),\n corrections: [],\n };\n }\n const syndromes = {};\n // eslint-disable-next-line functional/no-let, functional/no-loop-statement, no-plusplus\n for (let term = 0; term < polynomial.length; term++) {\n // eslint-disable-next-line functional/no-let, functional/no-loop-statement, no-plusplus\n for (let errorVector = 1; errorVector < finiteFieldOrder; errorVector++) {\n // eslint-disable-next-line functional/no-expression-statement, no-bitwise, functional/immutable-data\n polynomial[term] ^= errorVector;\n const correct = cashAddressPolynomialModulo(polynomial);\n if (correct === 0) {\n return {\n address: cashAddressPolynomialToCashAddress(polynomial),\n corrections: [term],\n };\n }\n // eslint-disable-next-line no-bitwise\n const s0 = (BigInt(correct) ^ BigInt(originalChecksum)).toString();\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n syndromes[s0] = term * finiteFieldOrder + errorVector;\n // eslint-disable-next-line functional/no-expression-statement, no-bitwise, functional/immutable-data\n polynomial[term] ^= errorVector;\n }\n }\n // eslint-disable-next-line functional/no-loop-statement\n for (const [s0, pe] of Object.entries(syndromes)) {\n // eslint-disable-next-line no-bitwise\n const s1Location = (BigInt(s0) ^ BigInt(originalChecksum)).toString();\n const s1 = syndromes[s1Location];\n if (s1 !== undefined) {\n const correctionIndex1 = Math.trunc(pe / finiteFieldOrder);\n const correctionIndex2 = Math.trunc(s1 / finiteFieldOrder);\n // eslint-disable-next-line functional/no-expression-statement, no-bitwise, functional/immutable-data\n polynomial[correctionIndex1] ^= pe % finiteFieldOrder;\n // eslint-disable-next-line functional/no-expression-statement, no-bitwise, functional/immutable-data\n polynomial[correctionIndex2] ^= s1 % finiteFieldOrder;\n return {\n address: cashAddressPolynomialToCashAddress(polynomial),\n corrections: [correctionIndex1, correctionIndex2].sort((a, b) => a - b),\n };\n }\n }\n return CashAddressCorrectionError.tooManyErrors;\n};\n//# sourceMappingURL=cash-address.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/address/cash-address.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/address/locking-bytecode.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/address/locking-bytecode.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AddressType: () => (/* binding */ AddressType),\n/* harmony export */ LockingBytecodeEncodingError: () => (/* binding */ LockingBytecodeEncodingError),\n/* harmony export */ addressContentsToLockingBytecode: () => (/* binding */ addressContentsToLockingBytecode),\n/* harmony export */ base58AddressToLockingBytecode: () => (/* binding */ base58AddressToLockingBytecode),\n/* harmony export */ cashAddressToLockingBytecode: () => (/* binding */ cashAddressToLockingBytecode),\n/* harmony export */ lockingBytecodeToAddressContents: () => (/* binding */ lockingBytecodeToAddressContents),\n/* harmony export */ lockingBytecodeToBase58Address: () => (/* binding */ lockingBytecodeToBase58Address),\n/* harmony export */ lockingBytecodeToCashAddress: () => (/* binding */ lockingBytecodeToCashAddress)\n/* harmony export */ });\n/* harmony import */ var _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../vm/instruction-sets/common/opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js\");\n/* harmony import */ var _base58_address__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base58-address */ \"./node_modules/@bitauth/libauth/build/module/lib/address/base58-address.js\");\n/* harmony import */ var _cash_address__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cash-address */ \"./node_modules/@bitauth/libauth/build/module/lib/address/cash-address.js\");\n\n\n\n/**\n * The most common address types used on bitcoin and bitcoin-like networks. Each\n * address type represents a commonly used locking bytecode pattern.\n *\n * @remarks\n * Addresses are strings which encode information about the network and\n * `lockingBytecode` to which a transaction output can pay.\n *\n * Several address formats exist – `Base58Address` was the format used by the\n * original satoshi client, and is still in use on several active chains (see\n * `encodeBase58Address`). On Bitcoin Cash, the `CashAddress` standard is most\n * common (See `encodeCashAddress`).\n */\nvar AddressType;\n(function (AddressType) {\n /**\n * Pay to Public Key (P2PK). This address type is uncommon, and primarily\n * occurs in early blocks because the original satoshi implementation mined\n * rewards to P2PK addresses.\n *\n * There are no standardized address formats for representing a P2PK address.\n * Instead, most applications use the `AddressType.p2pkh` format.\n */\n AddressType[\"p2pk\"] = \"P2PK\";\n /**\n * Pay to Public Key Hash (P2PKH). The most common address type. P2PKH\n * addresses lock funds using a single private key.\n */\n AddressType[\"p2pkh\"] = \"P2PKH\";\n /**\n * Pay to Script Hash (P2SH). An address type which locks funds to the hash of\n * a script provided in the spending transaction. See BIP13 for details.\n */\n AddressType[\"p2sh\"] = \"P2SH\";\n /**\n * This `AddressType` represents an address using an unknown or uncommon\n * locking bytecode pattern for which no standardized address formats exist.\n */\n AddressType[\"unknown\"] = \"unknown\";\n})(AddressType || (AddressType = {}));\n/**\n * Attempt to match a lockingBytecode to a standard address type for use in\n * address encoding. (See `AddressType` for details.)\n *\n * For a locking bytecode matching the Pay to Public Key Hash (P2PKH) pattern,\n * the returned `type` is `AddressType.p2pkh` and `payload` is the `HASH160` of\n * the public key.\n *\n * For a locking bytecode matching the Pay to Script Hash (P2SH) pattern, the\n * returned `type` is `AddressType.p2sh` and `payload` is the `HASH160` of the\n * redeeming bytecode, A.K.A. \"redeem script hash\".\n *\n * For a locking bytecode matching the Pay to Public Key (P2PK) pattern, the\n * returned `type` is `AddressType.p2pk` and `payload` is the full public key.\n *\n * Any other locking bytecode will return a `type` of `AddressType.unknown` and\n * a payload of the unmodified `bytecode`.\n *\n * @param bytecode - the locking bytecode to match\n */\n// eslint-disable-next-line complexity\nconst lockingBytecodeToAddressContents = (bytecode) => {\n const p2pkhLength = 25;\n if (bytecode.length === p2pkhLength &&\n bytecode[0] === _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_DUP &&\n bytecode[1] === _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_HASH160 &&\n bytecode[2] === _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_PUSHBYTES_20 &&\n bytecode[23] === _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_EQUALVERIFY &&\n bytecode[24] === _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_CHECKSIG) {\n const start = 3;\n const end = 23;\n return { payload: bytecode.slice(start, end), type: AddressType.p2pkh };\n }\n const p2shLength = 23;\n if (bytecode.length === p2shLength &&\n bytecode[0] === _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_HASH160 &&\n bytecode[1] === _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_PUSHBYTES_20 &&\n bytecode[22] === _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_EQUAL) {\n const start = 2;\n const end = 22;\n return { payload: bytecode.slice(start, end), type: AddressType.p2sh };\n }\n const p2pkUncompressedLength = 67;\n if (bytecode.length === p2pkUncompressedLength &&\n bytecode[0] === _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_PUSHBYTES_65 &&\n bytecode[66] === _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_CHECKSIG) {\n const start = 1;\n const end = 66;\n return { payload: bytecode.slice(start, end), type: AddressType.p2pk };\n }\n const p2pkCompressedLength = 35;\n if (bytecode.length === p2pkCompressedLength &&\n bytecode[0] === _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_PUSHBYTES_33 &&\n bytecode[34] === _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_CHECKSIG) {\n const start = 1;\n const end = 34;\n return { payload: bytecode.slice(start, end), type: AddressType.p2pk };\n }\n return {\n payload: bytecode.slice(),\n type: AddressType.unknown,\n };\n};\n/**\n * Get the locking bytecode for a valid `AddressContents` object. See\n * `lockingBytecodeToAddressContents` for details.\n *\n * For `AddressContents` of `type` `AddressType.unknown`, this method returns\n * the `payload` without modification.\n *\n * @param addressContents - the `AddressContents` to encode\n */\nconst addressContentsToLockingBytecode = (addressContents) => {\n if (addressContents.type === AddressType.p2pkh) {\n return Uint8Array.from([\n _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_DUP,\n _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_HASH160,\n _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_PUSHBYTES_20,\n ...addressContents.payload,\n _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_EQUALVERIFY,\n _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_CHECKSIG,\n ]);\n }\n if (addressContents.type === AddressType.p2sh) {\n return Uint8Array.from([\n _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_HASH160,\n _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_PUSHBYTES_20,\n ...addressContents.payload,\n _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_EQUAL,\n ]);\n }\n if (addressContents.type === AddressType.p2pk) {\n const compressedPublicKeyLength = 33;\n return addressContents.payload.length === compressedPublicKeyLength\n ? Uint8Array.from([\n _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_PUSHBYTES_33,\n ...addressContents.payload,\n _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_CHECKSIG,\n ])\n : Uint8Array.from([\n _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_PUSHBYTES_65,\n ...addressContents.payload,\n _vm_instruction_sets_common_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesCommon.OP_CHECKSIG,\n ]);\n }\n return addressContents.payload;\n};\n/**\n * Encode a locking bytecode as a CashAddress given a network prefix.\n *\n * If `bytecode` matches either the P2PKH or P2SH pattern, it is encoded using\n * the proper address type and returned as a valid CashAddress (string).\n *\n * If `bytecode` cannot be encoded as an address (i.e. because the pattern is\n * not standard), the resulting `AddressContents` is returned.\n *\n * @param bytecode - the locking bytecode to encode\n * @param prefix - the network prefix to use, e.g. `bitcoincash`, `bchtest`, or\n * `bchreg`\n */\nconst lockingBytecodeToCashAddress = (bytecode, prefix) => {\n const contents = lockingBytecodeToAddressContents(bytecode);\n if (contents.type === AddressType.p2pkh) {\n return (0,_cash_address__WEBPACK_IMPORTED_MODULE_1__.encodeCashAddress)(prefix, _cash_address__WEBPACK_IMPORTED_MODULE_1__.CashAddressType.P2PKH, contents.payload);\n }\n if (contents.type === AddressType.p2sh) {\n return (0,_cash_address__WEBPACK_IMPORTED_MODULE_1__.encodeCashAddress)(prefix, _cash_address__WEBPACK_IMPORTED_MODULE_1__.CashAddressType.P2SH, contents.payload);\n }\n return contents;\n};\nvar LockingBytecodeEncodingError;\n(function (LockingBytecodeEncodingError) {\n LockingBytecodeEncodingError[\"unknownCashAddressType\"] = \"This CashAddress uses an unknown address type.\";\n})(LockingBytecodeEncodingError || (LockingBytecodeEncodingError = {}));\n/**\n * Convert a CashAddress to its respective locking bytecode.\n *\n * This method returns the locking bytecode and network prefix. If an error\n * occurs, an error message is returned as a string.\n *\n * @param address - the CashAddress to convert\n */\nconst cashAddressToLockingBytecode = (address) => {\n const decoded = (0,_cash_address__WEBPACK_IMPORTED_MODULE_1__.decodeCashAddress)(address);\n if (typeof decoded === 'string')\n return decoded;\n if (decoded.type === _cash_address__WEBPACK_IMPORTED_MODULE_1__.CashAddressType.P2PKH) {\n return {\n bytecode: addressContentsToLockingBytecode({\n payload: decoded.hash,\n type: AddressType.p2pkh,\n }),\n prefix: decoded.prefix,\n };\n }\n if (decoded.type === _cash_address__WEBPACK_IMPORTED_MODULE_1__.CashAddressType.P2SH) {\n return {\n bytecode: addressContentsToLockingBytecode({\n payload: decoded.hash,\n type: AddressType.p2sh,\n }),\n prefix: decoded.prefix,\n };\n }\n return LockingBytecodeEncodingError.unknownCashAddressType;\n};\n/**\n * Encode a locking bytecode as a Base58Address for a given network.\n *\n * If `bytecode` matches either the P2PKH or P2SH pattern, it is encoded using\n * the proper address type and returned as a valid Base58Address (string).\n *\n * If `bytecode` cannot be encoded as an address (i.e. because the pattern is\n * not standard), the resulting `AddressContents` is returned.\n *\n * @param sha256 - an implementation of sha256 (a universal implementation is\n * available via `instantiateSha256`)\n * @param bytecode - the locking bytecode to encode\n * @param network - the network for which to encode the address (`mainnet` or\n * `testnet`)\n */\nconst lockingBytecodeToBase58Address = (sha256, bytecode, network) => {\n const contents = lockingBytecodeToAddressContents(bytecode);\n if (contents.type === AddressType.p2pkh) {\n return (0,_base58_address__WEBPACK_IMPORTED_MODULE_2__.encodeBase58AddressFormat)(sha256, {\n 'copay-bch': _base58_address__WEBPACK_IMPORTED_MODULE_2__.Base58AddressFormatVersion.p2pkhCopayBCH,\n mainnet: _base58_address__WEBPACK_IMPORTED_MODULE_2__.Base58AddressFormatVersion.p2pkh,\n testnet: _base58_address__WEBPACK_IMPORTED_MODULE_2__.Base58AddressFormatVersion.p2pkhTestnet,\n }[network], contents.payload);\n }\n if (contents.type === AddressType.p2sh) {\n return (0,_base58_address__WEBPACK_IMPORTED_MODULE_2__.encodeBase58AddressFormat)(sha256, {\n 'copay-bch': _base58_address__WEBPACK_IMPORTED_MODULE_2__.Base58AddressFormatVersion.p2shCopayBCH,\n mainnet: _base58_address__WEBPACK_IMPORTED_MODULE_2__.Base58AddressFormatVersion.p2sh,\n testnet: _base58_address__WEBPACK_IMPORTED_MODULE_2__.Base58AddressFormatVersion.p2shTestnet,\n }[network], contents.payload);\n }\n return contents;\n};\n/**\n * Convert a Base58Address to its respective locking bytecode.\n *\n * This method returns the locking bytecode and network version. If an error\n * occurs, an error message is returned as a string.\n *\n * @param address - the CashAddress to convert\n */\nconst base58AddressToLockingBytecode = (sha256, address) => {\n const decoded = (0,_base58_address__WEBPACK_IMPORTED_MODULE_2__.decodeBase58Address)(sha256, address);\n if (typeof decoded === 'string')\n return decoded;\n return {\n bytecode: addressContentsToLockingBytecode({\n payload: decoded.payload,\n type: [\n _base58_address__WEBPACK_IMPORTED_MODULE_2__.Base58AddressFormatVersion.p2pkh,\n _base58_address__WEBPACK_IMPORTED_MODULE_2__.Base58AddressFormatVersion.p2pkhCopayBCH,\n _base58_address__WEBPACK_IMPORTED_MODULE_2__.Base58AddressFormatVersion.p2pkhTestnet,\n ].includes(decoded.version)\n ? AddressType.p2pkh\n : AddressType.p2sh,\n }),\n version: decoded.version,\n };\n};\n//# sourceMappingURL=locking-bytecode.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/address/locking-bytecode.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/bin/bin.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/bin/bin.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CompressionFlag: () => (/* reexport safe */ _secp256k1_secp256k1_wasm__WEBPACK_IMPORTED_MODULE_2__.CompressionFlag),\n/* harmony export */ ContextFlag: () => (/* reexport safe */ _secp256k1_secp256k1_wasm__WEBPACK_IMPORTED_MODULE_2__.ContextFlag),\n/* harmony export */ getEmbeddedSecp256k1Binary: () => (/* reexport safe */ _secp256k1_secp256k1_wasm__WEBPACK_IMPORTED_MODULE_2__.getEmbeddedSecp256k1Binary),\n/* harmony export */ instantiateRustWasm: () => (/* reexport safe */ _hashes__WEBPACK_IMPORTED_MODULE_0__.instantiateRustWasm),\n/* harmony export */ instantiateSecp256k1Wasm: () => (/* reexport safe */ _secp256k1_secp256k1_wasm__WEBPACK_IMPORTED_MODULE_2__.instantiateSecp256k1Wasm),\n/* harmony export */ instantiateSecp256k1WasmBytes: () => (/* reexport safe */ _secp256k1_secp256k1_wasm__WEBPACK_IMPORTED_MODULE_2__.instantiateSecp256k1WasmBytes),\n/* harmony export */ ripemd160Base64Bytes: () => (/* reexport safe */ _ripemd160_ripemd160_base64__WEBPACK_IMPORTED_MODULE_1__.ripemd160Base64Bytes),\n/* harmony export */ sha1Base64Bytes: () => (/* reexport safe */ _sha1_sha1_base64__WEBPACK_IMPORTED_MODULE_3__.sha1Base64Bytes),\n/* harmony export */ sha256Base64Bytes: () => (/* reexport safe */ _sha256_sha256_base64__WEBPACK_IMPORTED_MODULE_4__.sha256Base64Bytes),\n/* harmony export */ sha512Base64Bytes: () => (/* reexport safe */ _sha512_sha512_base64__WEBPACK_IMPORTED_MODULE_5__.sha512Base64Bytes)\n/* harmony export */ });\n/* harmony import */ var _hashes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hashes */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/hashes.js\");\n/* harmony import */ var _ripemd160_ripemd160_base64__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ripemd160/ripemd160.base64 */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/ripemd160/ripemd160.base64.js\");\n/* harmony import */ var _secp256k1_secp256k1_wasm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./secp256k1/secp256k1-wasm */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1-wasm.js\");\n/* harmony import */ var _sha1_sha1_base64__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./sha1/sha1.base64 */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/sha1/sha1.base64.js\");\n/* harmony import */ var _sha256_sha256_base64__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sha256/sha256.base64 */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/sha256/sha256.base64.js\");\n/* harmony import */ var _sha512_sha512_base64__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./sha512/sha512.base64 */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/sha512/sha512.base64.js\");\n\n\n\n\n\n\n//# sourceMappingURL=bin.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/bin/bin.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/bin/hashes.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/bin/hashes.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ instantiateRustWasm: () => (/* binding */ instantiateRustWasm)\n/* harmony export */ });\n/* eslint-disable functional/no-conditional-statement, functional/no-let, functional/no-expression-statement, no-underscore-dangle, functional/no-try-statement, @typescript-eslint/no-magic-numbers, max-params, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\n/**\n * Note, most of this method is translated and boiled-down from the wasm-pack\n * workflow. Significant changes to wasm-bindgen or wasm-pack build will likely\n * require modifications to this method.\n */\nconst instantiateRustWasm = async (webassemblyBytes, expectedImportModuleName, hashExportName, initExportName, updateExportName, finalExportName) => {\n const wasm = (await WebAssembly.instantiate(webassemblyBytes, {\n [expectedImportModuleName]: {\n /**\n * This would only be called in cases where a `__wbindgen_malloc` failed.\n * Since `__wbindgen_malloc` isn't exposed to consumers, this error\n * can only be encountered if the code below is broken.\n */\n // eslint-disable-next-line camelcase, @typescript-eslint/naming-convention\n __wbindgen_throw: /* istanbul ignore next */ (ptr, len) => {\n // eslint-disable-next-line functional/no-throw-statement\n throw new Error(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n Array.from(getUint8Memory().subarray(ptr, ptr + len))\n .map((num) => String.fromCharCode(num))\n .join(''));\n },\n },\n })).instance.exports; // eslint-disable-line @typescript-eslint/no-explicit-any\n let cachedUint8Memory; // eslint-disable-line @typescript-eslint/init-declarations\n let cachedUint32Memory; // eslint-disable-line @typescript-eslint/init-declarations\n let cachedGlobalArgumentPtr; // eslint-disable-line @typescript-eslint/init-declarations\n const globalArgumentPtr = () => {\n if (cachedGlobalArgumentPtr === undefined) {\n cachedGlobalArgumentPtr = wasm.__wbindgen_global_argument_ptr();\n }\n return cachedGlobalArgumentPtr;\n };\n /**\n * Must be hoisted for `__wbindgen_throw`.\n */\n // eslint-disable-next-line func-style\n function getUint8Memory() {\n if (cachedUint8Memory === undefined ||\n cachedUint8Memory.buffer !== wasm.memory.buffer) {\n cachedUint8Memory = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8Memory;\n }\n const getUint32Memory = () => {\n if (cachedUint32Memory === undefined ||\n cachedUint32Memory.buffer !== wasm.memory.buffer) {\n cachedUint32Memory = new Uint32Array(wasm.memory.buffer);\n }\n return cachedUint32Memory;\n };\n const passArray8ToWasm = (array) => {\n const ptr = wasm.__wbindgen_malloc(array.length);\n getUint8Memory().set(array, ptr);\n return [ptr, array.length];\n };\n const getArrayU8FromWasm = (ptr, len) => getUint8Memory().subarray(ptr, ptr + len);\n const hash = (input) => {\n const [ptr0, len0] = passArray8ToWasm(input);\n const retPtr = globalArgumentPtr();\n try {\n wasm[hashExportName](retPtr, ptr0, len0);\n const mem = getUint32Memory();\n const ptr = mem[retPtr / 4];\n const len = mem[retPtr / 4 + 1];\n const realRet = getArrayU8FromWasm(ptr, len).slice();\n wasm.__wbindgen_free(ptr, len);\n return realRet;\n }\n finally {\n wasm.__wbindgen_free(ptr0, len0);\n }\n };\n const init = () => {\n const retPtr = globalArgumentPtr();\n wasm[initExportName](retPtr);\n const mem = getUint32Memory();\n const ptr = mem[retPtr / 4];\n const len = mem[retPtr / 4 + 1];\n const realRet = getArrayU8FromWasm(ptr, len).slice();\n wasm.__wbindgen_free(ptr, len);\n return realRet;\n };\n const update = (rawState, input) => {\n const [ptr0, len0] = passArray8ToWasm(rawState);\n const [ptr1, len1] = passArray8ToWasm(input);\n const retPtr = globalArgumentPtr();\n try {\n wasm[updateExportName](retPtr, ptr0, len0, ptr1, len1);\n const mem = getUint32Memory();\n const ptr = mem[retPtr / 4];\n const len = mem[retPtr / 4 + 1];\n const realRet = getArrayU8FromWasm(ptr, len).slice();\n wasm.__wbindgen_free(ptr, len);\n return realRet;\n }\n finally {\n rawState.set(getUint8Memory().subarray(ptr0 / 1, ptr0 / 1 + len0));\n wasm.__wbindgen_free(ptr0, len0);\n wasm.__wbindgen_free(ptr1, len1);\n }\n };\n const final = (rawState) => {\n const [ptr0, len0] = passArray8ToWasm(rawState);\n const retPtr = globalArgumentPtr();\n try {\n wasm[finalExportName](retPtr, ptr0, len0);\n const mem = getUint32Memory();\n const ptr = mem[retPtr / 4];\n const len = mem[retPtr / 4 + 1];\n const realRet = getArrayU8FromWasm(ptr, len).slice();\n wasm.__wbindgen_free(ptr, len);\n return realRet;\n }\n finally {\n rawState.set(getUint8Memory().subarray(ptr0 / 1, ptr0 / 1 + len0));\n wasm.__wbindgen_free(ptr0, len0);\n }\n };\n return {\n final,\n hash,\n init,\n update,\n };\n};\n/* eslint-enable functional/no-conditional-statement, functional/no-let, functional/no-expression-statement, no-underscore-dangle, functional/no-try-statement, @typescript-eslint/no-magic-numbers, max-params, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\n//# sourceMappingURL=hashes.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/bin/hashes.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/bin/ripemd160/ripemd160.base64.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/bin/ripemd160/ripemd160.base64.js ***! + \******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ripemd160Base64Bytes: () => (/* binding */ ripemd160Base64Bytes)\n/* harmony export */ });\n/* eslint-disable tsdoc/syntax */\n/**\n * @hidden\n */\n// prettier-ignore\nconst ripemd160Base64Bytes = 'AGFzbQEAAAABRgxgAn9/AX9gAn9/AGADf39/AGABfwF/YAV/f39/fwF/YAN/f38Bf2AAAGABfwBgBX9/f39/AGAAAX9gBH9/f38AYAF/AX4CIAELLi9yaXBlbWQxNjAQX193YmluZGdlbl90aHJvdwABAysqAAECAwQGBwICAQEHCAIDAQEJAAcBCgoCAQgCAQIHBwcBAQAAAQcLBQUFBAUBcAEEBAUDAQARBgkBfwFBwJXAAAsHkwEIBm1lbW9yeQIACXJpcGVtZDE2MAAIDnJpcGVtZDE2MF9pbml0AAwQcmlwZW1kMTYwX3VwZGF0ZQAND3JpcGVtZDE2MF9maW5hbAAOEV9fd2JpbmRnZW5fbWFsbG9jAA8PX193YmluZGdlbl9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AgAmoiAjYCACAAIAJBAXI2AgQMBQsgAEH8EigCACACaiICQQFyNgIEQYQTIAA2AgBB/BIgAjYCACAAIAJqIAI2AgAMBAsgAxAgDAELQewPQewPKAIAQX4gAUEDdndxNgIACyAEIAJqIQIgAyAEaiEDCyADIAMoAgRBfnE2AgQgACACQQFyNgIEIAAgAmogAjYCAAJ/AkAgAkH/AU0EQCACQQN2IgFBA3RB9A9qIQJB7A8oAgAiA0EBIAFBH3F0IgFxRQ0BIAJBCGohAyACKAIIDAILIAAgAhAhDAILQewPIAMgAXI2AgAgAkEIaiEDIAILIQEgAyAANgIAIAEgADYCDCAAIAI2AgwgACABNgIICyAFQQhqDwtBgBMgACACayIBNgIAQYgTQYgTKAIAIgAgAmoiAzYCACADIAFBAXI2AgQgACACQQNyNgIEIABBCGoLpQEBAn9BAiEFAkACQAJAAkACQCAAKAIEIgYgAWsgAk8NACABIAJqIgIgAUkhAQJAIAQEQEEAIQUgAQ0CIAZBAXQiASACIAIgAUkbIQIMAQtBACEFIAENAQsgAkEASA0AIAZFDQEgACgCACACEBMiAUUNAgwDCyAFDwsgAhAEIgENAQsgAw0BCyABBEAgACABNgIAIABBBGogAjYCAEECDwtBAQ8LAAsIAEGMFBAHAAtmAgF/A34jAEEwayIBJAAgACkCECECIAApAgghAyAAKQIAIQQgAUEUakEANgIAIAEgBDcDGCABQgE3AgQgAUH0DDYCECABIAFBGGo2AgAgASADNwMgIAEgAjcDKCABIAFBIGoQJQALuAEBAX8jAEHgAWsiAyQAIANBOGpBzAgoAgA2AgAgA0EwakHECCkCADcDACADQgA3AyAgA0G8CCkCADcDKCADQTxqQQBBxAAQKhogA0EgaiABIAIQCSADQYABaiADQSBqQeAAECgaIANBCGogA0GAAWoQCiADQSBqIANBCGpBFBADIANBiAFqIANBKGooAgA2AgAgAyADKQMgNwOAASADIANBgAFqEAsgACADKQMANwIAIANB4AFqJAALlwMBBH8jAEFAaiIDJAAgACAAKQMAIAKtfDcDACADIABBCGo2AiggAyADQShqNgIsAkACQAJAAkACQAJAIAAoAhwiBQRAQcAAIAVrIgQgAk0NASADQRhqIAUgBSACaiIEIABBIGoQFiADKAIcIAJHDQUgAygCGCABIAIQKBoMAwsgAiEEDAELIANBMGogASACIAQQFyADQTxqKAIAIQQgAygCOCEBIAMoAjAhBSADKAI0IQIgA0EgaiAAQSBqIgYgACgCHBAYIAIgAygCJEcNBCADKAIgIAUgAhAoGiAAQRxqQQA2AgAgA0EsaiAGEBkLIANBPGohAiADQThqIQUCQANAIARBP00NASADQTBqIAEgBEHAABAXIAIoAgAhBCAFKAIAIQEgA0EIakEAQcAAIAMoAjAgAygCNBAaIANBLGogAygCCBAZDAALAAsgA0EQaiAAQSBqIAQQGyADKAIUIARHDQEgAygCECABIAQQKBoLIABBHGogBDYCACADQUBrJAAPC0H0ExAHAAtB9BMQBwALQfQTEAcAC+MCAgR/AX4jAEFAaiICJAAgAiABQQhqIgU2AiQgASkDACEGIAEoAhwhAyACIAJBJGo2AigCQCADQT9NBEAgAUEgaiIEIANqQYABOgAAIAEgASgCHEEBaiIDNgIcIAJBGGogBCADEBggAigCGEEAIAIoAhwQKhpBwAAgASgCHGtBB00EQCACQShqIAQQGSACQRBqIAQgAUEcaigCABAbIAIoAhBBACACKAIUECoaCyACQQhqIARBOBAYIAIoAgxBCEcNASACKAIIIAZCA4Y3AAAgAkEoaiAEEBkgAUEcakEANgIAIAJBADYCKEEEIQECQANAIAFBGEYNASACQShqIAFqQQA6AAAgAiACKAIoQQFqNgIoIAFBAWohAQwACwALIAAgBSkAADcAACAAQRBqIAVBEGooAAA2AAAgAEEIaiAFQQhqKQAANwAAIAJBQGskAA8LQcwTIANBwAAQHQALQdwTEAcAC2MBAn8gASgCACECAkACQCABKAIEIgMgASgCCCIBRgRAIAMhAQwBCyADIAFJDQEgAQRAIAIgARATIgINAQALIAIgAxARQQEhAkEAIQELIAAgATYCBCAAIAI2AgAPC0G0ExAHAAuQAQEBfyMAQYABayIBJAAgAUEwakHECCkCADcDAC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BzvrPynpqQQh3IApqIhVBCndqIA8gF2ogASAUQQp3Ig9zIBFzakEPdyASaiIUQQp3IhhqNgIEIAAgHSAQIApqIBUgCyAJQQp3IhdBf3Nyc2pBzvrPynpqQQV3IBZqIhBqIBIgHGogESABQQp3IgFzIBRzakENdyAPaiIRQQp3ajYCACAAIBcgIWogGiAWaiAQIBUgIkF/c3JzakHO+s/KempBBndqIA8gG2ogFCATcyARc2pBC3cgAWoiD2o2AhAgACAXIB9qIBNqIAEgGWogESAYcyAPc2pBC3dqNgIMCzkAAkAgAiABTwRAIAJBwQBPDQEgACACIAFrNgIEIAAgAyABajYCAA8LIAEgAhAcAAsgAkHAABACAAtNAgF/An4jAEEQayIEJAAgBEEIakEAIAMgASACEBogBCkDCCEFIAQgAyACIAEgAhAaIAQpAwAhBiAAIAU3AgAgACAGNwIIIARBEGokAAssAQF/IwBBEGsiAyQAIANBCGogAkHAACABEBYgACADKQMINwIAIANBEGokAAsOACAAKAIAKAIAIAEQFQs3AAJAIAIgAU8EQCAEIAJJDQEgACACIAFrNgIEIAAgAyABajYCAA8LIAEgAhAcAAsgAiAEEAIACysBAX8jAEEQayIDJAAgA0EIakEAIAIgARAWIAAgAykDCDcCACADQRBqJAALfQEBfyMAQTBrIgIkACACIAE2AgQgAiAANgIAIAJBLGpBATYCACACQRRqQQI2AgAgAkEcakECNgIAIAJBATYCJCACQfwUNgIIIAJBAjYCDCACQbwNNgIQIAIgAjYCICACIAJBBGo2AiggAiACQSBqNgIYIAJBCGpBjBUQJQALfAEBfyMAQTBrIgMkACADIAI2AgQgAyABNgIAIANBLGpBATYCACADQRRqQQI2AgAgA0EcakECNgIAIANBATYCJCADQcwUNgIIIANBAjYCDCADQbwNNgIQIAMgA0EEajYCICADIAM2AiggAyADQSBqNgIYIANBCGogABAlAAtQAAJAAkBB2A8oAgBBAUYEQEHcD0HcDygCAEEBaiIANgIAIABBA0kNAQwCC0HYD0KBgICAEDcDAAtB5A8oAgAiAEF/TA0AQeQPIAA2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HAAAGAAAACgcAACIAAACnBgAAFAAAAK0HAAAFAAAALAcAABYAAABCBwAADQAAAKcGAAAUAAAAswcAAAUAAABPBwAAKAAAAHcHAAATAAAA9QEAAB4ADAdsaW5raW5nAwK0DQ==';\n//# sourceMappingURL=ripemd160.base64.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/bin/ripemd160/ripemd160.base64.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1-wasm-types.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1-wasm-types.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CompressionFlag: () => (/* binding */ CompressionFlag),\n/* harmony export */ ContextFlag: () => (/* binding */ ContextFlag)\n/* harmony export */ });\n// cSpell:ignore noncefp, ndata, outputlen\n/**\n * bitflags used in secp256k1's public API (translated from secp256k1.h)\n */\n/* eslint-disable no-bitwise, @typescript-eslint/no-magic-numbers */\n/** All flags' lower 8 bits indicate what they're for. Do not use directly. */\n// const SECP256K1_FLAGS_TYPE_MASK = (1 << 8) - 1;\nconst SECP256K1_FLAGS_TYPE_CONTEXT = 1 << 0;\nconst SECP256K1_FLAGS_TYPE_COMPRESSION = 1 << 1;\n/** The higher bits contain the actual data. Do not use directly. */\nconst SECP256K1_FLAGS_BIT_CONTEXT_VERIFY = 1 << 8;\nconst SECP256K1_FLAGS_BIT_CONTEXT_SIGN = 1 << 9;\nconst SECP256K1_FLAGS_BIT_COMPRESSION = 1 << 8;\n/** Flags to pass to secp256k1_context_create. */\nconst SECP256K1_CONTEXT_VERIFY = SECP256K1_FLAGS_TYPE_CONTEXT | SECP256K1_FLAGS_BIT_CONTEXT_VERIFY;\nconst SECP256K1_CONTEXT_SIGN = SECP256K1_FLAGS_TYPE_CONTEXT | SECP256K1_FLAGS_BIT_CONTEXT_SIGN;\nconst SECP256K1_CONTEXT_NONE = SECP256K1_FLAGS_TYPE_CONTEXT;\n/** Flag to pass to secp256k1_ec_pubkey_serialize and secp256k1_ec_privkey_export. */\nconst SECP256K1_EC_COMPRESSED = SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION;\nconst SECP256K1_EC_UNCOMPRESSED = SECP256K1_FLAGS_TYPE_COMPRESSION;\n/**\n * Flag to pass to a Secp256k1.contextCreate method.\n *\n * The purpose of context structures is to cache large precomputed data tables\n * that are expensive to construct, and also to maintain the randomization data\n * for blinding.\n *\n * You can create a context with only VERIFY or only SIGN capabilities, or you\n * can use BOTH. (NONE can be used for conversion/serialization.)\n */\nvar ContextFlag;\n(function (ContextFlag) {\n ContextFlag[ContextFlag[\"NONE\"] = SECP256K1_CONTEXT_NONE] = \"NONE\";\n ContextFlag[ContextFlag[\"VERIFY\"] = SECP256K1_CONTEXT_VERIFY] = \"VERIFY\";\n ContextFlag[ContextFlag[\"SIGN\"] = SECP256K1_CONTEXT_SIGN] = \"SIGN\";\n ContextFlag[ContextFlag[\"BOTH\"] = SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY] = \"BOTH\";\n})(ContextFlag || (ContextFlag = {}));\n/**\n * Flag to pass a Secp256k1 public key serialization method.\n *\n * You can indicate COMPRESSED (33 bytes, header byte 0x02 or 0x03) or\n * UNCOMPRESSED (65 bytes, header byte 0x04) format.\n */\nvar CompressionFlag;\n(function (CompressionFlag) {\n CompressionFlag[CompressionFlag[\"COMPRESSED\"] = SECP256K1_EC_COMPRESSED] = \"COMPRESSED\";\n CompressionFlag[CompressionFlag[\"UNCOMPRESSED\"] = SECP256K1_EC_UNCOMPRESSED] = \"UNCOMPRESSED\";\n})(CompressionFlag || (CompressionFlag = {}));\n//# sourceMappingURL=secp256k1-wasm-types.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1-wasm-types.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1-wasm.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1-wasm.js ***! + \****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CompressionFlag: () => (/* reexport safe */ _secp256k1_wasm_types__WEBPACK_IMPORTED_MODULE_0__.CompressionFlag),\n/* harmony export */ ContextFlag: () => (/* reexport safe */ _secp256k1_wasm_types__WEBPACK_IMPORTED_MODULE_0__.ContextFlag),\n/* harmony export */ getEmbeddedSecp256k1Binary: () => (/* binding */ getEmbeddedSecp256k1Binary),\n/* harmony export */ instantiateSecp256k1Wasm: () => (/* binding */ instantiateSecp256k1Wasm),\n/* harmony export */ instantiateSecp256k1WasmBytes: () => (/* binding */ instantiateSecp256k1WasmBytes)\n/* harmony export */ });\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/base64.js\");\n/* harmony import */ var _secp256k1_wasm_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./secp256k1-wasm-types */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1-wasm-types.js\");\n/* harmony import */ var _secp256k1_base64__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./secp256k1.base64 */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1.base64.js\");\n/* eslint-disable no-underscore-dangle, max-params, @typescript-eslint/naming-convention */\n// cSpell:ignore memcpy, anyfunc\n\n\n\n\n/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nconst wrapSecp256k1Wasm = (instance, heapU8, heapU32) => ({\n contextCreate: (context) => instance.exports._secp256k1_context_create(context),\n contextRandomize: (contextPtr, seedPtr) => instance.exports._secp256k1_context_randomize(contextPtr, seedPtr),\n free: (pointer) => instance.exports._free(pointer),\n heapU32,\n heapU8,\n instance,\n malloc: (bytes) => instance.exports._malloc(bytes),\n mallocSizeT: (num) => {\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n const pointer = instance.exports._malloc(4);\n // eslint-disable-next-line no-bitwise, @typescript-eslint/no-magic-numbers\n const pointerView32 = pointer >> 2;\n // eslint-disable-next-line functional/no-expression-statement\n heapU32.set([num], pointerView32);\n return pointer;\n },\n mallocUint8Array: (array) => {\n const pointer = instance.exports._malloc(array.length);\n // eslint-disable-next-line functional/no-expression-statement\n heapU8.set(array, pointer);\n return pointer;\n },\n privkeyTweakAdd: (contextPtr, secretKeyPtr, tweakNum256Ptr) => instance.exports._secp256k1_ec_privkey_tweak_add(contextPtr, secretKeyPtr, tweakNum256Ptr),\n privkeyTweakMul: (contextPtr, secretKeyPtr, tweakNum256Ptr) => instance.exports._secp256k1_ec_privkey_tweak_mul(contextPtr, secretKeyPtr, tweakNum256Ptr),\n pubkeyCreate: (contextPtr, publicKeyPtr, secretKeyPtr) => instance.exports._secp256k1_ec_pubkey_create(contextPtr, publicKeyPtr, secretKeyPtr),\n pubkeyParse: (contextPtr, publicKeyOutPtr, publicKeyInPtr, publicKeyInLength) => instance.exports._secp256k1_ec_pubkey_parse(contextPtr, publicKeyOutPtr, publicKeyInPtr, publicKeyInLength),\n pubkeySerialize: (contextPtr, outputPtr, outputLengthPtr, publicKeyPtr, compression) => instance.exports._secp256k1_ec_pubkey_serialize(contextPtr, outputPtr, outputLengthPtr, publicKeyPtr, compression),\n pubkeyTweakAdd: (contextPtr, publicKeyPtr, tweakNum256Ptr) => instance.exports._secp256k1_ec_pubkey_tweak_add(contextPtr, publicKeyPtr, tweakNum256Ptr),\n pubkeyTweakMul: (contextPtr, publicKeyPtr, tweakNum256Ptr) => instance.exports._secp256k1_ec_pubkey_tweak_mul(contextPtr, publicKeyPtr, tweakNum256Ptr),\n readHeapU8: (pointer, bytes) => new Uint8Array(heapU8.buffer, pointer, bytes),\n readSizeT: (pointer) => {\n // eslint-disable-next-line no-bitwise, @typescript-eslint/no-magic-numbers\n const pointerView32 = pointer >> 2;\n return heapU32[pointerView32];\n },\n recover: (contextPtr, outputPubkeyPointer, rSigPtr, msg32Ptr) => instance.exports._secp256k1_ecdsa_recover(contextPtr, outputPubkeyPointer, rSigPtr, msg32Ptr),\n recoverableSignatureParse: (contextPtr, outputRSigPtr, inputSigPtr, rid) => instance.exports._secp256k1_ecdsa_recoverable_signature_parse_compact(contextPtr, outputRSigPtr, inputSigPtr, rid),\n recoverableSignatureSerialize: (contextPtr, sigOutPtr, recIDOutPtr, rSigPtr) => instance.exports._secp256k1_ecdsa_recoverable_signature_serialize_compact(contextPtr, sigOutPtr, recIDOutPtr, rSigPtr),\n schnorrSign: (contextPtr, outputSigPtr, msg32Ptr, secretKeyPtr) => instance.exports._secp256k1_schnorr_sign(contextPtr, outputSigPtr, msg32Ptr, secretKeyPtr),\n schnorrVerify: (contextPtr, sigPtr, msg32Ptr, publicKeyPtr) => instance.exports._secp256k1_schnorr_verify(contextPtr, sigPtr, msg32Ptr, publicKeyPtr),\n seckeyVerify: (contextPtr, secretKeyPtr) => instance.exports._secp256k1_ec_seckey_verify(contextPtr, secretKeyPtr),\n sign: (contextPtr, outputSigPtr, msg32Ptr, secretKeyPtr) => instance.exports._secp256k1_ecdsa_sign(contextPtr, outputSigPtr, msg32Ptr, secretKeyPtr),\n signRecoverable: (contextPtr, outputRSigPtr, msg32Ptr, secretKeyPtr) => instance.exports._secp256k1_ecdsa_sign_recoverable(contextPtr, outputRSigPtr, msg32Ptr, secretKeyPtr),\n signatureMalleate: (contextPtr, outputSigPtr, inputSigPtr) => instance.exports._secp256k1_ecdsa_signature_malleate(contextPtr, outputSigPtr, inputSigPtr),\n signatureNormalize: (contextPtr, outputSigPtr, inputSigPtr) => instance.exports._secp256k1_ecdsa_signature_normalize(contextPtr, outputSigPtr, inputSigPtr),\n signatureParseCompact: (contextPtr, sigOutPtr, compactSigInPtr) => instance.exports._secp256k1_ecdsa_signature_parse_compact(contextPtr, sigOutPtr, compactSigInPtr),\n signatureParseDER: (contextPtr, sigOutPtr, sigDERInPtr, sigDERInLength) => instance.exports._secp256k1_ecdsa_signature_parse_der(contextPtr, sigOutPtr, sigDERInPtr, sigDERInLength),\n signatureSerializeCompact: (contextPtr, outputCompactSigPtr, inputSigPtr) => instance.exports._secp256k1_ecdsa_signature_serialize_compact(contextPtr, outputCompactSigPtr, inputSigPtr),\n signatureSerializeDER: (contextPtr, outputDERSigPtr, outputDERSigLengthPtr, inputSigPtr) => instance.exports._secp256k1_ecdsa_signature_serialize_der(contextPtr, outputDERSigPtr, outputDERSigLengthPtr, inputSigPtr),\n verify: (contextPtr, sigPtr, msg32Ptr, pubkeyPtr) => instance.exports._secp256k1_ecdsa_verify(contextPtr, sigPtr, msg32Ptr, pubkeyPtr),\n});\n/* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable functional/immutable-data, functional/no-expression-statement, @typescript-eslint/no-magic-numbers, functional/no-conditional-statement, no-bitwise, functional/no-throw-statement */\n/**\n * Method extracted from Emscripten's preamble.js\n */\nconst isLittleEndian = (buffer) => {\n const littleEndian = true;\n const notLittleEndian = false;\n const heap16 = new Int16Array(buffer);\n const heap32 = new Int32Array(buffer);\n const heapU8 = new Uint8Array(buffer);\n heap32[0] = 1668509029;\n heap16[1] = 25459;\n return heapU8[2] !== 115 || heapU8[3] !== 99\n ? /* istanbul ignore next */ notLittleEndian\n : littleEndian;\n};\n/**\n * Method derived from Emscripten's preamble.js\n */\nconst alignMemory = (factor, size) => Math.ceil(size / factor) * factor;\n/**\n * The most performant way to instantiate secp256k1 functionality. To avoid\n * using Node.js or DOM-specific APIs, you can use `instantiateSecp256k1`.\n *\n * Note, most of this method is translated and boiled-down from Emscripten's\n * preamble.js. Significant changes to the WASM build or breaking updates to\n * Emscripten will likely require modifications to this method.\n *\n * @param webassemblyBytes - A buffer containing the secp256k1 binary.\n */\nconst instantiateSecp256k1WasmBytes = async (webassemblyBytes) => {\n const STACK_ALIGN = 16;\n const GLOBAL_BASE = 1024;\n const WASM_PAGE_SIZE = 65536;\n const TOTAL_STACK = 5242880;\n const TOTAL_MEMORY = 16777216;\n const wasmMemory = new WebAssembly.Memory({\n initial: TOTAL_MEMORY / WASM_PAGE_SIZE,\n maximum: TOTAL_MEMORY / WASM_PAGE_SIZE,\n });\n /* istanbul ignore if */\n if (!isLittleEndian(wasmMemory.buffer)) {\n /*\n * note: this block is excluded from test coverage. It's A) hard to test\n * (must be either tested on big-endian hardware or a big-endian buffer\n * mock) and B) extracted from Emscripten's preamble.js, where it should\n * be tested properly.\n */\n throw new Error('Runtime error: expected the system to be little-endian.');\n }\n const STATIC_BASE = GLOBAL_BASE;\n const STATICTOP_INITIAL = STATIC_BASE + 67696 + 16;\n const DYNAMICTOP_PTR = STATICTOP_INITIAL;\n const DYNAMICTOP_PTR_SIZE = 4;\n const STATICTOP = (STATICTOP_INITIAL + DYNAMICTOP_PTR_SIZE + 15) & -16;\n const STACKTOP = alignMemory(STACK_ALIGN, STATICTOP);\n const STACK_BASE = STACKTOP;\n const STACK_MAX = STACK_BASE + TOTAL_STACK;\n const DYNAMIC_BASE = alignMemory(STACK_ALIGN, STACK_MAX);\n const heapU8 = new Uint8Array(wasmMemory.buffer);\n const heap32 = new Int32Array(wasmMemory.buffer);\n const heapU32 = new Uint32Array(wasmMemory.buffer);\n heap32[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE;\n const TABLE_SIZE = 6;\n const MAX_TABLE_SIZE = 6;\n // eslint-disable-next-line functional/no-let, @typescript-eslint/init-declarations\n let getErrNoLocation;\n /*\n * note: A number of methods below are excluded from test coverage. They are\n * a) not part of the regular usage of this library (should only be evaluated\n * if the consumer mis-implements the library and exist only to make\n * debugging easier) and B) already tested adequately in Emscripten, from\n * which this section is extracted.\n */\n const env = {\n DYNAMICTOP_PTR,\n STACKTOP,\n ___setErrNo: /* istanbul ignore next */ (value) => {\n if (getErrNoLocation !== undefined) {\n heap32[getErrNoLocation() >> 2] = value;\n }\n return value;\n },\n _abort: /* istanbul ignore next */ (err = 'Secp256k1 Error') => {\n throw new Error(err);\n },\n // eslint-disable-next-line camelcase\n _emscripten_memcpy_big: /* istanbul ignore next */ (dest, src, num) => {\n heapU8.set(heapU8.subarray(src, src + num), dest);\n return dest;\n },\n abort: /* istanbul ignore next */ (err = 'Secp256k1 Error') => {\n throw new Error(err);\n },\n abortOnCannotGrowMemory: /* istanbul ignore next */ () => {\n throw new Error('Secp256k1 Error: abortOnCannotGrowMemory was called.');\n },\n enlargeMemory: /* istanbul ignore next */ () => {\n throw new Error('Secp256k1 Error: enlargeMemory was called.');\n },\n getTotalMemory: () => TOTAL_MEMORY,\n };\n const info = {\n env: {\n ...env,\n memory: wasmMemory,\n memoryBase: STATIC_BASE,\n table: new WebAssembly.Table({\n element: 'anyfunc',\n initial: TABLE_SIZE,\n maximum: MAX_TABLE_SIZE,\n }),\n tableBase: 0,\n },\n global: { Infinity, NaN },\n };\n return WebAssembly.instantiate(webassemblyBytes, info).then((result) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n getErrNoLocation = result.instance.exports.___errno_location;\n return wrapSecp256k1Wasm(result.instance, heapU8, heapU32);\n });\n};\n/* eslint-enable functional/immutable-data, functional/no-expression-statement, @typescript-eslint/no-magic-numbers, functional/no-conditional-statement, no-bitwise, functional/no-throw-statement */\nconst getEmbeddedSecp256k1Binary = () => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.base64ToBin)(_secp256k1_base64__WEBPACK_IMPORTED_MODULE_2__.secp256k1Base64Bytes).buffer;\n/**\n * An ultimately-portable (but slower) version of `instantiateSecp256k1Bytes`\n * which does not require the consumer to provide the secp256k1 binary buffer.\n */\nconst instantiateSecp256k1Wasm = async () => instantiateSecp256k1WasmBytes(getEmbeddedSecp256k1Binary());\n//# sourceMappingURL=secp256k1-wasm.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1-wasm.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1.base64.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1.base64.js ***! + \******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ secp256k1Base64Bytes: () => (/* binding */ secp256k1Base64Bytes)\n/* harmony export */ });\n/* eslint-disable tsdoc/syntax */\n/**\n * @hidden\n */\n// prettier-ignore\nconst secp256k1Base64Bytes = 'AGFzbQEAAAABXg5gAn9/AGAGf39/f39/AX9gAX8AYAABf2AAAGADf39/AX9gAX8Bf2ACf38Bf2AEf39/fwF/YAV/f39/fwF/YAN/f38AYAd/f39/f39/AX9gBH9/f38AYAV/f39/fwAC5wEMA2VudgZtZW1vcnkCAYACgAIDZW52BXRhYmxlAXABBgYDZW52CXRhYmxlQmFzZQN/AANlbnYORFlOQU1JQ1RPUF9QVFIDfwADZW52CFNUQUNLVE9QA38AA2VudgVhYm9ydAACA2Vudg1lbmxhcmdlTWVtb3J5AAMDZW52DmdldFRvdGFsTWVtb3J5AAMDZW52F2Fib3J0T25DYW5ub3RHcm93TWVtb3J5AAMDZ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JCkPoAfnwgFUIaiHwiFadB////H3E2AhQgACAUIA9+IA0gDX58IBAgFn58IBcgE358IBJCCoZ8IAwgCn4gCyALfnwgDkIaiHwiDUL///8fgyIOQpD6AH58IBVCGoh8IgynQf///x9xNgIYIAAgFCATfiARIA9+fCAQIBh+fCAXIBZ+fCAOQgqGfCANQhqIIANBAXStIAp+fCINQv///x+DIg5CkPoAfnwgDEIaiHwiDKdB////H3E2AhwgACARIBN+IAsgD358IBQgFn58IBAgEH58IBcgGH58IA5CCoZ8IA1CGoggCiAKfnwiCkL///8fgyILQpD6AH58IAxCGoh8Ig+nQf///x9xNgIgIAAgCkIaiCIKQpD6AH4gGkL///8fg3wgC0IKhnwgD0IaiHwiC6dB////AXE2AiQgACALQhaIIApCDoZ8IgpC0Qd+IBtC////H4N8IgunQf///x9xNgIAIAAgCkIGhiAcQv///x+DfCALQhqIfCIKp0H///8fcTYCBCAAIApCGoggGUL///8fg3w+AggL4xQCIX8MfiMEIQ8jBEFAayQEIA8gASgCAK0iJSAlfiImPgIAIAFBBGoiFygCAK0iJCAlfiIjQiCIISkgI6ciA0EBdCIEICZCIIinaiICIARJIQUgDyACNgIEIAFBCGoiHCgCAK0iJyAlfiIjQiCIISggBCADSSApQgGGpyIGciAFaiIEICOnIgNBAXQiCGoiAiAISSEJIAUgBEVxIAYgKadJaiAIIANJIChCAYanIgVyIAlqIg5qIgggAiAkICR+IiOnIgNqIgIgA0kgI0IgiKdqIgZqIQogDyACNgIIIAFBDGoiHSgCAK0iJiAlfiIjQiCIISUgCiAjpyIEQQF0IgtqIgIgC0khDCAnICR+IiNCIIghJCACICOnIgNBAXQiB2oiAiAHSSENIA8gAjYCDCABQRBqIh4oAgCtIikgASgCAK0iJ34iI0IgiCErIAkgDkVxIAUgKKdJaiAIIA5JaiAKIAZJaiALIARJICVCAYanIgtyIAxqIglqIgUgByADSSAkQgGGpyIIciANaiIKaiIGICOnIgRBAXQiB2oiAiAHSSEVICYgFygCAK0iJn4iI0IgiCEo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hFiAPIAE2AhwgICgCAK0gKX4iI0IgiCEuIAogLadJIAkgLKdJaiALICinSWogISAbRXFqIBkgE0VxaiAaIBRFcWogDiAbSWogByATSWogBSAUSWogECAISWogESAGSSAqQgGGpyIJciAiaiITaiIOIBIgBEkgK0IBhqciCnIgF2oiFGoiByAMIANJICVCAYanIgtyIBVqIhBqIgUgDSACSSAkQgGGpyIIciAWaiIRaiIGICOnIgRBAXQiEmoiASASSSEZIB8oAgCtICd+IiNCIIghLCABICOnIgNBAXQiDGoiASAMSSEaIBgoAgCtICZ+IiNCIIghKCABICOnIgJBAXQiDWoiASANSSEbIAogK6dJIAkgKqdJaiALICWnSWogCCAkp0lqICIgE0VxaiAOIBNJaiAXIBRFcWogByAUSWogFSAQRXFqIAUgEElqIBYgEUVxaiAGIBFJaiASIARJIC5CAYanIg5yIBlqIhVqIgogDCADSSAsQgGGpyIHciAaaiIWaiILIA0gAkkgKEIBhqciBXIgG2oiEGoiCCABIB4oAgCtIiQgJH4iI6ciAmoiASACSSAjQiCIp2oiBmohESAPIAE2AiAgICgCAK0iKSAcKAIArX4iI0IgiCEtIBEgI6ciBEEBdCIMaiIBIAxJIRMgHygCAK0iJyAdKAIArSImfiIjQiCIISogASAjpyIDQQF0Ig1qIgEgDUkhFCAYKAIArSIlICR+IiNCIIghJCABICOnIgJBAXQiCWoiASAJSSESIA8gATYCJCApICZ+IiNCIIghKyAHICynSSAOIC6nSWogBSAop0lqIBkgFUVxaiAaIBZFcWogGyAQRXFqIAogFUlqIAsgFklqIAggEElqIBEgBklqIAwgBEkgLUIBhqciB3IgE2oiDGoiCyANIANJICpCAYanIgVyIBRqIg1qIgggCSACSSAkQgGGpyIGciASaiIJaiIEICOnIgNBAXQiDmoiASAOSSEQICcgHigCAK0iJn4iI0IgiCEoIAEgI6ciAkEBdCIKaiIBIApJIREgBSAqp0kgByAtp0lqIAYgJKdJaiATIAxFcWogCyAMSWogFCANRXFqIAggDUlqIBIgCUVxaiAEIAlJaiAOIANJICt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EUaiIRKAIAaiIIQRp2IABBGGoiEigCAGoiBEEadiAAQRxqIhMoAgBqIglBGnYgAEEgaiIUKAIAaiILQRp2IAVB////AXFqIgVBFnYgA0H///8fcSIDQUBrIAJB////H3EiAkHRB2pBGnZqQf///x9LIAYgAXEgB3EgCHEgBEH///8fcSIEcSAJcSALcUH///8fRiAFQf///wFGcXFyIgprQdEHcSACaiECIApBBnQgA2ogAkEadmoiA0EadiABQf///x9xaiIKQRp2IAZB////H3FqIgZBGnYgB0H///8fcWoiB0EadiAIQf///x9xaiIIQRp2IARqIgRBGnYgCUH///8fcWoiCUEadiALQf///x9xaiEBIAAgAkH///8fcTYCACANIANB////H3E2AgAgDiAKQf///x9xNgIAIA8gBkH///8fcTYCACAQIAdB////H3E2AgAgESAIQf///x9xNgIAIBIgBEH///8fcTYCACATIAlB////H3E2AgAgFCABQf///x9xNgIAIAwgAUEadiAFakH///8BcTYCAAuhFwEnfyMEIQQjBEHAA2okBCACKAJQIQYgASgCeARAIAAgBjYCeCAAIAIpAgA3AgAgACACKQIINwIIIAAgAikCEDcCECAAIAIpAhg3AhggACACKQIgNwIgIABBKGoiAyACQShqIgEpAgA3AgAgAyABKQIINwIIIAMgASkCEDcCECADIAEpAhg3AhggAyABKQIgNwIgIABBATYCUCAAQdQAaiIAQgA3AgAgAEIANwIIIABCADcCECAAQgA3AhggAEEANgIgIAQkBA8LIAYEQCADBEAgA0EBNgIAIANBBGoiAkIANwIAIAJCADcCCCACQgA3AhAgAkIANwIYIAJBADYCIAsgACABKQIANwIAIAAgASkCCDcCCCAAIAEpAhA3AhAgACABKQIYNwIYIAAgASkCIDcCICAAIAEpAig3AiggACABKQIwNwIwIAAgASkCODcCOCAAQUBrIAFBQGspAgA3AgAgACABKQJINwJIIAAgASkCUDcCUCAAIAEpAlg3AlggACABKQJgNwJgIAAgASkCaDcCaCAAIAEpAnA3AnAgACABKAJ4NgJ4IAQkBA8LIARB+ABqIQwgBEHQAGohJCAEQShqIQogAEH4AGoiK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BqNgIAIAVB/P3//wAgC2sgFigCBGo2AgQgBUH8////ACAeayAWKAIIajYCCCAFQfz///8AIB9rIBYoAgxqNgIMIAVB/P///wAgIGsgFigCEGo2AhAgBUH8////ACAhayAWKAIUajYCFCAFQfz///8AICJrIBYoAhhqNgIYIAVB/P///wAgI2sgFigCHGo2AhwgBUH8////ACAbayAWKAIgajYCICAFQfz//wcgHGsgFigCJGo2AiRB/P//ByAnKAIAayECIARBoAFqIgtBvOH//wAgDWsgBygCAGo2AgAgC0H8/f//ACAUayAHKAIEajYCBCALQfz///8AIBVrIAcoAghqNgIIIAtB/P///wAgDmsgBygCDGo2AgwgC0H8////ACAPayAHKAIQajYCECALQfz///8AIBBrIAcoAhRqNgIUIAtB/P///wAgEWsgBygCGGo2AhggC0H8////ACASayAHKAIcajYCHCALQfz///8AIAZrIAcoAiBqNgIgIAsgAiAHKAIkajYCJCAFEBdFBEAgDCALEAcgJCAFEAcgCiAFICQQCiADBEAgAyAFKQIANwIAIAMgBSkCCDcCCCADIAUpAhA3AhAgAyAFKQIYNwIYIAMgBSkCIDcCIAsgAEHQAGogJiAFEAogBCAIICQQCiAAIAQpAgA3AgAgACAEKQIINwIIIAAgBCkCEDcCECAAIAQpAhg3AhggACAEKQIgNwIgQfj7//8BIABBBGoiEygCAEEBdCAKQQRqIh4oAgBqayEOQfj///8BIABBCGoiFygCAEEBdCAKQQhqIh8oAgBqayEPQfj///8BIABBDGoiGCgCAEEBdCAKQQxqIiAoAgBqayEQQfj///8BIABBEGoiGSgCAEEBdCAKQRBqIiEoAgBqayERQfj///8BIABBFGoiGigCAEEBdCAKQRRqIiIoAgBqayESQfj///8BIABBGGoiBSgCAEEBdCAKQRhqIiMoAgBqayEGQfj///8BIABBHGoiBygCAEEBdCAKQRxqIhsoAgBqayEDQfj///8BIABBIGoiDSgCAEEBdCAKQSBqIhwoAgBqayECQfj//w8gAEEkaiIUKAIAQQF0IApBJGoiHSgCAGprIQEgAEH4wv//ASAAKAIAQQF0IAooAgBqayAMKAIAaiIVNgIAIBMgDiAMKAIEaiIONgIAIBcgDyAMKAIIaiIPNgIAIBggECAMKAIMaiIQNgIAIBkgESAMKAIQaiIRNgIAIBogEiAMKAIUaiISNgIAIAUgBiAMKAIYaiIGNgIAIAcgAyAMKAIcaiIDNgIAIA0gAiAMKAIgaiICNgIAIBQgASAMKAIkaiIBNgIAIABBKGoiE0G0pP//AiAVayAEKAIAajYCACAAQSxqIhdB9Pn//wIgDmsgBCgCBGo2AgAgAEEwaiIYQfT///8CIA9rIAQoAghqNgIAIABBNGoiGUH0////AiAQayAEKAIMajYCACAAQThqIhpB9P///wIgEWsgBCgCEGo2AgAgAEE8aiIFQfT///8CIBJrIAQoAhRqNgIAIABBQGsiB0H0////AiAGayAEKAIYajYCACAAQcQAaiINQfT///8CIANrIAQoAhxqNgIAIABByABqIhRB9P///wIgAmsgBCgCIGo2AgAgAEHMAGoiFUH0//8XIAFrIAQoAiRqNgIAIBMgEyALEAogCiAKIAkQCiAKQbzh//8AIAooAgBrIg42AgAgHkH8/f//ACAeKAIAayIPNgIAIB9B/P///wAgHygCAGsiEDYCACAgQfz///8AICAoAgBrIhE2AgAgIUH8////ACAhKAIAayISNgIAICJB/P///wAgIigCAGsiBjYCACAjQfz///8AICMoAgBrIgM2AgAgG0H8////ACAbKAIAayICNgIAIBxB/P///wAgHCgCAGsiATYCACAdQfz//wcgHSgCAGsiADYCACATIBMoAgAgDmo2AgAgFyAXKAIAIA9qNgIAIBggGCgCACAQajYCACAZIBkoAgAgEWo2AgAgGiAaKAIAIBJqNgIAIAUgBSgCACAGajYCACAHIAcoAgAgA2o2AgAgDSANKAIAIAJqNgIAIBQgFCgCACABajYCACAVIBUoAgAgAGo2AgAgBCQEDwsgCxAXBEAgACABIAMQGiAEJAQPCyADBEAgA0IANwIAIANCADcCCCADQgA3AhAgA0IANwIYIANCADcCIAsgKUEBNgIAIAQkBAuvAwEBfyAAIAFBHGoiAigCAEEYdjoAACAAIAIoAgBBEHY6AA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EAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEEAcgBCAEIAcQCiAEIAQQByAEIAQQByAEIAQQByAEIAQQByAEIAQQByAEIAQgARAKIAQgBBAHIAQgBBAHIAQgBBAHIAQgBCALEAogBCAEEAcgBCAEEAcgACABIAQQCiAEJAQL7gQBG38gAEEkaiILKAIAIgJBFnYiAUHRB2wgACgCAGohBCABQQZ0IABBBGoiDCgCAGogBEEadmoiBUEadiAAQQhqIg0oAgBqIgZB////H3EhByAGQRp2IABBDGoiDigCAGoiCEEadiAAQRBqIg8oAgBqIQEgCEH///8fcSEJIAFB////H3EhCiABQRp2IABBFGoiECgCAGoiEUEadiAAQRhqIhIoAgBqIRMgEUH///8fcSEUIBNBGnYgAEEcaiIVKAIAaiIWQRp2IABBIGoiFygCAGohAyAWQf///x9xIRggA0H///8fcSEZIANBGnYgAkH///8BcWoiAkEWdiAFQf///x9xIgVBQGsgBEH///8fcSIEQdEHaiIaQRp2IhtqQf///x9LIAggBnEgAXEgEXEgE0H///8fcSIBcSAWcSADcUH///8fRiACQf///wFGcXFyIgNFBEAgACAENgIAIAwgBTYCACANIAc2AgAgDiAJNgIAIA8gCjYCACAQIBQ2AgAgEiABNgIAIBUgGDYCACAXIBk2AgAgCyACNgIADwsgGyAFaiADQQZ0aiIDQRp2IAdqIgRBGnYgCWoiBkEadiAKaiIHQRp2IBRqIghBGnYgAWoiAUEadiAYaiIJQRp2IBlqIgpBGnYgAmpB////AXEhAiAAIBpB////H3E2AgAgDCADQf///x9xNgIAIA0gBEH///8fcTYCACAOIAZB////H3E2AgAgDyAHQf///x9xNgIAIBAgCEH///8fcTYCACASIAFB////H3E2AgAgFSAJQf///x9xNgIAIBcgCkH///8fcTYCACALIAI2AgALsAIBCn8gACgCJCIBQRZ2IgJB0QdsIAAoAgBqIgNB////H3EiBEHQB3MhBSAEQQBHIAVB////H0dxBEBBAA8LIANBGnYgAkEGdHIgACgCBGoiAkEadiAAKAIIaiIDQRp2IAAoAgxqIgZBGnYgACgCEGoiB0EadiAAKAIUaiIIQRp2IAAoAhhqIglBGnYgACgCHGoiCkEadiAAKAIgaiIAQRp2IAFB////AXFqIQEgAkHAAHMgBXEgA3EgBnEgB3EgCHEgCXEgCnEgAHEgAUGAgIAec3FB////H0YEf0EBBSACQf///x9xIARyIANB////H3FyIAZB////H3FyIAdB////H3FyIAhB////H3FyIAlB////H3FyIApB////H3FyIABB////H3FyIAFyRQtBAXELmAIBBH8gACACaiEEIAFB/wFxIQEgAkHDAE4EQANAIABBA3EEQCAAIAE6AAAgAEEBaiEADAELCyAEQXxxIgVBQGohBiABIAFBCHRyIAFBEHRyIAFBGHRyIQMDQCAAIAZMBEAgACADNgIAIAAgAzYCBCAAIAM2AgggACADNgIMIAAgAzYCECAAIAM2AhQgACADNgIYIAAgAzYCHCAAIAM2AiAgACADNgIkIAAgAzYCKCAAIAM2AiwgACADNgIwIAAgAzYCNCAAIAM2AjggACADNgI8IABBQGshAAwBCwsDQCAAIAVIBEAgACADNgIAIABBBGohAAwBCwsLA0AgACAESARAIAAgAToAACAAQQFqIQAMAQsLIAQgAmsLqy8BnwF/IwQhDSMEQbAmaiQEIA1BgCZqIQ4gDUHYJWohESANQdgkaiEGIA1BhCRqIRIgDUGwI2ohDCANQcgfaiEWIA1ByBdqIUkgDUHoD2ohBSANQagNaiEJIA1BiAhqIQsCfwJAIAMoAgQgAygCAHIgAygCCHIgAygCDHIgAygCEHIgAygCFHIgAygCGHIgAygCHHJFDQAgAigCeA0AIA1BhAhqIgpBADYCACANQYAIaiANIANBBRArIgM2AgAgBiACIAooAgAiD0H8AGxqIhBBABAaIAwgBikCADcCACAMIAYpAgg3AgggDCAGKQIQNwIQIAwgBikCGDcCGCAMIAYpAiA3AiAgDEEoaiIKIAZ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QggCSAKQf///x9xNgIAICQgJUH///8fcTYCACAmICdB////H3E2AgAgKCApQf///x9xNgIAICogK0H///8fcTYCACAsIC1B////H3E2AgAgLiAvQf///x9xNgIAIDAgMUH///8fcTYCACAyIAhB////H3E2AgAgIiAIQRp2ICNB////AXFqNgIAIBYgAikCADcCACAWIAIpAgg3AgggFiACKQIQNwIQIBYgAikCGDcCGCAWIAIpAiA3AiAgC0EANgKcBSAGIA8pAgA3AgAgBiAPKQIINwIIIAYgDykCEDcCECAGIA8pAhg3AhggBiAPKQIgNwIgIA4gBhAHIBEgDiAGEAogC0H4A2ogBUHoBWogDhAKIAtBoARqIAVBkAZqIBEQCiALIAUoAuAGNgLIBCAGIAYgIRAKIA4gBhAHIBEgDiAGEAogC0GkA2ogBUHsBGogDhAKIAtBzANqIAVBlAVqIBEQCiALIAUoAuQFNgL0AyAGIAYgHxAKIA4gBhAHIBEgDiAGEAogC0HQAmogBUHwA2ogDhAKIAtB+AJqIAVBmARqIBEQCiALIAUoAugENgKgAyAGIAYgHhAKIA4gBhAHIBEgDiAGEAogC0H8AWogBUH0AmogDhAKIAtBpAJqIAVBnANqIBEQCiALIAUoAuwDNgLMAiAGIAYgHRAKIA4gBhAHIBEgDiAGEAogC0GoAWogBUH4AWogDhAKIAtB0AFqIAVBoAJqIBEQCiALIAUoAvACNgL4ASAGIAYgBxAKIA4gBhAHIBEgDiAGEAogC0HUAGogBUH8AGogDhAKIAtB/ABqIAVBpAFqIBEQCiALIAUoAvQBNgKkASAGIAYgFBAKIA4gBhAHIBEgDiAGEAogCyAFIA4QCiALQShqIBAgERAKIAsgEygCADYCUEEBIUogA0EASgR/IAMFQQALDAELIBZBATYCACAWQQRqIgJCADcCACACQgA3AgggAkIANwIQIAJCADcCGCACQQA2AiBBASFLQQALIQIgBARAIEkgBEEPECsiAyFMIAMgAkoEQCADIQILCyABQfgAaiIdQQE2AgAgAUIANwIAIAFCADcCCCABQgA3AhAgAUIANwIYIAFCADcCICABQgA3AiggAUIAN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qIglBBGohmAEgCUEIaiGZASAJQQxqIZoBIAlBEGohmwEgCUEUaiGcASAJQRhqIZ0BIAlBHGohngEgCUEgaiGfASAJQSRqIaABIAFB0ABqIaEBIAFB1ABqIR8gBUEoaiEhIAVBLGohIiAFQTBqISMgBUE0aiEkIAVBOGohJSAFQTxqISYgBUFAayEnIAVBxABqISggBUHIAGohKSAFQcwAaiEqIA1BgAhqKAIAIaIBA0AgAkF/aiEEIAEgAUEAEBogSyACIKIBSnJFBEBBACEDA0AgDSADQYgIbGogBEECdGooAgAiBwRAIAsgA0EDdEHUAGxqIRUgB0EASgRAIAUgFSAHQX9qQQJtQdQAbGoiBykCADcCACAFIAcpAgg3AgggBSAHKQIQNwIQIAUgBykCGDcCGCAFIAcpAiA3AiAgBSAHKQIoNwIoIAUgBykCMDcCMCAFIAcpAjg3AjggBUFAayAHQUBrKQIANwIAIAUgBykCSDcCSCAFIAcoAlA2AlAFIAUgFSAHQX9zQQJtQdQAbGoiBykCADcCACAFIAcpAgg3AgggBSAHKQIQNwIQIAUgBykCGDcCGCAFIAcpAiA3AiAgBSAHKQIoNwIoIAUgBykCMDcCMCAFIAcpAjg3AjggBUFAayAHQUBrKQIANwIAIAUgBykCSDcCSCAFIAcoAlA2AlAgIUG84f//ACAhKAIAazYCACAiQfz9//8AICIoAgBrNgIAICNB/P///wAgIygCAGs2AgAgJEH8////ACAkKAIAazYCACAlQfz///8AICUoAgBrNgIAICZB/P///wAgJigCAGs2AgAgJ0H8////ACAnKAIAazYCACAoQfz///8AICgoAgBrNgIAIClB/P///wAgKSgCAGs2AgAgKkH8//8HICooAgBrNgIACyABIAEgBUEAEBALIANBAWoiAyBKRw0ACwsgAiBMTARAIEkgBEECdGooAgAiAwRAIAAoAgAhByADQQBKBEAgBSAHIANBf2pBAm1BBnRqECMFIAUgByADQX9zQQJtQQZ0ahAjICFBvOH//wAgISgCAGs2AgAgIkH8/f//ACAiKAIAazYCACAjQfz///8AICMoAgBrNgIAICRB/P///wAgJCgCAGs2AgAgJUH8////ACAlKAIAazYCACAmQfz///8AICYoAgBrNgIAICdB/P///wAgJygCAGs2AgAgKEH8////ACAoKAIAazYCACApQfz///8AICkoAgBrNgIAICpB/P//ByAqKAIAazYCAAsCQCBqKAIARQRAIB0oAgAEQCAdQQA2AgAgLCAWEAcgTSAsIBYQCiABIAUgLBAKIBMgYCBNEAogoQFBATYCACAfQgA3AgAgH0IANwIIIB9CADcCECAfQgA3AhggH0EANgIgDAILIB1BADYCACAOIB4gFhAKIBEgDhAHIAYgASkCADcCACAGIAEpAgg3AgggBiABKQIQNwIQIAYgASkCGDcCGCAGIAEpAiA3AiAgVigCACIVQRZ2IgdB0QdsIAYoAgBqIQMgB0EGdCBOKAIAaiADQRp2aiIXQRp2IE8oAgBqIhhBGnYgUCgCAGoiGUEadiBRKAIAaiIaQRp2IFIoAgBqIhtBGnYgUygCAGoiHEEadiBUKAIAaiIgQRp2IFUoAgBqIQcgBiADQf///x9xIkU2AgAgTiAXQf///x9xIhc2AgAgTyAYQf///x9xIhg2AgAgUCAZQf///x9xIhk2AgAgUSAaQf///x9xIho2AgAgUiAbQf///x9xIhs2AgAgUyAcQf///x9xIhw2AgAgVCAgQf///x9xIiA2AgAgVSAHQf///x9xIkY2AgAgViAHQRp2IBVB////AXFqIhU2AgAgEiAFIBEQCiAMIBMpAgA3AgAgDCATKQIINwIIIAwgEykCEDcCECAMIBMpAhg3AhggDCATKQIgNwIgIF8oAgAiR0EWdiIHQdEHbCAMKAIAaiEDIAdBBnQgVygCAGogA0EadmoiM0EadiBYKAIAaiI0QRp2IFkoAgBqIjVBGnYgWigCAGoiNkEadiBbKAIAaiI3QRp2IFwoAgBqIjhBGnYgXSgCAGoiSEEadiBeKAIAaiEHIAwgA0H///8fcSIDNgIAIFcgM0H///8fcSIzNgIAIFggNEH///8fcSI0NgIAIFkgNUH///8fcSI1NgIAIFogNkH///8fcSI2NgIAIFsgN0H///8fcSI3NgIAIFwgOEH///8fcSI4NgIAIF0gSEH///8fcSJINgIAIF4gB0H///8fcSKjATYCACBfIAdBGnYgR0H///8BcWoiBzYCACAPIGAgERAKIA8gDyAOEAogCEG84f//ACBFayASKAIAajYCACBrQfz9//8AIBdrIHQoAgBqNgIAIGxB/P///wAgGGsgdSgCAGo2AgAgbUH8////ACAZayB2KAIAajYCACBuQfz///8AIBprIHcoAgBqNgIAIG9B/P///wAgG2sgeCgCAGo2AgAgcEH8////ACAcayB5KAIAajYCACBxQfz///8AICBrIHooAgBqNgIAIHJB/P///wAgRmsgeygCAGo2AgAgc0H8//8HIBVrIHwoAgBqNgIAIBBBvOH//wAgA2sgDygCAGo2AgAgfUH8/f//ACAzayCGASgCAGo2AgAgfkH8////ACA0ayCHASgCAGo2AgAgf0H8////ACA1ayCIASgCAGo2AgAggAFB/P///wAgNmsgiQEoAgBqNgIAIIEBQfz///8AIDdrIIoBKAIAajYCACCCAUH8////ACA4ayCLASgCAGo2AgAggwFB/P///wAgSGsgjAEoAgBqNgIAIIQBQfz///8AIKMBayCNASgCAGo2AgAghQFB/P//ByAHayCOASgCAGo2AgAgCBAXRQRAIBQgEBAHICsgCBAHIAogCCArEAogHiAeIAgQCiAJIAYgKxAKIAEgCSkCADcCACABIAkpAgg3AgggASAJKQIQNwIQIAEgCSkCGDcCGCABIAkpAiA3AiAgLSgCACEDIC4oAgAhByAvKAIAIRUgMCgCACEXIDEoAgAhGCAyKAIAIRkgOSgCACEaIDooAgAhGyA7KAIAIRwgYSgCAEF+bCEgIGIoAgBBfmwhRSBjKAIAQX5sIUYgZCgCAEF+bCFHIGUoAgBBfmwhMyBmKAIAQX5sITQgZygCAEF+bCE1IGgoAgBBfmwhNiBpKAIAQX5sITcgASABKAIAQX5sQfjC//8BaiAKKAIAayAUKAIAaiI4NgIAIGEgIEH4+///AWogA2sgjwEoAgBqIgM2AgAgYiBFQfj///8BaiAHayCQASgCAGoiBzYCACBjIEZB+P///wFqIBVrIJEBKAIAaiIVNgIAIGQgR0H4////AWogF2sgkgEoAgBqIhc2AgAgZSAzQfj///8BaiAYayCTASgCAGoiGDYCACBmIDRB+P///wFqIBlrIJQBKAIAaiIZNgIAIGcgNUH4////AWogGmsglQEoAgBqIho2AgAgaCA2Qfj///8BaiAbayCWASgCAGoiGzYCACBpIDdB+P//D2ogHGsglwEoAgBqIhw2AgAgE0G0pP//AiA4ayAJKAIAajYCACA8QfT5//8CIANrIJgBKAIAajYCACA9QfT///8CIAdrIJkBKAIAajYCACA+QfT///8CIBVrIJoBKAIAajYCACA/QfT///8CIBdrIJsBKAIAajYCACBAQfT///8CIBhrIJwBKAIAajYCACBBQfT///8CIBlrIJ0BKAIAajYCACBCQfT///8CIBprIJ4BKAIAajYCACBDQfT///8CIBtrIJ8BKAIAajYCACBEQfT//xcgHGsgoAEoAgBqNgIAIBMgEyAQEAogCiAKIAwQCiAKQbzh//8AIAooAgBrIgM2AgAgLUH8/f//ACAtKAIAayIHNgIAIC5B/P///wAgLigCAGsiFTYCACAvQfz///8AIC8oAgBrIhc2AgAgMEH8////ACAwKAIAayIYNgIAIDFB/P///wAgMSgCAGsiGTYCACAyQfz///8AIDIoAgBrIho2AgAgOUH8////ACA5KAIAayIbNgIAIDpB/P///wAgOigCAGsiHDYCACA7Qfz//wcgOygCAGsiIDYCACATIBMoAgAgA2o2AgAgPCA8KAIAIAdqNgIAID0gPSgCACAVajYCACA+ID4oAgAgF2o2AgAgPyA/KAIAIBhqNgIAIEAgQCgCACAZajYCACBBIEEoAgAgGmo2AgAgQiBCKAIAIBtqNgIAIEMgQygCACAcajYCACBEIEQoAgAgIGo2AgAMAgsgEBAXBEAgASABQQAQGgUgHUEBNgIACwsLCwsgAkEBSgRAIAQhAgwBCwsgHSgCAARAIA0kBA8LIB4gHiAWEAogDSQEC84SATB/IwQhBCMEQaABaiQEIARB+ABqIQUgBEHQAGohByAEQShqIQMgACABKAJ4IgY2AnggAkEARyEIIAYEQCAIRQRAIAQkBA8LIAJBATYCACACQQRqIgBCADcCACAAQgA3AgggAEIANwIQIABC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AQQZsISsgCCgCAEEGbCEsIAkoAgBBBmwhLSAKKAIAQQZsIS4gCygCAEEGbCEvIAwoAgBBBmwhMCANKAIAQQZsITEgDigCAEEGbCEyIAMgAygCAEEGbEG84f//ACApa2o2AgAgAiAqQfz9//8AIAFrajYCACAGICtB/P///wAgEWtqNgIAIAggLEH8////ACAca2o2AgAgCSAtQfz///8AIB5rajYCACAKIC5B/P///wAgIGtqNgIAIAsgL0H8////ACAia2o2AgAgDCAwQfz///8AICRrajYCACANIDFB/P///wAgJmtqNgIAIA4gMkH8//8HIChrajYCACAAQShqIgEgBSADEAogB0Ga0v+/ASAEKAIAayICNgIAIA9B+vz/vwEgEigCAGsiAzYCACAQQfr//78BIBMoAgBrIgU2AgAgG0H6//+/ASAUKAIAayIHNgIAIB1B+v//vwEgFSgCAGsiBjYCACAfQfr//78BIBYoAgBrIgg2AgAgIUH6//+/ASAXKAIAayIJNgIAICNB+v//vwEgGCgCAGsiCjYCACAlQfr//78BIBkoAgBrIgs2AgAgJ0H6//8LIBooAgBrIgw2AgAgASABKAIAIAJqNgIAIABBLGoiASABKAIAIANqNgIAIABBMGoiASABKAIAIAVqNgIAIABBNGoiASABKAIAIAdqNgIAIABBOGoiASABKAIAIAZqNgIAIABBPGoiASABKAIAIAhqNgIAIABBQGsiASABKAIAIAlqNgIAIABBxABqIgEgASgCACAKajYCACAAQcgAaiIBIAEoAgAgC2o2AgAgAEHMAGoiACAAKAIAIAxqNgIAIAQkBAsLiAQBFH8jBCECIwRB0ABqJAQgAkEoaiIDIAEpAgA3AgAgAyABKQIINwIIIAMgASkCEDcCECADIAEpAhg3AhggAyABKQIgNwIgIAMQDyACIAFBKGoiASkCADcCACACIAEpAgg3AgggAiABKQIQNwIQIAIgASkCGDcCGCACIAEpAiA3AiAgAhAPIAMoAgghASADKAIMIQQgAygCFEECdCADKAIQIglBGHZyIAMoAhgiCkEcdHIhCyADKAIcIQUgAygCJEEKdCADKAIgIgxBEHZyIQ0gAigCBCIOQRp0IA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wAwIAggAykAODcAOCADQUBrIQMgBiAIEAwgAkFAaiICQcAATw0ACyANIA5rIQMgBQshAiADBEAgAiEEQQAhAgwCCwsMAQsgCCACaiAEIAMQCxoLIAogECgCACICQR12QRh0NgIAIAogAkELdEGAgPwHcSACQRt0ciACQQV2QYD+A3FyIAJBFXZB/wFxcjYCBCAQIAJBNyACa0E/cUEBaiIDajYCACAGQSBqIQUCQAJAIANBwAAgAkE/cSICayIESQRAQfmMBCEEDAEFIAUgAmpB+YwEIAQQCxogBEH5jARqIQIgBiAFEAwgAyAEayIDQcAATwRAA0AgBSACKQAANwAAIAUgAikACDcACCAFIAIpABA3ABAgBSACKQAYNwAYIAUgAikAIDcAICAFIAIpACg3ACggBSACKQAwNwAwIAUgAikAODcAOCACQUBrIQIgBiAFEAwgA0FAaiIDQcAATw0ACwsgAwRAIAIhBEEAIQIMAgsLDAELIAUgAmogBCADEAsaCyAQKAIAIgJBP3EhBCAQIAJBCGo2AgAgBkEgaiEFAkACQEHAACAEayIDQQhLBEAgCiECQQghAwwBBSAFIARqIAogAxALGiAKIANqIQIgBiAFEAxBCCADayIDQcAATwRAA0AgBSACKQAANwAAIAUgAikACDcACCAFIAIpABA3ABAgBSACKQAYNwAYIAUgAikAIDcAICAFIAIpACg3ACggBSACKQAwNwAwIAUgAikAODcAOCACQUBrIQIgBiAFEAwgA0FAaiIDQcAATw0ACwsgAwRAQQAhBAwCCwsMAQsgBSAEaiACIAMQCxoLIAYoAgAQCSESIAZBADYCACAGQQRqIh4oAgAQCSEIIB5BADYCACAGQQhqIh8oAgAQCSENIB9BADYCACAGQQxqIiAoAgAQCSEOICBBADYCACAGQRBqIiEoAgAQCSEFICFBADYCACAGQRRqIiMoAgAQCSEEICNBADYCACAGQRhqIhMoAgAQCSEDIBNBADYCACAGQRxqIh0oAgAQCSECIB1BADYCACAJIBI2AgAgCUEEaiIrIAg2AgAgCUEIaiIsIA02AgAgCUEMaiItIA42AgAgCUEQaiIuIAU2AgAgCUEUaiIv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IAMQCCADIAMQCCADIAMQCCADIAMQCCADIAMQCCADIAMQCCADIAMQCCADIAMQCCADIAMQCCADIAMQCCADIAMQCCADIAMQCCADIAMQCCADIAMgBRANIARB4AFqIgIgAxAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAiADEA0gBEHAAWoiAyACEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADEAggAyADIAIQDSAEQaABaiICIAMQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIgBRANIAIgAhAIIAIgAhAIIAIgAhAIIAIgAiAJEA0gAiACEAggAiACEAggAiACEAggAiACEAggAiACIAYQDSACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIgCRANIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAiAKEA0gAiACEAggAiACEAggAiACEAggAiACEAggAiACIAoQDSACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIgBhANIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAiAGEA0gAiACEAggAiACEAggAiACEAggAiACEAggAiACEAggAiACEAggAiACIAQQDSACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIgCRANIAIgAhAIIAIgAhAIIAIgAhAIIAIgAiAGEA0gAiACEAggAiACEAggAiACEAggAiACEAggAiACEAggAiACIAsQDSACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIgCRANIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAiAGEA0gAiACEAggAiACEAggAiACEAggAiACEAggAiACIAYQDSACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIgCBANIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAiALEA0gAiACEAggAiACEAggAiACEAggAiACEAggAiACEAggAiACEAggAiACIAoQDSACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIgBBANIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAiAMEA0gAiACEAggAiACEAggAiACEAggAiACEAggAiACEAggAiACEAggAiACIAQQDSACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIgBBANIAIgAhAIIAIgAhAIIAIgAhAIIAIgAhAIIAIgAiALEA0gAiACEAggAiACEAggAiACEAggAiACEAggAiACEAggAiACEAggAiACIAEQDSACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCACIAIQCCAAIAIgBxANIAQkBAvYAwETfyMEIQIjBEHQAGokBCACIAFB0ABqEAcgAiACIAAQCiABKAIkIgZBFnYiAEHRB2wgASgCAGohBCAAQQZ0IAEoAgRqIARBGnZqIgdBGnYgASgCCGoiCEEadiABKAIMaiIJQRp2IAEoAhBqIgpBGnYgASgCFGoiC0EadiABKAIYaiIMQRp2IAEoAhxqIg1BGnYgASgCIGohBUH8/f//ACACKAIEayEOQfz///8AIAIoAghrIQ9B/P///wAgAigCDGshEEH8////ACACKAIQayERQfz///8AIAIoAhRrIRJB/P///wAgAigCGGshE0H8////ACACKAIcayEUQfz///8AIAIoAiBrIQEgAigCJCEAIAJBKGoiA0G84f//ACACKAIAayAEQf///x9xajYCACADIA4gB0H///8fcWo2AgQgAyAPIAhB////H3FqNgIIIAMgECAJQf///x9xajYCDCADIBEgCkH///8fcWo2AhAgAyASIAtB////H3FqNgIUIAMgEyAMQf///x9xajYCGCADIBQgDUH///8fcWo2AhwgAyABIAVB////H3FqNgIgIAMgBkH///8BcUH8//8HaiAAayAFQRp2ajYCJCADEBchACACJAQgAAuXEAEKfyMEIQQjBEHgA2okBCAEQdAAaiEDIARBKGohCCAEQbgDaiILIAEQByALIAsgARAKIARBkANqIgogCxAHIAogCiABEAogBEHoAmoiBiAKKQIANwIAIAYgCikCCDcCCCAGIAopAhA3AhAgBiAKKQIYNwIYIAYgCikCIDcCICAGIAYQByAGIAYQByAGIAYQByAGIAYgChAKIARBwAJqIgIgBikCADcCACACIAYpAgg3AgggAiAGKQIQNwIQIAIgBikCGDcCGCACIAYpAiA3AiAgAiACEAcgAiACEAcgAiACEAcgAiACIAoQCiAEQZgCaiIGIAIpAgA3AgAgBiACKQIINwIIIAYgAikCEDcCECAGIAIpAhg3AhggBiACKQIgNwIgIAYgBhAHIAYgBhAHIAYgBiALEAogBEHwAWoiByAGKQIANwIAIAcgBikCCDcCCCAHIAYpAhA3AhAgByAGKQIYNwIYIAcgBikCIDcCICAHIAcQByAHIAcQByAHIAcQByAHIAcQByAHIAcQByAHIAcQByAHIAcQByAHIAcQByAHIAcQByAHIAcQByAHIAcQByAHIAcgBhAKIARByAFqIgUgBykCADcCACAFIAcpAgg3AgggBSAHKQIQNwIQIA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ICECDAEFIAQgAmogAyAJEAsaIAMgCWohASAGIAQQDEEgIAlrIgJBwABPBEADQCAEIAEpAAA3AAAgBCABKQAINwAIIAQgASkAEDcAECAEIAEpABg3ABggBCABKQAgNwAgIAQgASkAKDcAKCAEIAEpADA3ADAgBCABKQA4NwA4IAFBQGshASAGIAQQDCACQUBqIgJBwABPDQALCyACBEBBACEDDAILCwwBCyAEIANqIAEgAhALGgsgByAIKAIAIgFBHXZBGHQ2AgAgByABQQt0QYCA/AdxIAFBG3RyIAFBBXZBgP4DcXIgAUEVdkH/AXFyNgIEIAggAUE3IAFrQT9xQQFqIgJqNgIAAkACQCACQcAAIAFBP3EiAWsiA0kEQEH5jAQhAwwBBSAEIAFqQfmMBCADEAsaIANB+YwEaiEBIAYgBBAMIAIgA2siAkHAAE8EQANAIAQgASkAADcAACAEIAEpAAg3AAggBCABKQAQNwAQIAQgASkAGDcAGCAEIAEpACA3ACAgBCABKQAoNwAoIAQgASkAMDcAMCAEIAEpADg3ADggAUFAayEBIAYgBBAMIAJBQGoiAkHAAE8NAAsLIAIEQCABIQNBACEBDAILCwwBCyAEIAFqIAMgAhALGgsgCCgCACIBQT9xIQMgCCABQQhqNgIAAkACQEHAACADayICQQhLBEAgByEBQQghAgwBBSAEIANqIAcgAhALGiAHIAJqIQEgBiAEEAxBCCACayICQcAATwRAA0AgBCABKQAANwAAIAQgASkACDcACCAEIAEpABA3ABAgBCABKQAYNwAYIAQgASkAIDcAICAEIAEpACg3ACggBCABKQAwNwAwIAQgASkAODcAOCABQUBrIQEgBiAEEAwgAkFAaiICQcAATw0ACwsgAgRAQQAhAwwCCwsMAQsgBCADaiABIAIQCxoLIAYoAgAQCSEIIAZBADYCACAKKAIAEAkhCSAKQQA2AgAgCygCABAJIQogC0EANgIAIAwoAgAQCSELIAxBADYCACANKAIAEAkhByANQQA2AgAgDigCABAJIQMgDkEANgIAIA8oAgAQCSECIA9BADYCACARKAIAEAkhASAFIAg2AgAgBSAJNgIEIAUgCjYCCC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kEfyAEIQFBACEEIAMFIAYgAmpBgH9qIgtBQHEiB0GAAWogBmshBiADIQIgBCEDA0AgDiADKQAANwAAIA4gAykACDcACCAOIAMpABA3ABAgDiADKQAYNwAYIA4gAykAIDcAICAOIAMpACg3ACggDiADKQAwNwAwIA4gAykAODcAOCADQUBrIQMgCiAOEAwgAkFAaiICQcAATw0ACyABIAZqIQFBACEEIAsgB2sLIQILIAIEQCAKQSBqIARqIAEgAhALGgsgCSANKAIAIgFBHXZBGHQ2AgAgCSABQQt0QYCA/AdxIAFBG3RyIAFBBXZBgP4DcXIgAUEVdkH/AXFyNgIEIA0gAUE3IAFrQT9xQQFqIgJqNgIAIApBIGohBAJAAkAgAkHAACABQT9xIgFrIgNJBEBB+YwEIQMMAQUgBCABakH5jAQgAxALGiADQfmMBGohASAKIAQQDCACIANrIgJBwABPBEADQCAEIAEpAAA3AAAgBCABKQAINwAIIAQgASkAEDcAECAEIAEpABg3ABggBCABKQAgNwAgIAQgASkAKDcAKCAEIAEpADA3ADAgBCABKQA4NwA4IAFBQGshASAKIAQQDCACQUBqIgJBwABPDQALCyACBEAgASEDQQAhAQwCCwsMAQsgBCABaiADIAIQCxoLIA0oAgAiAUE/cSEDIA0gAUEIajYCACAKQSBqIQQCQAJAQcAAIANrIgJBCEsEQCAJIQFBCCECDAEFIAQgA2ogCSACEAsaIAkgAmohASAKIAQQDEEIIAJrIgJBwABPBEADQCAEIAEpAAA3AAAgBCABKQAINwAIIAQgASkAEDcAECAEIAEpABg3ABggBCABKQAgNwAgIAQgASkAKDcAKCAEIAEpADA3ADAgBCABKQA4NwA4IAFBQGshASAKIAQQDCACQUBqIgJBwABPDQALCyACBEBBACEDDAILCwwBCyAEIANqIAEgAhALGgsgCigCABAJIQ4gCkEANgIAIBooAgAQCSELIBpBADYCACAbKAIAEAkhByAbQQA2AgAgHCgCABAJIQYgHEEANgIAIB0oAgAQCSEEIB1BADYCACAeKAIAEAkhAyAeQQA2AgAgHygCABAJIQIgH0EANgIAIC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PDQALCyACBEBBACEDDAILCwwBCyAFIANqIAEgAhALGgsgDCgCABAJIQ4gDEEANgIAIBMoAgAQCSELIBNBADYCACAUKAIAEAkhByAUQQA2AgAgFSgCABAJIQYgFUEANgIAIBYoAgAQCSEEIBZBADYCACAXKAIAEAkhAyAXQQA2AgAgGCgCABAJIQIgGEEANgIAICEoAgAQCSEBICFBADYCACAuIA42AAAgLyALNgAAIDAgBzYAACAxIAY2AAAgMiAENgAAIDMgAzYAACA0IAI2AAAgNSABNgAAIAogGRATIA0oAgAiAUE/cSEEIA0gAUEgajYCACAKQSBqIQsCQAJAQcAAIARrIgFBIEsEQCAAIQEgBCEDQSAhAgwBBSALIARqIAAgARALGiAAIAFqIQMgCiALEAxBICABayICQcAASQR/IAMFIABB5ABqIARBoH9qIgdBQHEiBkEcciAEa2ohBCACIQEgAyECA0AgCyACKQAANwAAIAsgAikACDcACCALIAIpABA3ABAgCyACKQAYNwAYIAsgAikAIDcAICALIAIpACg3ACggCyACKQAwNwAwIAsgAikAODcAOCACQUBrIQIgCiALEAwgAUFAaiIBQcAATw0ACyAHIAZrIQIgBAshASACBEBBACEDDAILCwwBCyALIANqIAEgAhALGgsgCSANKAIAIgFBHXZBGHQ2AgAgCSABQQt0QYCA/AdxIAFBG3RyIAFBBXZBgP4DcXIgAUEVdkH/AXFyNgIEIA0gAUE3IAFrQT9xQQFqIgJqNgIAIApBIGohBAJAAkAgAkHAACABQT9xIgFrIgNJBEBB+YwEIQMMAQUgBCABakH5jAQgAxALGiADQfmMBGohASAKIAQQDCACIANrIgJBwABPBEADQCAEIAEpAAA3AAAgBCABKQAINwAIIAQgASkAEDcAECAEIAEpABg3ABggBCABKQAgNwAgIAQgASkAKDcAKCAEIAEpADA3ADAgBCABKQA4NwA4IAFBQGshASAKIAQQDCACQUBqIgJBwABPDQALCyACBEAgASEDQQAhAQwCCwsMAQsgBCABaiADIAIQCxoLIA0oAgAiAUE/cSEDIA0gAUEIajYCACAKQSBqIQQCQAJAQcAAIANrIgJBCEsEQCAJIQFBCCECDAEFIAQgA2ogCSACEAsaIAkgAmohASAKIAQQDEEIIAJrIgJBwABPBEADQCAEIAEpAAA3AAAgBCABKQAINwAIIAQgASkAEDcAECAEIAEpABg3ABggBCABKQAgNwAgIAQgASkAKDcAKCAEIAEpADA3ADAgBCABKQA4NwA4IAFBQGshASAKIAQQDCACQUBqIgJBwABPDQALCyACBEBBACEDDAILCwwBCyAEIANqIAEgAhALGgsgCigCABAJIQ4gCkEANgIAIBooAgAQCSELIBpBADYCACAbKAIAEAkhByAbQQA2AgAgHCgCABAJIQYgHEEANgIAIB0oAgAQCSEEIB1BADYCACAeKAIAEAkhAyAeQQA2AgAgHygCABAJIQIgH0EANgIAICAoAgAQCSEBICBBADYCACAIIA42AgAgIiALNgIAICMgBzYCACAkIAY2AgAgJSAENgIAICYgAzYCACAnIAI2AgAgKCABNgIAIBEoAgAiAUE/cSEDIBEgAUEgajYCAAJAAkBBwAAgA2siBEEgSwRAIAghASADIQJBICEDDAEFIAUgA2ogCCAEEAsaIAggBGohAiAMIAUQDEEgIARrIgFBwABJBH8gASEDIAIFIANBoH9qIgNBBnZBAXQhBiAEQUBqIQQDQCAFIAIpAAA3AAAgBSACKQAINwAIIAUgAikAEDcAECAFIAIpABg3ABggBSACKQAgNwAgIAUgAikAKDcAKCAFIAIpADA3ADAgBSACKQA4NwA4IAJBQGshAiAMIAUQDCABQUBqIgFBwABPDQALIANBP3EhAyAIIAZBBGpBBXRqIARqCyEBIAMEQEEAIQIMAgsLDAELIAUgAmogASADEAsaCyAJIBEoAgAiAUEddkEYdDYCACAJIAFBC3RBgID8B3EgAUEbdHIgAUEFdkGA/gNxciABQRV2Qf8BcXI2AgQgESABQTcgAWtBP3FBAWoiAmo2AgACQAJAIAJBwAAgAUE/cSIBayIISQRAQfmMBCEIDAEFIAUgAWpB+YwEIAgQCxogCEH5jARqIQEgDCAFEAwgAiAIayICQcAATwRAA0AgBSABKQAANwAAIAUgASkACDcACCAFIAEpABA3ABAgBSABKQAYNwAYIAUgASkAIDcAICAFIAEpACg3ACggBSABKQAwNwAwIAUgASkAODcAOCABQUBrIQEgDCAFEAwgAkFAaiICQcAATw0ACwsgAgRAIAEhCEEAIQEMAgsLDAELIAUgAWogCCACEAsaCyARKAIAIgFBP3EhAiARIAFBCGo2AgACQEHAACACayIIQQhLBEAgCSEBIAIhCUEIIQIFIAUgAmogCSAIEAsaIAkgCGohASAMIAUQDEEIIAhrIgJBwABPBEADQCAFIAEpAAA3AAAgBSABKQAINwAIIAUgASkAEDcAECAFIAEpABg3ABggBSABKQAgNwAgIAUgASkAKDcAKCAFIAEpADA3ADAgBSABKQA4NwA4IAFBQGshASAMIAUQDCACQUBqIgJBwABPDQALCyACBEBBACEJDAILIAwoAgAQCSEHIAxBADYCACATKAIAEAkhBiATQQA2AgAgFCgCABAJIQQgFEEANgIAIBUoAgAQCSEDIBVBADYCACAWKAIAEAkhCCAWQQA2AgAgFygCABAJIQkgF0EANgIAIBgoAgAQCSECIBhBADYCACAhKAIAEAkhASAAIAc2AAAgKSAGNgAAICogBDYAACArIAM2AAAgLCAINgAAIC0gCTYAACASIAI2AAAgECABNgAAIABBQGtBADYCACAKJAQPCwsgBSAJaiABIAIQCxogDCgCABAJIQcgDEEANgIAIBMoAgAQCSEGIBNBADYCACAUKAIAEAkhBCAUQQA2AgAgFSgCABAJIQMgFUEANgIAIBYoAgAQCSEIIBZBADYCACAXKAIAEAkhCSAXQQA2AgAgGCgCABAJIQIgGEEANgIAICEoAgAQCSEBIAAgBzYAACApIAY2AAAgKiAENgAAICsgAzYAACAsIAg2AAAgLSAJNgAAIBIgAjYAACAQIAE2AAAgAEFAa0EANgIAIAokBAvlBAIOfwJ+IwQhAyMEQSBqJAQgAyABKQIANwIAIAMgASkCCDcCCCADIAEpAhA3AhAgAyABKQIYNwIYIABBAEGACBAYGiADQRxqIgYoAgAiAUF/SgR/QQEFIAMgAygCACIEQX9zrULCgtmBDXwiESAEIAFyIANBBGoiBCgCAC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ABCADcCGAsgASABKAIAIARqNgIAIAMkBEEBC9YDAQN/IwQhAyMEQYABaiQEIAAgASkCADcCACAAIAEpAgg3AgggACABKQIQNwIQIAAgASkCGDcCGCAAIAEpAiA3AiAgA0HQAGoiBSABEAcgA0EoaiIEIAEgBRAKIABBADYCUCADIAQoAgBBB2o2AgAgAyAEKAIENgIEIAMgBCgCCDYCCCADIAQoAgw2AgwgAyAEKAIQNgIQIAMgBCgCFDYCFCADIAQoAhg2AhggAyAEKAIcNgIcIAMgBCgCIDYCICADIAQoAiQ2AiQgAEEoaiIFIAMQIkUEQCADJARBAA8LIAUQFiAFKAIAIgFBAXEgAkYEQCADJARBAQ8LIAVBvOH//wAgAWs2AgAgAEEsaiIBQfz9//8AIAEoAgBrNgIAIABBMGoiAUH8////ACABKAIAazYCACAAQTRqIgFB/P///wAgASgCAGs2AgAgAEE4aiIBQfz///8AIAEoAgBrNgIAIABBPGoiAUH8////ACABKAIAazYCACAAQUBrIgFB/P///wAgASgCAGs2AgAgAEHEAGoiAUH8////ACABKAIAazYCACAAQcgAaiIBQfz///8AIAEoAgBrNgIAIABBzABqIgBB/P//ByAAKAIAazYCACADJARBAQv2CwIRfwJ+IwQhBSMEQaADaiQEIAVBuAJqIgJCADcAACACQgA3AAggAkIANwAQIAJCADcAGCACQgA3ACAgAkIANwAoIAJCADcAMCACQgA3ADggAUUEQCAAQQA2ApwBIABBJGoiA0GQiAQpAgA3AgAgA0GYiAQpAgA3AgggA0GgiAQpAgA3AhAgA0GoiAQpAgA3AhggA0GwiAQpAgA3AiAgAEEBNgJ0IABB+ABqIgNCADcCACADQgA3AgggA0IANwIQIANCADcCGCADQQA2AiAgAEGEuLznADYCTCAAQf61r/AANgJQIABBuMz59QA2AlQgAEHny/X2ADYCWCAAQcjQi/gANgJcIABB0vvu4wA2AmAgAEG8gMHtADYCZCAAQYbVuecANgJoIABB2bKj7AA2AmwgAEHG4rcHNgJwIABBATYCBCAAQQhqIgNCADcCACADQgA3AgggA0IANwIQIANBADYCGAsgBUH4AmoiBiAAQQRqIg8QESACIAYpAAA3AAAgAiAGKQAINwAIIAIgBikAEDcAECACIAYpABg3ABggAUEARyIHBEAgAkEgaiIDIAEpAAA3AAAgAyABKQAINwAIIAMgASkAEDcAECADIAEpABg3ABgLIAVBkAJqIQggBUHwAWohBCAFQfAAaiEDIAVByABqIQEgBUEEaiIQIAIgBwR/QcAABUEgCxAqIAJCADcAACACQgA3AAggAkIANwAQIAJCADcAGCACQgA3ACAgAkIANwAoIAJCADcAMCACQgA3ADggAUEEaiECIAFBCGohByABQQxqIQkgAUEQaiEKIAFBFGohCyABQRhqIQwgAUEcaiENIAFBIGohESABQSRqIRIDQCAQIAYQHyAFIAEgBhAURSIONgIAIA4EQCAFQQE2AgAMAQUgBSACKAIAIAEoAgByIAcoAgByIAkoAgByIAooAgByIAsoAgByIAwoAgByIA0oAgByIBEoAgByIBIoAgByRSIONgIAIA4NAQsLIAggARAHIABBJGoiAiACIAgQCiAAQcwAaiIHIAcgCBAKIAcgByABEAogAEH0AGoiCCAIIAEQCiABQgA3AgAgAUIANwIIIAFCADcCECABQgA3AhggAUIANwIgIARBBGohASAEQQhqIQggBEEMaiEHIARBEGohCSAEQRRqIQogBEEYaiELIARBHGohDANAIBAgBhAfIAQgBiAFEA4gBSgCAARAIAVBATYCAAwBBSAFIAEoAgAgBCgCAHIgCCgCAHIgBygCAHIgCSgCAHIgCigCAHIgCygCAHIgDCgCAHJFIg02AgAgDQ0BCwsgBkIANwAAIAZCADcACCAGQgA3ABAgBkIANwAYIAAgAyAEEB4gBCAEKAIAIgBBf3OtQsKC2YENfCITIAEoAgAiBiAAciAIKAIAIgByIAcoAgAiEHIgCSgCACINciAKKAIAIhFyIAsoAgAiEnIgDCgCACIOckEAR0EfdEEfda0iFIM+AgAgASATQiCIQoy9yf4LhCAGQX9zrXwiEyAUgz4CACAIIABBf3OtQrvAovoKfCATQiCIfCITIBSDPgIAIAcgEEF/c61C5rm71Qt8IBNCIIh8IhMgFIM+AgAgCSANQX9zrUL+////D3wgE0IgiHwiEyAUgz4CACAKIBFBf3OtQv////8PfCATQiCIfCITIBSDPgIAIAsgEkF/c61C/////w98IBNCIIh8IhMgFIM+AgAgDCAOQX9zrUL/////D3wgE0IgiHwgFIM+AgAgDyAEKQIANwIAIA8gBCkCCDcCCCAPIAQpAhA3AhAgDyAEKQIYNwIYIAIgAykCADcCACACIAMpAgg3AgggAiADKQIQNwIQIAIgAykCGDcCGCACIAMpAiA3AiAgAiADKQIoNwIoIAIgAykCMDcCMCACIAMpAjg3AjggAkFAayADQUBrKQIANwIAIAIgAykCSDcCSCACIAMpAlA3AlAgAiADKQJYNwJYIAIgAykCYDcCYCACIAMpAmg3AmggAiADKQJwNwJwIAIgAygCeDYCeCAFJAQLuAQBB38jBCEFIwRB0AJqJAQgAUUEQEHkiAQgACgCqAEgACgCpAFBA3FBAmoRAAAgBSQEQQAPCyABQgA3AAAgAUIANwAIIAFCADcAECABQgA3ABggAUIANwAgIAFCADcAKCABQgA3ADAgAUIANwA4IABBBGoiBigCAEUEQEG6iwQgACgCqAEgACgCpAFBA3FBAmoRAAAgBSQEQQAPCyACRQRAQYiMBCAAKAKoASAAKAKkAUEDcUECahEAACAFJARBAA8LIAVBoAJqIQggBUH4AWohCSAFQfwAaiEDIAVBKGohByAFQQhqIgQgAiAFEA4gBSgCAARAQQAhAAUgBCgCBCAEKAIAciAEKAIIciAEKAIMciAEKAIQciAEKAIUciAEKAIYciAEKAIcckEARyICIQAgAgRAIAYgAyAEEB4gByADKAJ4NgJQIANB0ABqIgYgBhAVIAggBhAHIAkgBiAIEAogAyADIAgQCiADQShqIgIgAiAJEAogBkEBNgIAIANB1ABqIgZCADcCACAGQgA3AgggBkIANwIQIAZCADcCGCAGQQA2AiAgByADKQIANwIAIAcgAykCCDcCCCAHIAMpAhA3AhAgByADKQIYNwIYIAcgAykCIDcCICAHQShqIgMgAikCADcCACADIAIpAgg3AgggAyACKQIQNwIQIAMgAikCGDcCGCADIA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QF/IAEgAEggACABIAJqSHEEQCABIAJqIQEgACIDIAJqIQADQCACQQBKBEAgAkEBayECIABBAWsiACABQQFrIgEsAAA6AAAMAQsLIAMhAAUgACABIAIQCxoLIAALBgBBwJEEC64YATp/IwQhCCMEQcAGaiQEIAFB/wFxQQFHBEAQBQsgAEGACCkDADcCpAEgAEGICCkDADcCrAEgAEEANgIAIABBBGoiAkEANgIAIAFBgARxBEAgAkGQCDYCACACQQAQLwsgAUGAAnFFBEAgCCQEIAAPCyAIQZAGaiEDIAhB6AVqIQQgCEHsBGohDiAIQZgEaiEPIAhBxANqIQYgCEHIAmohCSAIQaACaiEQIAhB+AFqIQwgCEHQAWohDSAIQagBaiEUIAhBgAFqISggAEG4AWohByAAKAIARQRAIAhBADYCeCAIQZCIBCkCADcCACAIQZiIBCkCADcCCCAIQaCIBCkCADcCECAIQaiIBCkCADcCGCAIQbCIBCkCADcCICAIQShqIgVBuIgEKQIANwIAIAVBwIgEKQIANwIIIAVByIgEKQIANwIQIAVB0IgEKQIANwIYIAVB2IgEKQIANwIgIAhBATYCUCAIQdQAaiIBQgA3AgAgAUIANwIIIAFCADcCECABQgA3AhggAUEANgIgIAAgBzYCACAOIAhBABAaIA8gDikCADcCACAPIA4pAgg3AgggDyAOKQIQNwIQIA8gDikCGDcCGCAPIA4pAiA3AiAgD0EoaiICIA5BKGoiASkCADcCACACIAEpAgg3AgggAiABKQIQNwIQIAIgASkCGDcCGCACIAEpAiA3AiAgD0EANgJQIAMgDkHQAGoiExAHIAQgAyATEAogBiAIIAMQCiAGQShqIgogBSAEEAogBkHQAGoiFUEANgIAIAkgBikCADcCACAJIAYpAgg3AgggCSAGKQIQNwIQIAkgBikCGDcCGCAJIAYpAiA3AiAgCUEoaiIRIAopAgA3AgAgESAKKQIINwIIIBEgCikCEDcCECARIAopAhg3AhggESAKKQIgNwIgIAlB0ABqIhIgCEHQAGoiASkCADcCACASIAEpAgg3AgggEiABKQIQNwIQIBIgASkCGDcCGCASIAEpAiA3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IDKQIANwIAIAIgAykCCDcCCCACIAMpAhA3AhAgAiADKQIYNwIYIAIgAykCIDcCICANQQE2AlAgDUHUAGoiAkIANwIAIAJCADcCCCACQgA3AhAgAkIANwIYIAJBADYCICAWIAcQICALIBYgBRANIAsgCygCACICQX9zrULCgtmBDXwiGiALQQRqIgMoAgAiBCACciALQQhqIgIoAgAiBnIgC0EMaiIHKAIAIgxyIAtBEGoiCigCACIPciALQRRqIhAoAgAiEXIgC0EYaiISKAIAIhRyIAtBHGoiFygCACITckEAR0EfdEEfda0iG4M+AgAgAyAaQiCIQoy9yf4LhCAEQX9zrXwiGiAbgz4CACACIAZBf3OtQrvAovoKfCAaQiCIfCIaIBuDPgIAIAcgDEF/c61C5rm71Qt8IBpCIIh8IhogG4M+AgAgCiAPQX9zrUL+////D3wgGkIgiHwiGiAbgz4CACAQIBFBf3OtQv////8PfCAaQiCIfCIaIBuDPgIAIBIgFEF/c61C/////w98IBpCIIh8IhogG4M+AgAgFyATQX9zrUL/////D3wgGkIgiHwgG4M+AgAgGSAWIAkQDSAAIAggDSAZIAsQGSAOIAhB+ABqIgMoAgAiADYCUCAARQRAIAhB0ABqIgIgAhAVIBUgAhAHIBggAiAVEAogCCAIIBUQCiAIQShqIgAgACAYEAogAkEBNgIAIAhB1ABqIgJCADcCACACQgA3AgggAkIANwIQIAJCADcCGCACQQA2AiAgDiAIKQIANwIAIA4gCCkCCDcCCCAOIAgpAhA3AhAgDiAIKQIYNwIYIA4gCCkCIDcCICAOQShqIgIgACkCADcCACACIAApAgg3AgggAiAAKQIQNwIQIAIgACkCGDcCGCACIAApAiA3AiAgAygCACEACyAARQRAIAEgDhAbIAUkBEEBDwsLCyABQgA3AAAgAUIANwAIIAFCADcAECABQgA3ABggAUIANwAgIAFCADcAKCABQgA3ADAgAUIANwA4IAUkBEEAC6AGARF/IwQhBiMEQdABaiQEIAZBADYCACAAQQRqIg8oAgBFBEBBuosEIAAoAqgBIAAoAqQBQQNxQQJqEQAAIAYkBEEADwsgAkUEQEGsiwQgACgCqAEgACgCpAFBA3FBAmoRAAAgBiQEQQAPCyABRQRAQfaLBCAAKAKoASAAKAKkAUEDcUECahEAACAGJARBAA8LIANFBEBBiIwEIAAoAqgBIAAoAqQBQQNxQQJqEQAAIAYkBEEADwsgBkGIAWohCiAGQegAaiELIAZByABqIQcgBkEoaiEIIAZBCGohCSAGQQRqIQ0gBkGoAWohDCAEBH8gBAVBAQshDiAHIAMgBhAOIAYoAgBFBEAgBygCBCAHKAIAciAHKAIIciAHKAIMciAHKAIQciAHKAIUciAHKAIYciAHKAIccgRAIAkgAkEAEA4CQCAMIAIgA0EAIAVBACAOQQFxEQEAIgAEQCAIQQRqIRAgCEEIaiERIAhBDGohEiAIQRBqIRMgCEEUaiEUIAhBGGohFSAIQRxqIRZBACEEA0AgCCAMIAYQDiAGKAIARQRAIBAoAgAgCCgCAHIgESgCAHIgEigCAHIgEygCAHIgFCgCAHIgFSgCAHIgFigCAHIEQCAPIAogCyAHIAkgCCANEDENBAsLIAwgAiADQQAgBSAEQQFqIgQgDkEBcREBACIADQBBACEACwVBACEACwsgCUIANwIAIAlCADcCCCAJQgA3AhAgCUIANwIYIAhCADcCACAIQgA3AgggCEIANwIQIAhCADcCGCAHQgA3AgAgB0IANwIIIAdCADcCECAHQgA3AhggAARAIA0oAgAhAyABIAopAAA3AAAgASAKKQAINwAIIAEgCikAEDcAECABIAopABg3ABggAUEgaiICIAspAAA3AAAgAiALKQAINwAIIAIgCykAEDcAECACIAspABg3ABggAUFAayADOgAAIAYkBCAADwsLCyABQgA3AAAgAUIANwAIIAFCADcAECABQgA3ABggAUIANwAgIAFCADcAKCABQgA3ADAgAUIANwA4IAFBQGtBADoAACAGJARBAAv+AQECfyMEIQQjBEFAayQEIAFFBEBByooEIAAoAqgBIAAoAqQBQQNxQQJqEQAAIAQkBEEADwsgA0UEQEGuigQgACgCqAEgACgCpAFBA3FBAmoRAAAgBCQEQQAPCyAEQSBqIQUgAgR/IAUgAykAADcAACA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gAgHSAYQf///x9xNgIAIDEgDkH///8fcTYCACAyICBB////H3E2AgAgMyAhQf///x9xNgIAIDQgBEH///8fcTYCACAlIARBGnYgFEH///8BcWo2AgAgB0HAAmoiBCACIAYQCiABKAJMIhlBFnYiBUHRB2wgASgCKGohGiAFQQZ0IAEoAixqIBpBGnZqIihBGnYgASgCMGoiKUEadiABKAI0aiIqQRp2IAEoAjhqIitBGnYgASgCPGoiLEEadiABQUBrKAIAaiItQRp2IAEoAkRqIiJBGnYgASgCSGohHiAHQZgCaiIFIAJBKGoiWCAGEAogBSAFID0QCiAHQfABaiIBIAMpAgA3AgAgASADKQIINwIIIAEgAykCEDcCECABIAMpAhg3AhggASADKQIgNwIgIAEgASgCACAEKAIAIgZqNgIAIAFBBGoiFCAUKAIAIAQoAgQiNWo2AgAgAUEIaiIVIBUoAgAgBCgCCCI2ajYCACABQQxqIhYgFigCACAEKAIMIjdqNgIAIAFBEGoiFyAXKAIAIAQoAhAiCWo2AgAgAUEUaiIYIBgoAgAgBCgCFCIQajYCACABQRhqIg4gDigCACAEKAIYIgtqNgIAIAFBHGoiICAgKAIAIAQoAhwiEWo2AgAgAUEgaiIhICEoAgAgBCgCICIPajYCACABQSRqIi4gLigCACAEKAIkIiNqNgIAIAUoAgAgGkH///8fcSJDaiE4IAUoAgQgKEH///8fcSJEaiEoIAUoAgggKUH///8fcSJFaiEpIAUoAgwgKkH///8fcSJGaiEqIAUoAhAgK0H///8fcSJHaiErIAUoAhQgLEH///8fcSJIaiEsIAUoAhggLUH///8fcSJJaiEtIAUoAhwgIkH///8fcSJKaiEiIAUoAiAgHkH///8fcSJLaiEvIAUoAiQgHkEadiAZQf///wFxaiJMaiEaIAdB0ABqIgQgARAHIAdBKGoiBUG84f//ACAGazYCACAFQQRqIj5B/P3//wAgNWs2AgAgBUEIaiI1Qfz///8AIDZrNgIAIAVBDGoiNkH8////ACA3azYCACAFQRBqIjdB/P///wAgCWs2AgAgBUEUaiIJQfz///8AIBBrNgIAIAVB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gUoAgAiA0EWdiIaQdEHbCAEKAIAIglqIQYgGkEGdCAAQdQAaiIaKAIAIhBqIAZBGnZqIj1BGnYgAEHYAGoiOCgCACILaiIxQRp2IABB3ABqIigoAgAiEWoiMkEadiAAQeAAaiIpKAIAIg9qIjNBGnYgAEHkAGoiKigCACIjaiI0QRp2IABB6ABqIisoAgAiDGoiPkEadiAAQewAaiIsKAIAIjBqIjVBGnYgAEHwAGoiLSgCACINaiI2QRp2IANB////AXFqITdBASBAKAIAayFBIAQgCUEBdDYCACAaIBBBAXQ2AgAgOCALQQF0NgIAICggEUEBdDYCACApIA9BAXQ2AgAgKiAjQQF0NgIAICsgDEEBdDYCACAsIDBBAXQ2AgAgLSANQQF0NgIAIAUgA0EBdDYCACAKQbzh//8AIAooAgBrIiQ2AgBB/P3//wAgCkEEaiIDKAIAayEJIAMgCTYCAEH8////ACAKQQhqIhAoAgBrIQsgECALNgIAQfz///8AIApBDGoiESgCAGshDyARIA82AgBB/P///wAgCkEQaiIjKAIAayEMICMgDDYCAEH8////ACAKQRRqIjAoAgBrIQ0gMCANNgIAQfz///8AIApBGGoiOSgCAGshEiA5IBI2AgBB/P///wAgCkEcaiI6KAIAayETIDogEzYCAEH8////ACAKQSBqIjsoAgBrIR8gOyAfNgIAQfz//wcgCkEkaiI/KAIAayEbID8gGzYCACAuKAIAIBtqIkJBFnYiPEHRB2wgASgCACAkamohGyA8QQZ0IBQoAgAgCWpqIBtBGnZqIiRBGnYgFSgCACALamoiC0EadiAWKAIAIA9qaiIPQRp2IBcoAgAgDGpqIgxBGnYgGCgCACANamoiDUEadiAOKAIAIBJqaiISQRp2ICAoAgAgE2pqIhNBGnYgISgCACAfamohCSABIBtB////H3EiHzYCACAUICRB////H3EiGzYCACAVIAtB////H3EiCzYCACAWIA9B////H3EiDzYCACAXIAxB////H3EiDDYCACAYIA1B////H3EiDTYCACAOIBJB////H3EiEjYCACAgIBNB////H3EiEzYCACAhIAlB////H3EiJDYCACAuIAlBGnYgQkH///8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AKciALciAMckUEQEHajAQgACgCqAEgACgCpAFBA3FBAmoRAAAgAUIANwAAIAFCADcACCABQgA3ABAgAUIANwAYIAFCADcAICABQgA3ACggAUIANwAwIAFCADcAOCAEJARBAA8LIARBwAJqIQogBEGYAmohCyAEQfgBaiEIIARB/ABqIQMgAUIANwAAIAFCADcACCABQgA3ABAgAUIANwAYIAFCADcAICABQgA3ACggAUIANwAwIAFCADcAOCAJKAIEIAkoAgByIAkoAghyIAkoAgxyIAkoAhByIAkoAhRyIAkoAhhyIAkoAhxyBH8gCEIANwIAIAhCADcCCCAIQgA3AhAgCEIANwIYIANB+ABqIgxBADYCACADIAIpAgA3AgAgAyACKQIINwIIIAMgAikCEDcCECADIAIpAhg3AhggAyACKQIgNwIgIANBKGoiBSACQShqIgYpAgA3AgAgBSAGKQIINwIIIAUgBikCEDcCECAFIAYpAhg3AhggBSAGKQIgNwIgIANBATYCUCADQdQAaiIHQgA3AgAgB0IANwIIIAdCADcCECAHQgA3AhggB0EANgIgIAAgAyADIAkgCBAZIA0gDCgCADYCACADQdAAaiIAIAAQFSAKIAAQByALIAAgChAKIAMgAyAKEAogBSAFIAsQCiAAQQE2AgAgB0IANwIAIAdCADcCCCAHQgA3AhAgB0IANwIYIAdBADYCICACIAMpAgA3AgAgAiADKQIINwIIIAIgAykCEDcCECACIAMpAhg3AhggAiADKQIgNwIgIAYgBSkCADcCACAGIAUpAgg3AgggBiAFKQIQNwIQIAYgBSkCGDcCGCAGIAUpAiA3AiAgASACEBsgBCQEQQEFIAQkBEEACwvhAgEBfyMEIQMjBEHQAGokBCADQQA2AgAgAUUEQEGIjAQgACgCqAEgACgCpAFBA3FBAmoRAAAgAyQEQQAPCyACRQRAQZeMBCAAKAKoASAAKAKkAUEDcUECahEAACADJARBAA8LIANBKGoiACACIAMQDiADQQhqIgIgAUEAEA4gAygCAAR/IAFCADcAACABQgA3AAggAUIANwAQIAFCADcAGEEABSAAKAIEIAAoAgByIAAoAghyIAAoAgxyIAAoAhByI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AIA4gCiALIAcgCSAIQQAQMQ0ECwsgDCACIANBACAFIARBAWoiBCANQQFxEQEAIgANAEEAIQALBUEAIQALCyAJQgA3AgAgCUIANwIIIAlCADcCECAJQgA3AhggCEIANwIAIAhCADcCCCAIQgA3AhAgCEIANwIYIAdCADcCACAHQgA3AgggB0IANwIQIAdCADcCGCAABEAgASAKKQAANwAAIAEgCikACDcACCABIAopABA3ABAgASAKKQAYNwAYIAFBIGoiASALKQAANwAAIAEgCykACDcACCABIAspABA3ABAgASALKQAYNwAYIAYkBCAADwsLCyABQgA3AAAgAUIANwAIIAFCADcAECABQgA3ABggAUIANwAgIAFCADcAKCABQgA3ADAgAUIANwA4IAYkBEEAC9cCAQJ/IwQhByMEQcABaiQEIAdByABqIgYgAikAADcAACAGIAIpAAg3AAggBiACKQAQNwAQIAYgAikAGDcAGCAGQSBqIgIgASkAADcAACACIAEpAAg3AAggAiABKQAQNwAQIAIgASkAGDcAGCAEBH8gBkFAayIBIAQpAAA3AAAgASAEKQAINwAIIAEgBCkAEDcAECABIAQpABg3ABhB4AAFQcAACyEBIAMEQCAGIAFqIgIgAykAADcAACACIAMpAAg3AAggAUEQciEBCyAHIAYgARAqIAZCADcAACAGQgA3AAggBkIANwAQIAZCADcAGCAGQgA3ACAgBkIANwAoIAZCADcAMCAGQgA3ADggBkFAa0IANwAAIAZCADcASCAGQgA3AFAgBkIANwBYIAZCADcAYCAGQgA3AGhBACEBA0AgByAAEB8gAUEBaiIBIAVNDQALIAckBEEBC90QASl/IwQhBSMEQYAEaiQEIAAoAgBFBEBB+IoEIAAoAqgBIAAoAqQBQQNxQQJqEQAAIAUkBEEADwsgAkUEQEGsiwQgACgCqAEgACgCpAFBA3FBAmoRAAAgBSQEQQAPCyABRQRAQa6KBCAAKAKoASAAKAKkAUEDcUECahEAACAFJARBAA8LIANFBEBB5IgEIAAoAqgBIAAoAqQBQQNxQQJqEQAAIAUkBEEADwsgBSACQQAQDiAFQUBrIgYgASkAADcAACAGIAEpAAg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HDQFBACADKAIIIgBBgojxD0sNDBogAEGCiPEPRwRAQd2FlQMhAAwCC0EAIAMoAgQiAEGLuaEbSw0MGiAAQYu5oRtHBEBB3YWVAyEADAILQQAgAygCAEHt9aYeSw0MGkHdhZUDIQALCyADIAMoAgBBwYLZAWo2AgAgA0EEaiIIIAgoAgBBtMbeBGo2AgAgA0EIaiIIIAgoAgBB/feOEGo2AgAgDCAAQaL66hxqNgIAIAsgAUHc3eoVajYCACAKQf///x82AgAgCUH///8fNgIAIARB////HzYCACAGQf///x82AgAgAkH///8BNgIAIAMgBxAhQQBHCwsLCwsLCwsFQQALBUEACwshACAFJAQgAAuYBQIJfwd+IwQhBCMEQSBqJAQgAkUEQEHbigQgACgCqAEgACgCpAFBA3FBAmoRAAAgBCQEQQAPCyAEIgAgAikAADcAACAAIAIpAAg3AAggACACKQAQNwAQIAAgAikAGDcAGCACKAA4IghBf0cgAigAPCIEQR92IgVBf3MiA3EgBEH/////B0lyIAMgAigANCIJQX9HcXIgAyACKAAwIgpBf0dxciADIAIoACwiA0Hz3N3qBUlxciIGQQFzIANB89zd6gVLcSAFciIHQQFzIAIoACgiBUGdoJG9BUlxIAZyIgtBAXMgBUGdoJG9BUtxIAdyIgdBAXMgAigAJCIGQcbepP99SXEgC3JBf3MiCyAGQcbepP99S3EgB3IgCyACKAAgIgJBoMHswAZLcXIhByABRQRAIAAkBCAHDwsgBwRAIAhBf3OtQv////8PfCAJQX9zrUL/////D3wgCkF/c61C/v///w98IANBf3OtQua5u9ULfCAFQX9zrUK7wKL6CnwgBkF/c61CjL3J/gt8IAJBf3OtQsKC2YENfCIMQiCIfCIOQiCIfCIPQiCIfCIQQiCIfCIRQiCIfCISQiCIfCENIAwgBiACciAFciADciAKciAJciAIciAEckEAR0EfdEEfda0iDIOnIQIgDyAMg6chBSAQIAyDpyEDIBEgDIOnIQogEiAMg6chCSANIAyDpyEIIARBf3OtQv////8PfCANQiCIfCAMg6chBCAOIAyDpyEGCyABIAApAAA3AAAgASAAKQAINwAIIAEgACkAEDcAECABIAApABg3ABggASACNgAgIAEgBjYAJCABIAU2ACggASADNgAsIAEgCjYAMCABIAk2ADQgASAINgA4IAEgBDYAPCAAJAQgBwuDAwIGfwh+IAJFBEBB24oEIAAoAqgBIAAoAqQBQQNxQQJqEQAAQQAPCyABBH8gAigAICIAQX9zrULCgtmBDXwhCiACKAAkIgMgAHIgAigAKCIAciACKAAsIgRyIAIoADAiBXIgAigANCIGciACKAA4IgdyIAIoADwiCHJBAEdBH3RBH3WtIQkgB0F/c61C/////w98IAZBf3OtQv////8PfCAFQX9zrUL+////D3wgBEF/c61C5rm71Qt8IABBf3OtQrvAovoKfCADQX9zrUKMvcn+C3wgCkIgiHwiDEIgiHwiDUIgiHwiDkIgiHwiD0IgiHwiEEIgiHwhCyABIAJBIBA0GiABIAogCYM+ACAgASAMIAmDPgAkIAEgDSAJgz4AKCABIA4gCYM+ACwgASAPIAmDPgAwIAEgECAJgz4ANCABIAsgCYM+ADggASAIQX9zrUL/////D3wgC0IgiHwgCYM+ADxBAQVB6YoEIAAoAqgBIAAoAqQBQQNxQQJqEQAAQQALC8sBAQJ/IwQhAyMEQUBrJAQgAUUEQEHKigQgACgCqAEgACgCpAFBA3FBAmoRAAAgAyQEQQAPCyADQSBqIQQgAgR/IAQgAikAADcAACAEIAIpAAg3AAggBCACKQAQNwAQIAQgAikAGDcAGCADIAJBIGoiACkAADcAACADIAApAAg3AAggAyAAKQAQNwAQIAMgACkAGDcAGCABIAQQESABQSBqIAMQESADJARBAQVBrooEIAAoAqgBIAAoAqQBQQNxQQJqEQAAIAMkBEEACwuUGwFcfyMEIRAjBEHQAGokBCABRQRAQdeJBCAAKAKoASAAKAKkAUEDcUECahEAACAQJARBAA8LIAJFBEBBgYkEIAAoAqgBIAAoAqQBQQNxQQJqEQAAIBAkBEEADwsgA0UEQEGuigQgACgCqAEgACgCpAFBA3FBAmoRAAAgECQEQQAPCyADKAAAIQUgAygABCEGIAMoAAghByADKAAMIQggAyg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CgmY3R4LT5lY211bHRfY3R4KQBtc2czMiAhPSBOVUxMAHNlY3AyNTZrMV9lY211bHRfZ2VuX2NvbnRleHRfaXNfYnVpbHQoJmN0eC0+ZWNtdWx0X2dlbl9jdHgpAHNpZ25hdHVyZSAhPSBOVUxMAHNlY2tleSAhPSBOVUxMAHR3ZWFrICE9IE5VTEwAcmVjaWQgPj0gMCAmJiByZWNpZCA8PSAzAHJlY2lkICE9IE5VTEwAc2lnNjQgIT0gTlVMTAAhc2VjcDI1NmsxX2ZlX2lzX3plcm8oJmdlLT54KQABgABBuY0ECxBTY2hub3JyK1NIQTI1NiAg';\n//# sourceMappingURL=secp256k1.base64.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1.base64.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/bin/sha1/sha1.base64.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/bin/sha1/sha1.base64.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ sha1Base64Bytes: () => (/* binding */ sha1Base64Bytes)\n/* harmony export */ });\n/* eslint-disable tsdoc/syntax */\n/**\n * @hidden\n */\n// prettier-ignore\nconst sha1Base64Bytes = 'AGFzbQEAAAABRgxgAn9/AX9gAn9/AGADf39/AGABfwF/YAV/f39/fwF/YAN/f38Bf2AAAGABfwBgBX9/f39/AGAAAX9gBH9/f38AYAF/AX4CGwEGLi9zaGExEF9fd2JpbmRnZW5fdGhyb3cAAQMvLgABAgMEBgcCAgEBBwgCAwEBCQAHCgoCAQgCAQECCggCAAEHBwcBAQAABwsFBQUEBQFwAQUFBQMBABEGCQF/AUGQl8AACwd/CAZtZW1vcnkCAARzaGExAAgJc2hhMV9pbml0AAwLc2hhMV91cGRh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0EAIQFBuBQoAgAiACACTQ0ADAgLIAEPC0HAFCAANgIAQbgUQbgUKAIAIAJqIgI2AgAgACACQQFyNgIEDAULIABBtBQoAgAgAmoiAkEBcjYCBEG8FCAANgIAQbQUIAI2AgAgACACaiACNgIADAQLIAMQJQwBC0GkEUGkESgCAEF+IAFBA3Z3cTYCAAsgBCACaiECIAMgBGohAwsgAyADKAIEQX5xNgIEIAAgAkEBcjYCBCAAIAJqIAI2AgACfwJAIAJB/wFNBEAgAkEDdiIBQQN0QawRaiECQaQRKAIAIgNBASABQR9xdCIBcUUNASACQQhqIQMgAigCCAwCCyAAIAIQJgwCC0GkESADIAFyNgIAIAJBCGohAyACCyEBIAMgADYCACABIAA2AgwgACACNgIMIAAgATYCCAsgBUEIag8LQbgUIAAgAmsiATYCAEHAFEHAFCgCACIAIAJqIgM2AgAgAyABQQFyNgIEIAAgAkEDcjYCBCAAQQhqC6UBAQJ/QQIhBQJAAkACQAJAAkAgACgCBCIGIAFrIAJPDQAgASACaiICIAFJIQECQCAEBEBBACEFIAENAiAGQQF0IgEgAiACIAFJGyECDAELQQAhBSABDQELIAJBAEgNACAGRQ0BIAAoAgAgAhATIgFFDQIMAwsgBQ8LIAIQBCIBDQELIAMNAQsgAQRAIAAgATYCACAAQQRqIAI2AgBBAg8LQQEPCwALCABB5BUQBwALZgIBfwN+IwBBMGsiASQAIAApAhAhAiAAKQIIIQMgACkCACEEIAFBFGpBADYCACABIAQ3AxggAUIBNwIEIAFBrA42AhAgASABQRhqNgIAIAEgAzcDICABIAI3AyggASABQSBqECIAC7gBAQF/IwBB4AFrIgMkACADQThqQcwIKAIANgIAIANBMGpBxAgpAgA3AwAgA0IANwMgIANBvAgpAgA3AyggA0E8akEAQcQAEC4aIANBIGogASACEAkgA0GAAWogA0EgakHgABAsGiADQQhqIANBgAFqEAogA0EgaiADQQhqQRQQAyADQYgBaiADQShqKAIANgIAIAMgAykDIDcDgAEgAyADQYABahALIAAgAykDADcCACADQeABaiQAC5cDAQ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gAkEoaiABaiIDIAMoAgAiA0EYdCADQQh0QYCA/AdxciADQQh2QYD+A3EgA0EYdnJyNgIAIAFBBGohAQwACwALIAAgAikDKDcAACAAQRBqIAJBOGooAgA2AAAgAEEIaiACQTBqKQMANwAAIAJBQGskAA8LQYQVIARBwAAQHQALQZQVEAcAC2MBAn8gASgCACECAkACQCABKAIEIgMgASgCCCIBRgRAIAMhAQwBCyADIAFJDQEgAQRAIAIgARATIgINAQALIAIgAxARQQEhAkEAIQELIAAgATYCBCAAIAI2AgAPC0HsFBAHAAuQAQEBfyMAQYABayIBJAAgAUEwakHECCkCADcDACABQThqQcwIKAIANgIAIAFCADcDICABQbwIKQIANwMoIAFBPGpBAEHEABAuGiABQRBqIAFBIGpB4AAQAyABQShqIAFBGGooAgA2AgAgASABKQMQNwMgIAFBCGogAUEgahALIAAgASkDCDcCACABQYABaiQAC4YBAQF/IwBB4AFrIgUkACAFQSBqIAEgAhABQeAAEC0aIAVBIGogAyAEEAkgBUGAAWogBUEgakHgABAsGiAFQRBqIAVBgAFqQeAAEAMgBUGIAWogBUEYaigCADYCACAFIAUpAxA3A4ABIAVBCGogBUGAAWoQCyAAIAUpAwg3AgAgBUHgAWokAAtuAQF/IwBBkAFrIgMkACADQTBqIAEgAhABQeAAECwaIANBGGogA0EwahAKIANBCGogA0EYakEUEAMgA0E4aiADQRBqKAIANgIAIAMgAykDCDcDMCADIANBMGoQCyAAIAMpAwA3AgAgA0GQAWokAAtKAQF/IwBBEGsiASQAIAFCATcDACABQQA2AgggAUEAIABBAEEAEAVB/wFxQQJGBEAgASgCACEAIAFBEGokACAADwtBgAhBFhAAAAsIACAAIAEQEQsLACABBEAgABAUCwsFAEHIEAvHBQEIfwJAAkACQAJAAkACQCABQb9/Sw0AQRAgAUELakF4cSABQQtJGyECIABBfGoiBigCACIHQXhxIQMCQAJAAkACQCAHQQNxBEAgAEF4aiIIIANqIQUgAyACTw0BQcAUKAIAIAVGDQJBvBQoAgAgBUYNAyAFKAIEIg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AgARAbCzcAAkAgAiABTwRAIAQgAkkNASAAIAIgAWs2AgQgACADIAFqNgIADwsgASACEBwACyACIAQQAgALKwEBfyMAQRBrIgMkACADQQhqQQAgAiABEBUgACADKQMINwIAIANBEGokAAuFHwIdfwF+IwBBkAFrIgIkACACIAFBwAAQLCEBQQAhAgJAA0AgAkHAAEYNASABIAJqIhMgEygCACITQRh0IBNBCHRBgID8B3FyIBNBCHZBgP4DcSATQRh2cnI2AgAgAkEEaiECDAALAAsgACgCDCEbIAAoAgghHCAAKAIAIRkgASgCACEDIAEoAgwhBCABKAIIIQUgASgCBCELIAEgACgCBCIdNgJ0IAEgGTYCcCABIBw2AnggASAbNgJ8IAEgCzYChAEgASAFNgKIASABIAQ2AowBIAEgAyAAKAIQIh5qNgKAASABQUBrIAFB8ABqIAFBgAFqQQAQHiABKAIcIQYgASgCGCEPIAEoAhAhFCABKAIUIQwgAUH4AGoiEyABQcgAaiICKQMANwMAIAEgASkDQDcDcCABIAw2AoQBIAEgFCAZQR53ajYCgAEgASAPNgKIASABIAY2AowBIAFB4ABqIAFB8ABqIAFBgAFqQQAQHiABKAJsIRYgASkCZCEfIAEoAiAhDSABKAIsIRAgASgCKCEKIAEoAiQhESABIAEoAmAiDjYCcCABIB83AnQgASAWNgJ8IAEgETYChAEgASAKNgKIASABIBA2AowBIAEgDSABKAJAQR53ajYCgAEgAUHgAGogAUHwAGogAUGAAWpBABAeIAIgAUHoAGoiFikDADcDACABIAEpA2A3A0AgASgCPCEHIAEoAjghCCABKAIwIRIgASgCNCEJIBMgAikDADcDACABIAEpA0A3A3AgASAJNgKEASABIBIgDkEed2o2AoABIAEgCDYCiAEgASAHNgKMASABQeAAaiABQfAAaiABQYABakEAEB4gASgCbCEOIAEpAmQhHyABKAJgIRcgASARIAQgC3NzNgKEASABIA0gBSADc3M2AoABIAEgCiAUIAVzczYCiAEgASAQIAwgBHNzNgKMASABQdAAaiABQYABaiAJIAggBxAfIAEgFzYCcCABIB83AnQgASAONgJ8IAEgASgCVCIDNgKEASABIAEoAlgiCzYCiAEgASABKAJcIg42AowBIAEgASgCQEEedyABKAJQIhVqNgKAASABQeAAaiABQfAAaiABQYABakEAEB4gAiAWKQMANwMAIAEgASkDYDcDQCABIAkgBiAMc3M2AoQBIAEgEiAPIBRzczYCgAEgASAIIA0gD3NzNgKIASABIAcgESAGc3M2AowBIAFB8ABqIAFBgAFqIAMgCyAOEB8gASgCfCEEIAEoAnghBSABKAJwIQ8gASgCdCEGIBMgAikDADcDACABIAEpA0A3A3AgASAGNgKEASABIA8gF0Eed2o2AoABIAEgBTYCiAEgASAENgKMASABQeAAaiABQfAAaiABQYABakEBEB4gASgCbCEMIAEpAmQhHyABKAJgIRcgASADIBAgEXNzNgKEASABIBUgCiANc3M2AoABIAEgCyASIApzczYCiAEgASAOIAkgEHNzNgKMASABQfAAaiABQYABaiAGIAUgBBAfIAEoAnAhFCABKAJ8IQ0gASgCeCEQIAEoAnQhCiABIBc2AnAgASAfNwJ0IAEgDDYCfCABIAo2AoQBIAEgEDYCiAEgASANNgKMASABIBQgASgCQEEed2o2AoABIAFB4ABqIAFB8ABqIAFBgAFqQQEQHiACIBYpAwA3AwAgASABKQNgNwNAIAEgBiAHIAlzczYChAEgASAPIAggEnNzNgKAASABIAUgFSAIc3M2AogBIAEgBCADIAdzczYCjAEgAUHwAGogAUGAAWogCiAQIA0QHyABKAJ8IQcgASgCeCEIIAEoAnAhDCABKAJ0IQkgEyACKQMANwMAIAEgASkDQDcDcCABIAk2AoQBIAEgDCAXQR53ajYCgAEgASAINgKIASABIAc2AowBIAFB4ABqIAFB8ABqIAFBgAFqQQEQHiABKAJsIRcgASkCZCEfIAEoAmAhGCABIAogDiADc3M2AoQBIAEgFCALIBVzczYCgAEgASAQIA8gC3NzNgKIASABIA0gBiAOc3M2AowBIAFB8ABqIAFBgAFqIAkgCCAHEB8gASgCcCELIAEoAnwhESABKAJ4IRIgASgCdCEDIAEgGDYCcCABIB83AnQgASAXNgJ8IAEgAzYChAEgASASNgKIASABIBE2AowBIAEgCyABKAJAQR53ajYCgAEgAUHgAGogAUHwAGogAUGAAWpBARAeIAIgFikDADcDACABIAEpA2A3A0AgASAJIAQgBnNzNgKEASABIAwgBSAPc3M2AoABIAEgCCAUIAVzczYCiAEgASAHIAogBHNzNgKMASABQdAAaiABQYABaiADIBIgERAfIBMgAikDADcDACABIAEpA0A3A3AgASABKAJUIg42AoQBIAEgASgCWCIPNgKIASABIAEoAlwiFTYCjAEgASABKAJQIhcgGEEed2o2AoABIAFB4ABqIAFB8ABqIAFBgAFqQQEQHiABKAJsIRogASkCZCEfIAEoAmAhGCABIAMgDSAKc3M2AoQBIAEgCyAQIBRzczYCgAEgASASIAwgEHNzNgKIASABIBEgCSANc3M2AowBIAFB8ABqIAFBgAFqIA4gDyAVEB8gASgCcCEUIAEoAnwhBCABKAJ4IQUgASgCdCEGIAEgGDYCcCABIB83AnQgASAaNgJ8IAEgBjYChAEgASAFNgKIASABIAQ2AowBIAEgFCABKAJAQR53ajYCgAEgAUHgAGogAUHwAGogAUGAAWpBAhAeIAIgFikDADcDACABIAEpA2A3A0AgASAOIAcgCXNzNgKEASABIBcgCCAMc3M2AoABIAEgDyALIAhzczYCiAEgASAVIAMgB3NzNgKMASABQfAAaiABQYABaiAGIAUgBBAfIAEoAnwhByABKAJ4IQggASgCcCEMIAEoAnQhCSATIAIpAwA3AwAgASABKQNANwNwIAEgCTYChAEgASAMIBhBHndqNgKAASABIAg2AogBIAEgBzYCjAEgAUHgAGogAUHwAGogAUGAAWpBAhAeIAEoAmwhGiABKQJkIR8gASgCYCEYIAEgBiARIANzczYChAEgASAUIBIgC3NzNgKAASABIAUgFyASc3M2AogBIAEgBCAOIBFzczYCjAEgAUHwAGogAUGAAWogCSAIIAcQHyABKAJwIQsgASgCfCENIAEoAnghECABKAJ0IQogASAYNgJwIAEgHzcCdCABIBo2AnwgASAKNgKEASABIBA2AogBIAEgDTYCjAEgASALIAEoAkBBHndqNgKAASABQeAAaiABQfAAaiABQYABakECEB4gAiAWKQMANwMAIAEgASkDYDcDQCABIAkgFSAOc3M2AoQBIAEgDCAPIBdzczYCgAEgASAIIBQgD3NzNgKIASABIAcgBiAVc3M2AowBIAFB8ABqIAFBgAFqIAogECANEB8gASgCfCERIAEoAnghEiABKAJwIQ4gASgCdCEDIBMgAikDADcDACABIAEpA0A3A3AgASADNgKEASABIA4gGEEed2o2AoABIAEgEjYCiAEgASARNgKMASABQeAAaiABQfAAaiABQYABakECEB4gASgCbCEPIAEpAmQhHyABKAJgIRUgASAKIAQgBnNzNgKEASABIAsgBSAUc3M2AoABIAEgECAMIAVzczYCiAEgASANIAkgBHNzNgKMASABQdAAaiABQYABaiADIBIgERAfIAEgFTYCcCABIB83AnQgASAPNgJ8IAEgASgCVCIENgKEASABIAEoAlgiBTYCiAEgASABKAJcIgY2AowBIAEgASgCQEEedyABKAJQIhRqNgKAASABQeAAaiABQfAAaiABQYABakECEB4gAiAWKQMANwMAIAEgASkDYDcDQCABIAMgByAJc3M2AoQBIAEgDiAIIAxzczYCgAEgASASIAsgCHNzNgKIASABIBEgCiAHc3M2AowBIAFB8ABqIAFBgAFqIAQgBSAGEB8gASgCfCEHIAEoAnghCCABKAJwIQ8gASgCdCEJIBMgAikDADcDACABIAEpA0A3A3AgASAJNgKEASABIA8gFUEed2o2AoABIAEgCDYCiAEgASAHNgKMASABQeAAaiABQfAAaiABQYABakEDEB4gASgCbCEVIAEpAmQhHyABKAJgIQwgASAEIA0gCnNzNgKEASABIBQgECALc3M2AoABIAEgBSAOIBBzczYCiAEgASAGIAMgDXNzNgKMASABQfAAaiABQYABaiAJIAggBxAfIAEoAnAhECABKAJ8IQogASgCeCELIAEoAnQhDSABIAw2AnAgASAfNwJ0IAEgFTYCfCABIA02AoQBIAEgCzYCiAEgASAKNgKMASABIBAgASgCQEEed2o2AoABIAFB4ABqIAFB8ABqIAFBgAFqQQMQHiACIBYpAwA3AwAgASABKQNgNwNAIAEgCSARIANzczYChAEgASAPIBIgDnNzNgKAASABIAggFCASc3M2AogBIAEgByAEIBFzczYCjAEgAUHwAGogAUGAAWogDSALIAoQHyABKAJ8IREgASgCeCESIAEoAnAhDiABKAJ0IQMgEyACKQMANwMAIAEgASkDQDcDcCABIAM2AoQBIAEgDiAMQR53ajYCgAEgASASNgKIASABIBE2AowBIAFB4ABqIAFB8ABqIAFBgAFqQQMQHiABKAJsIRUgASkCZCEfIAEoAmAhDCABIA0gBiAEc3M2AoQBIAEgECAFIBRzczYCgAEgASALIA8gBXNzNgKIASABIAogCSAGc3M2AowBIAFB8ABqIAFBgAFqIAMgEiAREB8gASgCcCEKIAEoAnwhBCABKAJ4IQUgASgCdCEGIAEgDDYCcCABIB83AnQgASAVNgJ8IAEgBjYChAEgASAFNgKIASABIAQ2AowBIAEgCiABKAJAQR53ajYCgAEgAUHgAGogAUHwAGogAUGAAWpBAxAeIAIgFikDADcDACABIAEpA2A3A0AgASADIAcgCXNzNgKEASABIA4gCCAPc3M2AoABIAEgEiAQIAhzczYCiAEgASARIA0gB3NzNgKMASABQdAAaiABQYABaiAGIAUgBBAfIBMgAikDADcDACABIAEpA0A3A3AgASABKQJUNwKEASABIAEoAlw2AowBIAEgASgCUCAMQR53ajYCgAEgAUHgAGogAUHwAGogAUGAAWpBAxAeIAEoAmwhAiABKAJoIRMgASgCZCEWIAAgGSABKAJgajYCACAAIBYgHWo2AgQgACATIBxqNgIIIAAgAiAbajYCDCAAIB4gASgCQEEed2o2AhAgAUGQAWokAAt9AQF/IwBBMGsiAiQAIAIgATYCBCACIAA2AgAgAkEsakECNgIAIAJBFGpBAjYCACACQRxqQQI2AgAgAkECNgIkIAJB1BY2AgggAkECNgIMIAJB9A42AhAgAiACNgIgIAIgAkEEajYCKCACIAJBIGo2AhggAkEIakHkFhAiAAt8AQF/IwBBMGsiAyQAIAMgAjYCBCADIAE2AgAgA0EsakECNgIAIANBFGpBAjYCACADQRxqQQI2AgAgA0ECNgIkIANBpBY2AgggA0ECNgIMIANB9A42AhAgA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QT9xQYABcjoADkEECyEIIAEoAhghAkF/IQAgAUEcaigCACIJQQxqIQECQAJAAkADQCAAQQFqIgAgBE8NASACIApBDGogCCABKAIAEQUARQ0ACwwBCyACIAcgBiAJQQxqKAIAIgERBQANAEF/IQADQCAAQQFqIgAgA08NAiACIApBDGogCCABEQUARQ0ACwtBAQwBC0EACyEAIApBEGokACAAC0YCAX8BfiMAQSBrIgIkACABKQIAIQMgAkEUaiABKQIINwIAIAJBlBY2AgQgAkGsDjYCACACIAA2AgggAiADNwIMIAIQJAALUAACQAJAQZARKAIAQQFGBEBBlBFBlBEoAgBBAWoiADYCACAAQQNJDQEMAgtBkBFCgYCAgBA3AwALQZwRKAIAIgBBf0wNAEGcESAANgIACwALPwECfyMAQRBrIgEkAAJ/IAAoAggiAiACDQAaQfwVEAcACxogASAAKQIMNwMAIAEgAEEUaikCADcDCCABECMAC7MCAQV/IAAoAhghAwJAAkACQCAAKAIMIgIgAEcEQCAAKAIIIgEgAjYCDCACIAE2AgggAw0BDAILIABBFGoiASAAQRBqIAEoAgAbIgQoAgAiAQRAAkADQCAEIQUgASICQRRqIgQoAgAiAQRAIAENAQwCCyACQRBqIQQgAigCECIBDQALCyAFQQA2AgAgAw0BDAILQQAhAiADRQ0BCwJAIAAoAhwiBEECdEG0E2oiASgCACAARwRAIANBEGogA0EUaiADKAIQIABGGyACNgIAIAINAQwCCyABIAI2AgAgAkUNAgsgAiADNgIYIAAoAhAiAQRAIAIgATYCECABIAI2AhgLIABBFGooAgAiAUUNACACQRRqIAE2AgAgASACNgIYCw8LQagRQagRKAIAQX4gBHdxNgIAC8UCAQR/IAACf0EAIAFBCHYiA0UNABpBHyICIAFB////B0sNABogAUEmIANnIgJrQR9xdkEBcUEfIAJrQQF0cgsiAjYCHCAAQgA3AhAgAkECdEG0E2ohAwJAAkACQEGoESgCACIEQQEgAkEfcXQiBXEEQCADKAIAIgQoAgRBeHEgAUcNASAEIQIMAgsgAyAANgIAQagRIAQgBXI2AgAgACADNgI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BpbmRleCBpcyBsaWJjb3JlL3NsaWNlL21vZC5ycwABAAAAAAAAACAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAABAAAAAQAAACAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAABpbmRleCAgb3V0IG9mIHJhbmdlIGZvciBzbGljZSBvZiBsZW5ndGggc2xpY2UgaW5kZXggc3RhcnRzIGF0ICBidXQgZW5kcyBhdCBpbnRlcm5hbCBlcnJvcjogZW50ZXJlZCB1bnJlYWNoYWJsZSBjb2RlbGliYWxsb2MvcmF3X3ZlYy5ycwBB7BQLnQIWBAAAJAAAAC8IAAATAAAASAIAAAkAAADQBAAAUwAAAEsAAAARAAAAUAQAACAAAABwBAAAWgAAAB8AAAAFAAAAIwUAADQAAABfBwAAFAAAAG0GAAAJAAAAzwUAABgAAAClBQAAKgAAAFcFAABOAAAAQgAAAA4AAAAUBgAAEQAAAC8IAAATAAAA8gIAAAUAAAAlBgAAKwAAAFAGAAARAAAAWQEAABUAAAADAAAAAAAAAAEAAAAEAAAALQcAACAAAABNBwAAEgAAALwHAAAGAAAAwgcAACIAAABfBwAAFAAAAK0HAAAFAAAA5AcAABYAAAD6BwAADQAAAF8HAAAUAAAAswcAAAUAAAAHCAAAKAAAAC8IAAATAAAA9QEAAB4ADAdsaW5raW5nAwKMDw==';\n//# sourceMappingURL=sha1.base64.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/bin/sha1/sha1.base64.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/bin/sha256/sha256.base64.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/bin/sha256/sha256.base64.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ sha256Base64Bytes: () => (/* binding */ sha256Base64Bytes)\n/* harmony export */ });\n/* eslint-disable tsdoc/syntax */\n/**\n * @hidden\n */\n// prettier-ignore\nconst sha256Base64Bytes = 'AGFzbQEAAAABRgxgAn9/AX9gAn9/AGADf39/AGABfwF/YAV/f39/fwF/YAN/f38Bf2AAAGABfwBgBX9/f39/AGAAAX9gBH9/f38AYAF/AX4CHQEILi9zaGEyNTYQX193YmluZGdlbl90aHJvdwABAy4tAAECAwQGBwICAQEHCAIDAQEJAAcKCgIBCAIBAQIIAgoHBwcBAQAAAQcLBQUFBAUBcAEEBAUDAQARBgkBfwFB0JXAAAsHhwEIBm1lbW9yeQIABnNoYTI1NgAIC3NoYTI1Nl9pbml0AAwNc2hhMjU2X3VwZGF0ZQANDHNoYTI1Nl9maW5hbAAOEV9fd2JpbmRnZW5fbWFsbG9jAA8PX193YmluZGdlbl9mcmVlABAeX193YmluZGdlbl9nbG9iYWxfYXJndW1lbnRfcHRyABIJCQEAQQELAycpKgqhhwEtFgAgAUHvAEsEQCAADwtB8AAgARACAAt9AQF/IwBBMGsiAiQAIAIgATYCBCACIAA2AgAgAkEsakEBNgIAIAJBFGpBAjYCACACQRxqQQI2AgAgAkEBNgIkIAJB7BQ2AgggAkECNgIMIAJBzA02AhAgAiACNgIgIAIgAkEEajYCKCACIAJBIGo2AhggAkEIakH8FBAoAAuyAQEDfyMAQRBrIgMkAAJAAkACQCACQX9KBEBBASEEIAIEQCACEAQiBEUNAwsgAyAENgIAIAMgAjYCBCADQQA2AgggA0EAIAJBAUEBEAVB/wFxIgRBAkcNASADQQhqIgQgBCgCACIFIAJqNgIAIAUgAygCAGogASACECsaIABBCGogBCgCADYCACAAIAMpAwA3AgAgA0EQaiQADwsQBgALIARBAXENARAGAAsAC0GsFRAHAAurGQIIfwF+AkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJ/AkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEH0AU0EQEH8DygCACIFQRAgAEELak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Ag8LQQEPCwALCABBnBQQBwALZgIBfwN+IwBBMGsiASQAIAApAhAhAiAAKQIIIQMgACkCACEEIAFBFGpBADYCACABIAQ3AxggAUIBNwIEIAFBhA02AhAgASABQRhqNgIAIAEgAzcDICABIAI3AyggASABQSBqECgAC8UBAQF/IwBBkAJrIgMkACADQTBqQQBBzAAQLRogA0GUAWpB4AopAgA3AgAgA0GMAWpB2AopAgA3AgAgA0GEAWpB0AopAgA3AgAgA0HICikCADcCfCADQTBqIAEgAhAJIANBoAFqIANBMGpB8AAQKxogA0EQaiADQaABahAKIANBMGogA0EQakEgEAMgA0GoAWogA0E4aigCADYCACADIAMpAzA3A6ABIANBCGogA0GgAWoQCyAAIAMpAwg3AgAgA0GQAmokAAubAwEEfyMAQUBqIgMkACAAIAApAwAgAq1CA4Z8NwMAIAMgAEHMAGo2AiggAyADQShqNgIsAkACQAJAAkACQAJAIAAoAggiBQRAQcAAIAVrIgQgAk0NASADQRhqIAUgBSACaiIEIABBDGoQFSADKAIcIAJHDQUgAygCGCABIAIQKxoMAwsgAiEEDAELIANBMGogASACIAQQFiADQTxqKAIAIQQgAygCOCEBIAMoAjAhBSADKAI0IQIgA0EgaiAAQQxqIgYgACgCCBAXIAIgAygCJEcNBCADKAIgIAUgAhArGiAAQQhqQQA2AgAgA0EsaiAGEBgLIANBPGohAiADQThqIQUCQANAIARBP00NASADQTBqIAEgBEHAABAWIAIoAgAhBCAFKAIAIQEgA0EIakEAQcAAIAMoAjAgAygCNBAZIANBLGogAygCCBAYDAALAAsgA0EQaiAAQQxqIAQQGiADKAIUIARHDQEgAygCECABIAQQKxoLIABBCGogBDYCACADQUBrJAAPC0GEFBAHAAtBhBQQBwALQYQUEAcAC98EAgN/AX4jAEHQAGsiAiQAIAIgAUHMAGo2AiQgASkDACEFIAEoAgghBCACIAJBJGo2AigCQCAEQT9NBEAgAUEMaiIDIARqQYABOgAAIAEgASgCCEEBaiIENgIIIAJBGGogAyAEEBcgAigCGEEAIAIoAhwQLRpBwAAgASgCCGtBB00EQCACQShqIAMQGCACQRBqIAMgAUEIaigCABAaIAIoAhBBACACKAIUEC0aCyACQQhqIANBOBAXIAIoAgxBCEcNASACKAIIIAVCOIYgBUIohkKAgICAgIDA/wCDhCAFQhiGQoCAgICA4D+DIAVCCIZCgICAgPAfg4SEIAVCCIhCgICA+A+DIAVCGIhCgID8B4OEIAVCKIhCgP4DgyAFQjiIhISENwAAIAJBKGogAxAYIAFBCGpBADYCACACQQA2AiggAkEoakEEciEEQQAhAwJAA0AgA0EgRg0BIAQgA2pBADoAACACIAIoAihBAWo2AiggA0EBaiEDDAALAAsgAkFAayABQeQAaikAADcDACACQThqIAFB3ABqKQAANwMAIAJBMGogAUHUAGopAAA3AwAgAiABKQBMNwMoQQAhAwJAA0AgA0EgRg0BIAJBKGogA2oiBCAEKAIAIgRBGHQgBEEIdEGAgPwHcXIgBEEIdkGA/gNxIARBGHZycjYCACADQQRqIQMMAAsACyAAIAIpAyg3AAAgAEEYaiACQUBrKQMANwAAIABBEGogAkE4aikDADcAACAAQQhqIAJBMGopAwA3AAAgAkHQAGokAA8LQdwTIARBwAAQHQALQewTEAcAC2MBAn8gASgCACECAkACQCABKAIEIgMgASgCCCIBRgRAIAMhAQwBCyADIAFJDQEgAQRAIAIgARATIgINAQALIAIgAxARQQEhAkEAIQELIAAgATYCBCAAIAI2AgAPC0HEExAHAAuaAQEBfyMAQZABayIBJAAgAUEgakEAQcwAEC0aIAFBhAFqQeAKKQIANwIAIAFB/ABqQdgKKQIANwIAIAFB9ABqQdAKKQIANwIAIAFByAopAgA3AmwgAUEQaiABQSBqQfAAEAMgAUEoaiABQRhqKAIANgIAIAEgASkDEDcDICABQQhqIAFBIGoQCyAAIAEpAwg3AgAgAUGQAWokAAuGAQEBfyMAQYACayIFJAAgBUEgaiABIAIQAUHwABAsGiAFQSBqIAMgBBAJIAVBkAFqIAVBIGpB8AAQKxogBUEQaiAFQZABakHwABADIAVBmAFqIAVBGGooAgA2AgAgBSAFKQ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CdCABIA42AnAgASATNgJ4IAEgGDYCfCABQdAAaiABQeAAaiABQfAAaiARQYiEnOZ4aiANQZTwoaZ4ahAeIAEoAlwhDCABKAJYIRAgASgCUCEXIAEoAlQhAiABIAg2AnQgASAHNgJwIAEgGTYCeCABIAo2AnwgAUHgAGogAUHwAGogFhAfIAEgCSABKAJgajYCcCABIBUgASgCZGo2AnQgASASIAEoAmhqNgJ4IAEgCyABKAJsajYCfCABQeAAaiABQfAAaiARIA0QICABKAJgIQ0gASgCZCEZIAEoAmghByABKAJsIQggASAPNgJkIAEgDjYCYCABIBM2AmggASAYNgJsIAEgAjYCdCABIBc2AnAgASAQNgJ4IAEgDDYCfCABQdAAaiABQeAAaiABQfAAaiAHQevZwaJ6aiAIQfr/+4V5ahAeIAEoAlwhByABKAJYIQggASgCUCEKIAEoAlQhESABIAI2AmQgASAXNgJgIAEgEDYCaCABIAw2AmwgASARNgJ0IAEgCjYCcCABIAg2AnggASAHNgJ8IAFB0ABqIAFB4ABqIAFB8ABqIA1B8vHFs3xqIBlB98fm93tqEB4gASgCXCENIAEoAlghGCABKAJQIRMgACAeIAEoAlRqNgIEIAAgEyAdajYCACAAIAogIWo2AgggACARICJqNgIMIAAgGCAcajYCECAAIA0gG2o2AhQgACAIICBqNgIYIAAgByAfajYCHCABQYABaiQAC30BAX8jAEEwayICJAAgAiABNgIEIAIgADYCACACQSxqQQE2AgAgAkEUakECNgIAIAJBHGpBAjYCACACQQE2AiQgAkGMFTYCCCACQQI2AgwgAkHMDTYCECACIAI2AiAgAiACQQRqNgIoIAIgAkEgajYCGCACQQhqQZwVECgAC3wBAX8jAEEwayIDJAAgAyACNgIEIAMgATYCACADQSxqQQE2AgAgA0EUakECNgIAIANBHGpBAjYCACADQQE2AiQgA0HcFDYCCCADQQI2AgwgA0HMDTYCECADIANBBGo2AiAgAyADNgIoIAMgA0EgajYCGCADQQhqIAAQKAAL1gEBBn8gACABKAIAIgggAigCBCIHcyACKAIAIgVxIAggB3FzIAVBHnc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3OTgwODE4MjgzODQ4NTg2ODc4ODg5OTA5MTkyOTM5NDk1OTY5Nzk4OTkAAABpbmRleCBvdXQgb2YgYm91bmRzOiB0aGUgbGVuIGlzICBidXQgdGhlIGluZGV4IGlzIGxpYmNvcmUvc2xpY2UvbW9kLnJzAAEAAAAAAAAAIAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAEAAAABAAAAIAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAGluZGV4ICBvdXQgb2YgcmFuZ2UgZm9yIHNsaWNlIG9mIGxlbmd0aCBzbGljZSBpbmRleCBzdGFydHMgYXQgIGJ1dCBlbmRzIGF0IGludGVybmFsIGVycm9yOiBlbnRlcmVkIHVucmVhY2hhYmxlIGNvZGVsaWJhbGxvYy9yYXdfdmVjLnJzAEHEEwv9ARYEAAAkAAAAhwcAABMAAABIAgAACQAAAMAEAABTAAAASwAAABEAAAA6BAAAIAAAAFoEAABaAAAAHwAAAAUAAAATBQAANAAAALcGAAAUAAAAbQYAAAkAAABtBQAAEQAAAIcHAAATAAAA8gIAAAUAAAB+BQAAKwAAAKkFAAARAAAAWQEAABUAAAACAAAAAAAAAAEAAAADAAAAhQYAACAAAAClBgAAEgAAABQHAAAGAAAAGgcAACIAAAC3BgAAFAAAAK0HAAAFAAAAPAcAABYAAABSBwAADQAAALcGAAAUAAAAswcAAAUAAABfBwAAKAAAAIcHAAATAAAA9QEAAB4ADAdsaW5raW5nAwLEDQ==';\n//# sourceMappingURL=sha256.base64.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/bin/sha256/sha256.base64.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/bin/sha512/sha512.base64.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/bin/sha512/sha512.base64.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ sha512Base64Bytes: () => (/* binding */ sha512Base64Bytes)\n/* harmony export */ });\n/* eslint-disable tsdoc/syntax */\n/**\n * @hidden\n */\n// prettier-ignore\nconst sha512Base64Bytes = 'AGFzbQEAAAABXg5gAn9/AX9gAn9/AGADf39/AGABfwF/YAV/f39/fwF/YAN/f38Bf2AAAGABfwBgBX9/f39/AGAAAX9gBH9/f38AYAp/fn5+fn5+fn5+AGAIf35+fn5+fn4AYAF/AX4CHQEILi9zaGE1MTIQX193YmluZGdlbl90aHJvdwABAy0sAAECAwQGBwICAQEHCAIDAQEJAAcKCgIBCAIBAQILDAcHBwEBAAABBw0FBQUEBQFwAQQEBQMBABEGCQF/AUHwlcAACweHAQgGbWVtb3J5AgAGc2hhNTEyAAgLc2hhNTEyX2luaXQADA1zaGE1MTJfdXBkYXRlAA0Mc2hhNTEyX2ZpbmFsAA4RX193YmluZGdlbl9tYWxsb2MADw9fX3diaW5kZ2VuX2ZyZWUAEB5fX3diaW5kZ2VuX2dsb2JhbF9hcmd1bWVudF9wdHIAEgkJAQBBAQsDJigpCuuBASwWACABQdcBSwRAIAAPC0HYASABEAIAC30BAX8jAEEwayICJAAgAiABNgIEIAIgADYCACACQSxqQQE2AgAgAkEUakECNgIAIAJBHGpBAjYCACACQQE2AiQgAkGMFTYCCCACQQI2AgwgAkHsDTYCECACIAI2AiAgAiACQQRqNgIoIAIgAkEgajYCGCACQQhqQZwVECcAC7IBAQN/IwBBEGsiAyQAAkACQAJAIAJBf0oEQEEBIQQgAgRAIAIQBCIERQ0DCyADIAQ2AgAgAyACNgIEIANBADYCCCADQQAgAkEBQQEQBUH/AXEiBEECRw0BIANBCGoiBCAEKAIAIgUgAmo2AgAgBSADKAIAaiABIAIQKhogAEEIaiAEKAIANgIAIAAgAykDADcCACADQRBqJAAPCxAGAAsgBEEBcQ0BEAYACwALQcwVEAcAC6sZAgh/AX4CQAJAAkACQAJAA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AIQUgAQ0CIAZBAXQiASACIAIgAUkbIQIMAQtBACEFIAENAQsgAkEASA0AIAZFDQEgACgCACACEBMiAUUNAgwDCyAFDwsgAhAEIgENAQsgAw0BCyABBEAgACABNgIAIABBBGogAjYCAEECDwtBAQ8LAAsIAEG8FBAHAAtmAgF/A34jAEEwayIBJAAgACkCECECIAApAgghAyAAKQIAIQQgAUEUakEANgIAIAEgBDcDGCABQgE3AgQgAUGkDTYCECABIAFBGGo2AgAgASADNwMgIAEgAjcDKCABIAFBIGoQJwALsgEBAn8jAEGABGsiAyQAIANB2ABqIgRCADcDACADQgA3A1AgA0GgAWpBAEGEARAsGiADQeAAakHICkHAABAqGiADQdAAaiABIAIQCSADQagCaiADQdAAakHYARAqGiADQRBqIANBqAJqEAogA0HQAGogA0EQakHAABADIANBsAJqIAQoAgA2AgAgAyADKQNQNwOoAiADQQhqIANBqAJqEAsgACADKQMINwIAIANBgARqJAALuwMCBH8CfiMAQUBqIgMkACAAIAApAwgiByACrUIDhnwiCDcDCCAIIAdUBEAgACAAKQMAQgF8NwMACyADIABBEGo2AiggAyADQShqNgIsAkACQAJAAkACQAJAIAAoAlAiBQRAQYABIAVrIgQgAk0NASADQRhqIAUgBSACaiIEIABB1ABqEBUgAygCHCACRw0FIAMoAhggASACECoaDAMLIAIhBAwBCyADQTBqIAEgAiAEEBYgA0E8aigCACEEIAMoAjghASADKAIwIQUgAygCNCECIANBIGogAEHUAGoiBiAAKAJQEBcgAiADKAIkRw0EIAMoAiAgBSACECoaIABB0ABqQQA2AgAgA0EsaiAGEBgLIANBPGohAiADQThqIQUCQANAIARB/wBNDQEgA0EwaiABIARBgAEQFiACKAIAIQQgBSgCACEBIANBCGpBAEGAASADKAIwIAMoAjQQGSADQSxqIAMoAggQGAwACwALIANBEGogAEHUAGogBBAaIAMoAhQgBEcNASADKAIQIAEgBBAqGgsgAEHQAGogBDYCACADQUBrJAAPC0H8ExAHAAtB/BMQBwALQfwTEAcAC7cFAgN/An4jAEHwAGs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sgAUH/HyABQf8fSxsMBQtBtBMgATYCAEGsE0GsEygCACAAaiIANgIADAcLIAIQIgwBC0GcEEGcECgCAEF+IANBA3Z3cTYCAAsgASAAQQFyNgIEIAEgAGogADYCACABQbQTKAIARw0CQawTIAA2AgAPC0H/HwshAUHUE0F/NgIAQdwTIAE2AgAPC0HcEwJ/AkACfwJAIABB/wFNBEAgAEEDdiICQQN0QaQQaiEAQZwQKAIAIgNBASACQR9xdCICcUUNASAAQQhqIQMgACgCCAwCCyABIAAQI0HcE0HcEygCAEF/aiIBNgIAIAENBEHMEygCACIARQ0CQQAhAQNAIAFBAWohASAAKAIIIgANAAsgAUH/HyABQf8fSxsMAwtBnBAgAyACcjYCACAAQQhqIQMgAAshAiADIAE2AgAgAiABNgIMIAEgADYCDCABIAI2AggPC0H/HwsiATYCAAsPCyABIABBAXI2AgQgASAAaiAANgIACzkAAkAgAiABTwRAIAJBgQFPDQEgACACIAFrNgIEIAAgAyABajYCAA8LIAEgAhAcAAsgAkGAARACAAtNAgF/An4jAEEQayIEJAAgBEEIakEAIAMgASACEBkgBCkDCCEFIAQgAyACIAEgAhAZIAQpAwAhBiAAIAU3AgAgACAGNwIIIARBEGokAAssAQF/IwBBEGsiAyQAIANBCGogAkGAASABEBUgACADKQMINwIAIANBEGokAAsOACAAKAIAKAIAIAEQGws3AAJAIAIgAU8EQCAEIAJJDQEgACACIAFrNgIEIAAgAyABajYCAA8LIAEgAhAcAAsgAiAEEAIACysBAX8jAEEQayIDJAAgA0EIakEAIAIgARAVIAAgAykDCDcCACADQRBqJAALqioCAn8ifiMAQYAPayICJAAgAkGADmogAUGAARAqGkEAIQECQANAIAFBgAFGDQEgAkGADmogAWoiAyADKQMAIhxCOIYgHEIohkKAgICAgIDA/wCDhCAcQhiGQoCAgICA4D+DIBxCCIZCgICAgPAfg4SEIBxCCIhCgICA+A+DIBxCGIhCgID8B4OEIBxCKIhCgP4DgyAcQjiIhISENwMAIAFBCGohAQwACwALIAJB8A1qIAApAwA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AAAVAAAAAgAAAAAAAAABAAAAAwAAAKUGAAAgAAAAxQYAABIAAAA0BwAABgAAADoHAAAiAAAA1wYAABQAAACtBwAABQAAAFwHAAAWAAAAcgcAAA0AAADXBgAAFAAAALMHAAAFAAAAfwcAACgAAACnBwAAEwAAAPUBAAAeAAwHbGlua2luZwMC5A0=';\n//# sourceMappingURL=sha512.base64.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/bin/sha512/sha512.base64.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/crypto/crypto.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/crypto/crypto.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getEmbeddedRipemd160Binary: () => (/* reexport safe */ _ripemd160__WEBPACK_IMPORTED_MODULE_1__.getEmbeddedRipemd160Binary),\n/* harmony export */ getEmbeddedSha1Binary: () => (/* reexport safe */ _sha1__WEBPACK_IMPORTED_MODULE_3__.getEmbeddedSha1Binary),\n/* harmony export */ getEmbeddedSha256Binary: () => (/* reexport safe */ _sha256__WEBPACK_IMPORTED_MODULE_4__.getEmbeddedSha256Binary),\n/* harmony export */ getEmbeddedSha512Binary: () => (/* reexport safe */ _sha512__WEBPACK_IMPORTED_MODULE_5__.getEmbeddedSha512Binary),\n/* harmony export */ hmacSha256: () => (/* reexport safe */ _hmac__WEBPACK_IMPORTED_MODULE_0__.hmacSha256),\n/* harmony export */ hmacSha512: () => (/* reexport safe */ _hmac__WEBPACK_IMPORTED_MODULE_0__.hmacSha512),\n/* harmony export */ instantiateHmacFunction: () => (/* reexport safe */ _hmac__WEBPACK_IMPORTED_MODULE_0__.instantiateHmacFunction),\n/* harmony export */ instantiateRipemd160: () => (/* reexport safe */ _ripemd160__WEBPACK_IMPORTED_MODULE_1__.instantiateRipemd160),\n/* harmony export */ instantiateRipemd160Bytes: () => (/* reexport safe */ _ripemd160__WEBPACK_IMPORTED_MODULE_1__.instantiateRipemd160Bytes),\n/* harmony export */ instantiateSecp256k1: () => (/* reexport safe */ _secp256k1__WEBPACK_IMPORTED_MODULE_2__.instantiateSecp256k1),\n/* harmony export */ instantiateSecp256k1Bytes: () => (/* reexport safe */ _secp256k1__WEBPACK_IMPORTED_MODULE_2__.instantiateSecp256k1Bytes),\n/* harmony export */ instantiateSha1: () => (/* reexport safe */ _sha1__WEBPACK_IMPORTED_MODULE_3__.instantiateSha1),\n/* harmony export */ instantiateSha1Bytes: () => (/* reexport safe */ _sha1__WEBPACK_IMPORTED_MODULE_3__.instantiateSha1Bytes),\n/* harmony export */ instantiateSha256: () => (/* reexport safe */ _sha256__WEBPACK_IMPORTED_MODULE_4__.instantiateSha256),\n/* harmony export */ instantiateSha256Bytes: () => (/* reexport safe */ _sha256__WEBPACK_IMPORTED_MODULE_4__.instantiateSha256Bytes),\n/* harmony export */ instantiateSha512: () => (/* reexport safe */ _sha512__WEBPACK_IMPORTED_MODULE_5__.instantiateSha512),\n/* harmony export */ instantiateSha512Bytes: () => (/* reexport safe */ _sha512__WEBPACK_IMPORTED_MODULE_5__.instantiateSha512Bytes)\n/* harmony export */ });\n/* harmony import */ var _hmac__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hmac */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/hmac.js\");\n/* harmony import */ var _ripemd160__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ripemd160 */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/ripemd160.js\");\n/* harmony import */ var _secp256k1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./secp256k1 */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/secp256k1.js\");\n/* harmony import */ var _sha1__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./sha1 */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/sha1.js\");\n/* harmony import */ var _sha256__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sha256 */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/sha256.js\");\n/* harmony import */ var _sha512__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./sha512 */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/sha512.js\");\n\n\n\n\n\n\n//# sourceMappingURL=crypto.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/crypto/crypto.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/crypto/hmac.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/crypto/hmac.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ hmacSha256: () => (/* binding */ hmacSha256),\n/* harmony export */ hmacSha512: () => (/* binding */ hmacSha512),\n/* harmony export */ instantiateHmacFunction: () => (/* binding */ instantiateHmacFunction)\n/* harmony export */ });\n/* harmony import */ var _format_hex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../format/hex */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n\n/**\n * Instantiate a hash-based message authentication code (HMAC) function as\n * specified by RFC 2104.\n *\n * @param hashFunction - a cryptographic hash function which iterates a basic\n * compression function on blocks of data\n * @param blockByteLength - the byte-length of blocks used in `hashFunction`\n */\nconst instantiateHmacFunction = (hashFunction, blockByteLength) => (secret, message) => {\n const key = new Uint8Array(blockByteLength).fill(0);\n // eslint-disable-next-line functional/no-expression-statement\n key.set(secret.length > blockByteLength ? hashFunction(secret) : secret, 0);\n const innerPaddingFill = 0x36;\n const innerPadding = new Uint8Array(blockByteLength).fill(innerPaddingFill);\n // eslint-disable-next-line no-bitwise\n const innerPrefix = innerPadding.map((pad, index) => pad ^ key[index]);\n const innerContent = (0,_format_hex__WEBPACK_IMPORTED_MODULE_0__.flattenBinArray)([innerPrefix, message]);\n const innerResult = hashFunction(innerContent);\n const outerPaddingFill = 0x5c;\n const outerPadding = new Uint8Array(blockByteLength).fill(outerPaddingFill);\n // eslint-disable-next-line no-bitwise\n const outerPrefix = outerPadding.map((pad, index) => pad ^ key[index]);\n return hashFunction((0,_format_hex__WEBPACK_IMPORTED_MODULE_0__.flattenBinArray)([outerPrefix, innerResult]));\n};\nconst sha256BlockByteLength = 64;\n/**\n * Create a hash-based message authentication code using HMAC-SHA256 as\n * specified in `RFC 4231`. Returns a 32-byte Uint8Array.\n *\n * Secrets longer than the block byte-length (64 bytes) are hashed before\n * use, shortening their length to the minimum recommended length (32 bytes).\n * See `RFC 2104` for details.\n *\n * @param sha256 - an implementation of Sha256\n * @param secret - the secret key (recommended length: 32-64 bytes)\n * @param message - the message to authenticate\n */\nconst hmacSha256 = (sha256, secret, message) => instantiateHmacFunction(sha256.hash, sha256BlockByteLength)(secret, message);\nconst sha512BlockByteLength = 128;\n/**\n * Create a hash-based message authentication code using HMAC-SHA512 as\n * specified in `RFC 4231`. Returns a 64-byte Uint8Array.\n *\n * Secrets longer than the block byte-length (128 bytes) are hashed before\n * use, shortening their length to the minimum recommended length (64 bytes).\n * See `RFC 2104` for details.\n *\n * @param sha512 - an implementation of Sha512\n * @param secret - the secret key (recommended length: 64-128 bytes)\n * @param message - the message to authenticate\n */\nconst hmacSha512 = (sha512, secret, message) => instantiateHmacFunction(sha512.hash, sha512BlockByteLength)(secret, message);\n//# sourceMappingURL=hmac.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/crypto/hmac.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/crypto/ripemd160.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/crypto/ripemd160.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getEmbeddedRipemd160Binary: () => (/* binding */ getEmbeddedRipemd160Binary),\n/* harmony export */ instantiateRipemd160: () => (/* binding */ instantiateRipemd160),\n/* harmony export */ instantiateRipemd160Bytes: () => (/* binding */ instantiateRipemd160Bytes)\n/* harmony export */ });\n/* harmony import */ var _bin_bin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bin/bin */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/hashes.js\");\n/* harmony import */ var _bin_bin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../bin/bin */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/ripemd160/ripemd160.base64.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/base64.js\");\n\n\n/**\n * The most performant way to instantiate ripemd160 functionality. To avoid\n * using Node.js or DOM-specific APIs, you can use `instantiateRipemd160`.\n *\n * @param webassemblyBytes - A buffer containing the ripemd160 binary.\n */\nconst instantiateRipemd160Bytes = async (webassemblyBytes) => {\n const wasm = await (0,_bin_bin__WEBPACK_IMPORTED_MODULE_0__.instantiateRustWasm)(webassemblyBytes, './ripemd160', 'ripemd160', 'ripemd160_init', 'ripemd160_update', 'ripemd160_final');\n return {\n final: wasm.final,\n hash: wasm.hash,\n init: wasm.init,\n update: wasm.update,\n };\n};\nconst getEmbeddedRipemd160Binary = () => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.base64ToBin)(_bin_bin__WEBPACK_IMPORTED_MODULE_2__.ripemd160Base64Bytes).buffer;\nconst cachedRipemd160 = {};\n/**\n * An ultimately-portable (but slower) version of `instantiateRipemd160Bytes`\n * which does not require the consumer to provide the ripemd160 binary buffer.\n */\nconst instantiateRipemd160 = async () => {\n if (cachedRipemd160.cache !== undefined) {\n return cachedRipemd160.cache;\n }\n const result = instantiateRipemd160Bytes(getEmbeddedRipemd160Binary());\n // eslint-disable-next-line functional/immutable-data, functional/no-expression-statement\n cachedRipemd160.cache = result;\n return result;\n};\n//# sourceMappingURL=ripemd160.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/crypto/ripemd160.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/crypto/secp256k1.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/crypto/secp256k1.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ instantiateSecp256k1: () => (/* binding */ instantiateSecp256k1),\n/* harmony export */ instantiateSecp256k1Bytes: () => (/* binding */ instantiateSecp256k1Bytes)\n/* harmony export */ });\n/* harmony import */ var _bin_bin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bin/bin */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1-wasm-types.js\");\n/* harmony import */ var _bin_bin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../bin/bin */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/secp256k1/secp256k1-wasm.js\");\n/* eslint-disable functional/no-conditional-statement, functional/no-expression-statement, functional/no-throw-statement */\n\n/**\n * @param secp256k1Wasm - a Secp256k1Wasm object\n * @param randomSeed - a 32-byte random seed used to randomize the context after\n * creation\n */\nconst wrapSecp256k1Wasm = (secp256k1Wasm, randomSeed) => {\n /**\n * Currently, this wrapper creates a context with both SIGN and VERIFY\n * capabilities. For better initialization performance, consumers could\n * re-implement a wrapper with only the capabilities they require.\n */\n const contextPtr = secp256k1Wasm.contextCreate(_bin_bin__WEBPACK_IMPORTED_MODULE_0__.ContextFlag.BOTH);\n /**\n * Since all of these methods are single-threaded and synchronous, we can\n * reuse allocated WebAssembly memory for each method without worrying about\n * calls interfering with each other. Likewise, these spaces never need to be\n * `free`d, since we will continue using them until this entire object (and\n * with it, the entire WebAssembly instance) is garbage collected.\n *\n * If malicious javascript gained access to this object, it should be\n * considered a critical vulnerability in the consumer. However, as a best\n * practice, we zero out private keys below when we're finished with them.\n */\n const sigScratch = secp256k1Wasm.malloc(72 /* maxECDSASig */);\n const publicKeyScratch = secp256k1Wasm.malloc(65 /* maxPublicKey */);\n const messageHashScratch = secp256k1Wasm.malloc(32 /* messageHash */);\n const internalPublicKeyPtr = secp256k1Wasm.malloc(64 /* internalPublicKey */);\n const internalSigPtr = secp256k1Wasm.malloc(64 /* internalSig */);\n const schnorrSigPtr = secp256k1Wasm.malloc(64 /* schnorrSig */);\n const privateKeyPtr = secp256k1Wasm.malloc(32 /* privateKey */);\n const internalRSigPtr = secp256k1Wasm.malloc(65 /* recoverableSig */);\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n const recoveryNumPtr = secp256k1Wasm.malloc(4);\n // eslint-disable-next-line no-bitwise, @typescript-eslint/no-magic-numbers\n const recoveryNumPtrView32 = recoveryNumPtr >> 2;\n const getRecoveryNumPtr = () => secp256k1Wasm.heapU32[recoveryNumPtrView32];\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n const lengthPtr = secp256k1Wasm.malloc(4);\n // eslint-disable-next-line no-bitwise, @typescript-eslint/no-magic-numbers\n const lengthPtrView32 = lengthPtr >> 2;\n const cloneAndPad = (value, expectedLength) => {\n const zeroPaddedValue = new Uint8Array(expectedLength);\n zeroPaddedValue.set(value);\n return zeroPaddedValue;\n };\n const parsePublicKey = (publicKey) => {\n const paddedPublicKey = cloneAndPad(publicKey, 65 /* maxPublicKey */);\n secp256k1Wasm.heapU8.set(paddedPublicKey, publicKeyScratch);\n return (secp256k1Wasm.pubkeyParse(contextPtr, internalPublicKeyPtr, publicKeyScratch, \n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n publicKey.length) === 1);\n };\n const setLengthPtr = (value) => {\n secp256k1Wasm.heapU32.set([value], lengthPtrView32);\n };\n const getLengthPtr = () => secp256k1Wasm.heapU32[lengthPtrView32];\n const serializePublicKey = (length, flag) => {\n setLengthPtr(length);\n secp256k1Wasm.pubkeySerialize(contextPtr, publicKeyScratch, lengthPtr, internalPublicKeyPtr, flag);\n return secp256k1Wasm.readHeapU8(publicKeyScratch, getLengthPtr()).slice();\n };\n const getSerializedPublicKey = (compressed) => compressed\n ? serializePublicKey(33 /* compressedPublicKey */, _bin_bin__WEBPACK_IMPORTED_MODULE_0__.CompressionFlag.COMPRESSED)\n : serializePublicKey(65 /* uncompressedPublicKey */, _bin_bin__WEBPACK_IMPORTED_MODULE_0__.CompressionFlag.UNCOMPRESSED);\n const convertPublicKey = (compressed) => (publicKey) => {\n if (!parsePublicKey(publicKey)) {\n throw new Error('Failed to parse public key.');\n }\n return getSerializedPublicKey(compressed);\n };\n const parseSignature = (signature, isDer) => {\n const paddedSignature = cloneAndPad(signature, 72 /* maxECDSASig */);\n secp256k1Wasm.heapU8.set(paddedSignature, sigScratch);\n return isDer\n ? secp256k1Wasm.signatureParseDER(contextPtr, internalSigPtr, sigScratch, signature.length) === 1\n : secp256k1Wasm.signatureParseCompact(contextPtr, internalSigPtr, sigScratch) === 1;\n };\n const parseOrThrow = (signature, isDer) => {\n if (!parseSignature(signature, isDer)) {\n throw new Error('Failed to parse signature.');\n }\n };\n const getCompactSig = () => {\n secp256k1Wasm.signatureSerializeCompact(contextPtr, sigScratch, internalSigPtr);\n return secp256k1Wasm.readHeapU8(sigScratch, 64 /* compactSig */).slice();\n };\n const getDERSig = () => {\n setLengthPtr(72 /* maxECDSASig */);\n secp256k1Wasm.signatureSerializeDER(contextPtr, sigScratch, lengthPtr, internalSigPtr);\n return secp256k1Wasm.readHeapU8(sigScratch, getLengthPtr()).slice();\n };\n const convertSignature = (wasDER) => (signature) => {\n parseOrThrow(signature, wasDER);\n return wasDER ? getCompactSig() : getDERSig();\n };\n const fillPrivateKeyPtr = (privateKey) => {\n const paddedPrivateKey = cloneAndPad(privateKey, 32 /* privateKey */);\n secp256k1Wasm.heapU8.set(paddedPrivateKey, privateKeyPtr);\n };\n const zeroOutPtr = (pointer, bytes) => {\n secp256k1Wasm.heapU8.fill(0, pointer, pointer + bytes);\n };\n const zeroOutPrivateKeyPtr = () => {\n zeroOutPtr(privateKeyPtr, 32 /* privateKey */);\n };\n const withPrivateKey = (privateKey, instructions) => {\n fillPrivateKeyPtr(privateKey);\n const ret = instructions();\n zeroOutPrivateKeyPtr();\n return ret;\n };\n const derivePublicKey = (compressed) => (privateKey) => {\n const invalid = withPrivateKey(privateKey, () => secp256k1Wasm.pubkeyCreate(contextPtr, internalPublicKeyPtr, privateKeyPtr) !== 1);\n if (invalid) {\n throw new Error('Cannot derive public key from invalid private key.');\n }\n return getSerializedPublicKey(compressed);\n };\n const fillMessageHashScratch = (messageHash) => {\n const paddedMessageHash = cloneAndPad(messageHash, 32 /* messageHash */);\n secp256k1Wasm.heapU8.set(paddedMessageHash, messageHashScratch);\n };\n const normalizeSignature = () => {\n secp256k1Wasm.signatureNormalize(contextPtr, internalSigPtr, internalSigPtr);\n };\n const modifySignature = (isDer, normalize) => (signature) => {\n parseOrThrow(signature, isDer);\n if (normalize) {\n normalizeSignature();\n }\n else {\n secp256k1Wasm.signatureMalleate(contextPtr, internalSigPtr, internalSigPtr);\n }\n return isDer ? getDERSig() : getCompactSig();\n };\n const parseAndNormalizeSignature = (signature, isDer, normalize) => {\n const ret = parseSignature(signature, isDer);\n if (normalize) {\n normalizeSignature();\n }\n return ret;\n };\n const signMessageHash = (isDer) => (privateKey, messageHash) => {\n fillMessageHashScratch(messageHash);\n return withPrivateKey(privateKey, () => {\n const failed = secp256k1Wasm.sign(contextPtr, internalSigPtr, messageHashScratch, privateKeyPtr) !== 1;\n if (failed) {\n throw new Error('Failed to sign message hash. The private key is not valid.');\n }\n if (isDer) {\n setLengthPtr(72 /* maxECDSASig */);\n secp256k1Wasm.signatureSerializeDER(contextPtr, sigScratch, lengthPtr, internalSigPtr);\n return secp256k1Wasm.readHeapU8(sigScratch, getLengthPtr()).slice();\n }\n secp256k1Wasm.signatureSerializeCompact(contextPtr, sigScratch, internalSigPtr);\n return secp256k1Wasm\n .readHeapU8(sigScratch, 64 /* compactSig */)\n .slice();\n });\n };\n const signMessageHashSchnorr = () => (privateKey, messageHash) => {\n fillMessageHashScratch(messageHash);\n return withPrivateKey(privateKey, () => {\n const failed = secp256k1Wasm.schnorrSign(contextPtr, schnorrSigPtr, messageHashScratch, privateKeyPtr) !== 1;\n if (failed) {\n throw new Error('Failed to sign message hash. The private key is not valid.');\n }\n return secp256k1Wasm\n .readHeapU8(schnorrSigPtr, 64 /* schnorrSig */)\n .slice();\n });\n };\n const verifyMessage = (messageHash) => {\n fillMessageHashScratch(messageHash);\n return (secp256k1Wasm.verify(contextPtr, internalSigPtr, messageHashScratch, internalPublicKeyPtr) === 1);\n };\n const verifySignature = (isDer, normalize) => (signature, publicKey, messageHash) => parsePublicKey(publicKey) &&\n parseAndNormalizeSignature(signature, isDer, normalize) &&\n verifyMessage(messageHash);\n const verifyMessageSchnorr = (messageHash, signature) => {\n fillMessageHashScratch(messageHash);\n const paddedSignature = cloneAndPad(signature, 64 /* schnorrSig */);\n secp256k1Wasm.heapU8.set(paddedSignature, schnorrSigPtr);\n return (secp256k1Wasm.schnorrVerify(contextPtr, schnorrSigPtr, messageHashScratch, internalPublicKeyPtr) === 1);\n };\n const verifySignatureSchnorr = () => (signature, publicKey, messageHash) => parsePublicKey(publicKey)\n ? verifyMessageSchnorr(messageHash, signature)\n : false;\n const signMessageHashRecoverable = (privateKey, messageHash) => {\n fillMessageHashScratch(messageHash);\n return withPrivateKey(privateKey, () => {\n if (secp256k1Wasm.signRecoverable(contextPtr, internalRSigPtr, messageHashScratch, privateKeyPtr) !== 1) {\n throw new Error('Failed to sign message hash. The private key is not valid.');\n }\n secp256k1Wasm.recoverableSignatureSerialize(contextPtr, sigScratch, recoveryNumPtr, internalRSigPtr);\n return {\n recoveryId: getRecoveryNumPtr(),\n signature: secp256k1Wasm\n .readHeapU8(sigScratch, 64 /* compactSig */)\n .slice(),\n };\n });\n };\n const recoverPublicKey = (compressed) => (signature, recoveryId, messageHash) => {\n fillMessageHashScratch(messageHash);\n const paddedSignature = cloneAndPad(signature, 72 /* maxECDSASig */);\n secp256k1Wasm.heapU8.set(paddedSignature, sigScratch);\n if (secp256k1Wasm.recoverableSignatureParse(contextPtr, internalRSigPtr, sigScratch, recoveryId) !== 1) {\n throw new Error('Failed to recover public key. Could not parse signature.');\n }\n if (secp256k1Wasm.recover(contextPtr, internalPublicKeyPtr, internalRSigPtr, messageHashScratch) !== 1) {\n throw new Error('Failed to recover public key. The compact signature, recovery, or message hash is invalid.');\n }\n return getSerializedPublicKey(compressed);\n };\n const addTweakPrivateKey = (privateKey, tweakValue) => {\n fillMessageHashScratch(tweakValue);\n return withPrivateKey(privateKey, () => {\n if (secp256k1Wasm.privkeyTweakAdd(contextPtr, privateKeyPtr, messageHashScratch) !== 1) {\n throw new Error('Private key is invalid or adding failed.');\n }\n return secp256k1Wasm\n .readHeapU8(privateKeyPtr, 32 /* privateKey */)\n .slice();\n });\n };\n const mulTweakPrivateKey = (privateKey, tweakValue) => {\n fillMessageHashScratch(tweakValue);\n return withPrivateKey(privateKey, () => {\n if (secp256k1Wasm.privkeyTweakMul(contextPtr, privateKeyPtr, messageHashScratch) !== 1) {\n throw new Error('Private key is invalid or multiplying failed.');\n }\n return secp256k1Wasm\n .readHeapU8(privateKeyPtr, 32 /* privateKey */)\n .slice();\n });\n };\n const addTweakPublicKey = (compressed) => (publicKey, tweakValue) => {\n if (!parsePublicKey(publicKey)) {\n throw new Error('Failed to parse public key.');\n }\n fillMessageHashScratch(tweakValue);\n if (secp256k1Wasm.pubkeyTweakAdd(contextPtr, internalPublicKeyPtr, messageHashScratch) !== 1) {\n throw new Error('Adding failed');\n }\n return getSerializedPublicKey(compressed);\n };\n const mulTweakPublicKey = (compressed) => (publicKey, tweakValue) => {\n if (!parsePublicKey(publicKey)) {\n throw new Error('Failed to parse public key.');\n }\n fillMessageHashScratch(tweakValue);\n if (secp256k1Wasm.pubkeyTweakMul(contextPtr, internalPublicKeyPtr, messageHashScratch) !== 1) {\n throw new Error('Multiplying failed');\n }\n return getSerializedPublicKey(compressed);\n };\n /**\n * The value of this precaution is debatable, especially in the context of\n * javascript and WebAssembly.\n *\n * In the secp256k1 C library, context randomization is an additional layer of\n * security from side-channel attacks which attempt to extract private key\n * information by analyzing things like a CPU's emitted radio frequencies or\n * power usage.\n *\n * In this library, these attacks seem even less likely, since the \"platform\"\n * on which this code will be executed (e.g. V8) is likely to obscure any\n * such signals.\n *\n * Still, out of an abundance of caution (and because no one has produced a\n * definitive proof indicating that this is not helpful), this library exposes\n * the ability to randomize the context like the C library. Depending on the\n * intended application, consumers can decide whether or not to randomize.\n */\n if (randomSeed !== undefined) {\n const randomSeedPtr = messageHashScratch;\n const paddedRandomSeed = cloneAndPad(randomSeed, 32 /* randomSeed */);\n secp256k1Wasm.heapU8.set(paddedRandomSeed, randomSeedPtr);\n secp256k1Wasm.contextRandomize(contextPtr, randomSeedPtr);\n zeroOutPtr(randomSeedPtr, 32 /* randomSeed */);\n }\n return {\n addTweakPrivateKey,\n addTweakPublicKeyCompressed: addTweakPublicKey(true),\n addTweakPublicKeyUncompressed: addTweakPublicKey(false),\n compressPublicKey: convertPublicKey(true),\n derivePublicKeyCompressed: derivePublicKey(true),\n derivePublicKeyUncompressed: derivePublicKey(false),\n malleateSignatureCompact: modifySignature(false, false),\n malleateSignatureDER: modifySignature(true, false),\n mulTweakPrivateKey,\n mulTweakPublicKeyCompressed: mulTweakPublicKey(true),\n mulTweakPublicKeyUncompressed: mulTweakPublicKey(false),\n normalizeSignatureCompact: modifySignature(false, true),\n normalizeSignatureDER: modifySignature(true, true),\n recoverPublicKeyCompressed: recoverPublicKey(true),\n recoverPublicKeyUncompressed: recoverPublicKey(false),\n signMessageHashCompact: signMessageHash(false),\n signMessageHashDER: signMessageHash(true),\n signMessageHashRecoverableCompact: signMessageHashRecoverable,\n signMessageHashSchnorr: signMessageHashSchnorr(),\n signatureCompactToDER: convertSignature(false),\n signatureDERToCompact: convertSignature(true),\n uncompressPublicKey: convertPublicKey(false),\n validatePrivateKey: (privateKey) => withPrivateKey(privateKey, () => secp256k1Wasm.seckeyVerify(contextPtr, privateKeyPtr) === 1),\n validatePublicKey: parsePublicKey,\n verifySignatureCompact: verifySignature(false, true),\n verifySignatureCompactLowS: verifySignature(false, false),\n verifySignatureDER: verifySignature(true, true),\n verifySignatureDERLowS: verifySignature(true, false),\n verifySignatureSchnorr: verifySignatureSchnorr(),\n };\n};\n/**\n * This method is like `instantiateSecp256k1`, but requires the consumer to\n * `Window.fetch` or `fs.readFile` the `secp256k1.wasm` binary and provide it to\n * this method as `webassemblyBytes`. This skips a base64 decoding of an\n * embedded binary.\n *\n * ### Randomizing the Context with `randomSeed`\n * This method also accepts an optional, 32-byte `randomSeed`, which is passed\n * to the `contextRandomize` method in the underlying WebAssembly.\n *\n * The value of this precaution is debatable, especially in the context of\n * javascript and WebAssembly.\n *\n * In the secp256k1 C library, context randomization is an additional layer of\n * security from side-channel attacks which attempt to extract private key\n * information by analyzing things like a CPU's emitted radio frequencies or\n * power usage.\n *\n * In this library, these attacks seem even less likely, since the \"platform\"\n * on which this code will be executed (e.g. V8) is likely to obscure any\n * such signals.\n *\n * Still, out of an abundance of caution (and because no one has produced a\n * definitive proof indicating that this is not helpful), this library exposes\n * the ability to randomize the context like the C library. Depending on the\n * intended application, consumers can decide whether or not to randomize.\n *\n * @param webassemblyBytes - an ArrayBuffer containing the bytes from Libauth's\n * `secp256k1.wasm` binary. Providing this buffer manually may be faster than\n * the internal base64 decode which happens in `instantiateSecp256k1`.\n * @param randomSeed - a 32-byte random seed used to randomize the secp256k1\n * context after creation. See above for details.\n */\nconst instantiateSecp256k1Bytes = async (webassemblyBytes, randomSeed) => wrapSecp256k1Wasm(await (0,_bin_bin__WEBPACK_IMPORTED_MODULE_1__.instantiateSecp256k1WasmBytes)(webassemblyBytes), randomSeed);\nconst cachedSecp256k1 = {};\n/**\n * Create and wrap a Secp256k1 WebAssembly instance to expose a set of\n * purely-functional Secp256k1 methods. For slightly faster initialization, use\n * `instantiateSecp256k1Bytes`.\n *\n * @param randomSeed - a 32-byte random seed used to randomize the secp256k1\n * context after creation. See the description in `instantiateSecp256k1Bytes`\n * for details.\n */\nconst instantiateSecp256k1 = async (randomSeed) => {\n if (cachedSecp256k1.cache !== undefined) {\n return cachedSecp256k1.cache;\n }\n const result = Promise.resolve(wrapSecp256k1Wasm(await (0,_bin_bin__WEBPACK_IMPORTED_MODULE_1__.instantiateSecp256k1Wasm)(), randomSeed));\n // eslint-disable-next-line require-atomic-updates, functional/immutable-data\n cachedSecp256k1.cache = result;\n return result;\n};\n//# sourceMappingURL=secp256k1.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/crypto/secp256k1.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/crypto/sha1.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/crypto/sha1.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getEmbeddedSha1Binary: () => (/* binding */ getEmbeddedSha1Binary),\n/* harmony export */ instantiateSha1: () => (/* binding */ instantiateSha1),\n/* harmony export */ instantiateSha1Bytes: () => (/* binding */ instantiateSha1Bytes)\n/* harmony export */ });\n/* harmony import */ var _bin_bin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bin/bin */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/hashes.js\");\n/* harmony import */ var _bin_bin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../bin/bin */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/sha1/sha1.base64.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/base64.js\");\n\n\n/**\n * The most performant way to instantiate sha1 functionality. To avoid\n * using Node.js or DOM-specific APIs, you can use `instantiateSha1`.\n *\n * @param webassemblyBytes - A buffer containing the sha1 binary.\n */\nconst instantiateSha1Bytes = async (webassemblyBytes) => {\n const wasm = await (0,_bin_bin__WEBPACK_IMPORTED_MODULE_0__.instantiateRustWasm)(webassemblyBytes, './sha1', 'sha1', 'sha1_init', 'sha1_update', 'sha1_final');\n return {\n final: wasm.final,\n hash: wasm.hash,\n init: wasm.init,\n update: wasm.update,\n };\n};\nconst getEmbeddedSha1Binary = () => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.base64ToBin)(_bin_bin__WEBPACK_IMPORTED_MODULE_2__.sha1Base64Bytes).buffer;\nconst cachedSha1 = {};\n/**\n * An ultimately-portable (but slower) version of `instantiateSha1Bytes`\n * which does not require the consumer to provide the sha1 binary buffer.\n */\nconst instantiateSha1 = async () => {\n if (cachedSha1.cache !== undefined) {\n return cachedSha1.cache;\n }\n const result = instantiateSha1Bytes(getEmbeddedSha1Binary());\n // eslint-disable-next-line functional/immutable-data, functional/no-expression-statement\n cachedSha1.cache = result;\n return result;\n};\n//# sourceMappingURL=sha1.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/crypto/sha1.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/crypto/sha256.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/crypto/sha256.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getEmbeddedSha256Binary: () => (/* binding */ getEmbeddedSha256Binary),\n/* harmony export */ instantiateSha256: () => (/* binding */ instantiateSha256),\n/* harmony export */ instantiateSha256Bytes: () => (/* binding */ instantiateSha256Bytes)\n/* harmony export */ });\n/* harmony import */ var _bin_bin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bin/bin */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/hashes.js\");\n/* harmony import */ var _bin_bin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../bin/bin */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/sha256/sha256.base64.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/base64.js\");\n\n\n/**\n * The most performant way to instantiate sha256 functionality. To avoid\n * using Node.js or DOM-specific APIs, you can use `instantiateSha256`.\n *\n * @param webassemblyBytes - A buffer containing the sha256 binary.\n */\nconst instantiateSha256Bytes = async (webassemblyBytes) => {\n const wasm = await (0,_bin_bin__WEBPACK_IMPORTED_MODULE_0__.instantiateRustWasm)(webassemblyBytes, './sha256', 'sha256', 'sha256_init', 'sha256_update', 'sha256_final');\n return {\n final: wasm.final,\n hash: wasm.hash,\n init: wasm.init,\n update: wasm.update,\n };\n};\nconst getEmbeddedSha256Binary = () => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.base64ToBin)(_bin_bin__WEBPACK_IMPORTED_MODULE_2__.sha256Base64Bytes).buffer;\nconst cachedSha256 = {};\n/**\n * An ultimately-portable (but possibly slower) version of\n * `instantiateSha256Bytes` which does not require the consumer to provide the\n * sha256 binary buffer.\n */\nconst instantiateSha256 = async () => {\n if (cachedSha256.cache !== undefined) {\n return cachedSha256.cache;\n }\n const result = instantiateSha256Bytes(getEmbeddedSha256Binary());\n // eslint-disable-next-line functional/immutable-data, functional/no-expression-statement\n cachedSha256.cache = result;\n return result;\n};\n//# sourceMappingURL=sha256.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/crypto/sha256.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/crypto/sha512.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/crypto/sha512.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getEmbeddedSha512Binary: () => (/* binding */ getEmbeddedSha512Binary),\n/* harmony export */ instantiateSha512: () => (/* binding */ instantiateSha512),\n/* harmony export */ instantiateSha512Bytes: () => (/* binding */ instantiateSha512Bytes)\n/* harmony export */ });\n/* harmony import */ var _bin_bin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bin/bin */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/hashes.js\");\n/* harmony import */ var _bin_bin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../bin/bin */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/sha512/sha512.base64.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/base64.js\");\n\n\n/**\n * The most performant way to instantiate sha512 functionality. To avoid\n * using Node.js or DOM-specific APIs, you can use `instantiateSha512`.\n *\n * @param webassemblyBytes - A buffer containing the sha512 binary.\n */\nconst instantiateSha512Bytes = async (webassemblyBytes) => {\n const wasm = await (0,_bin_bin__WEBPACK_IMPORTED_MODULE_0__.instantiateRustWasm)(webassemblyBytes, './sha512', 'sha512', 'sha512_init', 'sha512_update', 'sha512_final');\n return {\n final: wasm.final,\n hash: wasm.hash,\n init: wasm.init,\n update: wasm.update,\n };\n};\nconst getEmbeddedSha512Binary = () => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.base64ToBin)(_bin_bin__WEBPACK_IMPORTED_MODULE_2__.sha512Base64Bytes).buffer;\nconst cachedSha512 = {};\n/**\n * An ultimately-portable (but slower) version of `instantiateSha512Bytes`\n * which does not require the consumer to provide the sha512 binary buffer.\n */\nconst instantiateSha512 = async () => {\n if (cachedSha512.cache !== undefined) {\n return cachedSha512.cache;\n }\n const result = instantiateSha512Bytes(getEmbeddedSha512Binary());\n // eslint-disable-next-line functional/immutable-data, functional/no-expression-statement\n cachedSha512.cache = result;\n return result;\n};\n//# sourceMappingURL=sha512.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/crypto/sha512.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/format/base-convert.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/format/base-convert.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseConversionError: () => (/* binding */ BaseConversionError),\n/* harmony export */ base58ToBin: () => (/* binding */ base58ToBin),\n/* harmony export */ binToBase58: () => (/* binding */ binToBase58),\n/* harmony export */ bitcoinBase58Alphabet: () => (/* binding */ bitcoinBase58Alphabet),\n/* harmony export */ createBaseConverter: () => (/* binding */ createBaseConverter)\n/* harmony export */ });\nvar BaseConversionError;\n(function (BaseConversionError) {\n BaseConversionError[\"tooLong\"] = \"An alphabet may be no longer than 254 characters.\";\n BaseConversionError[\"ambiguousCharacter\"] = \"A character code may only appear once in a single alphabet.\";\n BaseConversionError[\"unknownCharacter\"] = \"Encountered an unknown character for this alphabet.\";\n})(BaseConversionError || (BaseConversionError = {}));\n/**\n * Create a `BaseConverter`, which exposes methods for encoding and decoding\n * `Uint8Array`s using bitcoin-style padding: each leading zero in the input is\n * replaced with the zero-index character of the `alphabet`, then the remainder\n * of the input is encoded as a large number in the specified alphabet.\n *\n * For example, using the alphabet `01`, the input `[0, 15]` is encoded `01111`\n * – a single `0` represents the leading padding, followed by the base2 encoded\n * `0x1111` (15). With the same alphabet, the input `[0, 0, 255]` is encoded\n * `0011111111` - only two `0` characters are required to represent both\n * leading zeros, followed by the base2 encoded `0x11111111` (255).\n *\n * **This is not compatible with `RFC 3548`'s `Base16`, `Base32`, or `Base64`.**\n *\n * If the alphabet is malformed, this method returns the error as a `string`.\n *\n * @param alphabet - an ordered string which maps each index to a character,\n * e.g. `0123456789`.\n * @privateRemarks\n * Algorithm from the `base-x` implementation (which is derived from the\n * original Satoshi implementation): https://github.com/cryptocoinjs/base-x\n */\nconst createBaseConverter = (alphabet) => {\n const undefinedValue = 255;\n const uint8ArrayBase = 256;\n if (alphabet.length >= undefinedValue)\n return BaseConversionError.tooLong;\n const alphabetMap = new Uint8Array(uint8ArrayBase).fill(undefinedValue);\n // eslint-disable-next-line functional/no-loop-statement, functional/no-let, no-plusplus\n for (let index = 0; index < alphabet.length; index++) {\n const characterCode = alphabet.charCodeAt(index);\n if (alphabetMap[characterCode] !== undefinedValue) {\n return BaseConversionError.ambiguousCharacter;\n }\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n alphabetMap[characterCode] = index;\n }\n const base = alphabet.length;\n const paddingCharacter = alphabet.charAt(0);\n const factor = Math.log(base) / Math.log(uint8ArrayBase);\n const inverseFactor = Math.log(uint8ArrayBase) / Math.log(base);\n return {\n // eslint-disable-next-line complexity\n decode: (input) => {\n if (input.length === 0)\n return Uint8Array.of();\n const firstNonZeroIndex = input\n .split('')\n .findIndex((character) => character !== paddingCharacter);\n if (firstNonZeroIndex === -1) {\n return new Uint8Array(input.length);\n }\n const requiredLength = Math.floor((input.length - firstNonZeroIndex) * factor + 1);\n const decoded = new Uint8Array(requiredLength);\n /* eslint-disable functional/no-let, functional/no-expression-statement */\n let nextByte = firstNonZeroIndex;\n let remainingBytes = 0;\n // eslint-disable-next-line functional/no-loop-statement\n while (input[nextByte] !== undefined) {\n let carry = alphabetMap[input.charCodeAt(nextByte)];\n if (carry === undefinedValue)\n return BaseConversionError.unknownCharacter;\n let digit = 0;\n // eslint-disable-next-line functional/no-loop-statement\n for (let steps = requiredLength - 1; (carry !== 0 || digit < remainingBytes) && steps !== -1; \n // eslint-disable-next-line no-plusplus\n steps--, digit++) {\n carry += Math.floor(base * decoded[steps]);\n // eslint-disable-next-line functional/immutable-data\n decoded[steps] = Math.floor(carry % uint8ArrayBase);\n carry = Math.floor(carry / uint8ArrayBase);\n }\n remainingBytes = digit;\n // eslint-disable-next-line no-plusplus\n nextByte++;\n }\n /* eslint-enable functional/no-let, functional/no-expression-statement */\n const firstNonZeroResultDigit = decoded.findIndex((value) => value !== 0);\n const bin = new Uint8Array(firstNonZeroIndex + (requiredLength - firstNonZeroResultDigit));\n // eslint-disable-next-line functional/no-expression-statement\n bin.set(decoded.slice(firstNonZeroResultDigit), firstNonZeroIndex);\n return bin;\n },\n // eslint-disable-next-line complexity\n encode: (input) => {\n if (input.length === 0)\n return '';\n const firstNonZeroIndex = input.findIndex((byte) => byte !== 0);\n if (firstNonZeroIndex === -1) {\n return paddingCharacter.repeat(input.length);\n }\n const requiredLength = Math.floor((input.length - firstNonZeroIndex) * inverseFactor + 1);\n const encoded = new Uint8Array(requiredLength);\n /* eslint-disable functional/no-let, functional/no-expression-statement */\n let nextByte = firstNonZeroIndex;\n let remainingBytes = 0;\n // eslint-disable-next-line functional/no-loop-statement\n while (nextByte !== input.length) {\n let carry = input[nextByte];\n let digit = 0;\n // eslint-disable-next-line functional/no-loop-statement\n for (let steps = requiredLength - 1; (carry !== 0 || digit < remainingBytes) && steps !== -1; \n // eslint-disable-next-line no-plusplus\n steps--, digit++) {\n carry += Math.floor(uint8ArrayBase * encoded[steps]);\n // eslint-disable-next-line functional/immutable-data\n encoded[steps] = Math.floor(carry % base);\n carry = Math.floor(carry / base);\n }\n remainingBytes = digit;\n // eslint-disable-next-line no-plusplus\n nextByte++;\n }\n /* eslint-enable functional/no-let, functional/no-expression-statement */\n const firstNonZeroResultDigit = encoded.findIndex((value) => value !== 0);\n const padding = paddingCharacter.repeat(firstNonZeroIndex);\n return encoded\n .slice(firstNonZeroResultDigit)\n .reduce((all, digit) => all + alphabet.charAt(digit), padding);\n },\n };\n};\nconst bitcoinBase58Alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';\nconst base58 = createBaseConverter(bitcoinBase58Alphabet);\n/**\n * Convert a bitcoin-style base58-encoded string to a Uint8Array.\n *\n * See `createBaseConverter` for format details.\n * @param input - a valid base58-encoded string to decode\n */\nconst base58ToBin = base58.decode;\n/**\n * Convert a Uint8Array to a bitcoin-style base58-encoded string.\n *\n * See `createBaseConverter` for format details.\n * @param input - the Uint8Array to base58 encode\n */\nconst binToBase58 = base58.encode;\n//# sourceMappingURL=base-convert.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/format/base-convert.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/format/base64.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/format/base64.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ base64ToBin: () => (/* binding */ base64ToBin),\n/* harmony export */ binToBase64: () => (/* binding */ binToBase64),\n/* harmony export */ isBase64: () => (/* binding */ isBase64)\n/* harmony export */ });\n// base64 encode/decode derived from: https://github.com/niklasvh/base64-arraybuffer\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst base64GroupLength = 4;\nconst nonBase64Chars = new RegExp(`[^${chars}=]`, 'u');\n/**\n * For use before `base64ToBin`. Returns true if the provided string is valid\n * base64 (length is divisible by 4, only uses base64 characters).\n * @param maybeHex - a string to test\n */\nconst isBase64 = (maybeBase64) => maybeBase64.length % base64GroupLength === 0 &&\n !nonBase64Chars.test(maybeBase64);\n/* eslint-disable functional/no-expression-statement, functional/immutable-data, @typescript-eslint/no-magic-numbers, no-bitwise, no-plusplus */\n/**\n * Convert a base64-encoded string to a Uint8Array.\n *\n * Note, this method always completes. If `validBase64` is not valid base64, an\n * incorrect result will be returned. If `validBase64` is potentially malformed,\n * check it with `isBase64` before calling this method.\n *\n * @param validBase64 - a valid base64-encoded string to decode\n */\nconst base64ToBin = (validBase64) => {\n const lookup = new Uint8Array(123);\n // eslint-disable-next-line functional/no-let, functional/no-loop-statement\n for (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n const bufferLengthEstimate = validBase64.length * 0.75;\n const stringLength = validBase64.length;\n const bufferLength = validBase64[validBase64.length - 1] === '=' // eslint-disable-line @typescript-eslint/prefer-string-starts-ends-with\n ? validBase64[validBase64.length - 2] === '='\n ? bufferLengthEstimate - 2\n : bufferLengthEstimate - 1\n : bufferLengthEstimate;\n const buffer = new ArrayBuffer(bufferLength);\n const bytes = new Uint8Array(buffer);\n // eslint-disable-next-line functional/no-let\n let p = 0;\n // eslint-disable-next-line functional/no-let, functional/no-loop-statement\n for (let i = 0; i < stringLength; i += 4) {\n const encoded1 = lookup[validBase64.charCodeAt(i)];\n const encoded2 = lookup[validBase64.charCodeAt(i + 1)];\n const encoded3 = lookup[validBase64.charCodeAt(i + 2)];\n const encoded4 = lookup[validBase64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return bytes;\n};\n/**\n * Convert a Uint8Array to a base64-encoded string.\n * @param bytes - the Uint8Array to base64 encode\n */\nconst binToBase64 = (bytes) => {\n // eslint-disable-next-line functional/no-let\n let result = '';\n // eslint-disable-next-line functional/no-let, functional/no-loop-statement\n for (let i = 0; i < bytes.length; i += 3) {\n result += chars[bytes[i] >> 2];\n result += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n result += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n result += chars[bytes[i + 2] & 63];\n }\n const padded = bytes.length % 3 === 2\n ? `${result.substring(0, result.length - 1)}=`\n : bytes.length % 3 === 1\n ? `${result.substring(0, result.length - 2)}==`\n : result;\n return padded;\n};\n/* eslint-enable functional/no-expression-statement, functional/immutable-data, @typescript-eslint/no-magic-numbers, no-bitwise, no-plusplus */\n//# sourceMappingURL=base64.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/format/base64.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/format/bin-string.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/format/bin-string.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ binStringToBin: () => (/* binding */ binStringToBin),\n/* harmony export */ binToBinString: () => (/* binding */ binToBinString),\n/* harmony export */ isBinString: () => (/* binding */ isBinString)\n/* harmony export */ });\n/* harmony import */ var _hex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hex */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n\nconst binaryByteWidth = 8;\nconst binary = 2;\n/**\n * Decode a binary-encoded string into a Uint8Array.\n *\n * E.g.: `binStringToBin('0010101001100100')` → `new Uint8Array([42, 100])`\n *\n * Note, this method always completes. If `binaryDigits` is not divisible by 8,\n * the final byte will be parsed as if it were prepended with `0`s (e.g. `1`\n * is interpreted as `00000001`). If `binaryDigits` is potentially malformed,\n * check it with `isBinString` before calling this method.\n *\n * @param validHex - a string of valid, hexadecimal-encoded data\n */\nconst binStringToBin = (binaryDigits) => Uint8Array.from((0,_hex__WEBPACK_IMPORTED_MODULE_0__.splitEvery)(binaryDigits, binaryByteWidth).map((byteString) => parseInt(byteString, binary)));\n/**\n * Encode a Uint8Array into a binary-encoded string.\n *\n * E.g.: `binToBinString(Uint8Array.from([42, 100]))` → `'0010101001100100'`\n *\n * @param bytes - a Uint8Array to encode\n */\nconst binToBinString = (bytes) => bytes.reduce((str, byte) => str + byte.toString(binary).padStart(binaryByteWidth, '0'), '');\n/**\n * For use before `binStringToBin`. Returns true if the provided string is a\n * valid binary string (length is divisible by 8 and only uses the characters\n * `0` and `1`).\n * @param maybeBinString - a string to test\n */\nconst isBinString = (maybeBinString) => maybeBinString.length % binaryByteWidth === 0 &&\n !/[^01]/u.test(maybeBinString);\n//# sourceMappingURL=bin-string.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/format/bin-string.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/format/format.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/format/format.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseConversionError: () => (/* reexport safe */ _base_convert__WEBPACK_IMPORTED_MODULE_2__.BaseConversionError),\n/* harmony export */ LocktimeError: () => (/* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_6__.LocktimeError),\n/* harmony export */ base58ToBin: () => (/* reexport safe */ _base_convert__WEBPACK_IMPORTED_MODULE_2__.base58ToBin),\n/* harmony export */ base64ToBin: () => (/* reexport safe */ _base64__WEBPACK_IMPORTED_MODULE_3__.base64ToBin),\n/* harmony export */ bigIntToBinUint256BEClamped: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.bigIntToBinUint256BEClamped),\n/* harmony export */ bigIntToBinUint64LE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.bigIntToBinUint64LE),\n/* harmony export */ bigIntToBinUint64LEClamped: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.bigIntToBinUint64LEClamped),\n/* harmony export */ bigIntToBinUintLE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.bigIntToBinUintLE),\n/* harmony export */ bigIntToBitcoinVarInt: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.bigIntToBitcoinVarInt),\n/* harmony export */ binStringToBin: () => (/* reexport safe */ _bin_string__WEBPACK_IMPORTED_MODULE_1__.binStringToBin),\n/* harmony export */ binToBase58: () => (/* reexport safe */ _base_convert__WEBPACK_IMPORTED_MODULE_2__.binToBase58),\n/* harmony export */ binToBase64: () => (/* reexport safe */ _base64__WEBPACK_IMPORTED_MODULE_3__.binToBase64),\n/* harmony export */ binToBigIntUint256BE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.binToBigIntUint256BE),\n/* harmony export */ binToBigIntUint64LE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.binToBigIntUint64LE),\n/* harmony export */ binToBigIntUintBE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.binToBigIntUintBE),\n/* harmony export */ binToBigIntUintLE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.binToBigIntUintLE),\n/* harmony export */ binToBinString: () => (/* reexport safe */ _bin_string__WEBPACK_IMPORTED_MODULE_1__.binToBinString),\n/* harmony export */ binToFixedLength: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.binToFixedLength),\n/* harmony export */ binToHex: () => (/* reexport safe */ _hex__WEBPACK_IMPORTED_MODULE_0__.binToHex),\n/* harmony export */ binToNumberInt16LE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.binToNumberInt16LE),\n/* harmony export */ binToNumberInt32LE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.binToNumberInt32LE),\n/* harmony export */ binToNumberUint16LE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.binToNumberUint16LE),\n/* harmony export */ binToNumberUint32LE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.binToNumberUint32LE),\n/* harmony export */ binToNumberUintLE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.binToNumberUintLE),\n/* harmony export */ binToUtf8: () => (/* reexport safe */ _utf8__WEBPACK_IMPORTED_MODULE_8__.binToUtf8),\n/* harmony export */ bitcoinBase58Alphabet: () => (/* reexport safe */ _base_convert__WEBPACK_IMPORTED_MODULE_2__.bitcoinBase58Alphabet),\n/* harmony export */ createBaseConverter: () => (/* reexport safe */ _base_convert__WEBPACK_IMPORTED_MODULE_2__.createBaseConverter),\n/* harmony export */ dateToLocktime: () => (/* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_6__.dateToLocktime),\n/* harmony export */ dateToLocktimeBin: () => (/* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_6__.dateToLocktimeBin),\n/* harmony export */ flattenBinArray: () => (/* reexport safe */ _hex__WEBPACK_IMPORTED_MODULE_0__.flattenBinArray),\n/* harmony export */ hexToBin: () => (/* reexport safe */ _hex__WEBPACK_IMPORTED_MODULE_0__.hexToBin),\n/* harmony export */ isBase64: () => (/* reexport safe */ _base64__WEBPACK_IMPORTED_MODULE_3__.isBase64),\n/* harmony export */ isBinString: () => (/* reexport safe */ _bin_string__WEBPACK_IMPORTED_MODULE_1__.isBinString),\n/* harmony export */ isHex: () => (/* reexport safe */ _hex__WEBPACK_IMPORTED_MODULE_0__.isHex),\n/* harmony export */ locktimeToDate: () => (/* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_6__.locktimeToDate),\n/* harmony export */ maximumLocktimeDate: () => (/* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_6__.maximumLocktimeDate),\n/* harmony export */ maximumLocktimeTimestamp: () => (/* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_6__.maximumLocktimeTimestamp),\n/* harmony export */ minimumLocktimeDate: () => (/* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_6__.minimumLocktimeDate),\n/* harmony export */ minimumLocktimeTimestamp: () => (/* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_6__.minimumLocktimeTimestamp),\n/* harmony export */ numberToBinInt16LE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.numberToBinInt16LE),\n/* harmony export */ numberToBinInt32LE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.numberToBinInt32LE),\n/* harmony export */ numberToBinInt32TwosCompliment: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.numberToBinInt32TwosCompliment),\n/* harmony export */ numberToBinUint16BE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.numberToBinUint16BE),\n/* harmony export */ numberToBinUint16LE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.numberToBinUint16LE),\n/* harmony export */ numberToBinUint16LEClamped: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.numberToBinUint16LEClamped),\n/* harmony export */ numberToBinUint32BE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.numberToBinUint32BE),\n/* harmony export */ numberToBinUint32LE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.numberToBinUint32LE),\n/* harmony export */ numberToBinUint32LEClamped: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.numberToBinUint32LEClamped),\n/* harmony export */ numberToBinUintLE: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.numberToBinUintLE),\n/* harmony export */ parseLocktimeBin: () => (/* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_6__.parseLocktimeBin),\n/* harmony export */ range: () => (/* reexport safe */ _hex__WEBPACK_IMPORTED_MODULE_0__.range),\n/* harmony export */ readBitcoinVarInt: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.readBitcoinVarInt),\n/* harmony export */ sortObjectKeys: () => (/* reexport safe */ _log__WEBPACK_IMPORTED_MODULE_5__.sortObjectKeys),\n/* harmony export */ splitEvery: () => (/* reexport safe */ _hex__WEBPACK_IMPORTED_MODULE_0__.splitEvery),\n/* harmony export */ stringify: () => (/* reexport safe */ _log__WEBPACK_IMPORTED_MODULE_5__.stringify),\n/* harmony export */ stringifyTestVector: () => (/* reexport safe */ _log__WEBPACK_IMPORTED_MODULE_5__.stringifyTestVector),\n/* harmony export */ swapEndianness: () => (/* reexport safe */ _hex__WEBPACK_IMPORTED_MODULE_0__.swapEndianness),\n/* harmony export */ utf8ToBin: () => (/* reexport safe */ _utf8__WEBPACK_IMPORTED_MODULE_8__.utf8ToBin),\n/* harmony export */ varIntPrefixToSize: () => (/* reexport safe */ _numbers__WEBPACK_IMPORTED_MODULE_4__.varIntPrefixToSize)\n/* harmony export */ });\n/* harmony import */ var _hex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hex */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _bin_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bin-string */ \"./node_modules/@bitauth/libauth/build/module/lib/format/bin-string.js\");\n/* harmony import */ var _base_convert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base-convert */ \"./node_modules/@bitauth/libauth/build/module/lib/format/base-convert.js\");\n/* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base64 */ \"./node_modules/@bitauth/libauth/build/module/lib/format/base64.js\");\n/* harmony import */ var _numbers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./numbers */ \"./node_modules/@bitauth/libauth/build/module/lib/format/numbers.js\");\n/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./log */ \"./node_modules/@bitauth/libauth/build/module/lib/format/log.js\");\n/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./time */ \"./node_modules/@bitauth/libauth/build/module/lib/format/time.js\");\n/* harmony import */ var _type_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./type-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/format/type-utils.js\");\n/* harmony import */ var _type_utils__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_type_utils__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _type_utils__WEBPACK_IMPORTED_MODULE_7__) if([\"default\",\"binToHex\",\"flattenBinArray\",\"hexToBin\",\"isHex\",\"range\",\"splitEvery\",\"swapEndianness\",\"binStringToBin\",\"binToBinString\",\"isBinString\",\"BaseConversionError\",\"base58ToBin\",\"binToBase58\",\"bitcoinBase58Alphabet\",\"createBaseConverter\",\"base64ToBin\",\"binToBase64\",\"isBase64\",\"bigIntToBinUint256BEClamped\",\"bigIntToBinUint64LE\",\"bigIntToBinUint64LEClamped\",\"bigIntToBinUintLE\",\"bigIntToBitcoinVarInt\",\"binToBigIntUint256BE\",\"binToBigIntUint64LE\",\"binToBigIntUintBE\",\"binToBigIntUintLE\",\"binToFixedLength\",\"binToNumberInt16LE\",\"binToNumberInt32LE\",\"binToNumberUint16LE\",\"binToNumberUint32LE\",\"binToNumberUintLE\",\"numberToBinInt16LE\",\"numberToBinInt32LE\",\"numberToBinInt32TwosCompliment\",\"numberToBinUint16BE\",\"numberToBinUint16LE\",\"numberToBinUint16LEClamped\",\"numberToBinUint32BE\",\"numberToBinUint32LE\",\"numberToBinUint32LEClamped\",\"numberToBinUintLE\",\"readBitcoinVarInt\",\"varIntPrefixToSize\",\"sortObjectKeys\",\"stringify\",\"stringifyTestVector\",\"LocktimeError\",\"dateToLocktime\",\"dateToLocktimeBin\",\"locktimeToDate\",\"maximumLocktimeDate\",\"maximumLocktimeTimestamp\",\"minimumLocktimeDate\",\"minimumLocktimeTimestamp\",\"parseLocktimeBin\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _type_utils__WEBPACK_IMPORTED_MODULE_7__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _utf8__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utf8 */ \"./node_modules/@bitauth/libauth/build/module/lib/format/utf8.js\");\n\n\n\n\n\n\n\n\n\n//# sourceMappingURL=format.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/format/format.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/format/hex.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/format/hex.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ binToHex: () => (/* binding */ binToHex),\n/* harmony export */ flattenBinArray: () => (/* binding */ flattenBinArray),\n/* harmony export */ hexToBin: () => (/* binding */ hexToBin),\n/* harmony export */ isHex: () => (/* binding */ isHex),\n/* harmony export */ range: () => (/* binding */ range),\n/* harmony export */ splitEvery: () => (/* binding */ splitEvery),\n/* harmony export */ swapEndianness: () => (/* binding */ swapEndianness)\n/* harmony export */ });\n/**\n * Returns an array of incrementing values starting at `begin` and incrementing by one for `length`.\n *\n * E.g.: `range(3)` → `[0, 1, 2]` and `range(3, 1)` → `[1, 2, 3]`\n *\n * @param length - the number of elements in the array\n * @param begin - the index at which the range starts (default: `0`)\n */\nconst range = (length, begin = 0) => Array.from({ length }, (_, index) => begin + index);\n/**\n * Split a string into an array of `chunkLength` strings. The final string may have a length between 1 and `chunkLength`.\n *\n * E.g.: `splitEvery('abcde', 2)` → `['ab', 'cd', 'e']`\n */\nconst splitEvery = (input, chunkLength) => range(Math.ceil(input.length / chunkLength))\n .map((index) => index * chunkLength)\n .map((begin) => input.slice(begin, begin + chunkLength));\nconst hexByteWidth = 2;\nconst hexadecimal = 16;\n/**\n * Decode a hexadecimal-encoded string into a Uint8Array.\n *\n * E.g.: `hexToBin('2a64ff')` → `new Uint8Array([42, 100, 255])`\n *\n * Note, this method always completes. If `validHex` is not divisible by 2,\n * the final byte will be parsed as if it were prepended with a `0` (e.g. `aaa`\n * is interpreted as `aa0a`). If `validHex` is potentially malformed, check\n * it with `isHex` before calling this method.\n *\n * @param validHex - a string of valid, hexadecimal-encoded data\n */\nconst hexToBin = (validHex) => Uint8Array.from(splitEvery(validHex, hexByteWidth).map((byte) => parseInt(byte, hexadecimal)));\n/**\n * For use before `hexToBin`. Returns true if the provided string is valid\n * hexadecimal (length is divisible by 2, only uses hexadecimal characters).\n * @param maybeHex - a string to test\n */\nconst isHex = (maybeHex) => maybeHex.length % hexByteWidth === 0 && !/[^a-fA-F0-9]/u.test(maybeHex);\n/**\n * Encode a Uint8Array into a hexadecimal-encoded string.\n *\n * E.g.: `binToHex(new Uint8Array([42, 100, 255]))` → `'2a64ff'`\n *\n * @param bytes - a Uint8Array to encode\n */\nconst binToHex = (bytes) => bytes.reduce((str, byte) => str + byte.toString(hexadecimal).padStart(hexByteWidth, '0'), '');\n/**\n * Decode a hexadecimal-encoded string into bytes, reverse it, then re-encode.\n *\n * @param validHex - a string of valid, hexadecimal-encoded data. See\n * `hexToBin` for more information.\n */\nconst swapEndianness = (validHex) => binToHex(hexToBin(validHex).reverse());\n/**\n * Reduce an array of `Uint8Array`s into a single `Uint8Array`.\n * @param array - the array of `Uint8Array`s to flatten\n */\nconst flattenBinArray = (array) => {\n const totalLength = array.reduce((total, bin) => total + bin.length, 0);\n const flattened = new Uint8Array(totalLength);\n // eslint-disable-next-line functional/no-expression-statement\n array.reduce((index, bin) => {\n // eslint-disable-next-line functional/no-expression-statement\n flattened.set(bin, index);\n return index + bin.length;\n }, 0);\n return flattened;\n};\n//# sourceMappingURL=hex.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/format/hex.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/format/log.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/format/log.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ sortObjectKeys: () => (/* binding */ sortObjectKeys),\n/* harmony export */ stringify: () => (/* binding */ stringify),\n/* harmony export */ stringifyTestVector: () => (/* binding */ stringifyTestVector)\n/* harmony export */ });\n/* harmony import */ var _hex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hex */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n\nconst defaultStringifySpacing = 2;\n/**\n * A safe method to `JSON.stringify` a value, useful for debugging and logging\n * purposes.\n *\n * @remarks\n * Without modifications, `JSON.stringify` has several shortcomings in\n * debugging and logging usage:\n * - throws when serializing anything containing a `bigint`\n * - `Uint8Array`s are often serialized in base 10 with newlines between each\n * index item\n * - `functions` and `symbols` are not clearly marked\n *\n * This method is more helpful in these cases:\n * - `bigint`: `0n` → ``\n * - `Uint8Array`: `Uint8Array.of(0,0)` → ``\n * - `function`: `(x) => x * 2` → ` x * 2>`\n * - `symbol`: `Symbol(A)` → ``\n *\n * @param value - the data to serialize\n * @param spacing - the number of spaces to use in\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst stringify = (value, spacing = defaultStringifySpacing) => JSON.stringify(value, \n// eslint-disable-next-line complexity\n(_, item) => {\n const type = typeof item;\n const name = typeof item === 'object' && item !== null\n ? item.constructor.name\n : type;\n switch (name) {\n case 'Uint8Array':\n return ``;\n case 'bigint':\n return ``;\n case 'function':\n case 'symbol':\n // eslint-disable-next-line @typescript-eslint/ban-types\n return `<${name}: ${item.toString()}>`;\n default:\n return item;\n }\n}, spacing);\n/**\n * Given a value, recursively sort the keys of all objects it references\n * (without sorting arrays).\n *\n * @param objectOrArray - the object or array in which to sort object keys\n */\nconst sortObjectKeys = (objectOrArray\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n) => {\n if (Array.isArray(objectOrArray)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return objectOrArray.map(sortObjectKeys);\n }\n if (typeof objectOrArray !== 'object' ||\n objectOrArray === null ||\n objectOrArray.constructor.name !== 'Object') {\n return objectOrArray;\n }\n // eslint-disable-next-line functional/immutable-data\n const keys = Object.keys(objectOrArray).sort((a, b) => a.localeCompare(b));\n return keys.reduce((all, key) => ({\n ...all,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n [key]: sortObjectKeys(objectOrArray[key]),\n }), {});\n};\nconst uint8ArrayRegex = /\"[0-9a-f]*)>\"/gu;\nconst bigIntRegex = /\"[0-9]*)n>\"/gu;\n/**\n * An alternative to `stringify` which produces valid JavaScript for use as a\n * test vector in this library. `Uint8Array`s are constructed using `hexToBin`\n * and `bigint` values use the `BigInt` constructor. If `alphabetize` is `true`,\n * all objects will be sorted in the output.\n *\n * Note, this assumes all strings which match the expected regular expressions\n * are values of type `Uint8Array` and `bigint` respectively. String values\n * which otherwise happen to match these regular expressions will be converted\n * incorrectly.\n *\n * @param stringified - the result of `stringify`\n */\nconst stringifyTestVector = (\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nvalue, alphabetize = true) => {\n const stringified = alphabetize\n ? stringify(sortObjectKeys(value))\n : stringify(value);\n return stringified\n .replace(uint8ArrayRegex, \"hexToBin('$1')\")\n .replace(bigIntRegex, \"BigInt('$1')\");\n};\n//# sourceMappingURL=log.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/format/log.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/format/numbers.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/format/numbers.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ bigIntToBinUint256BEClamped: () => (/* binding */ bigIntToBinUint256BEClamped),\n/* harmony export */ bigIntToBinUint64LE: () => (/* binding */ bigIntToBinUint64LE),\n/* harmony export */ bigIntToBinUint64LEClamped: () => (/* binding */ bigIntToBinUint64LEClamped),\n/* harmony export */ bigIntToBinUintLE: () => (/* binding */ bigIntToBinUintLE),\n/* harmony export */ bigIntToBitcoinVarInt: () => (/* binding */ bigIntToBitcoinVarInt),\n/* harmony export */ binToBigIntUint256BE: () => (/* binding */ binToBigIntUint256BE),\n/* harmony export */ binToBigIntUint64LE: () => (/* binding */ binToBigIntUint64LE),\n/* harmony export */ binToBigIntUintBE: () => (/* binding */ binToBigIntUintBE),\n/* harmony export */ binToBigIntUintLE: () => (/* binding */ binToBigIntUintLE),\n/* harmony export */ binToFixedLength: () => (/* binding */ binToFixedLength),\n/* harmony export */ binToNumberInt16LE: () => (/* binding */ binToNumberInt16LE),\n/* harmony export */ binToNumberInt32LE: () => (/* binding */ binToNumberInt32LE),\n/* harmony export */ binToNumberUint16LE: () => (/* binding */ binToNumberUint16LE),\n/* harmony export */ binToNumberUint32LE: () => (/* binding */ binToNumberUint32LE),\n/* harmony export */ binToNumberUintLE: () => (/* binding */ binToNumberUintLE),\n/* harmony export */ numberToBinInt16LE: () => (/* binding */ numberToBinInt16LE),\n/* harmony export */ numberToBinInt32LE: () => (/* binding */ numberToBinInt32LE),\n/* harmony export */ numberToBinInt32TwosCompliment: () => (/* binding */ numberToBinInt32TwosCompliment),\n/* harmony export */ numberToBinUint16BE: () => (/* binding */ numberToBinUint16BE),\n/* harmony export */ numberToBinUint16LE: () => (/* binding */ numberToBinUint16LE),\n/* harmony export */ numberToBinUint16LEClamped: () => (/* binding */ numberToBinUint16LEClamped),\n/* harmony export */ numberToBinUint32BE: () => (/* binding */ numberToBinUint32BE),\n/* harmony export */ numberToBinUint32LE: () => (/* binding */ numberToBinUint32LE),\n/* harmony export */ numberToBinUint32LEClamped: () => (/* binding */ numberToBinUint32LEClamped),\n/* harmony export */ numberToBinUintLE: () => (/* binding */ numberToBinUintLE),\n/* harmony export */ readBitcoinVarInt: () => (/* binding */ readBitcoinVarInt),\n/* harmony export */ varIntPrefixToSize: () => (/* binding */ varIntPrefixToSize)\n/* harmony export */ });\n/**\n * Encode a positive integer as a little-endian Uint8Array. For values exceeding\n * `Number.MAX_SAFE_INTEGER` (`9007199254740991`), use `bigIntToBinUintLE`.\n * Negative values will return the same result as `0`.\n *\n * @param value - the number to encode\n */\nconst numberToBinUintLE = (value) => {\n const baseUint8Array = 256;\n const result = [];\n // eslint-disable-next-line functional/no-let\n let remaining = value;\n // eslint-disable-next-line functional/no-loop-statement\n while (remaining >= baseUint8Array) {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n result.push(remaining % baseUint8Array);\n // eslint-disable-next-line functional/no-expression-statement\n remaining = Math.floor(remaining / baseUint8Array);\n }\n // eslint-disable-next-line functional/no-conditional-statement, functional/no-expression-statement, functional/immutable-data\n if (remaining > 0)\n result.push(remaining);\n return Uint8Array.from(result);\n};\n/**\n * Fill a new Uint8Array of a specific byte-length with the contents of a given\n * Uint8Array, truncating or padding the Uint8Array with zeros.\n *\n * @param bin - the Uint8Array to resize\n * @param bytes - the desired byte-length\n */\nconst binToFixedLength = (bin, bytes) => {\n const fixedBytes = new Uint8Array(bytes);\n const maxValue = 255;\n // eslint-disable-next-line functional/no-expression-statement\n bin.length > bytes ? fixedBytes.fill(maxValue) : fixedBytes.set(bin);\n // TODO: re-enable eslint-disable-next-line @typescript-eslint/no-unused-expressions\n return fixedBytes;\n};\n/**\n * Encode a positive integer as a 2-byte Uint16LE Uint8Array, clamping the\n * results. (Values exceeding `0xffff` return the same result as `0xffff`,\n * negative values will return the same result as `0`.)\n *\n * @param value - the number to encode\n */\nconst numberToBinUint16LEClamped = (value) => {\n const uint16 = 2;\n return binToFixedLength(numberToBinUintLE(value), uint16);\n};\n/**\n * Encode a positive integer as a 4-byte Uint32LE Uint8Array, clamping the\n * results. (Values exceeding `0xffffffff` return the same result as\n * `0xffffffff`, negative values will return the same result as `0`.)\n *\n * @param value - the number to encode\n */\nconst numberToBinUint32LEClamped = (value) => {\n const uint32 = 4;\n return binToFixedLength(numberToBinUintLE(value), uint32);\n};\n/**\n * Encode a positive integer as a 2-byte Uint16LE Uint8Array.\n *\n * This method will return an incorrect result for values outside of the range\n * `0` to `0xffff`.\n *\n * @param value - the number to encode\n */\nconst numberToBinUint16LE = (value) => {\n const uint16Length = 2;\n const bin = new Uint8Array(uint16Length);\n const writeAsLittleEndian = true;\n const view = new DataView(bin.buffer, bin.byteOffset, bin.byteLength);\n // eslint-disable-next-line functional/no-expression-statement\n view.setUint16(0, value, writeAsLittleEndian);\n return bin;\n};\n/**\n * Encode an integer as a 2-byte Int16LE Uint8Array.\n *\n * This method will return an incorrect result for values outside of the range\n * `0x0000` to `0xffff`.\n *\n * @param value - the number to encode\n */\nconst numberToBinInt16LE = (value) => {\n const int16Length = 2;\n const bin = new Uint8Array(int16Length);\n const writeAsLittleEndian = true;\n const view = new DataView(bin.buffer, bin.byteOffset, bin.byteLength);\n // eslint-disable-next-line functional/no-expression-statement\n view.setInt16(0, value, writeAsLittleEndian);\n return bin;\n};\n/**\n * Encode an integer as a 4-byte Uint32LE Uint8Array.\n *\n * This method will return an incorrect result for values outside of the range\n * `0x00000000` to `0xffffffff`.\n *\n * @param value - the number to encode\n */\nconst numberToBinInt32LE = (value) => {\n const int32Length = 4;\n const bin = new Uint8Array(int32Length);\n const writeAsLittleEndian = true;\n const view = new DataView(bin.buffer, bin.byteOffset, bin.byteLength);\n // eslint-disable-next-line functional/no-expression-statement\n view.setInt32(0, value, writeAsLittleEndian);\n return bin;\n};\n/**\n * Decode a 2-byte Int16LE Uint8Array into a number.\n *\n * Throws if `bin` is shorter than 2 bytes.\n *\n * @param bin - the Uint8Array to decode\n */\nconst binToNumberInt16LE = (bin) => {\n const view = new DataView(bin.buffer, bin.byteOffset, bin.byteLength);\n const readAsLittleEndian = true;\n return view.getInt16(0, readAsLittleEndian);\n};\n/**\n * Decode a 4-byte Int32LE Uint8Array into a number.\n *\n * Throws if `bin` is shorter than 4 bytes.\n *\n * @param bin - the Uint8Array to decode\n */\nconst binToNumberInt32LE = (bin) => {\n const view = new DataView(bin.buffer, bin.byteOffset, bin.byteLength);\n const readAsLittleEndian = true;\n return view.getInt32(0, readAsLittleEndian);\n};\n/**\n * Encode a positive integer as a 2-byte Uint16LE Uint8Array.\n *\n * This method will return an incorrect result for values outside of the range\n * `0` to `0xffff`.\n *\n * @param value - the number to encode\n */\nconst numberToBinUint16BE = (value) => {\n const uint16Length = 2;\n const bin = new Uint8Array(uint16Length);\n const writeAsLittleEndian = false;\n const view = new DataView(bin.buffer, bin.byteOffset, bin.byteLength);\n // eslint-disable-next-line functional/no-expression-statement\n view.setUint16(0, value, writeAsLittleEndian);\n return bin;\n};\n/**\n * Encode a positive number as a 4-byte Uint32LE Uint8Array.\n *\n * This method will return an incorrect result for values outside of the range\n * `0` to `0xffffffff`.\n *\n * @param value - the number to encode\n */\nconst numberToBinUint32LE = (value) => {\n const uint32Length = 4;\n const bin = new Uint8Array(uint32Length);\n const writeAsLittleEndian = true;\n const view = new DataView(bin.buffer, bin.byteOffset, bin.byteLength);\n // eslint-disable-next-line functional/no-expression-statement\n view.setUint32(0, value, writeAsLittleEndian);\n return bin;\n};\n/**\n * Encode a positive number as a 4-byte Uint32BE Uint8Array.\n *\n * This method will return an incorrect result for values outside of the range\n * `0` to `0xffffffff`.\n *\n * @param value - the number to encode\n */\nconst numberToBinUint32BE = (value) => {\n const uint32Length = 4;\n const bin = new Uint8Array(uint32Length);\n const writeAsLittleEndian = false;\n const view = new DataView(bin.buffer, bin.byteOffset, bin.byteLength);\n // eslint-disable-next-line functional/no-expression-statement\n view.setUint32(0, value, writeAsLittleEndian);\n return bin;\n};\n/**\n * Encode a positive BigInt as little-endian Uint8Array. Negative values will\n * return the same result as `0`.\n *\n * @param value - the number to encode\n */\nconst bigIntToBinUintLE = (value) => {\n const baseUint8Array = 256;\n const base = BigInt(baseUint8Array);\n const result = [];\n // eslint-disable-next-line functional/no-let\n let remaining = value;\n // eslint-disable-next-line functional/no-loop-statement\n while (remaining >= base) {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n result.push(Number(remaining % base));\n // eslint-disable-next-line functional/no-expression-statement\n remaining /= base;\n }\n // eslint-disable-next-line functional/no-conditional-statement, functional/no-expression-statement, functional/immutable-data\n if (remaining > BigInt(0))\n result.push(Number(remaining));\n return Uint8Array.from(result.length > 0 ? result : [0]);\n};\n/**\n * Encode a positive BigInt as an 8-byte Uint64LE Uint8Array, clamping the\n * results. (Values exceeding `0xffff_ffff_ffff_ffff` return the same result as\n * `0xffff_ffff_ffff_ffff`, negative values return the same result as `0`.)\n *\n * @param value - the number to encode\n */\nconst bigIntToBinUint64LEClamped = (value) => {\n const uint64 = 8;\n return binToFixedLength(bigIntToBinUintLE(value), uint64);\n};\n/**\n * Encode a positive BigInt as an 8-byte Uint64LE Uint8Array.\n *\n * This method will return an incorrect result for values outside of the range\n * `0` to `0xffff_ffff_ffff_ffff`.\n *\n * @param value - the number to encode\n */\nconst bigIntToBinUint64LE = (value) => {\n const uint64LengthInBits = 64;\n const valueAsUint64 = BigInt.asUintN(uint64LengthInBits, value);\n const fixedLengthBin = bigIntToBinUint64LEClamped(valueAsUint64);\n return fixedLengthBin;\n};\n/**\n * Encode an integer as a 4-byte, little-endian Uint8Array using the number's\n * two's compliment representation (the format used by JavaScript's bitwise\n * operators).\n *\n * @remarks\n * The C++ bitcoin implementations sometimes represent short vectors using\n * signed 32-bit integers (e.g. `sighashType`). This method can be used to test\n * compatibility with those implementations.\n *\n * @param value - the number to encode\n */\nconst numberToBinInt32TwosCompliment = (value) => {\n const bytes = 4;\n const bitsInAByte = 8;\n const bin = new Uint8Array(bytes);\n // eslint-disable-next-line functional/no-let, functional/no-loop-statement, no-plusplus\n for (let offset = 0; offset < bytes; offset++) {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n bin[offset] = value;\n // eslint-disable-next-line functional/no-expression-statement, no-bitwise, no-param-reassign\n value >>>= bitsInAByte;\n }\n return bin;\n};\n/**\n * Decode a little-endian Uint8Array of any length into a number. For numbers\n * larger than `Number.MAX_SAFE_INTEGER` (`9007199254740991`), use\n * `binToBigIntUintLE`.\n *\n * The `bytes` parameter can be set to constrain the expected length (default:\n * `bin.length`). This method throws if `bin.length` is not equal to `bytes`.\n *\n * @privateRemarks\n * We avoid a bitwise strategy here because JavaScript uses 32-bit signed\n * integers for bitwise math, so larger numbers are converted incorrectly. E.g.\n * `2147483648 << 8` is `0`, while `2147483648n << 8n` is `549755813888n`.\n *\n * @param bin - the Uint8Array to decode\n * @param bytes - the number of bytes to read (default: `bin.length`)\n */\nconst binToNumberUintLE = (bin, bytes = bin.length) => {\n const base = 2;\n const bitsInAByte = 8;\n // eslint-disable-next-line functional/no-conditional-statement\n if (bin.length !== bytes) {\n // eslint-disable-next-line functional/no-throw-statement\n throw new TypeError(`Bin length must be ${bytes}.`);\n }\n return new Uint8Array(bin.buffer, bin.byteOffset, bin.length).reduce((accumulated, byte, i) => accumulated + byte * base ** (bitsInAByte * i), 0);\n};\n/**\n * Decode a 2-byte Uint16LE Uint8Array into a number.\n *\n * Throws if `bin` is shorter than 2 bytes.\n *\n * @param bin - the Uint8Array to decode\n */\nconst binToNumberUint16LE = (bin) => {\n const view = new DataView(bin.buffer, bin.byteOffset, bin.byteLength);\n const readAsLittleEndian = true;\n return view.getUint16(0, readAsLittleEndian);\n};\n/**\n * Decode a 4-byte Uint32LE Uint8Array into a number.\n *\n * Throws if `bin` is shorter than 4 bytes.\n *\n * @param bin - the Uint8Array to decode\n */\nconst binToNumberUint32LE = (bin) => {\n const view = new DataView(bin.buffer, bin.byteOffset, bin.byteLength);\n const readAsLittleEndian = true;\n return view.getUint32(0, readAsLittleEndian);\n};\n/**\n * Decode a big-endian Uint8Array of any length into a BigInt. If starting from\n * a hex value, consider using the BigInt constructor instead:\n * ```\n * BigInt(`0x${hex}`)\n * ```\n *\n * The `bytes` parameter can be set to constrain the expected length (default:\n * `bin.length`). This method throws if `bin.length` is not equal to `bytes`.\n *\n * @param bin - the Uint8Array to decode\n * @param bytes - the number of bytes to read (default: `bin.length`)\n */\nconst binToBigIntUintBE = (bin, bytes = bin.length) => {\n const bitsInAByte = 8;\n const shift = BigInt(bitsInAByte);\n // eslint-disable-next-line functional/no-conditional-statement\n if (bin.length !== bytes) {\n // eslint-disable-next-line functional/no-throw-statement\n throw new TypeError(`Bin length must be ${bytes}.`);\n }\n return new Uint8Array(bin.buffer, bin.byteOffset, bin.length).reduce(\n // eslint-disable-next-line no-bitwise\n (accumulated, byte) => (accumulated << shift) | BigInt(byte), BigInt(0));\n};\n/**\n * Decode an unsigned, 32-byte big-endian Uint8Array into a BigInt. This can be\n * used to decode Uint8Array-encoded cryptographic primitives like private\n * keys, public keys, curve parameters, and signature points.\n *\n * If starting from a hex value, consider using the BigInt constructor instead:\n * ```\n * BigInt(`0x${hex}`)\n * ```\n * @param bin - the Uint8Array to decode\n */\nconst binToBigIntUint256BE = (bin) => {\n const uint256Bytes = 32;\n return binToBigIntUintBE(bin, uint256Bytes);\n};\n/**\n * Encode a positive BigInt into an unsigned 32-byte big-endian Uint8Array. This\n * can be used to encoded numbers for cryptographic primitives like private\n * keys, public keys, curve parameters, and signature points.\n *\n * Negative values will return the same result as `0`, values higher than\n * 2^256-1 will return the maximum expressible unsigned 256-bit value\n * (`0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`).\n *\n * @param value - the BigInt to encode\n */\nconst bigIntToBinUint256BEClamped = (value) => {\n const uint256Bytes = 32;\n return binToFixedLength(bigIntToBinUintLE(value), uint256Bytes).reverse();\n};\n/**\n * Decode a little-endian Uint8Array of any length into a BigInt.\n *\n * The `bytes` parameter can be set to constrain the expected length (default:\n * `bin.length`). This method throws if `bin.length` is not equal to `bytes`.\n *\n * @param bin - the Uint8Array to decode\n * @param bytes - the number of bytes to read (default: `bin.length`)\n */\nconst binToBigIntUintLE = (bin, bytes = bin.length) => {\n const bitsInAByte = 8;\n // eslint-disable-next-line functional/no-conditional-statement\n if (bin.length !== bytes) {\n // eslint-disable-next-line functional/no-throw-statement\n throw new TypeError(`Bin length must be ${bytes}.`);\n }\n return new Uint8Array(bin.buffer, bin.byteOffset, bin.length).reduceRight(\n // eslint-disable-next-line no-bitwise\n (accumulated, byte) => (accumulated << BigInt(bitsInAByte)) | BigInt(byte), BigInt(0));\n};\n/**\n * Decode an 8-byte Uint64LE Uint8Array into a BigInt.\n *\n * Throws if `bin` is shorter than 8 bytes.\n *\n * @param bin - the Uint8Array to decode\n */\nconst binToBigIntUint64LE = (bin) => {\n const uint64LengthInBytes = 8;\n const truncatedBin = bin.length > uint64LengthInBytes ? bin.slice(0, uint64LengthInBytes) : bin;\n return binToBigIntUintLE(truncatedBin, uint64LengthInBytes);\n};\n/**\n * Get the expected byte length of a Bitcoin VarInt given a first byte.\n *\n * @param firstByte - the first byte of the VarInt\n */\nconst varIntPrefixToSize = (firstByte) => {\n const uint8 = 1;\n const uint16 = 2;\n const uint32 = 4;\n const uint64 = 8;\n switch (firstByte) {\n case 253 /* uint16Prefix */:\n return uint16 + 1;\n case 254 /* uint32Prefix */:\n return uint32 + 1;\n case 255 /* uint64Prefix */:\n return uint64 + 1;\n default:\n return uint8;\n }\n};\n/**\n * Read a Bitcoin VarInt (Variable-length integer) from a Uint8Array, returning\n * the `nextOffset` after the VarInt and the value as a BigInt.\n *\n * @param bin - the Uint8Array from which to read the VarInt\n * @param offset - the offset at which the VarInt begins\n */\nconst readBitcoinVarInt = (bin, offset = 0) => {\n const bytes = varIntPrefixToSize(bin[offset]);\n const hasPrefix = bytes !== 1;\n return {\n nextOffset: offset + bytes,\n value: hasPrefix\n ? binToBigIntUintLE(bin.subarray(offset + 1, offset + bytes), bytes - 1)\n : binToBigIntUintLE(bin.subarray(offset, offset + bytes), 1),\n };\n};\n/**\n * Encode a positive BigInt as a Bitcoin VarInt (Variable-length integer).\n *\n * Note: the maximum value of a Bitcoin VarInt is `0xffff_ffff_ffff_ffff`. This\n * method will return an incorrect result for values outside of the range `0` to\n * `0xffff_ffff_ffff_ffff`.\n *\n * @param value - the BigInt to encode (no larger than `0xffff_ffff_ffff_ffff`)\n */\nconst bigIntToBitcoinVarInt = (value) => value <= BigInt(252 /* uint8MaxValue */)\n ? Uint8Array.of(Number(value))\n : value <= BigInt(65535 /* uint16MaxValue */)\n ? Uint8Array.from([\n 253 /* uint16Prefix */,\n ...numberToBinUint16LE(Number(value)),\n ])\n : value <= BigInt(4294967295 /* uint32MaxValue */)\n ? Uint8Array.from([\n 254 /* uint32Prefix */,\n ...numberToBinUint32LE(Number(value)),\n ])\n : Uint8Array.from([255 /* uint64Prefix */, ...bigIntToBinUint64LE(value)]);\n//# sourceMappingURL=numbers.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/format/numbers.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/format/time.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/format/time.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LocktimeError: () => (/* binding */ LocktimeError),\n/* harmony export */ dateToLocktime: () => (/* binding */ dateToLocktime),\n/* harmony export */ dateToLocktimeBin: () => (/* binding */ dateToLocktimeBin),\n/* harmony export */ locktimeToDate: () => (/* binding */ locktimeToDate),\n/* harmony export */ maximumLocktimeDate: () => (/* binding */ maximumLocktimeDate),\n/* harmony export */ maximumLocktimeTimestamp: () => (/* binding */ maximumLocktimeTimestamp),\n/* harmony export */ minimumLocktimeDate: () => (/* binding */ minimumLocktimeDate),\n/* harmony export */ minimumLocktimeTimestamp: () => (/* binding */ minimumLocktimeTimestamp),\n/* harmony export */ parseLocktimeBin: () => (/* binding */ parseLocktimeBin)\n/* harmony export */ });\n/* harmony import */ var _numbers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./numbers */ \"./node_modules/@bitauth/libauth/build/module/lib/format/numbers.js\");\n\nconst msPerLocktimeSecond = 1000;\n/**\n * The minimum Unix timestamp (inclusive) which can be encoded by a\n * transaction's `locktime`.\n */\nconst minimumLocktimeTimestamp = 500000000;\n/**\n * The maximum Unix timestamp (inclusive) which can be encoded by a\n * transaction's `locktime`.\n */\nconst maximumLocktimeTimestamp = 0xffffffff;\n/**\n * The minimum Date (inclusive) which can be encoded by a transaction's\n * `locktime`.\n */\nconst minimumLocktimeDate = new Date(minimumLocktimeTimestamp * msPerLocktimeSecond);\n/**\n * The maximum Date (inclusive) which can be encoded by a transaction's\n * `locktime`.\n */\nconst maximumLocktimeDate = new Date(maximumLocktimeTimestamp * msPerLocktimeSecond);\nvar LocktimeError;\n(function (LocktimeError) {\n LocktimeError[\"dateOutOfRange\"] = \"The provided Date is outside of the range which can be encoded in locktime.\";\n LocktimeError[\"locktimeOutOfRange\"] = \"The provided locktime is outside of the range which can be encoded as a Date (greater than or equal to 500000000 and less than or equal to 4294967295).\";\n LocktimeError[\"incorrectLength\"] = \"The provided locktime is not the correct length (4 bytes).\";\n})(LocktimeError || (LocktimeError = {}));\n/**\n * Convert a JavaScript `Date` object to its equivalent transaction `locktime`\n * representation. The `date` is rounded to the nearest second (the precision of\n * `locktime` Dates).\n *\n * Note, a locktime values greater than or equal to `500000000`\n * See `Transaction.locktime` for details.\n *\n * @param date - the Date to convert to a locktime number\n */\nconst dateToLocktime = (date) => date < minimumLocktimeDate || date > maximumLocktimeDate\n ? LocktimeError.dateOutOfRange\n : Math.round(date.getTime() / msPerLocktimeSecond);\n/**\n * Convert a transaction `locktime` to its equivalent JavaScript `Date` object.\n * If locktime is outside the possible range (greater than or equal to\n * `500000000` and less than or equal to `4294967295`), an error message is\n * returned.\n *\n * @param locktime - a positive integer between `500000000` and `4294967295`,\n * inclusive\n */\nconst locktimeToDate = (locktime) => locktime < minimumLocktimeTimestamp || locktime > maximumLocktimeTimestamp\n ? LocktimeError.locktimeOutOfRange\n : new Date(locktime * msPerLocktimeSecond);\n/**\n * Convert a JavaScript `Date` object to its equivalent transaction `locktime`\n * bytecode representation. The `date` is rounded to the nearest second (the\n * precision of `locktime` Dates).\n *\n * Note: a block-based locktime can simply be encoded with `numberToBinUint32LE`\n * (provided it is no larger than the maximum, `499999999`).\n *\n * @param date - the Date to convert to a locktime Uint8Array\n */\nconst dateToLocktimeBin = (date) => {\n const result = dateToLocktime(date);\n return typeof result === 'string' ? result : (0,_numbers__WEBPACK_IMPORTED_MODULE_0__.numberToBinUint32LE)(result);\n};\nconst locktimeByteLength = 4;\n/**\n * Parse a locktime, returning a `number` for block heights, a `Date` for block\n * times, or a string for parsing errors.\n *\n * @param bin - the 4-byte Uint8Array locktime to parse\n */\nconst parseLocktimeBin = (bin) => {\n if (bin.length !== locktimeByteLength)\n return LocktimeError.incorrectLength;\n const parsed = (0,_numbers__WEBPACK_IMPORTED_MODULE_0__.binToNumberUint32LE)(bin);\n return parsed >= minimumLocktimeTimestamp\n ? new Date(parsed * msPerLocktimeSecond)\n : parsed;\n};\n//# sourceMappingURL=time.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/format/time.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/format/type-utils.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/format/type-utils.js ***! + \*****************************************************************************/ +/***/ (() => { + +eval("/*\n * const canBeAssigned: Immutable = Uint8Array.of(0, 0);\n * const canBeSpread = [...canBeAssigned];\n * const spreadResultWorks = Uint8Array.from(canBeSpread);\n * const functionRequiringIt = (bin: Immutable) => bin;\n * const canAcceptNonMutable = functionRequiringIt(Uint8Array.of());\n */\n//# sourceMappingURL=type-utils.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/format/type-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/format/utf8.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/format/utf8.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ binToUtf8: () => (/* binding */ binToUtf8),\n/* harmony export */ utf8ToBin: () => (/* binding */ utf8ToBin)\n/* harmony export */ });\n/**\n * This implementations is derived from:\n * https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js\n *\n * Copyright 2008 The Closure Library Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable complexity, functional/no-let, functional/immutable-data, no-bitwise, @typescript-eslint/no-magic-numbers, functional/no-expression-statement, functional/no-conditional-statement, functional/no-loop-statement, no-plusplus */\n/**\n * Interpret a string as UTF-8 and encode it as a Uint8Array.\n * @param utf8 - the string to encode\n */\nconst utf8ToBin = (utf8) => {\n const out = [];\n let p = 0;\n for (let i = 0; i < utf8.length; i++) {\n let c = utf8.charCodeAt(i);\n if (c < 128) {\n out[p++] = c;\n }\n else if (c < 2048) {\n out[p++] = (c >> 6) | 192;\n out[p++] = (c & 63) | 128;\n }\n else if ((c & 0xfc00) === 0xd800 &&\n i + 1 < utf8.length &&\n (utf8.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\n c = ((c & 0x03ff) << 10) + 0x10000 + (utf8.charCodeAt((i += 1)) & 0x03ff);\n out[p++] = (c >> 18) | 240;\n out[p++] = ((c >> 12) & 63) | 128;\n out[p++] = ((c >> 6) & 63) | 128;\n out[p++] = (c & 63) | 128;\n }\n else {\n out[p++] = (c >> 12) | 224;\n out[p++] = ((c >> 6) & 63) | 128;\n out[p++] = (c & 63) | 128;\n }\n }\n return new Uint8Array(out);\n};\n/**\n * Decode a Uint8Array as a UTF-8 string.\n * @param bytes - the Uint8Array to decode\n */\nconst binToUtf8 = (bytes) => {\n const out = [];\n let pos = 0;\n let c = 0;\n while (pos < bytes.length) {\n const c1 = bytes[pos++];\n if (c1 < 128) {\n out[c++] = String.fromCharCode(c1);\n }\n else if (c1 > 191 && c1 < 224) {\n const c2 = bytes[pos++];\n out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\n }\n else if (c1 > 239 && c1 < 365) {\n const c2 = bytes[pos++];\n const c3 = bytes[pos++];\n const c4 = bytes[pos++];\n const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\n 0x10000;\n out[c++] = String.fromCharCode((u >> 10) + 0xd800);\n out[c++] = String.fromCharCode((u & 1023) + 0xdc00);\n }\n else {\n const c2 = bytes[pos++];\n const c3 = bytes[pos++];\n out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n }\n }\n return out.join('');\n};\n//# sourceMappingURL=utf8.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/format/utf8.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/key/hd-key.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/key/hd-key.js ***! + \**********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ HdKeyDecodingError: () => (/* binding */ HdKeyDecodingError),\n/* harmony export */ HdKeyVersion: () => (/* binding */ HdKeyVersion),\n/* harmony export */ HdNodeCrackingError: () => (/* binding */ HdNodeCrackingError),\n/* harmony export */ HdNodeDerivationError: () => (/* binding */ HdNodeDerivationError),\n/* harmony export */ crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode: () => (/* binding */ crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode),\n/* harmony export */ decodeHdKey: () => (/* binding */ decodeHdKey),\n/* harmony export */ decodeHdPrivateKey: () => (/* binding */ decodeHdPrivateKey),\n/* harmony export */ decodeHdPublicKey: () => (/* binding */ decodeHdPublicKey),\n/* harmony export */ deriveHdPath: () => (/* binding */ deriveHdPath),\n/* harmony export */ deriveHdPrivateNodeChild: () => (/* binding */ deriveHdPrivateNodeChild),\n/* harmony export */ deriveHdPrivateNodeFromSeed: () => (/* binding */ deriveHdPrivateNodeFromSeed),\n/* harmony export */ deriveHdPrivateNodeIdentifier: () => (/* binding */ deriveHdPrivateNodeIdentifier),\n/* harmony export */ deriveHdPublicNode: () => (/* binding */ deriveHdPublicNode),\n/* harmony export */ deriveHdPublicNodeChild: () => (/* binding */ deriveHdPublicNodeChild),\n/* harmony export */ deriveHdPublicNodeIdentifier: () => (/* binding */ deriveHdPublicNodeIdentifier),\n/* harmony export */ encodeHdPrivateKey: () => (/* binding */ encodeHdPrivateKey),\n/* harmony export */ encodeHdPublicKey: () => (/* binding */ encodeHdPublicKey),\n/* harmony export */ instantiateBIP32Crypto: () => (/* binding */ instantiateBIP32Crypto)\n/* harmony export */ });\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/ripemd160.js\");\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/secp256k1.js\");\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/sha256.js\");\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/sha512.js\");\n/* harmony import */ var _crypto_hmac__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../crypto/hmac */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/hmac.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/base-convert.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/numbers.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _format_utf8__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../format/utf8 */ \"./node_modules/@bitauth/libauth/build/module/lib/format/utf8.js\");\n/* harmony import */ var _key_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./key-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/key/key-utils.js\");\n\n\n\n\n\n/**\n * Instantiate an object containing WASM implementations of each cryptographic\n * algorithm required by BIP32 utilities in this library.\n *\n * These WASM implementations provide optimal performance across every\n * JavaScript runtime, but depending on your application, you may prefer to\n * instantiate native implementations such as those provided by Node.js or the\n * `crypto.subtle` API (to reduce bundle size) or an external module (for\n * synchronous instantiation).\n */\nconst instantiateBIP32Crypto = async () => {\n const [ripemd160, secp256k1, sha256, sha512] = await Promise.all([\n (0,_crypto_crypto__WEBPACK_IMPORTED_MODULE_0__.instantiateRipemd160)(),\n (0,_crypto_crypto__WEBPACK_IMPORTED_MODULE_1__.instantiateSecp256k1)(),\n (0,_crypto_crypto__WEBPACK_IMPORTED_MODULE_2__.instantiateSha256)(),\n (0,_crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.instantiateSha512)(),\n ]);\n return { ripemd160, secp256k1, sha256, sha512 };\n};\nconst bip32HmacSha512Key = (0,_format_utf8__WEBPACK_IMPORTED_MODULE_4__.utf8ToBin)('Bitcoin seed');\nconst halfHmacSha512Length = 32;\n/**\n * Derive an `HdPrivateNode` from the provided seed following the BIP32\n * specification. A seed should include between 16 bytes and 64 bytes of\n * entropy (recommended: 32 bytes).\n *\n * @param crypto - an implementation of sha512\n * @param seed - the entropy from which to derive the `HdPrivateNode`\n * @param assumeValidity - if set, the derived private key will not be checked\n * for validity, and will be assumed valid if `true` or invalid if `false` (this\n * is useful for testing)\n */\nconst deriveHdPrivateNodeFromSeed = (crypto, seed, assumeValidity) => {\n const mac = (0,_crypto_hmac__WEBPACK_IMPORTED_MODULE_5__.hmacSha512)(crypto.sha512, bip32HmacSha512Key, seed);\n const privateKey = mac.slice(0, halfHmacSha512Length);\n const chainCode = mac.slice(halfHmacSha512Length);\n const depth = 0;\n const childIndex = 0;\n const parentFingerprint = Uint8Array.from([0, 0, 0, 0]);\n const valid = assumeValidity !== null && assumeValidity !== void 0 ? assumeValidity : (0,_key_utils__WEBPACK_IMPORTED_MODULE_6__.validateSecp256k1PrivateKey)(privateKey);\n return (valid\n ? { chainCode, childIndex, depth, parentFingerprint, privateKey, valid }\n : {\n chainCode,\n childIndex,\n depth,\n invalidPrivateKey: privateKey,\n parentFingerprint,\n valid,\n });\n};\n/**\n * Derive the public identifier for a given HD private node. This is used to\n * uniquely identify HD nodes in software. The first 4 bytes of this identifier\n * are considered its \"fingerprint\".\n *\n * @param crypto - implementations of sha256, ripemd160, and secp256k1\n * compressed public key derivation\n * @param hdPrivateNode - the HD private node from which to derive the public\n * identifier (not require to be valid)\n */\nconst deriveHdPrivateNodeIdentifier = (crypto, hdPrivateNode) => crypto.ripemd160.hash(crypto.sha256.hash(crypto.secp256k1.derivePublicKeyCompressed(hdPrivateNode.privateKey)));\n/**\n * Derive the public identifier for a given `HdPublicNode`. This is used to\n * uniquely identify HD nodes in software. The first 4 bytes of this identifier\n * are considered its fingerprint.\n *\n * @param crypto - implementations of sha256 and ripemd160\n */\nconst deriveHdPublicNodeIdentifier = (crypto, node) => crypto.ripemd160.hash(crypto.sha256.hash(node.publicKey));\n/**\n * The 4-byte version indicating the network and type of an `HdPrivateKey` or\n * `HdPublicKey`.\n */\nvar HdKeyVersion;\n(function (HdKeyVersion) {\n /**\n * Version indicating the HD key is an `HdPrivateKey` intended for use on the\n * main network. Base58 encoding at the expected length of an HD key results\n * in a prefix of `xprv`.\n *\n * Hex: `0x0488ade4`\n */\n HdKeyVersion[HdKeyVersion[\"mainnetPrivateKey\"] = 76066276] = \"mainnetPrivateKey\";\n /**\n * Version indicating the HD key is an `HdPublicKey` intended for use on the\n * main network. Base58 encoding at the expected length of an HD key results\n * in a prefix of `xpub`.\n *\n * Hex: `0x0488b21e`\n */\n HdKeyVersion[HdKeyVersion[\"mainnetPublicKey\"] = 76067358] = \"mainnetPublicKey\";\n /**\n * Version indicating the HD key is an `HdPrivateKey` intended for use on the\n * test network. Base58 encoding at the expected length of an HD key results\n * in a prefix of `tprv`.\n *\n * Hex: `0x04358394`\n */\n HdKeyVersion[HdKeyVersion[\"testnetPrivateKey\"] = 70615956] = \"testnetPrivateKey\";\n /**\n * Version indicating the HD key is an `HdPublicKey` intended for use on the\n * test network. Base58 encoding at the expected length of an HD key results\n * in a prefix of `tpub`.\n *\n * Hex: `0x043587cf`\n */\n HdKeyVersion[HdKeyVersion[\"testnetPublicKey\"] = 70617039] = \"testnetPublicKey\";\n})(HdKeyVersion || (HdKeyVersion = {}));\n/**\n * An error in the decoding of an HD public or private key.\n */\nvar HdKeyDecodingError;\n(function (HdKeyDecodingError) {\n HdKeyDecodingError[\"incorrectLength\"] = \"HD key decoding error: length is incorrect (must encode 82 bytes).\";\n HdKeyDecodingError[\"invalidChecksum\"] = \"HD key decoding error: checksum is invalid.\";\n HdKeyDecodingError[\"invalidPrivateNode\"] = \"HD key decoding error: the key for this HD private node is not a valid Secp256k1 private key.\";\n HdKeyDecodingError[\"missingPrivateKeyPaddingByte\"] = \"HD key decoding error: version indicates a private key, but the key data is missing a padding byte.\";\n HdKeyDecodingError[\"privateKeyExpected\"] = \"HD key decoding error: expected an HD private key, but encountered an HD public key.\";\n HdKeyDecodingError[\"publicKeyExpected\"] = \"HD key decoding error: expected an HD public key, but encountered an HD private key.\";\n HdKeyDecodingError[\"unknownCharacter\"] = \"HD key decoding error: key includes a non-base58 character.\";\n HdKeyDecodingError[\"unknownVersion\"] = \"HD key decoding error: key uses an unknown version.\";\n})(HdKeyDecodingError || (HdKeyDecodingError = {}));\n/**\n * Decode an HD private key as defined by BIP32, returning a `node` and a\n * `network`. Decoding errors are returned as strings.\n *\n * If the type of the key is known, use `decodeHdPrivateKey` or\n * `decodeHdPublicKey`.\n *\n * @param crypto - an implementation of sha256\n * @param hdKey - a BIP32 HD private key or HD public key\n */\n// eslint-disable-next-line complexity\nconst decodeHdKey = (crypto, hdKey) => {\n const decoded = (0,_format_format__WEBPACK_IMPORTED_MODULE_7__.base58ToBin)(hdKey);\n if (decoded === _format_format__WEBPACK_IMPORTED_MODULE_7__.BaseConversionError.unknownCharacter)\n return HdKeyDecodingError.unknownCharacter;\n const expectedLength = 82;\n if (decoded.length !== expectedLength)\n return HdKeyDecodingError.incorrectLength;\n const checksumIndex = 78;\n const payload = decoded.slice(0, checksumIndex);\n const checksumBits = decoded.slice(checksumIndex);\n const checksum = crypto.sha256.hash(crypto.sha256.hash(payload));\n if (!checksumBits.every((value, i) => value === checksum[i])) {\n return HdKeyDecodingError.invalidChecksum;\n }\n const depthIndex = 4;\n const fingerprintIndex = 5;\n const childIndexIndex = 9;\n const chainCodeIndex = 13;\n const keyDataIndex = 45;\n const version = new DataView(decoded.buffer, decoded.byteOffset, depthIndex).getUint32(0);\n const depth = decoded[depthIndex];\n const parentFingerprint = decoded.slice(fingerprintIndex, childIndexIndex);\n const childIndex = new DataView(decoded.buffer, decoded.byteOffset + childIndexIndex, decoded.byteOffset + chainCodeIndex).getUint32(0);\n const chainCode = decoded.slice(chainCodeIndex, keyDataIndex);\n const keyData = decoded.slice(keyDataIndex, checksumIndex);\n const isPrivateKey = version === HdKeyVersion.mainnetPrivateKey ||\n version === HdKeyVersion.testnetPrivateKey;\n if (isPrivateKey && keyData[0] !== 0x00) {\n return HdKeyDecodingError.missingPrivateKeyPaddingByte;\n }\n if (isPrivateKey) {\n const privateKey = keyData.slice(1);\n const valid = (0,_key_utils__WEBPACK_IMPORTED_MODULE_6__.validateSecp256k1PrivateKey)(privateKey);\n return {\n node: valid\n ? {\n chainCode,\n childIndex,\n depth,\n parentFingerprint,\n privateKey,\n valid: true,\n }\n : {\n chainCode,\n childIndex,\n depth,\n invalidPrivateKey: privateKey,\n parentFingerprint,\n valid: false,\n },\n version: version,\n };\n }\n const isPublicKey = version === HdKeyVersion.mainnetPublicKey ||\n version === HdKeyVersion.testnetPublicKey;\n if (!isPublicKey) {\n return HdKeyDecodingError.unknownVersion;\n }\n return {\n node: {\n chainCode,\n childIndex,\n depth,\n parentFingerprint,\n publicKey: keyData,\n },\n version: version,\n };\n};\n/**\n * Decode an HD private key as defined by BIP32.\n *\n * This method is similar to `decodeHdKey` but ensures that the result is a\n * valid HD private node. Decoding error messages are returned as strings.\n *\n * @param crypto - an implementation of sha256\n * @param hdPrivateKey - a BIP32 HD private key\n */\nconst decodeHdPrivateKey = (crypto, hdPrivateKey) => {\n const decoded = decodeHdKey(crypto, hdPrivateKey);\n if (typeof decoded === 'string')\n return decoded;\n if ('publicKey' in decoded.node) {\n return HdKeyDecodingError.privateKeyExpected;\n }\n if (!decoded.node.valid) {\n return HdKeyDecodingError.invalidPrivateNode;\n }\n if (decoded.version === HdKeyVersion.mainnetPrivateKey) {\n return {\n network: 'mainnet',\n node: decoded.node,\n };\n }\n return {\n network: 'testnet',\n node: decoded.node,\n };\n};\n/**\n * Decode an HD public key as defined by BIP32.\n *\n * This method is similar to `decodeHdKey` but ensures that the result is an\n * HD public node. Decoding error messages are returned as strings.\n *\n * @param crypto - an implementation of sha256\n * @param hdPublicKey - a BIP32 HD public key\n */\nconst decodeHdPublicKey = (crypto, hdPublicKey) => {\n const decoded = decodeHdKey(crypto, hdPublicKey);\n if (typeof decoded === 'string')\n return decoded;\n if (decoded.version === HdKeyVersion.mainnetPublicKey) {\n return {\n network: 'mainnet',\n node: decoded.node,\n };\n }\n if (decoded.version === HdKeyVersion.testnetPublicKey) {\n return {\n network: 'testnet',\n node: decoded.node,\n };\n }\n return HdKeyDecodingError.publicKeyExpected;\n};\n/**\n * Encode an HD private key (as defined by BIP32) given an HD private node.\n *\n * @param crypto - an implementation of sha256\n * @param keyParameters - a valid HD private node and the network for which to\n * encode the key\n */\nconst encodeHdPrivateKey = (crypto, keyParameters) => {\n const version = (0,_format_format__WEBPACK_IMPORTED_MODULE_8__.numberToBinUint32BE)(keyParameters.network === 'mainnet'\n ? HdKeyVersion.mainnetPrivateKey\n : HdKeyVersion.testnetPrivateKey);\n const depth = Uint8Array.of(keyParameters.node.depth);\n const childIndex = (0,_format_format__WEBPACK_IMPORTED_MODULE_8__.numberToBinUint32BE)(keyParameters.node.childIndex);\n const isPrivateKey = Uint8Array.of(0x00);\n const payload = (0,_format_format__WEBPACK_IMPORTED_MODULE_9__.flattenBinArray)([\n version,\n depth,\n keyParameters.node.parentFingerprint,\n childIndex,\n keyParameters.node.chainCode,\n isPrivateKey,\n keyParameters.node.privateKey,\n ]);\n const checksumLength = 4;\n const checksum = crypto.sha256\n .hash(crypto.sha256.hash(payload))\n .slice(0, checksumLength);\n return (0,_format_format__WEBPACK_IMPORTED_MODULE_7__.binToBase58)((0,_format_format__WEBPACK_IMPORTED_MODULE_9__.flattenBinArray)([payload, checksum]));\n};\n/**\n * Encode an HD public key (as defined by BIP32) given an HD public node.\n *\n * @param crypto - an implementation of sha256\n * @param keyParameters - an HD public node and the network for which to encode\n * the key\n */\nconst encodeHdPublicKey = (crypto, keyParameters) => {\n const version = (0,_format_format__WEBPACK_IMPORTED_MODULE_8__.numberToBinUint32BE)(keyParameters.network === 'mainnet'\n ? HdKeyVersion.mainnetPublicKey\n : HdKeyVersion.testnetPublicKey);\n const depth = Uint8Array.of(keyParameters.node.depth);\n const childIndex = (0,_format_format__WEBPACK_IMPORTED_MODULE_8__.numberToBinUint32BE)(keyParameters.node.childIndex);\n const payload = (0,_format_format__WEBPACK_IMPORTED_MODULE_9__.flattenBinArray)([\n version,\n depth,\n keyParameters.node.parentFingerprint,\n childIndex,\n keyParameters.node.chainCode,\n keyParameters.node.publicKey,\n ]);\n const checksumLength = 4;\n const checksum = crypto.sha256\n .hash(crypto.sha256.hash(payload))\n .slice(0, checksumLength);\n return (0,_format_format__WEBPACK_IMPORTED_MODULE_7__.binToBase58)((0,_format_format__WEBPACK_IMPORTED_MODULE_9__.flattenBinArray)([payload, checksum]));\n};\n/**\n * Derive the HD public node of an HD private node.\n *\n * Though private keys cannot be derived from HD public keys, sharing HD public\n * keys still carries risk. Along with allowing an attacker to associate wallet\n * addresses together (breaking privacy), should an attacker gain knowledge of a\n * single child private key, **it's possible to derive all parent HD private\n * keys**. See `crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode` for\n * details.\n *\n * @param crypto - an implementation of secp256k1 compressed public key\n * derivation (e.g. `instantiateSecp256k1`)\n * @param node - a valid HD private node\n */\nconst deriveHdPublicNode = (crypto, node) => {\n return {\n chainCode: node.chainCode,\n childIndex: node.childIndex,\n depth: node.depth,\n parentFingerprint: node.parentFingerprint,\n ...(node.parentIdentifier === undefined\n ? {}\n : { parentIdentifier: node.parentIdentifier }),\n publicKey: crypto.secp256k1.derivePublicKeyCompressed(node.privateKey),\n };\n};\n/**\n * An error in the derivation of child HD public or private nodes.\n */\nvar HdNodeDerivationError;\n(function (HdNodeDerivationError) {\n HdNodeDerivationError[\"childIndexExceedsMaximum\"] = \"HD key derivation error: child index exceeds maximum (4294967295).\";\n HdNodeDerivationError[\"nextChildIndexRequiresHardenedAlgorithm\"] = \"HD key derivation error: an incredibly rare HMAC-SHA512 result occurred, and incrementing the child index would require switching to the hardened algorithm.\";\n HdNodeDerivationError[\"hardenedDerivationRequiresPrivateNode\"] = \"HD key derivation error: derivation for hardened child indexes (indexes greater than or equal to 2147483648) requires an HD private node.\";\n HdNodeDerivationError[\"invalidDerivationPath\"] = \"HD key derivation error: invalid derivation path \\u2013 paths must begin with \\\"m\\\" or \\\"M\\\" and contain only forward slashes (\\\"/\\\"), apostrophes (\\\"'\\\"), or positive child index numbers.\";\n HdNodeDerivationError[\"invalidPrivateDerivationPrefix\"] = \"HD key derivation error: private derivation paths must begin with \\\"m\\\".\";\n HdNodeDerivationError[\"invalidPublicDerivationPrefix\"] = \"HD key derivation error: public derivation paths must begin with \\\"M\\\".\";\n})(HdNodeDerivationError || (HdNodeDerivationError = {}));\n/**\n * Derive a child HD private node from an HD private node.\n *\n * To derive a child HD public node, use `deriveHdPublicNode` on the result of\n * this method. If the child uses a non-hardened index, it's also possible to\n * use `deriveHdPublicNodeChild`.\n *\n * @privateRemarks\n * The `Secp256k1.addTweakPrivateKey` method throws if the tweak is out of range\n * or if the resulting private key would be invalid. The procedure to handle\n * this error is standardized by BIP32: return the HD node at the next child\n * index. (Regardless, this scenario is incredibly unlikely without a weakness\n * in HMAC-SHA512.)\n *\n * @param crypto - implementations of sha256, ripemd160, secp256k1 compressed\n * public key derivation, and secp256k1 private key \"tweak addition\"\n * (application of the EC group operation) – these are available via\n * `instantiateBIP32Crypto`\n * @param node - the valid HD private node from which to derive the child node\n * @param index - the index at which to derive the child node - indexes greater\n * than or equal to the hardened index offset (`0x80000000`/`2147483648`) are\n * derived using the \"hardened\" derivation algorithm\n */\n// eslint-disable-next-line complexity\nconst deriveHdPrivateNodeChild = (crypto, node, index) => {\n const maximumIndex = 0xffffffff;\n if (index > maximumIndex) {\n return HdNodeDerivationError.childIndexExceedsMaximum;\n }\n const hardenedIndexOffset = 0x80000000;\n const useHardenedAlgorithm = index >= hardenedIndexOffset;\n const keyMaterial = useHardenedAlgorithm\n ? node.privateKey\n : crypto.secp256k1.derivePublicKeyCompressed(node.privateKey);\n const serialization = Uint8Array.from([\n ...(useHardenedAlgorithm ? [0x00] : []),\n ...keyMaterial,\n ...(0,_format_format__WEBPACK_IMPORTED_MODULE_8__.numberToBinUint32BE)(index),\n ]);\n const derivation = (0,_crypto_hmac__WEBPACK_IMPORTED_MODULE_5__.hmacSha512)(crypto.sha512, node.chainCode, serialization);\n const tweakValueLength = 32;\n const tweakValue = derivation.slice(0, tweakValueLength);\n const nextChainCode = derivation.slice(tweakValueLength);\n // eslint-disable-next-line functional/no-try-statement\n try {\n const nextPrivateKey = crypto.secp256k1.addTweakPrivateKey(node.privateKey, tweakValue);\n const parentIdentifier = deriveHdPrivateNodeIdentifier(crypto, node);\n const parentFingerprintLength = 4;\n return {\n chainCode: nextChainCode,\n childIndex: index,\n depth: node.depth + 1,\n parentFingerprint: parentIdentifier.slice(0, parentFingerprintLength),\n parentIdentifier,\n privateKey: nextPrivateKey,\n valid: true,\n };\n }\n catch (error) /* istanbul ignore next - testing requires >2^127 brute force */ {\n if (index === hardenedIndexOffset - 1) {\n return HdNodeDerivationError.nextChildIndexRequiresHardenedAlgorithm;\n }\n return deriveHdPrivateNodeChild(crypto, node, index + 1);\n }\n};\n/**\n * Derive a non-hardened child HD public node from an HD public node.\n *\n * Because hardened derivation also requires knowledge of the parent private\n * node, it's not possible to use an HD public node to derive a hardened child\n * HD public node.\n *\n * Though private keys cannot be derived from HD public keys, sharing HD public\n * keys still carries risk. Along with allowing an attacker to associate wallet\n * addresses together (breaking privacy), should an attacker gain knowledge of a\n * single child private key, **it's possible to derive all parent HD private\n * keys**. See `crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode` for\n * details.\n *\n * @privateRemarks\n * The `Secp256k1.addTweakPublicKeyCompressed` method throws if the tweak is out\n * of range or if the resulting public key would be invalid. The procedure to\n * handle this error is standardized by BIP32: return the HD node at the next\n * child index. (Regardless, this scenario is incredibly unlikely without a\n * weakness in HMAC-SHA512.)\n *\n * @param crypto - implementations of sha256, sha512, ripemd160, and secp256k1\n * compressed public key \"tweak addition\" (application of the EC group\n * operation) – these are available via `instantiateBIP32Crypto`\n * @param node - the HD public node from which to derive the child public node\n * @param index - the index at which to derive the child node\n */\nconst deriveHdPublicNodeChild = (crypto, node, index) => {\n const hardenedIndexOffset = 0x80000000;\n if (index >= hardenedIndexOffset) {\n return HdNodeDerivationError.hardenedDerivationRequiresPrivateNode;\n }\n const serialization = Uint8Array.from([\n ...node.publicKey,\n ...(0,_format_format__WEBPACK_IMPORTED_MODULE_8__.numberToBinUint32BE)(index),\n ]);\n const derivation = (0,_crypto_hmac__WEBPACK_IMPORTED_MODULE_5__.hmacSha512)(crypto.sha512, node.chainCode, serialization);\n const tweakValueLength = 32;\n const tweakValue = derivation.slice(0, tweakValueLength);\n const nextChainCode = derivation.slice(tweakValueLength);\n // eslint-disable-next-line functional/no-try-statement\n try {\n const nextPublicKey = crypto.secp256k1.addTweakPublicKeyCompressed(node.publicKey, tweakValue);\n const parentIdentifier = deriveHdPublicNodeIdentifier(crypto, node);\n const parentFingerprintLength = 4;\n return {\n chainCode: nextChainCode,\n childIndex: index,\n depth: node.depth + 1,\n parentFingerprint: parentIdentifier.slice(0, parentFingerprintLength),\n parentIdentifier,\n publicKey: nextPublicKey,\n };\n }\n catch (error) /* istanbul ignore next - testing requires >2^127 brute force */ {\n if (index === hardenedIndexOffset - 1) {\n return HdNodeDerivationError.nextChildIndexRequiresHardenedAlgorithm;\n }\n return deriveHdPublicNodeChild(crypto, node, index + 1);\n }\n};\n/**\n * Derive a child HD node from a parent node given a derivation path. The\n * resulting node is the same type as the parent node (private nodes return\n * private nodes, public nodes return public nodes).\n *\n * @remarks\n * The derivation path uses the notation specified in BIP32:\n *\n * The first character must be either `m` for private derivation or `M` for\n * public derivation, followed by sets of `/` and a number representing the\n * child index used in the derivation at that depth. Hardened derivation is\n * represented by a trailing `'`, and may only appear in private derivation\n * paths (hardened derivation requires knowledge of the private key). Hardened\n * child indexes are represented with the hardened index offset (`2147483648`)\n * subtracted.\n *\n * For example, `m/0/1'/2` uses private derivation (`m`), with child indexes in\n * the following order:\n *\n * `derivePrivate(derivePrivate(derivePrivate(node, 0), 2147483648 + 1), 2)`\n *\n * Likewise, `M/3/4/5` uses public derivation (`M`), with child indexes in the\n * following order:\n *\n * `derivePublic(derivePublic(derivePublic(node, 3), 4), 5)`\n *\n * Because hardened derivation requires a private node, paths which specify\n * public derivation (`M`) using hardened derivation (`'`) will return an error.\n * To derive the public node associated with a child private node which requires\n * hardened derivation, begin with private derivation, then provide the result\n * to `deriveHdPublicNode`.\n *\n * @param crypto - implementations of sha256, sha512, ripemd160, and secp256k1\n * derivation functions – these are available via `instantiateBIP32Crypto`\n * @param node - the HD node from which to begin the derivation (for paths\n * beginning with `m`, an `HdPrivateNodeValid`; for paths beginning with `M`, an\n * `HdPublicNode`)\n * @param path - the BIP32 derivation path, e.g. `m/0/1'/2` or `M/3/4/5`\n */\n// eslint-disable-next-line complexity\nconst deriveHdPath = (crypto, node, path) => {\n const validDerivationPath = /^[mM](?:\\/[0-9]+'?)*$/u;\n if (!validDerivationPath.test(path)) {\n return HdNodeDerivationError.invalidDerivationPath;\n }\n const parsed = path.split('/');\n const isPrivateDerivation = 'privateKey' in node;\n if (isPrivateDerivation && parsed[0] !== 'm') {\n return HdNodeDerivationError.invalidPrivateDerivationPrefix;\n }\n if (!isPrivateDerivation && parsed[0] !== 'M') {\n return HdNodeDerivationError.invalidPublicDerivationPrefix;\n }\n const base = 10;\n const hardenedIndexOffset = 0x80000000;\n const indexes = parsed\n .slice(1)\n .map((index) => index.endsWith(\"'\")\n ? parseInt(index.slice(0, -1), base) + hardenedIndexOffset\n : parseInt(index, base));\n return (isPrivateDerivation\n ? indexes.reduce((result, nextIndex) => typeof result === 'string'\n ? result\n : deriveHdPrivateNodeChild(crypto, result, nextIndex), node // eslint-disable-line @typescript-eslint/prefer-reduce-type-parameter\n )\n : indexes.reduce((result, nextIndex) => typeof result === 'string'\n ? result\n : deriveHdPublicNodeChild(crypto, result, nextIndex), node // eslint-disable-line @typescript-eslint/prefer-reduce-type-parameter\n ));\n};\nvar HdNodeCrackingError;\n(function (HdNodeCrackingError) {\n HdNodeCrackingError[\"cannotCrackHardenedDerivation\"] = \"HD node cracking error: cannot crack an HD parent node using hardened child node.\";\n})(HdNodeCrackingError || (HdNodeCrackingError = {}));\n/**\n * Derive the HD private node from a HD public node, given any non-hardened\n * child private node.\n *\n * @remarks\n * This exploits the \"non-hardened\" BIP32 derivation algorithm. Because\n * non-hardened derivation only requires knowledge of the \"chain code\" (rather\n * than requiring knowledge of the parent private key) it's possible to\n * calculate the value by which the parent private key is \"tweaked\" to arrive at\n * the child private key. Since we have the child private key, we simply\n * subtract this \"tweaked\" amount to get back to the parent private key.\n *\n * The BIP32 \"hardened\" derivation algorithm is designed to address this\n * weakness. Using hardened derivation, child private nodes can be shared\n * without risk of leaking the parent private node, but this comes at the cost\n * of public node derivation. Given only a parent public node, it is not\n * possible to derive hardened child public keys, so applications must choose\n * between support for HD public node derivation or support for sharing child\n * private nodes.\n *\n * @param crypto - an implementation of sha512\n * @param parentPublicNode - the parent HD public node for which to derive a\n * private node\n * @param childPrivateNode - any non-hardened child private node of the parent\n * node (only the `privateKey` and the `childIndex` are required)\n */\nconst crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode = (crypto, parentPublicNode, childPrivateNode) => {\n const hardenedIndexOffset = 0x80000000;\n if (childPrivateNode.childIndex >= hardenedIndexOffset) {\n return HdNodeCrackingError.cannotCrackHardenedDerivation;\n }\n const serialization = Uint8Array.from([\n ...parentPublicNode.publicKey,\n ...(0,_format_format__WEBPACK_IMPORTED_MODULE_8__.numberToBinUint32BE)(childPrivateNode.childIndex),\n ]);\n const derivation = (0,_crypto_hmac__WEBPACK_IMPORTED_MODULE_5__.hmacSha512)(crypto.sha512, parentPublicNode.chainCode, serialization);\n const tweakValueLength = 32;\n const tweakValue = (0,_format_format__WEBPACK_IMPORTED_MODULE_8__.binToBigIntUint256BE)(derivation.slice(0, tweakValueLength));\n const childPrivateValue = (0,_format_format__WEBPACK_IMPORTED_MODULE_8__.binToBigIntUint256BE)(childPrivateNode.privateKey);\n const secp256k1OrderN = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141');\n const trueMod = (n, m) => ((n % m) + m) % m;\n const parentPrivateValue = trueMod(childPrivateValue - tweakValue, secp256k1OrderN);\n const privateKey = (0,_format_format__WEBPACK_IMPORTED_MODULE_8__.bigIntToBinUint256BEClamped)(parentPrivateValue);\n return {\n chainCode: parentPublicNode.chainCode,\n childIndex: parentPublicNode.childIndex,\n depth: parentPublicNode.depth,\n parentFingerprint: parentPublicNode.parentFingerprint,\n ...(parentPublicNode.parentIdentifier === undefined\n ? {}\n : { parentIdentifier: parentPublicNode.parentIdentifier }),\n privateKey,\n valid: true,\n };\n};\n//# sourceMappingURL=hd-key.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/key/hd-key.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/key/key-utils.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/key/key-utils.js ***! + \*************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ generatePrivateKey: () => (/* binding */ generatePrivateKey),\n/* harmony export */ validateSecp256k1PrivateKey: () => (/* binding */ validateSecp256k1PrivateKey)\n/* harmony export */ });\n/**\n * Verify that a private key is valid for the Secp256k1 curve. Returns `true`\n * for success, or `false` on failure.\n *\n * Private keys are 256-bit numbers encoded as a 32-byte, big-endian Uint8Array.\n * Nearly every 256-bit number is a valid secp256k1 private key. Specifically,\n * any 256-bit number greater than `0x01` and less than\n * `0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4140`\n * is a valid private key. This range is part of the definition of the\n * secp256k1 elliptic curve parameters.\n *\n * This method does not require the `Secp256k1` WASM implementation (available\n * via `instantiateSecp256k1`).\n */\nconst validateSecp256k1PrivateKey = (privateKey) => {\n const privateKeyLength = 32;\n if (privateKey.length !== privateKeyLength ||\n privateKey.every((value) => value === 0)) {\n return false;\n }\n /**\n * The largest possible Secp256k1 private key – equal to the order of the\n * Secp256k1 curve minus one.\n */\n // prettier-ignore\n const maximumSecp256k1PrivateKey = [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 186, 174, 220, 230, 175, 72, 160, 59, 191, 210, 94, 140, 208, 54, 65, 63]; // eslint-disable-line @typescript-eslint/no-magic-numbers\n const firstDifference = privateKey.findIndex((value, i) => value !== maximumSecp256k1PrivateKey[i]);\n if (firstDifference === -1 ||\n privateKey[firstDifference] < maximumSecp256k1PrivateKey[firstDifference]) {\n return true;\n }\n return false;\n};\n/**\n * Securely generate a valid Secp256k1 private key given a secure source of\n * randomness.\n *\n * **Node.js Usage**\n * ```ts\n * import { randomBytes } from 'crypto';\n * import { generatePrivateKey } from '@bitauth/libauth';\n *\n * const key = generatePrivateKey(secp256k1, () => randomBytes(32));\n * ```\n *\n * **Browser Usage**\n * ```ts\n * import { generatePrivateKey } from '@bitauth/libauth';\n *\n * const key = generatePrivateKey(secp256k1, () =>\n * window.crypto.getRandomValues(new Uint8Array(32))\n * );\n * ```\n *\n * @param secp256k1 - an implementation of Secp256k1\n * @param secureRandom - a method which returns a securely-random 32-byte\n * Uint8Array\n */\nconst generatePrivateKey = (secureRandom) => {\n // eslint-disable-next-line functional/no-let, @typescript-eslint/init-declarations\n let maybeKey;\n // eslint-disable-next-line functional/no-loop-statement\n do {\n // eslint-disable-next-line functional/no-expression-statement\n maybeKey = secureRandom();\n } while (!validateSecp256k1PrivateKey(maybeKey));\n return maybeKey;\n};\n//# sourceMappingURL=key-utils.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/key/key-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/key/key.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/key/key.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ HdKeyDecodingError: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.HdKeyDecodingError),\n/* harmony export */ HdKeyVersion: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.HdKeyVersion),\n/* harmony export */ HdNodeCrackingError: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.HdNodeCrackingError),\n/* harmony export */ HdNodeDerivationError: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.HdNodeDerivationError),\n/* harmony export */ WalletImportFormatError: () => (/* reexport safe */ _wallet_import_format__WEBPACK_IMPORTED_MODULE_2__.WalletImportFormatError),\n/* harmony export */ crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode),\n/* harmony export */ decodeHdKey: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.decodeHdKey),\n/* harmony export */ decodeHdPrivateKey: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.decodeHdPrivateKey),\n/* harmony export */ decodeHdPublicKey: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.decodeHdPublicKey),\n/* harmony export */ decodePrivateKeyWif: () => (/* reexport safe */ _wallet_import_format__WEBPACK_IMPORTED_MODULE_2__.decodePrivateKeyWif),\n/* harmony export */ deriveHdPath: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.deriveHdPath),\n/* harmony export */ deriveHdPrivateNodeChild: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.deriveHdPrivateNodeChild),\n/* harmony export */ deriveHdPrivateNodeFromSeed: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.deriveHdPrivateNodeFromSeed),\n/* harmony export */ deriveHdPrivateNodeIdentifier: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.deriveHdPrivateNodeIdentifier),\n/* harmony export */ deriveHdPublicNode: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.deriveHdPublicNode),\n/* harmony export */ deriveHdPublicNodeChild: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.deriveHdPublicNodeChild),\n/* harmony export */ deriveHdPublicNodeIdentifier: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.deriveHdPublicNodeIdentifier),\n/* harmony export */ encodeHdPrivateKey: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.encodeHdPrivateKey),\n/* harmony export */ encodeHdPublicKey: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.encodeHdPublicKey),\n/* harmony export */ encodePrivateKeyWif: () => (/* reexport safe */ _wallet_import_format__WEBPACK_IMPORTED_MODULE_2__.encodePrivateKeyWif),\n/* harmony export */ generatePrivateKey: () => (/* reexport safe */ _key_utils__WEBPACK_IMPORTED_MODULE_1__.generatePrivateKey),\n/* harmony export */ instantiateBIP32Crypto: () => (/* reexport safe */ _hd_key__WEBPACK_IMPORTED_MODULE_0__.instantiateBIP32Crypto),\n/* harmony export */ validateSecp256k1PrivateKey: () => (/* reexport safe */ _key_utils__WEBPACK_IMPORTED_MODULE_1__.validateSecp256k1PrivateKey)\n/* harmony export */ });\n/* harmony import */ var _hd_key__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hd-key */ \"./node_modules/@bitauth/libauth/build/module/lib/key/hd-key.js\");\n/* harmony import */ var _key_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./key-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/key/key-utils.js\");\n/* harmony import */ var _wallet_import_format__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./wallet-import-format */ \"./node_modules/@bitauth/libauth/build/module/lib/key/wallet-import-format.js\");\n\n\n\n//# sourceMappingURL=key.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/key/key.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/key/wallet-import-format.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/key/wallet-import-format.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ WalletImportFormatError: () => (/* binding */ WalletImportFormatError),\n/* harmony export */ decodePrivateKeyWif: () => (/* binding */ decodePrivateKeyWif),\n/* harmony export */ encodePrivateKeyWif: () => (/* binding */ encodePrivateKeyWif)\n/* harmony export */ });\n/* harmony import */ var _address_address__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../address/address */ \"./node_modules/@bitauth/libauth/build/module/lib/address/base58-address.js\");\n\nvar WalletImportFormatError;\n(function (WalletImportFormatError) {\n WalletImportFormatError[\"incorrectLength\"] = \"The WIF private key payload is not the correct length.\";\n})(WalletImportFormatError || (WalletImportFormatError = {}));\n/**\n * Encode a private key using Wallet Import Format (WIF).\n *\n * WIF encodes the 32-byte private key, a 4-byte checksum, and a `type`\n * indicating the intended usage for the private key. See\n * `WalletImportFormatType` for details.\n *\n * @remarks\n * WIF-encoding uses the Base58Address format with version\n * `Base58AddressFormatVersion.wif` (`128`/`0x80`) or\n * `Base58AddressFormatVersion.wifTestnet` (`239`/`0xef`), respectively.\n *\n * To indicate that the private key is intended for use in a P2PKH address using\n * the compressed form of its derived public key, a `0x01` is appended to the\n * payload prior to encoding. For the uncompressed construction, the extra byte\n * is omitted.\n *\n * @param sha256 - an implementation of sha256 (a universal implementation is\n * available via `instantiateSha256`)\n * @param privateKey - a 32-byte Secp256k1 ECDSA private key\n * @param type - the intended usage of the private key (e.g. `mainnet` or\n * `testnet`)\n */\nconst encodePrivateKeyWif = (sha256, privateKey, type) => {\n const compressedByte = 0x01;\n const mainnet = type === 'mainnet' || type === 'mainnet-uncompressed';\n const compressed = type === 'mainnet' || type === 'testnet';\n const payload = compressed\n ? Uint8Array.from([...privateKey, compressedByte])\n : privateKey;\n return (0,_address_address__WEBPACK_IMPORTED_MODULE_0__.encodeBase58AddressFormat)(sha256, mainnet\n ? _address_address__WEBPACK_IMPORTED_MODULE_0__.Base58AddressFormatVersion.wif\n : _address_address__WEBPACK_IMPORTED_MODULE_0__.Base58AddressFormatVersion.wifTestnet, payload);\n};\n/**\n * Decode a private key using Wallet Import Format (WIF). See\n * `encodePrivateKeyWif` for details.\n *\n * @param sha256 - an implementation of sha256 (a universal implementation is\n * available via `instantiateSha256`)\n * @param wifKey - the private key to decode (in Wallet Import Format)\n */\n// eslint-disable-next-line complexity\nconst decodePrivateKeyWif = (sha256, wifKey) => {\n const compressedPayloadLength = 33;\n const decoded = (0,_address_address__WEBPACK_IMPORTED_MODULE_0__.decodeBase58AddressFormat)(sha256, wifKey);\n if (typeof decoded === 'string')\n return decoded;\n const mainnet = decoded.version === _address_address__WEBPACK_IMPORTED_MODULE_0__.Base58AddressFormatVersion.wif;\n const compressed = decoded.payload.length === compressedPayloadLength;\n const privateKey = compressed\n ? decoded.payload.slice(0, -1)\n : decoded.payload;\n const type = mainnet\n ? compressed\n ? 'mainnet'\n : 'mainnet-uncompressed'\n : compressed\n ? 'testnet'\n : 'testnet-uncompressed';\n return { privateKey, type };\n};\n//# sourceMappingURL=wallet-import-format.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/key/wallet-import-format.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/lib.js": +/*!***************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/lib.js ***! + \***************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AddressType: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.AddressType),\n/* harmony export */ Base58AddressError: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.Base58AddressError),\n/* harmony export */ Base58AddressFormatVersion: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.Base58AddressFormatVersion),\n/* harmony export */ Bech32DecodingError: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.Bech32DecodingError),\n/* harmony export */ BitRegroupingError: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.BitRegroupingError),\n/* harmony export */ CashAddressCorrectionError: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.CashAddressCorrectionError),\n/* harmony export */ CashAddressDecodingError: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.CashAddressDecodingError),\n/* harmony export */ CashAddressEncodingError: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.CashAddressEncodingError),\n/* harmony export */ CashAddressNetworkPrefix: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.CashAddressNetworkPrefix),\n/* harmony export */ CashAddressType: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.CashAddressType),\n/* harmony export */ CashAddressVersionByte: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.CashAddressVersionByte),\n/* harmony export */ CashAddressVersionByteDecodingError: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.CashAddressVersionByteDecodingError),\n/* harmony export */ CompressionFlag: () => (/* reexport safe */ _bin_bin__WEBPACK_IMPORTED_MODULE_2__.CompressionFlag),\n/* harmony export */ ContextFlag: () => (/* reexport safe */ _bin_bin__WEBPACK_IMPORTED_MODULE_2__.ContextFlag),\n/* harmony export */ HdKeyDecodingError: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.HdKeyDecodingError),\n/* harmony export */ HdKeyVersion: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.HdKeyVersion),\n/* harmony export */ HdNodeCrackingError: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.HdNodeCrackingError),\n/* harmony export */ HdNodeDerivationError: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.HdNodeDerivationError),\n/* harmony export */ LockingBytecodeEncodingError: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.LockingBytecodeEncodingError),\n/* harmony export */ TransactionDecodingError: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.TransactionDecodingError),\n/* harmony export */ WalletImportFormatError: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.WalletImportFormatError),\n/* harmony export */ addressContentsToLockingBytecode: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.addressContentsToLockingBytecode),\n/* harmony export */ attemptCashAddressFormatErrorCorrection: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.attemptCashAddressFormatErrorCorrection),\n/* harmony export */ base58AddressToLockingBytecode: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.base58AddressToLockingBytecode),\n/* harmony export */ bech32CharacterSet: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.bech32CharacterSet),\n/* harmony export */ bech32CharacterSetIndex: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.bech32CharacterSetIndex),\n/* harmony export */ bech32PaddedToBin: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.bech32PaddedToBin),\n/* harmony export */ binToBech32Padded: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.binToBech32Padded),\n/* harmony export */ cashAddressBitToSize: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.cashAddressBitToSize),\n/* harmony export */ cashAddressChecksumToUint5Array: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.cashAddressChecksumToUint5Array),\n/* harmony export */ cashAddressPolynomialModulo: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.cashAddressPolynomialModulo),\n/* harmony export */ cashAddressPolynomialToCashAddress: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.cashAddressPolynomialToCashAddress),\n/* harmony export */ cashAddressSizeToBit: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.cashAddressSizeToBit),\n/* harmony export */ cashAddressToLockingBytecode: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.cashAddressToLockingBytecode),\n/* harmony export */ compileInputTemplate: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.compileInputTemplate),\n/* harmony export */ compileOutputTemplate: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.compileOutputTemplate),\n/* harmony export */ crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode),\n/* harmony export */ decodeBase58Address: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.decodeBase58Address),\n/* harmony export */ decodeBase58AddressFormat: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.decodeBase58AddressFormat),\n/* harmony export */ decodeBech32: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.decodeBech32),\n/* harmony export */ decodeCashAddress: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.decodeCashAddress),\n/* harmony export */ decodeCashAddressFormat: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.decodeCashAddressFormat),\n/* harmony export */ decodeCashAddressFormatWithoutPrefix: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.decodeCashAddressFormatWithoutPrefix),\n/* harmony export */ decodeCashAddressVersionByte: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.decodeCashAddressVersionByte),\n/* harmony export */ decodeHdKey: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.decodeHdKey),\n/* harmony export */ decodeHdPrivateKey: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.decodeHdPrivateKey),\n/* harmony export */ decodeHdPublicKey: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.decodeHdPublicKey),\n/* harmony export */ decodePrivateKeyWif: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.decodePrivateKeyWif),\n/* harmony export */ decodeTransaction: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.decodeTransaction),\n/* harmony export */ decodeTransactionUnsafe: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.decodeTransactionUnsafe),\n/* harmony export */ deriveHdPath: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.deriveHdPath),\n/* harmony export */ deriveHdPrivateNodeChild: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.deriveHdPrivateNodeChild),\n/* harmony export */ deriveHdPrivateNodeFromSeed: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.deriveHdPrivateNodeFromSeed),\n/* harmony export */ deriveHdPrivateNodeIdentifier: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.deriveHdPrivateNodeIdentifier),\n/* harmony export */ deriveHdPublicNode: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.deriveHdPublicNode),\n/* harmony export */ deriveHdPublicNodeChild: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.deriveHdPublicNodeChild),\n/* harmony export */ deriveHdPublicNodeIdentifier: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.deriveHdPublicNodeIdentifier),\n/* harmony export */ encodeBase58Address: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.encodeBase58Address),\n/* harmony export */ encodeBase58AddressFormat: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.encodeBase58AddressFormat),\n/* harmony export */ encodeBech32: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.encodeBech32),\n/* harmony export */ encodeCashAddress: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.encodeCashAddress),\n/* harmony export */ encodeCashAddressFormat: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.encodeCashAddressFormat),\n/* harmony export */ encodeCashAddressVersionByte: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.encodeCashAddressVersionByte),\n/* harmony export */ encodeHdPrivateKey: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.encodeHdPrivateKey),\n/* harmony export */ encodeHdPublicKey: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.encodeHdPublicKey),\n/* harmony export */ encodeInput: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.encodeInput),\n/* harmony export */ encodeInputs: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.encodeInputs),\n/* harmony export */ encodeOutpoints: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.encodeOutpoints),\n/* harmony export */ encodeOutput: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.encodeOutput),\n/* harmony export */ encodeOutputsForSigning: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.encodeOutputsForSigning),\n/* harmony export */ encodeOutputsForTransaction: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.encodeOutputsForTransaction),\n/* harmony export */ encodePrivateKeyWif: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.encodePrivateKeyWif),\n/* harmony export */ encodeSequenceNumbersForSigning: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.encodeSequenceNumbersForSigning),\n/* harmony export */ encodeTransaction: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.encodeTransaction),\n/* harmony export */ extractMissingVariables: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.extractMissingVariables),\n/* harmony export */ extractResolvedVariables: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.extractResolvedVariables),\n/* harmony export */ generatePrivateKey: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.generatePrivateKey),\n/* harmony export */ generateTransaction: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.generateTransaction),\n/* harmony export */ getEmbeddedRipemd160Binary: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.getEmbeddedRipemd160Binary),\n/* harmony export */ getEmbeddedSecp256k1Binary: () => (/* reexport safe */ _bin_bin__WEBPACK_IMPORTED_MODULE_2__.getEmbeddedSecp256k1Binary),\n/* harmony export */ getEmbeddedSha1Binary: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.getEmbeddedSha1Binary),\n/* harmony export */ getEmbeddedSha256Binary: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.getEmbeddedSha256Binary),\n/* harmony export */ getEmbeddedSha512Binary: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.getEmbeddedSha512Binary),\n/* harmony export */ getTransactionHash: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.getTransactionHash),\n/* harmony export */ getTransactionHashBE: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.getTransactionHashBE),\n/* harmony export */ getTransactionHashLE: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.getTransactionHashLE),\n/* harmony export */ hmacSha256: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.hmacSha256),\n/* harmony export */ hmacSha512: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.hmacSha512),\n/* harmony export */ instantiateBIP32Crypto: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.instantiateBIP32Crypto),\n/* harmony export */ instantiateHmacFunction: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.instantiateHmacFunction),\n/* harmony export */ instantiateRipemd160: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.instantiateRipemd160),\n/* harmony export */ instantiateRipemd160Bytes: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.instantiateRipemd160Bytes),\n/* harmony export */ instantiateRustWasm: () => (/* reexport safe */ _bin_bin__WEBPACK_IMPORTED_MODULE_2__.instantiateRustWasm),\n/* harmony export */ instantiateSecp256k1: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.instantiateSecp256k1),\n/* harmony export */ instantiateSecp256k1Bytes: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.instantiateSecp256k1Bytes),\n/* harmony export */ instantiateSecp256k1Wasm: () => (/* reexport safe */ _bin_bin__WEBPACK_IMPORTED_MODULE_2__.instantiateSecp256k1Wasm),\n/* harmony export */ instantiateSecp256k1WasmBytes: () => (/* reexport safe */ _bin_bin__WEBPACK_IMPORTED_MODULE_2__.instantiateSecp256k1WasmBytes),\n/* harmony export */ instantiateSha1: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.instantiateSha1),\n/* harmony export */ instantiateSha1Bytes: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.instantiateSha1Bytes),\n/* harmony export */ instantiateSha256: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.instantiateSha256),\n/* harmony export */ instantiateSha256Bytes: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.instantiateSha256Bytes),\n/* harmony export */ instantiateSha512: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.instantiateSha512),\n/* harmony export */ instantiateSha512Bytes: () => (/* reexport safe */ _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.instantiateSha512Bytes),\n/* harmony export */ invalidSatoshis: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.invalidSatoshis),\n/* harmony export */ isBech32CharacterSet: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.isBech32CharacterSet),\n/* harmony export */ lockingBytecodeToAddressContents: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.lockingBytecodeToAddressContents),\n/* harmony export */ lockingBytecodeToBase58Address: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.lockingBytecodeToBase58Address),\n/* harmony export */ lockingBytecodeToCashAddress: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.lockingBytecodeToCashAddress),\n/* harmony export */ maskCashAddressPrefix: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.maskCashAddressPrefix),\n/* harmony export */ readTransactionInput: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.readTransactionInput),\n/* harmony export */ readTransactionOutput: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.readTransactionOutput),\n/* harmony export */ regroupBits: () => (/* reexport safe */ _address_address__WEBPACK_IMPORTED_MODULE_0__.regroupBits),\n/* harmony export */ ripemd160Base64Bytes: () => (/* reexport safe */ _bin_bin__WEBPACK_IMPORTED_MODULE_2__.ripemd160Base64Bytes),\n/* harmony export */ safelyExtendCompilationData: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.safelyExtendCompilationData),\n/* harmony export */ sha1Base64Bytes: () => (/* reexport safe */ _bin_bin__WEBPACK_IMPORTED_MODULE_2__.sha1Base64Bytes),\n/* harmony export */ sha256Base64Bytes: () => (/* reexport safe */ _bin_bin__WEBPACK_IMPORTED_MODULE_2__.sha256Base64Bytes),\n/* harmony export */ sha512Base64Bytes: () => (/* reexport safe */ _bin_bin__WEBPACK_IMPORTED_MODULE_2__.sha512Base64Bytes),\n/* harmony export */ validateSecp256k1PrivateKey: () => (/* reexport safe */ _key_key__WEBPACK_IMPORTED_MODULE_4__.validateSecp256k1PrivateKey),\n/* harmony export */ verifyTransaction: () => (/* reexport safe */ _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__.verifyTransaction)\n/* harmony export */ });\n/* harmony import */ var _address_address__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./address/address */ \"./node_modules/@bitauth/libauth/build/module/lib/address/address.js\");\n/* harmony import */ var _vm_vm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vm/vm */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/vm.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _vm_vm__WEBPACK_IMPORTED_MODULE_1__) if([\"default\",\"AddressType\",\"Base58AddressError\",\"Base58AddressFormatVersion\",\"Bech32DecodingError\",\"BitRegroupingError\",\"CashAddressCorrectionError\",\"CashAddressDecodingError\",\"CashAddressEncodingError\",\"CashAddressNetworkPrefix\",\"CashAddressType\",\"CashAddressVersionByte\",\"CashAddressVersionByteDecodingError\",\"LockingBytecodeEncodingError\",\"addressContentsToLockingBytecode\",\"attemptCashAddressFormatErrorCorrection\",\"base58AddressToLockingBytecode\",\"bech32CharacterSet\",\"bech32CharacterSetIndex\",\"bech32PaddedToBin\",\"binToBech32Padded\",\"cashAddressBitToSize\",\"cashAddressChecksumToUint5Array\",\"cashAddressPolynomialModulo\",\"cashAddressPolynomialToCashAddress\",\"cashAddressSizeToBit\",\"cashAddressToLockingBytecode\",\"decodeBase58Address\",\"decodeBase58AddressFormat\",\"decodeBech32\",\"decodeCashAddress\",\"decodeCashAddressFormat\",\"decodeCashAddressFormatWithoutPrefix\",\"decodeCashAddressVersionByte\",\"encodeBase58Address\",\"encodeBase58AddressFormat\",\"encodeBech32\",\"encodeCashAddress\",\"encodeCashAddressFormat\",\"encodeCashAddressVersionByte\",\"isBech32CharacterSet\",\"lockingBytecodeToAddressContents\",\"lockingBytecodeToBase58Address\",\"lockingBytecodeToCashAddress\",\"maskCashAddressPrefix\",\"regroupBits\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _vm_vm__WEBPACK_IMPORTED_MODULE_1__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _bin_bin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bin/bin */ \"./node_modules/@bitauth/libauth/build/module/lib/bin/bin.js\");\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/crypto.js\");\n/* harmony import */ var _key_key__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./key/key */ \"./node_modules/@bitauth/libauth/build/module/lib/key/key.js\");\n/* harmony import */ var _template_template__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./template/template */ \"./node_modules/@bitauth/libauth/build/module/lib/template/template.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _template_template__WEBPACK_IMPORTED_MODULE_5__) if([\"default\",\"AddressType\",\"Base58AddressError\",\"Base58AddressFormatVersion\",\"Bech32DecodingError\",\"BitRegroupingError\",\"CashAddressCorrectionError\",\"CashAddressDecodingError\",\"CashAddressEncodingError\",\"CashAddressNetworkPrefix\",\"CashAddressType\",\"CashAddressVersionByte\",\"CashAddressVersionByteDecodingError\",\"LockingBytecodeEncodingError\",\"addressContentsToLockingBytecode\",\"attemptCashAddressFormatErrorCorrection\",\"base58AddressToLockingBytecode\",\"bech32CharacterSet\",\"bech32CharacterSetIndex\",\"bech32PaddedToBin\",\"binToBech32Padded\",\"cashAddressBitToSize\",\"cashAddressChecksumToUint5Array\",\"cashAddressPolynomialModulo\",\"cashAddressPolynomialToCashAddress\",\"cashAddressSizeToBit\",\"cashAddressToLockingBytecode\",\"decodeBase58Address\",\"decodeBase58AddressFormat\",\"decodeBech32\",\"decodeCashAddress\",\"decodeCashAddressFormat\",\"decodeCashAddressFormatWithoutPrefix\",\"decodeCashAddressVersionByte\",\"encodeBase58Address\",\"encodeBase58AddressFormat\",\"encodeBech32\",\"encodeCashAddress\",\"encodeCashAddressFormat\",\"encodeCashAddressVersionByte\",\"isBech32CharacterSet\",\"lockingBytecodeToAddressContents\",\"lockingBytecodeToBase58Address\",\"lockingBytecodeToCashAddress\",\"maskCashAddressPrefix\",\"regroupBits\",\"createAuthenticationVirtualMachine\",\"CompressionFlag\",\"ContextFlag\",\"getEmbeddedSecp256k1Binary\",\"instantiateRustWasm\",\"instantiateSecp256k1Wasm\",\"instantiateSecp256k1WasmBytes\",\"ripemd160Base64Bytes\",\"sha1Base64Bytes\",\"sha256Base64Bytes\",\"sha512Base64Bytes\",\"getEmbeddedRipemd160Binary\",\"getEmbeddedSha1Binary\",\"getEmbeddedSha256Binary\",\"getEmbeddedSha512Binary\",\"hmacSha256\",\"hmacSha512\",\"instantiateHmacFunction\",\"instantiateRipemd160\",\"instantiateRipemd160Bytes\",\"instantiateSecp256k1\",\"instantiateSecp256k1Bytes\",\"instantiateSha1\",\"instantiateSha1Bytes\",\"instantiateSha256\",\"instantiateSha256Bytes\",\"instantiateSha512\",\"instantiateSha512Bytes\",\"HdKeyDecodingError\",\"HdKeyVersion\",\"HdNodeCrackingError\",\"HdNodeDerivationError\",\"WalletImportFormatError\",\"crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode\",\"decodeHdKey\",\"decodeHdPrivateKey\",\"decodeHdPublicKey\",\"decodePrivateKeyWif\",\"deriveHdPath\",\"deriveHdPrivateNodeChild\",\"deriveHdPrivateNodeFromSeed\",\"deriveHdPrivateNodeIdentifier\",\"deriveHdPublicNode\",\"deriveHdPublicNodeChild\",\"deriveHdPublicNodeIdentifier\",\"encodeHdPrivateKey\",\"encodeHdPublicKey\",\"encodePrivateKeyWif\",\"generatePrivateKey\",\"instantiateBIP32Crypto\",\"validateSecp256k1PrivateKey\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _template_template__WEBPACK_IMPORTED_MODULE_5__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _transaction_transaction__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./transaction/transaction */ \"./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/format.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _format_format__WEBPACK_IMPORTED_MODULE_7__) if([\"default\",\"AddressType\",\"Base58AddressError\",\"Base58AddressFormatVersion\",\"Bech32DecodingError\",\"BitRegroupingError\",\"CashAddressCorrectionError\",\"CashAddressDecodingError\",\"CashAddressEncodingError\",\"CashAddressNetworkPrefix\",\"CashAddressType\",\"CashAddressVersionByte\",\"CashAddressVersionByteDecodingError\",\"LockingBytecodeEncodingError\",\"addressContentsToLockingBytecode\",\"attemptCashAddressFormatErrorCorrection\",\"base58AddressToLockingBytecode\",\"bech32CharacterSet\",\"bech32CharacterSetIndex\",\"bech32PaddedToBin\",\"binToBech32Padded\",\"cashAddressBitToSize\",\"cashAddressChecksumToUint5Array\",\"cashAddressPolynomialModulo\",\"cashAddressPolynomialToCashAddress\",\"cashAddressSizeToBit\",\"cashAddressToLockingBytecode\",\"decodeBase58Address\",\"decodeBase58AddressFormat\",\"decodeBech32\",\"decodeCashAddress\",\"decodeCashAddressFormat\",\"decodeCashAddressFormatWithoutPrefix\",\"decodeCashAddressVersionByte\",\"encodeBase58Address\",\"encodeBase58AddressFormat\",\"encodeBech32\",\"encodeCashAddress\",\"encodeCashAddressFormat\",\"encodeCashAddressVersionByte\",\"isBech32CharacterSet\",\"lockingBytecodeToAddressContents\",\"lockingBytecodeToBase58Address\",\"lockingBytecodeToCashAddress\",\"maskCashAddressPrefix\",\"regroupBits\",\"createAuthenticationVirtualMachine\",\"CompressionFlag\",\"ContextFlag\",\"getEmbeddedSecp256k1Binary\",\"instantiateRustWasm\",\"instantiateSecp256k1Wasm\",\"instantiateSecp256k1WasmBytes\",\"ripemd160Base64Bytes\",\"sha1Base64Bytes\",\"sha256Base64Bytes\",\"sha512Base64Bytes\",\"getEmbeddedRipemd160Binary\",\"getEmbeddedSha1Binary\",\"getEmbeddedSha256Binary\",\"getEmbeddedSha512Binary\",\"hmacSha256\",\"hmacSha512\",\"instantiateHmacFunction\",\"instantiateRipemd160\",\"instantiateRipemd160Bytes\",\"instantiateSecp256k1\",\"instantiateSecp256k1Bytes\",\"instantiateSha1\",\"instantiateSha1Bytes\",\"instantiateSha256\",\"instantiateSha256Bytes\",\"instantiateSha512\",\"instantiateSha512Bytes\",\"HdKeyDecodingError\",\"HdKeyVersion\",\"HdNodeCrackingError\",\"HdNodeDerivationError\",\"WalletImportFormatError\",\"crackHdPrivateNodeFromHdPublicNodeAndChildPrivateNode\",\"decodeHdKey\",\"decodeHdPrivateKey\",\"decodeHdPublicKey\",\"decodePrivateKeyWif\",\"deriveHdPath\",\"deriveHdPrivateNodeChild\",\"deriveHdPrivateNodeFromSeed\",\"deriveHdPrivateNodeIdentifier\",\"deriveHdPublicNode\",\"deriveHdPublicNodeChild\",\"deriveHdPublicNodeIdentifier\",\"encodeHdPrivateKey\",\"encodeHdPublicKey\",\"encodePrivateKeyWif\",\"generatePrivateKey\",\"instantiateBIP32Crypto\",\"validateSecp256k1PrivateKey\",\"BuiltInVariables\",\"CompilerDefaults\",\"IdentifierResolutionErrorType\",\"IdentifierResolutionType\",\"SigningSerializationAlgorithmIdentifier\",\"allErrorsAreRecoverable\",\"attemptCompilerOperations\",\"authenticationTemplateP2pkh\",\"authenticationTemplateP2pkhNonHd\",\"authenticationTemplateToCompilationEnvironment\",\"authenticationTemplateToCompilationEnvironmentVirtualizedTests\",\"authenticationTemplateToCompilerBCH\",\"compileBtl\",\"compileScript\",\"compileScriptContents\",\"compileScriptP2shLocking\",\"compileScriptP2shUnlocking\",\"compileScriptRaw\",\"compilerOperationAddressData\",\"compilerOperationAttemptBytecodeResolution\",\"compilerOperationCurrentBlockHeight\",\"compilerOperationCurrentBlockTime\",\"compilerOperationHdKeyEcdsaDataSignatureBCH\",\"compilerOperationHdKeyEcdsaSignatureBCH\",\"compilerOperationHdKeyPublicKeyCommon\",\"compilerOperationHdKeySchnorrDataSignatureBCH\",\"compilerOperationHdKeySchnorrSignatureBCH\",\"compilerOperationHelperAddressIndex\",\"compilerOperationHelperCompileScript\",\"compilerOperationHelperComputeDataSignatureBCH\",\"compilerOperationHelperComputeSignatureBCH\",\"compilerOperationHelperDeriveHdKeyPrivate\",\"compilerOperationHelperDeriveHdPrivateNode\",\"compilerOperationHelperGenerateCoveredBytecode\",\"compilerOperationHelperHdKeyDataSignatureBCH\",\"compilerOperationHelperHdKeySignatureBCH\",\"compilerOperationHelperKeyDataSignatureBCH\",\"compilerOperationHelperKeySignatureBCH\",\"compilerOperationHelperUnknownEntity\",\"compilerOperationKeyEcdsaDataSignatureBCH\",\"compilerOperationKeyEcdsaSignatureBCH\",\"compilerOperationKeyPublicKeyCommon\",\"compilerOperationKeySchnorrDataSignatureBCH\",\"compilerOperationKeySchnorrSignatureBCH\",\"compilerOperationRequires\",\"compilerOperationSigningSerializationCorrespondingOutput\",\"compilerOperationSigningSerializationCorrespondingOutputHash\",\"compilerOperationSigningSerializationCoveredBytecode\",\"compilerOperationSigningSerializationCoveredBytecodeLength\",\"compilerOperationSigningSerializationFullBCH\",\"compilerOperationSigningSerializationLocktime\",\"compilerOperationSigningSerializationOutpointIndex\",\"compilerOperationSigningSerializationOutpointTransactionHash\",\"compilerOperationSigningSerializationOutputValue\",\"compilerOperationSigningSerializationSequenceNumber\",\"compilerOperationSigningSerializationTransactionOutpoints\",\"compilerOperationSigningSerializationTransactionOutpointsHash\",\"compilerOperationSigningSerializationTransactionOutputs\",\"compilerOperationSigningSerializationTransactionOutputsHash\",\"compilerOperationSigningSerializationTransactionSequenceNumbers\",\"compilerOperationSigningSerializationTransactionSequenceNumbersHash\",\"compilerOperationSigningSerializationVersion\",\"compilerOperationWalletData\",\"compilerOperationsBCH\",\"compilerOperationsCommon\",\"containsRange\",\"createAuthenticationProgramEvaluationCommon\",\"createCompiler\",\"createCompilerBCH\",\"createCompilerCommonSynchronous\",\"createIdentifierResolver\",\"describeExpectedInput\",\"extendCompilationDataWithScenarioBytecode\",\"extendScenarioDefinition\",\"extendScenarioDefinitionData\",\"extendedScenarioDefinitionToCompilationData\",\"extractBytecodeResolutions\",\"extractEvaluationSamples\",\"extractEvaluationSamplesRecursive\",\"extractResolvedVariableBytecodeMap\",\"extractUnexecutedRanges\",\"generateDefaultScenarioDefinition\",\"generateExtendedScenario\",\"generateScenarioCommon\",\"getResolutionErrors\",\"mergeRanges\",\"parseAuthenticationTemplateEntities\",\"parseAuthenticationTemplateScenarioData\",\"parseAuthenticationTemplateScenarioDataHdKeys\",\"parseAuthenticationTemplateScenarioDataKeys\",\"parseAuthenticationTemplateScenarioTransaction\",\"parseAuthenticationTemplateScenarioTransactionInputs\",\"parseAuthenticationTemplateScenarioTransactionOutputLockingBytecode\",\"parseAuthenticationTemplateScenarioTransactionOutputs\",\"parseAuthenticationTemplateScenarios\",\"parseAuthenticationTemplateScripts\",\"parseAuthenticationTemplateVariable\",\"parseScript\",\"reduceScript\",\"resolveScriptIdentifier\",\"resolveScriptSegment\",\"resolveVariableIdentifier\",\"stringifyErrors\",\"validateAuthenticationTemplate\",\"verifyBtlEvaluationState\",\"TransactionDecodingError\",\"compileInputTemplate\",\"compileOutputTemplate\",\"decodeTransaction\",\"decodeTransactionUnsafe\",\"encodeInput\",\"encodeInputs\",\"encodeOutpoints\",\"encodeOutput\",\"encodeOutputsForSigning\",\"encodeOutputsForTransaction\",\"encodeSequenceNumbersForSigning\",\"encodeTransaction\",\"extractMissingVariables\",\"extractResolvedVariables\",\"generateTransaction\",\"getTransactionHash\",\"getTransactionHashBE\",\"getTransactionHashLE\",\"invalidSatoshis\",\"readTransactionInput\",\"readTransactionOutput\",\"safelyExtendCompilationData\",\"verifyTransaction\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _format_format__WEBPACK_IMPORTED_MODULE_7__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n\n\n\n\n\n\n\n\n//# sourceMappingURL=lib.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/lib.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/compiler-bch/compiler-bch.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/compiler-bch/compiler-bch.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SigningSerializationAlgorithmIdentifier: () => (/* binding */ SigningSerializationAlgorithmIdentifier),\n/* harmony export */ authenticationTemplateToCompilerBCH: () => (/* binding */ authenticationTemplateToCompilerBCH),\n/* harmony export */ compilerOperationHdKeyEcdsaDataSignatureBCH: () => (/* binding */ compilerOperationHdKeyEcdsaDataSignatureBCH),\n/* harmony export */ compilerOperationHdKeyEcdsaSignatureBCH: () => (/* binding */ compilerOperationHdKeyEcdsaSignatureBCH),\n/* harmony export */ compilerOperationHdKeySchnorrDataSignatureBCH: () => (/* binding */ compilerOperationHdKeySchnorrDataSignatureBCH),\n/* harmony export */ compilerOperationHdKeySchnorrSignatureBCH: () => (/* binding */ compilerOperationHdKeySchnorrSignatureBCH),\n/* harmony export */ compilerOperationHelperComputeDataSignatureBCH: () => (/* binding */ compilerOperationHelperComputeDataSignatureBCH),\n/* harmony export */ compilerOperationHelperComputeSignatureBCH: () => (/* binding */ compilerOperationHelperComputeSignatureBCH),\n/* harmony export */ compilerOperationHelperHdKeyDataSignatureBCH: () => (/* binding */ compilerOperationHelperHdKeyDataSignatureBCH),\n/* harmony export */ compilerOperationHelperHdKeySignatureBCH: () => (/* binding */ compilerOperationHelperHdKeySignatureBCH),\n/* harmony export */ compilerOperationHelperKeyDataSignatureBCH: () => (/* binding */ compilerOperationHelperKeyDataSignatureBCH),\n/* harmony export */ compilerOperationHelperKeySignatureBCH: () => (/* binding */ compilerOperationHelperKeySignatureBCH),\n/* harmony export */ compilerOperationKeyEcdsaDataSignatureBCH: () => (/* binding */ compilerOperationKeyEcdsaDataSignatureBCH),\n/* harmony export */ compilerOperationKeyEcdsaSignatureBCH: () => (/* binding */ compilerOperationKeyEcdsaSignatureBCH),\n/* harmony export */ compilerOperationKeySchnorrDataSignatureBCH: () => (/* binding */ compilerOperationKeySchnorrDataSignatureBCH),\n/* harmony export */ compilerOperationKeySchnorrSignatureBCH: () => (/* binding */ compilerOperationKeySchnorrSignatureBCH),\n/* harmony export */ compilerOperationSigningSerializationFullBCH: () => (/* binding */ compilerOperationSigningSerializationFullBCH),\n/* harmony export */ compilerOperationsBCH: () => (/* binding */ compilerOperationsBCH),\n/* harmony export */ createCompilerBCH: () => (/* binding */ createCompilerBCH)\n/* harmony export */ });\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/sha1.js\");\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/sha256.js\");\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/sha512.js\");\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/ripemd160.js\");\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/secp256k1.js\");\n/* harmony import */ var _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vm/instruction-sets/common/signing-serialization */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/signing-serialization.js\");\n/* harmony import */ var _vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../vm/instruction-sets/instruction-sets */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-instruction-sets.js\");\n/* harmony import */ var _vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../vm/instruction-sets/instruction-sets */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-utils.js\");\n/* harmony import */ var _vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../vm/instruction-sets/instruction-sets */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-opcodes.js\");\n/* harmony import */ var _vm_virtual_machine__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../vm/virtual-machine */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/virtual-machine.js\");\n/* harmony import */ var _compiler__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../compiler */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler.js\");\n/* harmony import */ var _compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../compiler-operation-helpers */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-operation-helpers.js\");\n/* harmony import */ var _compiler_operations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../compiler-operations */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-operations.js\");\n\n\n\n\n\n\n\nvar SigningSerializationAlgorithmIdentifier;\n(function (SigningSerializationAlgorithmIdentifier) {\n /**\n * A.K.A. `SIGHASH_ALL`\n */\n SigningSerializationAlgorithmIdentifier[\"allOutputs\"] = \"all_outputs\";\n /**\n * A.K.A. `SIGHASH_ALL|ANYONE_CAN_PAY`\n */\n SigningSerializationAlgorithmIdentifier[\"allOutputsSingleInput\"] = \"all_outputs_single_input\";\n /**\n * A.K.A. `SIGHASH_SINGLE`\n */\n SigningSerializationAlgorithmIdentifier[\"correspondingOutput\"] = \"corresponding_output\";\n /**\n * A.K.A. `SIGHASH_SINGLE|ANYONE_CAN_PAY`\n */\n SigningSerializationAlgorithmIdentifier[\"correspondingOutputSingleInput\"] = \"corresponding_output_single_input\";\n /**\n * A.K.A `SIGHASH_NONE`\n */\n SigningSerializationAlgorithmIdentifier[\"noOutputs\"] = \"no_outputs\";\n /**\n * A.K.A `SIGHASH_NONE|ANYONE_CAN_PAY`\n */\n SigningSerializationAlgorithmIdentifier[\"noOutputsSingleInput\"] = \"no_outputs_single_input\";\n})(SigningSerializationAlgorithmIdentifier || (SigningSerializationAlgorithmIdentifier = {}));\n// eslint-disable-next-line complexity\nconst getSigningSerializationType = (algorithmIdentifier, prefix = '') => {\n switch (algorithmIdentifier) {\n case `${prefix}${SigningSerializationAlgorithmIdentifier.allOutputs}`:\n return Uint8Array.of(\n // eslint-disable-next-line no-bitwise\n _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.allOutputs | _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.forkId);\n case `${prefix}${SigningSerializationAlgorithmIdentifier.allOutputsSingleInput}`:\n return Uint8Array.of(\n // eslint-disable-next-line no-bitwise\n _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.allOutputs |\n _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.singleInput |\n _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.forkId);\n case `${prefix}${SigningSerializationAlgorithmIdentifier.correspondingOutput}`:\n return Uint8Array.of(\n // eslint-disable-next-line no-bitwise\n _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.correspondingOutput |\n _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.forkId);\n case `${prefix}${SigningSerializationAlgorithmIdentifier.correspondingOutputSingleInput}`:\n return Uint8Array.of(\n // eslint-disable-next-line no-bitwise\n _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.correspondingOutput |\n _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.singleInput |\n _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.forkId);\n case `${prefix}${SigningSerializationAlgorithmIdentifier.noOutputs}`:\n return Uint8Array.of(\n // eslint-disable-next-line no-bitwise\n _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.noOutputs | _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.forkId);\n case `${prefix}${SigningSerializationAlgorithmIdentifier.noOutputsSingleInput}`:\n return Uint8Array.of(\n // eslint-disable-next-line no-bitwise\n _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.noOutputs |\n _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.singleInput |\n _vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationFlag.forkId);\n default:\n return undefined;\n }\n};\nconst compilerOperationHelperComputeSignatureBCH = ({ coveredBytecode, identifier, transactionContext, operationName, privateKey, sha256, sign, }) => {\n const [, , algorithm, unknown] = identifier.split('.');\n if (unknown !== undefined) {\n return {\n error: `Unknown component in \"${identifier}\" – the fragment \"${unknown}\" is not recognized.`,\n status: 'error',\n };\n }\n if (algorithm === undefined) {\n return {\n error: `Invalid signature identifier. Signatures must be of the form: \"[variable_id].${operationName}.[signing_serialization_type]\".`,\n status: 'error',\n };\n }\n const signingSerializationType = getSigningSerializationType(algorithm);\n if (signingSerializationType === undefined) {\n return {\n error: `Unknown signing serialization algorithm, \"${algorithm}\".`,\n status: 'error',\n };\n }\n const serialization = (0,_vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.generateSigningSerializationBCH)({\n correspondingOutput: transactionContext.correspondingOutput,\n coveredBytecode,\n locktime: transactionContext.locktime,\n outpointIndex: transactionContext.outpointIndex,\n outpointTransactionHash: transactionContext.outpointTransactionHash,\n outputValue: transactionContext.outputValue,\n sequenceNumber: transactionContext.sequenceNumber,\n sha256,\n signingSerializationType,\n transactionOutpoints: transactionContext.transactionOutpoints,\n transactionOutputs: transactionContext.transactionOutputs,\n transactionSequenceNumbers: transactionContext.transactionSequenceNumbers,\n version: transactionContext.version,\n });\n const digest = sha256.hash(sha256.hash(serialization));\n const bitcoinEncodedSignature = Uint8Array.from([\n ...sign(privateKey, digest),\n ...signingSerializationType,\n ]);\n return {\n bytecode: bitcoinEncodedSignature,\n signature: { serialization },\n status: 'success',\n };\n};\nconst compilerOperationHelperHdKeySignatureBCH = ({ operationName, secp256k1Method, }) => (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.attemptCompilerOperations)([_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationAttemptBytecodeResolution], (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['hdKeys', 'transactionContext'],\n environmentProperties: [\n 'entityOwnership',\n 'ripemd160',\n 'secp256k1',\n 'sha256',\n 'sha512',\n 'variables',\n 'sourceScriptIds',\n 'unlockingScripts',\n ],\n operation: (identifier, data, environment) => {\n const { hdKeys, transactionContext } = data;\n const { secp256k1, sha256, sourceScriptIds, unlockingScripts, } = environment;\n const derivationResult = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationHelperDeriveHdKeyPrivate)({\n environment,\n hdKeys,\n identifier,\n });\n if (derivationResult.status === 'error')\n return derivationResult;\n const result = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationHelperGenerateCoveredBytecode)({\n data,\n environment,\n identifier,\n sourceScriptIds,\n unlockingScripts,\n });\n if ('error' in result) {\n return result;\n }\n return compilerOperationHelperComputeSignatureBCH({\n coveredBytecode: result,\n identifier,\n operationName,\n privateKey: derivationResult.bytecode,\n sha256,\n sign: secp256k1[secp256k1Method],\n transactionContext,\n });\n },\n}));\nconst compilerOperationHdKeyEcdsaSignatureBCH = compilerOperationHelperHdKeySignatureBCH({\n operationName: 'signature',\n secp256k1Method: 'signMessageHashDER',\n});\nconst compilerOperationHdKeySchnorrSignatureBCH = compilerOperationHelperHdKeySignatureBCH({\n operationName: 'schnorr_signature',\n secp256k1Method: 'signMessageHashSchnorr',\n});\nconst compilerOperationHelperKeySignatureBCH = ({ operationName, secp256k1Method, }) => (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.attemptCompilerOperations)([_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationAttemptBytecodeResolution], (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['keys', 'transactionContext'],\n environmentProperties: [\n 'sha256',\n 'secp256k1',\n 'unlockingScripts',\n 'sourceScriptIds',\n ],\n operation: (identifier, data, environment) => {\n const { keys, transactionContext } = data;\n const { secp256k1, sha256, unlockingScripts, sourceScriptIds, } = environment;\n const { privateKeys } = keys;\n const [variableId] = identifier.split('.');\n const privateKey = privateKeys === undefined ? undefined : privateKeys[variableId];\n if (privateKey === undefined) {\n return {\n error: `Identifier \"${identifier}\" refers to a Key, but a private key for \"${variableId}\" (or an existing signature) was not provided in the compilation data.`,\n recoverable: true,\n status: 'error',\n };\n }\n const result = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationHelperGenerateCoveredBytecode)({\n data,\n environment,\n identifier,\n sourceScriptIds,\n unlockingScripts,\n });\n if ('error' in result) {\n return result;\n }\n return compilerOperationHelperComputeSignatureBCH({\n coveredBytecode: result,\n identifier,\n operationName,\n privateKey,\n sha256,\n sign: secp256k1[secp256k1Method],\n transactionContext,\n });\n },\n}));\nconst compilerOperationKeyEcdsaSignatureBCH = compilerOperationHelperKeySignatureBCH({\n operationName: 'signature',\n secp256k1Method: 'signMessageHashDER',\n});\nconst compilerOperationKeySchnorrSignatureBCH = compilerOperationHelperKeySignatureBCH({\n operationName: 'schnorr_signature',\n secp256k1Method: 'signMessageHashSchnorr',\n});\nconst compilerOperationHelperComputeDataSignatureBCH = ({ data, environment, identifier, operationName, privateKey, sha256, sign, }) => {\n const [, , scriptId, unknown] = identifier.split('.');\n if (unknown !== undefined) {\n return {\n error: `Unknown component in \"${identifier}\" – the fragment \"${unknown}\" is not recognized.`,\n status: 'error',\n };\n }\n if (scriptId === undefined) {\n return {\n error: `Invalid data signature identifier. Data signatures must be of the form: \"[variable_id].${operationName}.[target_script_id]\".`,\n status: 'error',\n };\n }\n const result = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationHelperCompileScript)({\n data,\n environment,\n targetScriptId: scriptId,\n });\n if (result === false) {\n return {\n error: `Data signature tried to sign an unknown target script, \"${scriptId}\".`,\n status: 'error',\n };\n }\n if ('error' in result) {\n return result;\n }\n const digest = sha256.hash(result);\n return {\n bytecode: sign(privateKey, digest),\n signature: { message: result },\n status: 'success',\n };\n};\nconst compilerOperationHelperKeyDataSignatureBCH = ({ operationName, secp256k1Method, }) => (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.attemptCompilerOperations)([_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationAttemptBytecodeResolution], (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['keys'],\n environmentProperties: ['sha256', 'secp256k1'],\n operation: (identifier, data, environment) => {\n const { keys } = data;\n const { secp256k1, sha256 } = environment;\n const { privateKeys } = keys;\n const [variableId] = identifier.split('.');\n const privateKey = privateKeys === undefined ? undefined : privateKeys[variableId];\n if (privateKey === undefined) {\n return {\n error: `Identifier \"${identifier}\" refers to a Key, but a private key for \"${variableId}\" (or an existing signature) was not provided in the compilation data.`,\n recoverable: true,\n status: 'error',\n };\n }\n return compilerOperationHelperComputeDataSignatureBCH({\n data,\n environment,\n identifier,\n operationName,\n privateKey,\n sha256,\n sign: secp256k1[secp256k1Method],\n });\n },\n}));\nconst compilerOperationKeyEcdsaDataSignatureBCH = compilerOperationHelperKeyDataSignatureBCH({\n operationName: 'data_signature',\n secp256k1Method: 'signMessageHashDER',\n});\nconst compilerOperationKeySchnorrDataSignatureBCH = compilerOperationHelperKeyDataSignatureBCH({\n operationName: 'schnorr_data_signature',\n secp256k1Method: 'signMessageHashSchnorr',\n});\nconst compilerOperationHelperHdKeyDataSignatureBCH = ({ operationName, secp256k1Method, }) => (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.attemptCompilerOperations)([_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationAttemptBytecodeResolution], (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['hdKeys'],\n environmentProperties: [\n 'entityOwnership',\n 'ripemd160',\n 'secp256k1',\n 'sha256',\n 'sha512',\n 'variables',\n ],\n operation: (identifier, data, environment) => {\n const { hdKeys } = data;\n const { secp256k1, sha256 } = environment;\n const derivationResult = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationHelperDeriveHdKeyPrivate)({\n environment,\n hdKeys,\n identifier,\n });\n if (derivationResult.status === 'error')\n return derivationResult;\n return compilerOperationHelperComputeDataSignatureBCH({\n data,\n environment,\n identifier,\n operationName,\n privateKey: derivationResult.bytecode,\n sha256,\n sign: secp256k1[secp256k1Method],\n });\n },\n}));\nconst compilerOperationHdKeyEcdsaDataSignatureBCH = compilerOperationHelperHdKeyDataSignatureBCH({\n operationName: 'data_signature',\n secp256k1Method: 'signMessageHashDER',\n});\nconst compilerOperationHdKeySchnorrDataSignatureBCH = compilerOperationHelperHdKeyDataSignatureBCH({\n operationName: 'schnorr_data_signature',\n secp256k1Method: 'signMessageHashSchnorr',\n});\nconst compilerOperationSigningSerializationFullBCH = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: ['sha256', 'sourceScriptIds', 'unlockingScripts'],\n operation: (identifier, data, environment) => {\n const [, algorithmOrComponent, unknownPart] = identifier.split('.');\n if (algorithmOrComponent === undefined) {\n return {\n error: `Invalid signing serialization operation. Include the desired component or algorithm, e.g. \"signing_serialization.version\".`,\n status: 'error',\n };\n }\n if (unknownPart !== undefined) {\n return {\n error: `Unknown component in \"${identifier}\" – the fragment \"${unknownPart}\" is not recognized.`,\n status: 'error',\n };\n }\n const signingSerializationType = getSigningSerializationType(algorithmOrComponent, 'full_');\n if (signingSerializationType === undefined) {\n return {\n error: `Unknown signing serialization algorithm, \"${algorithmOrComponent}\".`,\n status: 'error',\n };\n }\n const { sha256, sourceScriptIds, unlockingScripts } = environment;\n const result = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_1__.compilerOperationHelperGenerateCoveredBytecode)({\n data,\n environment,\n identifier,\n sourceScriptIds,\n unlockingScripts,\n });\n if ('error' in result) {\n return result;\n }\n const { transactionContext } = data;\n return {\n bytecode: (0,_vm_instruction_sets_common_signing_serialization__WEBPACK_IMPORTED_MODULE_0__.generateSigningSerializationBCH)({\n correspondingOutput: transactionContext.correspondingOutput,\n coveredBytecode: result,\n locktime: transactionContext.locktime,\n outpointIndex: transactionContext.outpointIndex,\n outpointTransactionHash: transactionContext.outpointTransactionHash,\n outputValue: transactionContext.outputValue,\n sequenceNumber: transactionContext.sequenceNumber,\n sha256,\n signingSerializationType,\n transactionOutpoints: transactionContext.transactionOutpoints,\n transactionOutputs: transactionContext.transactionOutputs,\n transactionSequenceNumbers: transactionContext.transactionSequenceNumbers,\n version: transactionContext.version,\n }),\n status: 'success',\n };\n },\n});\n/* eslint-disable camelcase, @typescript-eslint/naming-convention */\nconst compilerOperationsBCH = {\n ..._compiler_operations__WEBPACK_IMPORTED_MODULE_2__.compilerOperationsCommon,\n hdKey: {\n data_signature: compilerOperationHdKeyEcdsaDataSignatureBCH,\n public_key: _compiler_operations__WEBPACK_IMPORTED_MODULE_2__.compilerOperationsCommon.hdKey.public_key,\n schnorr_data_signature: compilerOperationHdKeySchnorrDataSignatureBCH,\n schnorr_signature: compilerOperationHdKeySchnorrSignatureBCH,\n signature: compilerOperationHdKeyEcdsaSignatureBCH,\n },\n key: {\n data_signature: compilerOperationKeyEcdsaDataSignatureBCH,\n public_key: _compiler_operations__WEBPACK_IMPORTED_MODULE_2__.compilerOperationsCommon.key.public_key,\n schnorr_data_signature: compilerOperationKeySchnorrDataSignatureBCH,\n schnorr_signature: compilerOperationKeySchnorrSignatureBCH,\n signature: compilerOperationKeyEcdsaSignatureBCH,\n },\n signingSerialization: {\n ..._compiler_operations__WEBPACK_IMPORTED_MODULE_2__.compilerOperationsCommon.signingSerialization,\n full_all_outputs: compilerOperationSigningSerializationFullBCH,\n full_all_outputs_single_input: compilerOperationSigningSerializationFullBCH,\n full_corresponding_output: compilerOperationSigningSerializationFullBCH,\n full_corresponding_output_single_input: compilerOperationSigningSerializationFullBCH,\n full_no_outputs: compilerOperationSigningSerializationFullBCH,\n full_no_outputs_single_input: compilerOperationSigningSerializationFullBCH,\n },\n};\n/**\n * Create a compiler using the default BCH environment.\n *\n * Internally instantiates the necessary crypto and VM implementations – use\n * `createCompiler` for more control.\n *\n * @param scriptsAndOverrides - a compilation environment from which properties\n * will be used to override properties of the default BCH environment – must\n * include the `scripts` property\n */\nconst createCompilerBCH = async (scriptsAndOverrides) => {\n const [sha1, sha256, sha512, ripemd160, secp256k1] = await Promise.all([\n (0,_crypto_crypto__WEBPACK_IMPORTED_MODULE_3__.instantiateSha1)(),\n (0,_crypto_crypto__WEBPACK_IMPORTED_MODULE_4__.instantiateSha256)(),\n (0,_crypto_crypto__WEBPACK_IMPORTED_MODULE_5__.instantiateSha512)(),\n (0,_crypto_crypto__WEBPACK_IMPORTED_MODULE_6__.instantiateRipemd160)(),\n (0,_crypto_crypto__WEBPACK_IMPORTED_MODULE_7__.instantiateSecp256k1)(),\n ]);\n const vm = (0,_vm_virtual_machine__WEBPACK_IMPORTED_MODULE_8__.createAuthenticationVirtualMachine)((0,_vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_9__.createInstructionSetBCH)({\n flags: (0,_vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_9__.getFlagsForInstructionSetBCH)(_vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_9__.instructionSetBCHCurrentStrict),\n ripemd160,\n secp256k1,\n sha1,\n sha256,\n }));\n return (0,_compiler__WEBPACK_IMPORTED_MODULE_10__.createCompiler)({\n ...{\n createAuthenticationProgram: _compiler__WEBPACK_IMPORTED_MODULE_10__.createAuthenticationProgramEvaluationCommon,\n opcodes: (0,_vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_11__.generateBytecodeMap)(_vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_12__.OpcodesBCH),\n operations: compilerOperationsBCH,\n ripemd160,\n secp256k1,\n sha256,\n sha512,\n vm,\n },\n ...scriptsAndOverrides,\n });\n};\n/**\n * Create a BCH `Compiler` from an `AuthenticationTemplate` and an optional set\n * of overrides.\n * @param template - the `AuthenticationTemplate` from which to create the BCH\n * compiler\n * @param overrides - a compilation environment from which properties will be\n * used to override properties of the default BCH environment\n */\nconst authenticationTemplateToCompilerBCH = async (template, overrides) => createCompilerBCH({\n ...overrides,\n ...(0,_compiler__WEBPACK_IMPORTED_MODULE_10__.authenticationTemplateToCompilationEnvironment)(template),\n});\n//# sourceMappingURL=compiler-bch.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/compiler-bch/compiler-bch.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/compiler-defaults.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/compiler-defaults.js ***! + \**************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CompilerDefaults: () => (/* binding */ CompilerDefaults)\n/* harmony export */ });\nvar CompilerDefaults;\n(function (CompilerDefaults) {\n /**\n * The `addressIndex` used by default scenarios.\n */\n CompilerDefaults[CompilerDefaults[\"defaultScenarioAddressIndex\"] = 0] = \"defaultScenarioAddressIndex\";\n /**\n *\n * The value of `currentBlockHeight` in the default authentication template\n * scenario. This is the height of the second mined block after the genesis\n * block: `000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd`.\n *\n * This default value was chosen to be low enough to simplify the debugging of\n * block height offsets while remaining differentiated from `0` and `1` which\n * are used both as boolean return values and for control flow.\n */\n CompilerDefaults[CompilerDefaults[\"defaultScenarioCurrentBlockHeight\"] = 2] = \"defaultScenarioCurrentBlockHeight\";\n /**\n * The value of `currentBlockTime` in the default authentication template\n * scenario. This is the Median Time-Past block time (BIP113) of block `2`\n * (the block used in `defaultScenarioCurrentBlockHeight`).\n */\n CompilerDefaults[CompilerDefaults[\"defaultScenarioCurrentBlockTime\"] = 1231469665] = \"defaultScenarioCurrentBlockTime\";\n /**\n * The default `outpointIndex` of inputs in scenarios.\n */\n CompilerDefaults[CompilerDefaults[\"defaultScenarioInputOutpointIndex\"] = 0] = \"defaultScenarioInputOutpointIndex\";\n /**\n * The default `outpointTransactionHash` of inputs in scenarios.\n */\n CompilerDefaults[\"defaultScenarioInputOutpointTransactionHash\"] = \"0000000000000000000000000000000000000000000000000000000000000000\";\n /**\n * The default `sequenceNumber` of inputs in scenarios.\n */\n CompilerDefaults[CompilerDefaults[\"defaultScenarioInputSequenceNumber\"] = 0] = \"defaultScenarioInputSequenceNumber\";\n /**\n * The default `unlockingBytecode` of untested inputs in scenarios.\n */\n CompilerDefaults[\"defaultScenarioInputUnlockingBytecodeHex\"] = \"\";\n /**\n * The default `satoshis` of outputs in scenarios.\n */\n CompilerDefaults[CompilerDefaults[\"defaultScenarioOutputSatoshis\"] = 0] = \"defaultScenarioOutputSatoshis\";\n /**\n * The hexadecimal-encoded value of the `lockingBytecode` in the single\n * default output (`transaction.outputs`) of the default authentication\n * template scenario.\n */\n CompilerDefaults[\"defaultScenarioTransactionOutputsLockingBytecodeHex\"] = \"\";\n /**\n * The value of `transaction.locktime` in the default authentication template\n * scenario.\n */\n CompilerDefaults[CompilerDefaults[\"defaultScenarioTransactionLocktime\"] = 0] = \"defaultScenarioTransactionLocktime\";\n /**\n * The value of `transaction.version` in the default authentication template\n * scenario. Transaction version `2` enables `OP_CHECKSEQUENCEVERIFY` as\n * described in BIP68, BIP112, and BIP113.\n */\n CompilerDefaults[CompilerDefaults[\"defaultScenarioTransactionVersion\"] = 2] = \"defaultScenarioTransactionVersion\";\n /**\n * The default value of the hypothetical UTXO being spent by the input under\n * test in a scenario.\n */\n CompilerDefaults[CompilerDefaults[\"defaultScenarioValue\"] = 0] = \"defaultScenarioValue\";\n /**\n * If unset, each `HdKey` uses this `addressOffset`.\n */\n CompilerDefaults[CompilerDefaults[\"hdKeyAddressOffset\"] = 0] = \"hdKeyAddressOffset\";\n /**\n * If unset, each `HdKey` uses this `hdPublicKeyDerivationPath`.\n */\n CompilerDefaults[\"hdKeyHdPublicKeyDerivationPath\"] = \"m\";\n /**\n * If unset, each `HdKey` uses this `privateDerivationPath`.\n */\n CompilerDefaults[\"hdKeyPrivateDerivationPath\"] = \"m/i\";\n /**\n * The prefix used to refer to other scenario bytecode scripts from within a\n * bytecode script. See `AuthenticationTemplateScenarioData.bytecode` for\n * details.\n */\n CompilerDefaults[\"scenarioBytecodeScriptPrefix\"] = \"_scenario_\";\n /**\n * The prefix used to identify the `check` script from a virtualized\n * `AuthenticationTemplateScriptTest`. For details, see\n * `authenticationTemplateToCompilationEnvironmentVirtualizedTests`.\n */\n CompilerDefaults[\"virtualizedTestCheckScriptPrefix\"] = \"__virtualized_test_check_\";\n /**\n * The prefix used to identify the concatenated tested and `check` script from\n * a virtualized `AuthenticationTemplateScriptTest`. For details, see\n * `authenticationTemplateToCompilationEnvironmentVirtualizedTests`.\n */\n CompilerDefaults[\"virtualizedTestLockingScriptPrefix\"] = \"__virtualized_test_lock_\";\n /**\n * The prefix used to identify the `setup` script from a virtualized\n * `AuthenticationTemplateScriptTest`. For details, see\n * `authenticationTemplateToCompilationEnvironmentVirtualizedTests`.\n */\n CompilerDefaults[\"virtualizedTestUnlockingScriptPrefix\"] = \"__virtualized_test_unlock_\";\n})(CompilerDefaults || (CompilerDefaults = {}));\n//# sourceMappingURL=compiler-defaults.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/compiler-defaults.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/compiler-operation-helpers.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/compiler-operation-helpers.js ***! + \***********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ attemptCompilerOperations: () => (/* binding */ attemptCompilerOperations),\n/* harmony export */ compilerOperationAttemptBytecodeResolution: () => (/* binding */ compilerOperationAttemptBytecodeResolution),\n/* harmony export */ compilerOperationHelperAddressIndex: () => (/* binding */ compilerOperationHelperAddressIndex),\n/* harmony export */ compilerOperationHelperCompileScript: () => (/* binding */ compilerOperationHelperCompileScript),\n/* harmony export */ compilerOperationHelperDeriveHdKeyPrivate: () => (/* binding */ compilerOperationHelperDeriveHdKeyPrivate),\n/* harmony export */ compilerOperationHelperDeriveHdPrivateNode: () => (/* binding */ compilerOperationHelperDeriveHdPrivateNode),\n/* harmony export */ compilerOperationHelperGenerateCoveredBytecode: () => (/* binding */ compilerOperationHelperGenerateCoveredBytecode),\n/* harmony export */ compilerOperationHelperUnknownEntity: () => (/* binding */ compilerOperationHelperUnknownEntity),\n/* harmony export */ compilerOperationRequires: () => (/* binding */ compilerOperationRequires)\n/* harmony export */ });\n/* harmony import */ var _key_hd_key__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../key/hd-key */ \"./node_modules/@bitauth/libauth/build/module/lib/key/hd-key.js\");\n/* harmony import */ var _compiler_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compiler-defaults */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-defaults.js\");\n/* harmony import */ var _language_resolve__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./language/resolve */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/resolve.js\");\n\n\n\n/**\n * Attempt a series of compiler operations, skipping to the next operation if\n * the current operation returns a `CompilerOperationSkip` (indicating it failed\n * and can be skipped). The `finalOperation` may not be skipped, and must either\n * return `CompilerOperationSuccess` or `CompilerOperationError`.\n *\n * @param operations - an array of skippable operations to try\n * @param finalOperation - a final, un-skippable operation\n */\nconst attemptCompilerOperations = (operations, finalOperation) => (identifier, data, environment) => {\n // eslint-disable-next-line functional/no-loop-statement\n for (const operation of operations) {\n const result = operation(identifier, data, environment);\n if (result.status !== 'skip')\n return result;\n }\n return finalOperation(identifier, data, environment);\n};\n/**\n * Modify a compiler operation to verify that certain properties exist in the\n * `CompilationData` and `CompilationEnvironment` before executing the provided\n * operation. If the properties don't exist, an error message is returned.\n *\n * This is useful for eliminating repetitive existence checks.\n *\n * @param canBeSkipped - if `true`, the accepted operation may return `false`,\n * and any missing properties will cause the returned operation to return\n * `false` (meaning the operation should be skipped)\n * @param dataProperties - an array of the top-level properties required in the\n * `CompilationData`\n * @param environmentProperties - an array of the top-level properties required\n * in the `CompilationEnvironment`\n * @param operation - the operation to run if all required properties exist\n */\nconst compilerOperationRequires = ({ canBeSkipped, dataProperties, environmentProperties, operation, }) => (identifier, data, environment) => {\n // eslint-disable-next-line functional/no-loop-statement\n for (const property of environmentProperties) {\n if (environment[property] === undefined)\n return (canBeSkipped\n ? { status: 'skip' }\n : {\n error: `Cannot resolve \"${identifier}\" – the \"${property}\" property was not provided in the compilation environment.`,\n status: 'error',\n });\n }\n // eslint-disable-next-line functional/no-loop-statement\n for (const property of dataProperties) {\n if (data[property] === undefined)\n return (canBeSkipped\n ? { status: 'skip' }\n : {\n error: `Cannot resolve \"${identifier}\" – the \"${property}\" property was not provided in the compilation data.`,\n status: 'error',\n });\n }\n return operation(identifier, data, environment);\n};\nconst compilerOperationAttemptBytecodeResolution = compilerOperationRequires({\n canBeSkipped: true,\n dataProperties: ['bytecode'],\n environmentProperties: [],\n operation: (identifier, data) => {\n const { bytecode } = data;\n if (bytecode[identifier] !== undefined) {\n return { bytecode: bytecode[identifier], status: 'success' };\n }\n return { status: 'skip' };\n },\n});\n// eslint-disable-next-line complexity\nconst compilerOperationHelperDeriveHdPrivateNode = ({ addressIndex, entityId, entityHdPrivateKey, environment, hdKey, identifier, }) => {\n var _a, _b;\n const addressOffset = (_a = hdKey.addressOffset) !== null && _a !== void 0 ? _a : _compiler_defaults__WEBPACK_IMPORTED_MODULE_0__.CompilerDefaults.hdKeyAddressOffset;\n const privateDerivationPath = (_b = hdKey.privateDerivationPath) !== null && _b !== void 0 ? _b : _compiler_defaults__WEBPACK_IMPORTED_MODULE_0__.CompilerDefaults.hdKeyPrivateDerivationPath;\n const i = addressIndex + addressOffset;\n const validPrivatePathWithIndex = /^m(?:\\/(?:[0-9]+|i)'?)*$/u;\n if (!validPrivatePathWithIndex.test(privateDerivationPath)) {\n return {\n error: `Could not generate ${identifier} – the path \"${privateDerivationPath}\" is not a valid \"privateDerivationPath\".`,\n status: 'error',\n };\n }\n const instancePath = privateDerivationPath.replace('i', i.toString());\n const masterContents = (0,_key_hd_key__WEBPACK_IMPORTED_MODULE_1__.decodeHdPrivateKey)(environment, entityHdPrivateKey);\n if (typeof masterContents === 'string') {\n return {\n error: `Could not generate ${identifier} – the HD private key provided for ${entityId} could not be decoded: ${masterContents}`,\n status: 'error',\n };\n }\n const instanceNode = (0,_key_hd_key__WEBPACK_IMPORTED_MODULE_1__.deriveHdPath)(environment, masterContents.node, instancePath);\n if (typeof instanceNode === 'string') {\n return {\n error: `Could not generate ${identifier} – the path \"${instancePath}\" could not be derived for entity \"${entityId}\": ${instanceNode}`,\n status: 'error',\n };\n }\n return {\n bytecode: instanceNode.privateKey,\n status: 'success',\n };\n};\nconst compilerOperationHelperUnknownEntity = (identifier, variableId) => ({\n error: `Identifier \"${identifier}\" refers to an HdKey, but the \"entityOwnership\" for \"${variableId}\" is not available in this compilation environment.`,\n status: 'error',\n});\nconst compilerOperationHelperAddressIndex = (identifier) => ({\n error: `Identifier \"${identifier}\" refers to an HdKey, but \"hdKeys.addressIndex\" was not provided in the compilation data.`,\n status: 'error',\n});\nconst compilerOperationHelperDeriveHdKeyPrivate = ({ environment, hdKeys, identifier, }) => {\n const { addressIndex, hdPrivateKeys } = hdKeys;\n const [variableId] = identifier.split('.');\n const entityId = environment.entityOwnership[variableId];\n if (entityId === undefined) {\n return compilerOperationHelperUnknownEntity(identifier, variableId);\n }\n if (addressIndex === undefined) {\n return compilerOperationHelperAddressIndex(identifier);\n }\n const entityHdPrivateKey = hdPrivateKeys === undefined ? undefined : hdPrivateKeys[entityId];\n if (entityHdPrivateKey === undefined) {\n return {\n error: `Identifier \"${identifier}\" refers to an HdKey owned by \"${entityId}\", but an HD private key for this entity (or an existing signature) was not provided in the compilation data.`,\n recoverable: true,\n status: 'error',\n };\n }\n /**\n * Guaranteed to be an `HdKey` if this method is reached in the compiler.\n */\n const hdKey = environment.variables[variableId];\n return compilerOperationHelperDeriveHdPrivateNode({\n addressIndex,\n entityHdPrivateKey,\n entityId,\n environment,\n hdKey,\n identifier,\n });\n};\n/**\n * Returns `false` if the target script ID doesn't exist in the compilation\n * environment (allows for the caller to generate the error message).\n *\n * If the compilation produced errors, returns a `CompilerOperationErrorFatal`.\n *\n * If the compilation was successful, returns the compiled bytecode as a\n * `Uint8Array`.\n */\nconst compilerOperationHelperCompileScript = ({ targetScriptId, data, environment, }) => {\n const signingTarget = environment.scripts[targetScriptId];\n const compiledTarget = (0,_language_resolve__WEBPACK_IMPORTED_MODULE_2__.resolveScriptIdentifier)({\n data,\n environment,\n identifier: targetScriptId,\n });\n if (signingTarget === undefined || compiledTarget === false) {\n return false;\n }\n if (typeof compiledTarget === 'string') {\n return {\n error: compiledTarget,\n status: 'error',\n };\n }\n return compiledTarget.bytecode;\n};\n/**\n * Returns either the properly generated `coveredBytecode` or a\n * `CompilerOperationErrorFatal`.\n */\nconst compilerOperationHelperGenerateCoveredBytecode = ({ data, environment, identifier, sourceScriptIds, unlockingScripts, }) => {\n const currentScriptId = sourceScriptIds[sourceScriptIds.length - 1];\n if (currentScriptId === undefined) {\n return {\n error: `Identifier \"${identifier}\" requires a signing serialization, but \"coveredBytecode\" cannot be determined because the compilation environment's \"sourceScriptIds\" is empty.`,\n status: 'error',\n };\n }\n const targetLockingScriptId = unlockingScripts[currentScriptId];\n if (targetLockingScriptId === undefined) {\n return {\n error: `Identifier \"${identifier}\" requires a signing serialization, but \"coveredBytecode\" cannot be determined because \"${currentScriptId}\" is not present in the compilation environment \"unlockingScripts\".`,\n status: 'error',\n };\n }\n const result = compilerOperationHelperCompileScript({\n data,\n environment,\n targetScriptId: targetLockingScriptId,\n });\n if (result === false) {\n return {\n error: `Identifier \"${identifier}\" requires a signing serialization which covers an unknown locking script, \"${targetLockingScriptId}\".`,\n status: 'error',\n };\n }\n return result;\n};\n//# sourceMappingURL=compiler-operation-helpers.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/compiler-operation-helpers.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/compiler-operations.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/compiler-operations.js ***! + \****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ compilerOperationAddressData: () => (/* binding */ compilerOperationAddressData),\n/* harmony export */ compilerOperationCurrentBlockHeight: () => (/* binding */ compilerOperationCurrentBlockHeight),\n/* harmony export */ compilerOperationCurrentBlockTime: () => (/* binding */ compilerOperationCurrentBlockTime),\n/* harmony export */ compilerOperationHdKeyPublicKeyCommon: () => (/* binding */ compilerOperationHdKeyPublicKeyCommon),\n/* harmony export */ compilerOperationKeyPublicKeyCommon: () => (/* binding */ compilerOperationKeyPublicKeyCommon),\n/* harmony export */ compilerOperationSigningSerializationCorrespondingOutput: () => (/* binding */ compilerOperationSigningSerializationCorrespondingOutput),\n/* harmony export */ compilerOperationSigningSerializationCorrespondingOutputHash: () => (/* binding */ compilerOperationSigningSerializationCorrespondingOutputHash),\n/* harmony export */ compilerOperationSigningSerializationCoveredBytecode: () => (/* binding */ compilerOperationSigningSerializationCoveredBytecode),\n/* harmony export */ compilerOperationSigningSerializationCoveredBytecodeLength: () => (/* binding */ compilerOperationSigningSerializationCoveredBytecodeLength),\n/* harmony export */ compilerOperationSigningSerializationLocktime: () => (/* binding */ compilerOperationSigningSerializationLocktime),\n/* harmony export */ compilerOperationSigningSerializationOutpointIndex: () => (/* binding */ compilerOperationSigningSerializationOutpointIndex),\n/* harmony export */ compilerOperationSigningSerializationOutpointTransactionHash: () => (/* binding */ compilerOperationSigningSerializationOutpointTransactionHash),\n/* harmony export */ compilerOperationSigningSerializationOutputValue: () => (/* binding */ compilerOperationSigningSerializationOutputValue),\n/* harmony export */ compilerOperationSigningSerializationSequenceNumber: () => (/* binding */ compilerOperationSigningSerializationSequenceNumber),\n/* harmony export */ compilerOperationSigningSerializationTransactionOutpoints: () => (/* binding */ compilerOperationSigningSerializationTransactionOutpoints),\n/* harmony export */ compilerOperationSigningSerializationTransactionOutpointsHash: () => (/* binding */ compilerOperationSigningSerializationTransactionOutpointsHash),\n/* harmony export */ compilerOperationSigningSerializationTransactionOutputs: () => (/* binding */ compilerOperationSigningSerializationTransactionOutputs),\n/* harmony export */ compilerOperationSigningSerializationTransactionOutputsHash: () => (/* binding */ compilerOperationSigningSerializationTransactionOutputsHash),\n/* harmony export */ compilerOperationSigningSerializationTransactionSequenceNumbers: () => (/* binding */ compilerOperationSigningSerializationTransactionSequenceNumbers),\n/* harmony export */ compilerOperationSigningSerializationTransactionSequenceNumbersHash: () => (/* binding */ compilerOperationSigningSerializationTransactionSequenceNumbersHash),\n/* harmony export */ compilerOperationSigningSerializationVersion: () => (/* binding */ compilerOperationSigningSerializationVersion),\n/* harmony export */ compilerOperationWalletData: () => (/* binding */ compilerOperationWalletData),\n/* harmony export */ compilerOperationsCommon: () => (/* binding */ compilerOperationsCommon)\n/* harmony export */ });\n/* harmony import */ var _format_numbers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../format/numbers */ \"./node_modules/@bitauth/libauth/build/module/lib/format/numbers.js\");\n/* harmony import */ var _key_hd_key__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../key/hd-key */ \"./node_modules/@bitauth/libauth/build/module/lib/key/hd-key.js\");\n/* harmony import */ var _vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../vm/instruction-sets/instruction-sets */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n/* harmony import */ var _compiler_defaults__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./compiler-defaults */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-defaults.js\");\n/* harmony import */ var _compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compiler-operation-helpers */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-operation-helpers.js\");\n\n\n\n\n\nconst compilerOperationAddressData = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['bytecode'],\n environmentProperties: [],\n operation: (identifier, data) => {\n const { bytecode } = data;\n if (identifier in bytecode) {\n return { bytecode: bytecode[identifier], status: 'success' };\n }\n return {\n error: `Identifier \"${identifier}\" refers to an AddressData, but \"${identifier}\" was not provided in the CompilationData \"bytecode\".`,\n recoverable: true,\n status: 'error',\n };\n },\n});\nconst compilerOperationWalletData = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['bytecode'],\n environmentProperties: [],\n operation: (identifier, data) => {\n const { bytecode } = data;\n if (identifier in bytecode) {\n return { bytecode: bytecode[identifier], status: 'success' };\n }\n return {\n error: `Identifier \"${identifier}\" refers to a WalletData, but \"${identifier}\" was not provided in the CompilationData \"bytecode\".`,\n recoverable: true,\n status: 'error',\n };\n },\n});\nconst compilerOperationCurrentBlockTime = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['currentBlockTime'],\n environmentProperties: [],\n operation: (_, data) => {\n return {\n bytecode: (0,_format_numbers__WEBPACK_IMPORTED_MODULE_1__.numberToBinUint32LE)(data.currentBlockTime),\n status: 'success',\n };\n },\n});\nconst compilerOperationCurrentBlockHeight = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['currentBlockHeight'],\n environmentProperties: [],\n operation: (_, data) => ({\n bytecode: (0,_vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_2__.bigIntToScriptNumber)(BigInt(data.currentBlockHeight)),\n status: 'success',\n }),\n});\nconst compilerOperationSigningSerializationCorrespondingOutput = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: [],\n operation: (_, data) => data.transactionContext.correspondingOutput === undefined\n ? { bytecode: Uint8Array.of(), status: 'success' }\n : {\n bytecode: data.transactionContext.correspondingOutput,\n status: 'success',\n },\n});\nconst compilerOperationSigningSerializationCorrespondingOutputHash = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: ['sha256'],\n operation: (_, data, environment) => data.transactionContext.correspondingOutput === undefined\n ? { bytecode: Uint8Array.of(), status: 'success' }\n : {\n bytecode: environment.sha256.hash(environment.sha256.hash(data.transactionContext.correspondingOutput)),\n status: 'success',\n },\n});\nconst compilerOperationHelperSigningSerializationCoveredBytecode = (returnLength) => (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: ['sourceScriptIds', 'unlockingScripts'],\n operation: (identifier, data, environment) => {\n const { unlockingScripts, sourceScriptIds } = environment;\n const result = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHelperGenerateCoveredBytecode)({\n data,\n environment,\n identifier,\n sourceScriptIds,\n unlockingScripts,\n });\n if ('error' in result) {\n return result;\n }\n return {\n bytecode: returnLength\n ? (0,_format_numbers__WEBPACK_IMPORTED_MODULE_1__.bigIntToBitcoinVarInt)(BigInt(result.length))\n : result,\n status: 'success',\n };\n },\n});\nconst compilerOperationSigningSerializationCoveredBytecode = compilerOperationHelperSigningSerializationCoveredBytecode(false);\nconst compilerOperationSigningSerializationCoveredBytecodeLength = compilerOperationHelperSigningSerializationCoveredBytecode(true);\nconst compilerOperationSigningSerializationLocktime = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: [],\n operation: (_, data) => ({\n bytecode: (0,_format_numbers__WEBPACK_IMPORTED_MODULE_1__.numberToBinUint32LE)(data.transactionContext.locktime),\n status: 'success',\n }),\n});\nconst compilerOperationSigningSerializationOutpointIndex = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: [],\n operation: (_, data) => ({\n bytecode: (0,_format_numbers__WEBPACK_IMPORTED_MODULE_1__.numberToBinUint32LE)(data.transactionContext.outpointIndex),\n status: 'success',\n }),\n});\nconst compilerOperationSigningSerializationOutpointTransactionHash = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: [],\n operation: (_, data) => ({\n bytecode: data.transactionContext.outpointTransactionHash,\n status: 'success',\n }),\n});\nconst compilerOperationSigningSerializationOutputValue = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: [],\n operation: (_, data) => ({\n bytecode: data.transactionContext.outputValue,\n status: 'success',\n }),\n});\nconst compilerOperationSigningSerializationSequenceNumber = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: [],\n operation: (_, data) => ({\n bytecode: (0,_format_numbers__WEBPACK_IMPORTED_MODULE_1__.numberToBinUint32LE)(data.transactionContext.sequenceNumber),\n status: 'success',\n }),\n});\nconst compilerOperationSigningSerializationTransactionOutpoints = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: [],\n operation: (_, data) => ({\n bytecode: data.transactionContext.transactionOutpoints,\n status: 'success',\n }),\n});\nconst compilerOperationSigningSerializationTransactionOutpointsHash = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: ['sha256'],\n operation: (_, data, environment) => ({\n bytecode: environment.sha256.hash(environment.sha256.hash(data.transactionContext.transactionOutpoints)),\n status: 'success',\n }),\n});\nconst compilerOperationSigningSerializationTransactionOutputs = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: [],\n operation: (_, data) => ({\n bytecode: data.transactionContext.transactionOutputs,\n status: 'success',\n }),\n});\nconst compilerOperationSigningSerializationTransactionOutputsHash = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: ['sha256'],\n operation: (_, data, environment) => ({\n bytecode: environment.sha256.hash(environment.sha256.hash(data.transactionContext.transactionOutputs)),\n status: 'success',\n }),\n});\nconst compilerOperationSigningSerializationTransactionSequenceNumbers = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: [],\n operation: (_, data) => ({\n bytecode: data.transactionContext.transactionSequenceNumbers,\n status: 'success',\n }),\n});\nconst compilerOperationSigningSerializationTransactionSequenceNumbersHash = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: ['sha256'],\n operation: (_, data, environment) => ({\n bytecode: environment.sha256.hash(environment.sha256.hash(data.transactionContext.transactionSequenceNumbers)),\n status: 'success',\n }),\n});\nconst compilerOperationSigningSerializationVersion = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['transactionContext'],\n environmentProperties: [],\n operation: (_, data) => ({\n bytecode: (0,_format_numbers__WEBPACK_IMPORTED_MODULE_1__.numberToBinUint32LE)(data.transactionContext.version),\n status: 'success',\n }),\n});\nconst compilerOperationKeyPublicKeyCommon = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.attemptCompilerOperations)([_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationAttemptBytecodeResolution], (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['keys'],\n environmentProperties: ['secp256k1'],\n operation: (identifier, data, environment) => {\n const { keys } = data;\n const { secp256k1 } = environment;\n const { privateKeys } = keys;\n const [variableId] = identifier.split('.');\n if (privateKeys !== undefined &&\n privateKeys[variableId] !== undefined) {\n return {\n bytecode: secp256k1.derivePublicKeyCompressed(privateKeys[variableId]),\n status: 'success',\n };\n }\n return {\n error: `Identifier \"${identifier}\" refers to a public key, but no public or private keys for \"${variableId}\" were provided in the compilation data.`,\n recoverable: true,\n status: 'error',\n };\n },\n}));\nconst compilerOperationHdKeyPublicKeyCommon = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.attemptCompilerOperations)([_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationAttemptBytecodeResolution], (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationRequires)({\n canBeSkipped: false,\n dataProperties: ['hdKeys'],\n environmentProperties: [\n 'entityOwnership',\n 'ripemd160',\n 'secp256k1',\n 'sha256',\n 'sha512',\n 'variables',\n ],\n operation: \n // eslint-disable-next-line complexity\n (identifier, data, environment) => {\n var _a, _b, _c;\n const { hdKeys } = data;\n const { hdPrivateKeys, addressIndex, hdPublicKeys } = hdKeys;\n const [variableId] = identifier.split('.');\n const entityId = environment.entityOwnership[variableId];\n if (entityId === undefined) {\n return (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHelperUnknownEntity)(identifier, variableId);\n }\n if (addressIndex === undefined) {\n return (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHelperAddressIndex)(identifier);\n }\n const entityHdPrivateKey = hdPrivateKeys === undefined ? undefined : hdPrivateKeys[entityId];\n /**\n * Guaranteed to be an `HdKey` if this method is reached in the compiler.\n */\n const hdKey = environment.variables[variableId];\n if (entityHdPrivateKey !== undefined) {\n const privateResult = (0,_compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHelperDeriveHdPrivateNode)({\n addressIndex,\n entityHdPrivateKey,\n entityId,\n environment,\n hdKey,\n identifier,\n });\n if (privateResult.status === 'error')\n return privateResult;\n return {\n bytecode: environment.secp256k1.derivePublicKeyCompressed(privateResult.bytecode),\n status: 'success',\n };\n }\n const entityHdPublicKey = hdPublicKeys === undefined ? undefined : hdPublicKeys[entityId];\n if (entityHdPublicKey === undefined) {\n return {\n error: `Identifier \"${identifier}\" refers to an HdKey owned by \"${entityId}\", but an HD private key or HD public key for this entity was not provided in the compilation data.`,\n recoverable: true,\n status: 'error',\n };\n }\n const addressOffset = (_a = hdKey.addressOffset) !== null && _a !== void 0 ? _a : _compiler_defaults__WEBPACK_IMPORTED_MODULE_3__.CompilerDefaults.hdKeyAddressOffset;\n const privateDerivationPath = (_b = hdKey.privateDerivationPath) !== null && _b !== void 0 ? _b : _compiler_defaults__WEBPACK_IMPORTED_MODULE_3__.CompilerDefaults.hdKeyPrivateDerivationPath;\n const publicDerivationPath = (_c = hdKey.publicDerivationPath) !== null && _c !== void 0 ? _c : privateDerivationPath.replace('m', 'M');\n const validPublicPathWithIndex = /^M(?:\\/(?:[0-9]+|i))*$/u;\n if (!validPublicPathWithIndex.test(publicDerivationPath)) {\n return {\n error: `Could not generate ${identifier} – the path \"${publicDerivationPath}\" is not a valid \"publicDerivationPath\".`,\n status: 'error',\n };\n }\n const i = addressIndex + addressOffset;\n const instancePath = publicDerivationPath.replace('i', i.toString());\n const masterContents = (0,_key_hd_key__WEBPACK_IMPORTED_MODULE_4__.decodeHdPublicKey)(environment, entityHdPublicKey);\n if (typeof masterContents === 'string') {\n return {\n error: `Could not generate \"${identifier}\" – the HD public key provided for \"${entityId}\" could not be decoded: ${masterContents}`,\n status: 'error',\n };\n }\n const instanceNode = (0,_key_hd_key__WEBPACK_IMPORTED_MODULE_4__.deriveHdPath)(environment, masterContents.node, instancePath);\n if (typeof instanceNode === 'string') {\n return {\n error: `Could not generate \"${identifier}\" – the path \"${instancePath}\" could not be derived for entity \"${entityId}\": ${instanceNode}`,\n status: 'error',\n };\n }\n return { bytecode: instanceNode.publicKey, status: 'success' };\n },\n}));\n/* eslint-disable camelcase, @typescript-eslint/naming-convention */\nconst compilerOperationsCommon = {\n addressData: compilerOperationAddressData,\n currentBlockHeight: compilerOperationCurrentBlockHeight,\n currentBlockTime: compilerOperationCurrentBlockTime,\n hdKey: {\n public_key: compilerOperationHdKeyPublicKeyCommon,\n },\n key: {\n public_key: compilerOperationKeyPublicKeyCommon,\n },\n signingSerialization: {\n corresponding_output: compilerOperationSigningSerializationCorrespondingOutput,\n corresponding_output_hash: compilerOperationSigningSerializationCorrespondingOutputHash,\n covered_bytecode: compilerOperationSigningSerializationCoveredBytecode,\n covered_bytecode_length: compilerOperationSigningSerializationCoveredBytecodeLength,\n locktime: compilerOperationSigningSerializationLocktime,\n outpoint_index: compilerOperationSigningSerializationOutpointIndex,\n outpoint_transaction_hash: compilerOperationSigningSerializationOutpointTransactionHash,\n output_value: compilerOperationSigningSerializationOutputValue,\n sequence_number: compilerOperationSigningSerializationSequenceNumber,\n transaction_outpoints: compilerOperationSigningSerializationTransactionOutpoints,\n transaction_outpoints_hash: compilerOperationSigningSerializationTransactionOutpointsHash,\n transaction_outputs: compilerOperationSigningSerializationTransactionOutputs,\n transaction_outputs_hash: compilerOperationSigningSerializationTransactionOutputsHash,\n transaction_sequence_numbers: compilerOperationSigningSerializationTransactionSequenceNumbers,\n transaction_sequence_numbers_hash: compilerOperationSigningSerializationTransactionSequenceNumbersHash,\n version: compilerOperationSigningSerializationVersion,\n },\n walletData: compilerOperationWalletData,\n};\n/* eslint-enable camelcase, @typescript-eslint/naming-convention */\n//# sourceMappingURL=compiler-operations.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/compiler-operations.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/compiler-types.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/compiler-types.js ***! + \***********************************************************************************/ +/***/ (() => { + +eval("//# sourceMappingURL=compiler-types.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/compiler-types.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/compiler.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/compiler.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ authenticationTemplateToCompilationEnvironment: () => (/* binding */ authenticationTemplateToCompilationEnvironment),\n/* harmony export */ authenticationTemplateToCompilationEnvironmentVirtualizedTests: () => (/* binding */ authenticationTemplateToCompilationEnvironmentVirtualizedTests),\n/* harmony export */ createAuthenticationProgramEvaluationCommon: () => (/* binding */ createAuthenticationProgramEvaluationCommon),\n/* harmony export */ createCompiler: () => (/* binding */ createCompiler),\n/* harmony export */ createCompilerCommonSynchronous: () => (/* binding */ createCompilerCommonSynchronous)\n/* harmony export */ });\n/* harmony import */ var _vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../vm/instruction-sets/instruction-sets */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-utils.js\");\n/* harmony import */ var _vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../vm/instruction-sets/instruction-sets */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js\");\n/* harmony import */ var _compiler_defaults__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./compiler-defaults */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-defaults.js\");\n/* harmony import */ var _compiler_operations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./compiler-operations */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-operations.js\");\n/* harmony import */ var _language_compile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./language/compile */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/compile.js\");\n/* harmony import */ var _scenarios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scenarios */ \"./node_modules/@bitauth/libauth/build/module/lib/template/scenarios.js\");\n\n\n\n\n\n/**\n * Create a `Compiler` from the provided compilation environment. This method\n * requires a full `CompilationEnvironment` and does not instantiate any new\n * crypto or VM implementations.\n *\n * @param compilationEnvironment - the environment from which to create the\n * compiler\n */\nconst createCompiler = (compilationEnvironment) => ({\n environment: compilationEnvironment,\n generateBytecode: (scriptId, data, debug = false) => {\n const result = (0,_language_compile__WEBPACK_IMPORTED_MODULE_0__.compileScript)(scriptId, data, compilationEnvironment);\n return (debug\n ? result\n : result.success\n ? { bytecode: result.bytecode, success: true }\n : {\n errorType: result.errorType,\n errors: result.errors,\n success: false,\n });\n },\n generateScenario: ({ unlockingScriptId, scenarioId }) => (0,_scenarios__WEBPACK_IMPORTED_MODULE_1__.generateScenarioCommon)({\n environment: compilationEnvironment,\n scenarioId,\n unlockingScriptId,\n }),\n});\nconst nullHashLength = 32;\n/**\n * A common `createAuthenticationProgram` implementation for most compilers.\n *\n * Accepts the compiled contents of an evaluation and produces a\n * `AuthenticationProgramCommon` which can be evaluated to produce the resulting\n * program state.\n *\n * The precise shape of the authentication program produced by this method is\n * critical to the determinism of BTL evaluations for the compiler in which it\n * is used, it therefore must be standardized between compiler implementations.\n *\n * @param evaluationBytecode - the compiled bytecode to incorporate in the\n * created authentication program\n */\nconst createAuthenticationProgramEvaluationCommon = (evaluationBytecode) => ({\n inputIndex: 0,\n sourceOutput: {\n lockingBytecode: evaluationBytecode,\n satoshis: Uint8Array.from([0, 0, 0, 0, 0, 0, 0, 0]),\n },\n spendingTransaction: {\n inputs: [\n {\n outpointIndex: 0,\n outpointTransactionHash: new Uint8Array(nullHashLength),\n sequenceNumber: 0,\n unlockingBytecode: Uint8Array.of(),\n },\n ],\n locktime: 0,\n outputs: [\n {\n lockingBytecode: Uint8Array.of(),\n satoshis: Uint8Array.from([0, 0, 0, 0, 0, 0, 0, 0]),\n },\n ],\n version: 0,\n },\n});\n/**\n * Synchronously create a compiler using the default common environment. Because\n * this compiler has no access to Secp256k1, Sha256, or a VM, it cannot compile\n * evaluations or operations which require key derivation or hashing.\n *\n * @param scriptsAndOverrides - a compilation environment from which properties\n * will be used to override properties of the default common compilation\n * environment – must include the `scripts` property\n */\nconst createCompilerCommonSynchronous = (scriptsAndOverrides) => {\n return createCompiler({\n ...{\n createAuthenticationProgram: createAuthenticationProgramEvaluationCommon,\n opcodes: (0,_vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_2__.generateBytecodeMap)(_vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon),\n operations: _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationsCommon,\n },\n ...scriptsAndOverrides,\n });\n};\n/**\n * Create a partial `CompilationEnvironment` from an `AuthenticationTemplate` by\n * extracting and formatting the `scripts` and `variables` properties.\n *\n * Note, if this `AuthenticationTemplate` might be malformed, first validate it\n * with `validateAuthenticationTemplate`.\n *\n * @param template - the `AuthenticationTemplate` from which to extract the\n * compilation environment\n */\nconst authenticationTemplateToCompilationEnvironment = (template) => {\n const scripts = Object.entries(template.scripts).reduce((all, [id, def]) => ({ ...all, [id]: def.script }), {});\n const variables = Object.values(template.entities).reduce((all, entity) => ({ ...all, ...entity.variables }), {});\n const entityOwnership = Object.entries(template.entities).reduce((all, [entityId, entity]) => {\n var _a;\n return ({\n ...all,\n ...Object.keys((_a = entity.variables) !== null && _a !== void 0 ? _a : {}).reduce((entityVariables, variableId) => ({\n ...entityVariables,\n [variableId]: entityId,\n }), {}),\n });\n }, {});\n const unlockingScripts = Object.entries(template.scripts).reduce((all, [id, def]) => 'unlocks' in def && def.unlocks !== undefined\n ? { ...all, [id]: def.unlocks }\n : all, {});\n const unlockingScriptTimeLockTypes = Object.entries(template.scripts).reduce((all, [id, def]) => 'timeLockType' in def && def.timeLockType !== undefined\n ? { ...all, [id]: def.timeLockType }\n : all, {});\n const lockingScriptTypes = Object.entries(template.scripts).reduce((all, [id, def]) => 'lockingType' in def &&\n def.lockingType !== undefined\n ? { ...all, [id]: def.lockingType }\n : all, {});\n const scenarios = template.scenarios === undefined\n ? undefined\n : Object.entries(template.scenarios).reduce((all, [id, def]) => ({ ...all, [id]: def }), {});\n return {\n entityOwnership,\n lockingScriptTypes,\n ...(scenarios === undefined ? {} : { scenarios }),\n scripts,\n unlockingScriptTimeLockTypes,\n unlockingScripts,\n variables,\n };\n};\n/**\n * Create a partial `CompilationEnvironment` from an `AuthenticationTemplate`,\n * virtualizing all script tests as unlocking and locking script pairs.\n *\n * @param template - the authentication template from which to extract the\n * compilation environment\n */\nconst authenticationTemplateToCompilationEnvironmentVirtualizedTests = (template) => {\n const virtualizedScripts = Object.entries(template.scripts).reduce((all, [scriptId, script]) => {\n if ('tests' in script) {\n return {\n ...all,\n ...script.tests.reduce((tests, test, index) => {\n var _a;\n const pushTestedScript = script.pushed === true;\n const checkScriptId = `${_compiler_defaults__WEBPACK_IMPORTED_MODULE_5__.CompilerDefaults.virtualizedTestCheckScriptPrefix}${scriptId}_${index}`;\n const virtualizedLockingScriptId = `${_compiler_defaults__WEBPACK_IMPORTED_MODULE_5__.CompilerDefaults.virtualizedTestLockingScriptPrefix}${scriptId}_${index}`;\n const virtualizedUnlockingScriptId = `${_compiler_defaults__WEBPACK_IMPORTED_MODULE_5__.CompilerDefaults.virtualizedTestUnlockingScriptPrefix}${scriptId}_${index}`;\n return {\n ...tests,\n [checkScriptId]: { script: test.check },\n [virtualizedLockingScriptId]: {\n script: pushTestedScript\n ? `<${scriptId}> ${checkScriptId}`\n : `${scriptId} ${checkScriptId}`,\n },\n [virtualizedUnlockingScriptId]: {\n script: (_a = test.setup) !== null && _a !== void 0 ? _a : '',\n unlocks: virtualizedLockingScriptId,\n },\n };\n }, {}),\n };\n }\n return all;\n }, {});\n const templateWithVirtualizedTests = {\n ...template,\n scripts: {\n ...template.scripts,\n ...virtualizedScripts,\n },\n };\n return authenticationTemplateToCompilationEnvironment(templateWithVirtualizedTests);\n};\n//# sourceMappingURL=compiler.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/compiler.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/language/compile.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/language/compile.js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ compileScript: () => (/* binding */ compileScript),\n/* harmony export */ compileScriptContents: () => (/* binding */ compileScriptContents),\n/* harmony export */ compileScriptP2shLocking: () => (/* binding */ compileScriptP2shLocking),\n/* harmony export */ compileScriptP2shUnlocking: () => (/* binding */ compileScriptP2shUnlocking),\n/* harmony export */ compileScriptRaw: () => (/* binding */ compileScriptRaw),\n/* harmony export */ describeExpectedInput: () => (/* binding */ describeExpectedInput)\n/* harmony export */ });\n/* harmony import */ var _compiler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../compiler */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler.js\");\n/* harmony import */ var _language_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./language-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/language-utils.js\");\n/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/parse.js\");\n/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reduce */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/reduce.js\");\n/* harmony import */ var _resolve__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resolve */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/resolve.js\");\n\n\n\n\n\n/**\n * A text-formatting method to pretty-print the list of expected inputs\n * (`Encountered unexpected input while parsing script. Expected ...`). If\n * present, the `EOF` expectation is always moved to the end of the list.\n * @param expectedArray - the alphabetized list of expected inputs produced by\n * `parseScript`\n */\nconst describeExpectedInput = (expectedArray) => {\n /**\n * The constant used by the parser to denote the end of the input\n */\n const EOF = 'EOF';\n const newArray = expectedArray.filter((value) => value !== EOF);\n // eslint-disable-next-line functional/no-conditional-statement\n if (newArray.length !== expectedArray.length) {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n newArray.push('the end of the script');\n }\n const withoutLastElement = newArray.slice(0, newArray.length - 1);\n const lastElement = newArray[newArray.length - 1];\n const arrayRequiresCommas = 3;\n const arrayRequiresOr = 2;\n return `Encountered unexpected input while parsing script. Expected ${newArray.length >= arrayRequiresCommas\n ? withoutLastElement.join(', ').concat(`, or ${lastElement}`)\n : newArray.length === arrayRequiresOr\n ? newArray.join(' or ')\n : lastElement}.`;\n};\n/**\n * This method is generally for internal use. The `compileScript` method is the\n * recommended API for direct compilation.\n */\nconst compileScriptContents = ({ data, environment, script, }) => {\n const parseResult = (0,_parse__WEBPACK_IMPORTED_MODULE_0__.parseScript)(script);\n if (!parseResult.status) {\n return {\n errorType: 'parse',\n errors: [\n {\n error: describeExpectedInput(parseResult.expected),\n range: {\n endColumn: parseResult.index.column,\n endLineNumber: parseResult.index.line,\n startColumn: parseResult.index.column,\n startLineNumber: parseResult.index.line,\n },\n },\n ],\n success: false,\n };\n }\n const resolver = (0,_resolve__WEBPACK_IMPORTED_MODULE_1__.createIdentifierResolver)({ data, environment });\n const resolvedScript = (0,_resolve__WEBPACK_IMPORTED_MODULE_1__.resolveScriptSegment)(parseResult.value, resolver);\n const resolutionErrors = (0,_language_utils__WEBPACK_IMPORTED_MODULE_2__.getResolutionErrors)(resolvedScript);\n if (resolutionErrors.length !== 0) {\n return {\n errorType: 'resolve',\n errors: resolutionErrors,\n parse: parseResult.value,\n resolve: resolvedScript,\n success: false,\n };\n }\n const reduction = (0,_reduce__WEBPACK_IMPORTED_MODULE_3__.reduceScript)(resolvedScript, environment.vm, environment.createAuthenticationProgram);\n return {\n ...(reduction.errors === undefined\n ? { bytecode: reduction.bytecode, success: true }\n : { errorType: 'reduce', errors: reduction.errors, success: false }),\n parse: parseResult.value,\n reduce: reduction,\n resolve: resolvedScript,\n };\n};\nconst emptyRange = () => ({\n endColumn: 0,\n endLineNumber: 0,\n startColumn: 0,\n startLineNumber: 0,\n});\n/**\n * This method is generally for internal use. The `compileScript` method is the\n * recommended API for direct compilation.\n */\nconst compileScriptRaw = ({ data, environment, scriptId, }) => {\n var _a;\n const script = environment.scripts[scriptId];\n if (script === undefined) {\n return {\n errorType: 'parse',\n errors: [\n {\n error: `No script with an ID of \"${scriptId}\" was provided in the compilation environment.`,\n range: emptyRange(),\n },\n ],\n success: false,\n };\n }\n if (((_a = environment.sourceScriptIds) === null || _a === void 0 ? void 0 : _a.includes(scriptId)) === true) {\n return {\n errorType: 'parse',\n errors: [\n {\n error: `A circular dependency was encountered: script \"${scriptId}\" relies on itself to be generated. (Source scripts: ${environment.sourceScriptIds.join(' → ')})`,\n range: emptyRange(),\n },\n ],\n success: false,\n };\n }\n const sourceScriptIds = environment.sourceScriptIds === undefined\n ? [scriptId]\n : [...environment.sourceScriptIds, scriptId];\n return compileScriptContents({\n data,\n environment: { ...environment, sourceScriptIds },\n script,\n });\n};\nconst compileScriptP2shLocking = ({ lockingBytecode, vm, }) => {\n const compiler = (0,_compiler__WEBPACK_IMPORTED_MODULE_4__.createCompilerCommonSynchronous)({\n scripts: {\n p2shLocking: 'OP_HASH160 <$( OP_HASH160)> OP_EQUAL',\n },\n variables: { lockingBytecode: { type: 'AddressData' } },\n vm,\n });\n return compiler.generateBytecode('p2shLocking', {\n bytecode: { lockingBytecode },\n });\n};\nconst compileScriptP2shUnlocking = ({ lockingBytecode, unlockingBytecode, }) => {\n const compiler = (0,_compiler__WEBPACK_IMPORTED_MODULE_4__.createCompilerCommonSynchronous)({\n scripts: {\n p2shUnlocking: 'unlockingBytecode ',\n },\n variables: {\n lockingBytecode: { type: 'AddressData' },\n unlockingBytecode: { type: 'AddressData' },\n },\n });\n return compiler.generateBytecode('p2shUnlocking', {\n bytecode: { lockingBytecode, unlockingBytecode },\n });\n};\n/**\n * Parse, resolve, and reduce the selected script using the provided `data` and\n * `environment`.\n *\n * Note, locktime validation only occurs if `transactionContext` is provided in\n * the environment.\n */\n// eslint-disable-next-line complexity\nconst compileScript = (scriptId, data, environment) => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const locktimeDisablingSequenceNumber = 0xffffffff;\n const lockTimeTypeBecomesTimestamp = 500000000;\n if (((_a = data.transactionContext) === null || _a === void 0 ? void 0 : _a.locktime) !== undefined) {\n if (((_b = environment.unlockingScriptTimeLockTypes) === null || _b === void 0 ? void 0 : _b[scriptId]) === 'height' &&\n data.transactionContext.locktime >= lockTimeTypeBecomesTimestamp) {\n return {\n errorType: 'parse',\n errors: [\n {\n error: `The script \"${scriptId}\" requires a height-based locktime (less than 500,000,000), but this transaction uses a timestamp-based locktime (\"${data.transactionContext.locktime}\").`,\n range: emptyRange(),\n },\n ],\n success: false,\n };\n }\n if (((_c = environment.unlockingScriptTimeLockTypes) === null || _c === void 0 ? void 0 : _c[scriptId]) === 'timestamp' &&\n data.transactionContext.locktime < lockTimeTypeBecomesTimestamp) {\n return {\n errorType: 'parse',\n errors: [\n {\n error: `The script \"${scriptId}\" requires a timestamp-based locktime (greater than or equal to 500,000,000), but this transaction uses a height-based locktime (\"${data.transactionContext.locktime}\").`,\n range: emptyRange(),\n },\n ],\n success: false,\n };\n }\n }\n if (((_d = data.transactionContext) === null || _d === void 0 ? void 0 : _d.sequenceNumber) !== undefined &&\n ((_e = environment.unlockingScriptTimeLockTypes) === null || _e === void 0 ? void 0 : _e[scriptId]) !== undefined &&\n data.transactionContext.sequenceNumber === locktimeDisablingSequenceNumber) {\n return {\n errorType: 'parse',\n errors: [\n {\n error: `The script \"${scriptId}\" requires a locktime, but this input's sequence number is set to disable transaction locktime (0xffffffff). This will cause the OP_CHECKLOCKTIMEVERIFY operation to error when the transaction is verified. To be valid, this input must use a sequence number which does not disable locktime.`,\n range: emptyRange(),\n },\n ],\n success: false,\n };\n }\n const rawResult = compileScriptRaw({\n data,\n environment,\n scriptId,\n });\n if (!rawResult.success) {\n return rawResult;\n }\n const unlocks = (_f = environment.unlockingScripts) === null || _f === void 0 ? void 0 : _f[scriptId];\n const unlockingScriptType = unlocks === undefined\n ? undefined\n : (_g = environment.lockingScriptTypes) === null || _g === void 0 ? void 0 : _g[unlocks];\n const isP2shUnlockingScript = unlockingScriptType === 'p2sh';\n const lockingScriptType = (_h = environment.lockingScriptTypes) === null || _h === void 0 ? void 0 : _h[scriptId];\n const isP2shLockingScript = lockingScriptType === 'p2sh';\n if (isP2shLockingScript) {\n const transformedResult = compileScriptP2shLocking({\n lockingBytecode: rawResult.bytecode,\n vm: environment.vm,\n });\n if (!transformedResult.success) {\n return transformedResult;\n }\n return {\n ...rawResult,\n bytecode: transformedResult.bytecode,\n transformed: 'p2sh-locking',\n };\n }\n if (isP2shUnlockingScript) {\n const lockingBytecodeResult = compileScriptRaw({\n data,\n environment,\n scriptId: unlocks,\n });\n if (!lockingBytecodeResult.success) {\n return lockingBytecodeResult;\n }\n const transformedResult = compileScriptP2shUnlocking({\n lockingBytecode: lockingBytecodeResult.bytecode,\n unlockingBytecode: rawResult.bytecode,\n });\n return {\n ...rawResult,\n bytecode: transformedResult.bytecode,\n transformed: 'p2sh-unlocking',\n };\n }\n return rawResult;\n};\n//# sourceMappingURL=compile.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/language/compile.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/language/language-types.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/language/language-types.js ***! + \********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IdentifierResolutionErrorType: () => (/* binding */ IdentifierResolutionErrorType),\n/* harmony export */ IdentifierResolutionType: () => (/* binding */ IdentifierResolutionType)\n/* harmony export */ });\nvar IdentifierResolutionType;\n(function (IdentifierResolutionType) {\n IdentifierResolutionType[\"opcode\"] = \"opcode\";\n IdentifierResolutionType[\"variable\"] = \"variable\";\n IdentifierResolutionType[\"script\"] = \"script\";\n})(IdentifierResolutionType || (IdentifierResolutionType = {}));\nvar IdentifierResolutionErrorType;\n(function (IdentifierResolutionErrorType) {\n IdentifierResolutionErrorType[\"unknown\"] = \"unknown\";\n IdentifierResolutionErrorType[\"variable\"] = \"variable\";\n IdentifierResolutionErrorType[\"script\"] = \"script\";\n})(IdentifierResolutionErrorType || (IdentifierResolutionErrorType = {}));\n//# sourceMappingURL=language-types.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/language/language-types.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/language/language-utils.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/language/language-utils.js ***! + \********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ allErrorsAreRecoverable: () => (/* binding */ allErrorsAreRecoverable),\n/* harmony export */ compileBtl: () => (/* binding */ compileBtl),\n/* harmony export */ containsRange: () => (/* binding */ containsRange),\n/* harmony export */ extractBytecodeResolutions: () => (/* binding */ extractBytecodeResolutions),\n/* harmony export */ extractEvaluationSamples: () => (/* binding */ extractEvaluationSamples),\n/* harmony export */ extractEvaluationSamplesRecursive: () => (/* binding */ extractEvaluationSamplesRecursive),\n/* harmony export */ extractResolvedVariableBytecodeMap: () => (/* binding */ extractResolvedVariableBytecodeMap),\n/* harmony export */ extractUnexecutedRanges: () => (/* binding */ extractUnexecutedRanges),\n/* harmony export */ getResolutionErrors: () => (/* binding */ getResolutionErrors),\n/* harmony export */ mergeRanges: () => (/* binding */ mergeRanges),\n/* harmony export */ stringifyErrors: () => (/* binding */ stringifyErrors)\n/* harmony export */ });\n/* harmony import */ var _format_hex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../format/hex */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _vm_instruction_sets_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../vm/instruction-sets/instruction-sets-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-utils.js\");\n/* harmony import */ var _compiler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../compiler */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler.js\");\n\n\n\nconst pluckStartPosition = (range) => ({\n startColumn: range.startColumn,\n startLineNumber: range.startLineNumber,\n});\nconst pluckEndPosition = (range) => ({\n endColumn: range.endColumn,\n endLineNumber: range.endLineNumber,\n});\n/**\n * Combine an array of `Range`s into a single larger `Range`.\n *\n * @param ranges - an array of `Range`s\n * @param parentRange - the range to assume if `ranges` is an empty array\n */\nconst mergeRanges = (ranges, parentRange = {\n endColumn: 0,\n endLineNumber: 0,\n startColumn: 0,\n startLineNumber: 0,\n}) => {\n const minimumRangesToMerge = 2;\n const unsortedMerged = ranges.length < minimumRangesToMerge\n ? ranges.length === 1\n ? ranges[0]\n : parentRange\n : ranges.reduce(\n // eslint-disable-next-line complexity\n (merged, range) => ({\n ...(range.endLineNumber > merged.endLineNumber\n ? pluckEndPosition(range)\n : range.endLineNumber === merged.endLineNumber &&\n range.endColumn > merged.endColumn\n ? pluckEndPosition(range)\n : pluckEndPosition(merged)),\n ...(range.startLineNumber < merged.startLineNumber\n ? pluckStartPosition(range)\n : range.startLineNumber === merged.startLineNumber &&\n range.startColumn < merged.startColumn\n ? pluckStartPosition(range)\n : pluckStartPosition(merged)),\n }), ranges[0]);\n return {\n ...pluckEndPosition(unsortedMerged),\n ...pluckStartPosition(unsortedMerged),\n };\n};\n/**\n * Returns true if the `outerRange` fully contains the `innerRange`, otherwise,\n * `false`.\n *\n * @param outerRange - the bounds of the outer range\n * @param innerRange - the inner range to test\n * @param exclusive - disallow the `innerRange` from overlapping the\n * `outerRange` (such that the outer start and end columns may not be equal) –\n * defaults to `true`\n */\n// eslint-disable-next-line complexity\nconst containsRange = (outerRange, innerRange, exclusive = true) => {\n const startsAfter = outerRange.startLineNumber < innerRange.startLineNumber\n ? true\n : outerRange.startLineNumber === innerRange.startLineNumber\n ? exclusive\n ? outerRange.startColumn < innerRange.startColumn\n : outerRange.startColumn <= innerRange.startColumn\n : false;\n const endsBefore = outerRange.endLineNumber > innerRange.endLineNumber\n ? true\n : outerRange.endLineNumber === innerRange.endLineNumber\n ? exclusive\n ? outerRange.endColumn > innerRange.endColumn\n : outerRange.endColumn >= innerRange.endColumn\n : false;\n return startsAfter && endsBefore;\n};\n/**\n * Perform a simplified compilation on a Bitauth Templating Language (BTL)\n * script containing only hex literals, bigint literals, UTF8 literals, and push\n * statements. Scripts may not contain variables/operations, evaluations, or\n * opcode identifiers (use hex literals instead).\n *\n * This is useful for accepting complex user input in advanced interfaces,\n * especially for `AddressData` and `WalletData`.\n *\n * Returns the compiled bytecode as a `Uint8Array`, or throws an error message.\n *\n * @param script - a simple BTL script containing no variables or evaluations\n */\nconst compileBtl = (script) => {\n const result = (0,_compiler__WEBPACK_IMPORTED_MODULE_0__.createCompilerCommonSynchronous)({\n scripts: { script },\n }).generateBytecode('script', {});\n if (result.success) {\n return result.bytecode;\n }\n return `BTL compilation error:${result.errors.reduce((all, { error, range }) => `${all} [${range.startLineNumber}, ${range.startColumn}]: ${error}`, '')}`;\n};\n/**\n * Extract a list of the errors which occurred while resolving a script.\n *\n * @param resolvedScript - the result of `resolveScript` from which to extract\n * errors\n */\nconst getResolutionErrors = (resolvedScript) => resolvedScript.reduce((errors, segment) => {\n switch (segment.type) {\n case 'error':\n return [\n ...errors,\n {\n error: segment.value,\n ...(segment.missingIdentifier === undefined\n ? {}\n : {\n missingIdentifier: segment.missingIdentifier,\n owningEntity: segment.owningEntity,\n }),\n range: segment.range,\n },\n ];\n case 'push':\n case 'evaluation':\n return [...errors, ...getResolutionErrors(segment.value)];\n default:\n return errors;\n }\n}, []);\n/**\n * Verify that every error in the provided array can be resolved by providing\n * additional variables in the compilation data (rather than deeper issues, like\n * problems with the authentication template or wallet implementation).\n *\n * Note, errors are only recoverable if the \"entity ownership\" of each missing\n * identifier is known (specified in `CompilationData`'s `entityOwnership`).\n *\n * @param errors - an array of compilation errors\n */\nconst allErrorsAreRecoverable = (errors) => errors.every((error) => 'missingIdentifier' in error && 'owningEntity' in error);\n/**\n * Get an array of all resolutions used in a `ResolvedScript`.\n * @param resolvedScript - the resolved script to search\n */\nconst extractBytecodeResolutions = (resolvedScript) => \n// eslint-disable-next-line complexity\nresolvedScript.reduce((all, segment) => {\n switch (segment.type) {\n case 'push':\n case 'evaluation':\n return [...all, ...extractBytecodeResolutions(segment.value)];\n case 'bytecode':\n if ('variable' in segment) {\n return [\n ...all,\n {\n bytecode: segment.value,\n text: segment.variable,\n type: 'variable',\n },\n ];\n }\n if ('script' in segment) {\n return [\n ...all,\n ...extractBytecodeResolutions(segment.source),\n {\n bytecode: segment.value,\n text: segment.script,\n type: 'script',\n },\n ];\n }\n if ('opcode' in segment) {\n return [\n ...all,\n {\n bytecode: segment.value,\n text: segment.opcode,\n type: 'opcode',\n },\n ];\n }\n return [\n ...all,\n {\n bytecode: segment.value,\n text: segment.literal,\n type: segment.literalType,\n },\n ];\n default:\n return all;\n }\n}, []);\n/**\n * Extract an object mapping the variable identifiers used in a `ResolvedScript`\n * to their resolved bytecode.\n *\n * @param resolvedScript - the resolved script to search\n */\nconst extractResolvedVariableBytecodeMap = (resolvedScript) => extractBytecodeResolutions(resolvedScript).reduce((all, resolution) => resolution.type === 'variable'\n ? { ...all, [resolution.text]: resolution.bytecode }\n : all, {});\n/**\n * Format a list of `CompilationError`s into a single string, with an error\n * start position following each error. E.g. for line 1, column 2:\n * `The error message. [1, 2]`\n *\n * Errors are separated with the `separator`, which defaults to `; `, e.g.:\n * `The first error message. [1, 2]; The second error message. [3, 4]`\n *\n * @param errors - an array of compilation errors\n * @param separator - the characters with which to join the formatted errors.\n */\nconst stringifyErrors = (errors, separator = '; ') => {\n return `${errors\n .map((error) => `[${error.range.startLineNumber}, ${error.range.startColumn}] ${error.error}`)\n .join(separator)}`;\n};\n/**\n * Extract a set of \"evaluation samples\" from the result of a BTL compilation\n * and a matching debug trace (from `vm.debug`), pairing program states with the\n * source ranges which produced them – like a \"source map\" for complete\n * evaluations. This is useful for omniscient debuggers like Bitauth IDE.\n *\n * Returns an array of samples and an array of unmatched program states\n * remaining if `nodes` doesn't contain enough instructions to consume all\n * program states provided in `trace`. Returned samples are ordered by the\n * ending position (line and column) of their range.\n *\n * If all program states are consumed before the available nodes are exhausted,\n * the remaining nodes are ignored (the produced samples end at the last\n * instruction for which a program state exists). This usually occurs when an\n * error halts evaluation before the end of the script. (Note: if this occurs,\n * the final trace state will not be used, as it is expected to be the\n * duplicated final result produced by `vm.debug`, and should not be matched\n * with the next instruction. The returned `unmatchedStates` will have a length\n * of `0`.)\n *\n * This method allows for samples to be extracted from a single evaluation;\n * most applications should use `extractEvaluationSamplesRecursive` instead.\n *\n * @remarks\n * This method incrementally concatenates the reduced bytecode from each node,\n * parsing the result into evaluation samples.\n *\n * Each node can contain only a portion of an instruction (like a long push\n * operation), or it can contain multiple instructions (like a long hex literal\n * representing a string of bytecode or an evaluation which is not wrapped by a\n * push).\n *\n * If a node contains only a portion of an instruction, the bytecode from\n * additional nodes are concatenated (and ranges merged) until an instruction\n * can be created. If any bytecode remains after a sample has been created, the\n * next sample begins in the same range. (For this reason, it's possible that\n * samples overlap.)\n *\n * If a node contains more than one instruction, the intermediate states\n * produced before the final state for that sample are saved to the sample's\n * `intermediateStates` array.\n *\n * If the program states in `trace` are exhausted before the final instruction\n * in a sample (usually caused by an evaluation error), the last instruction\n * with a matching program state is used for the sample (with its program\n * state), and the unmatched instructions are ignored. (This allows the \"last\n * known state\" to be displayed for the sample which caused evaluation to halt.)\n *\n * ---\n *\n * For example, the following script demonstrates many of these cases:\n *\n * `0x00 0x01 0xab01 0xcd9300 $(OP_3 <0x00> OP_SWAP OP_CAT) 0x010203`\n *\n * Which compiles to `0x0001ab01cd93000003010203`, disassembled:\n *\n * `OP_0 OP_PUSHBYTES_1 0xab OP_PUSHBYTES_1 0xcd OP_ADD OP_0 OP_0 OP_PUSHBYTES_3 0x010203`\n *\n * In the script, there are 6 top-level nodes (identified below within `[]`):\n *\n * `[0x00] [0x01] [0xab01] [0xcd9300] [$(OP_3 <0x00> OP_SWAP OP_CAT)] [0x010203]`\n *\n * These nodes together encode 7 instructions, some within a single node, and\n * some split between several nodes. Below we substitute the evaluation for its\n * result `0x0003` to group instructions by `[]`:\n *\n * `[0x00] [0x01 0xab][01 0xcd][93][00] [0x00][03 0x010203]`\n *\n * The \"resolution\" of samples is limited to the range of single nodes: nodes\n * cannot always be introspected to determine where contained instructions begin\n * and end. For example, it is ambiguous which portions of the evaluation are\n * responsible for the initial `0x00` and which are responsible for the `0x03`.\n *\n * For this reason, the range of each sample is limited to the range(s) of one\n * or more adjacent nodes. Samples may overlap in the range of a node which is\n * responsible for both ending a previous sample and beginning a new sample.\n * (Though, only 2 samples can overlap. If a node is responsible for more than 2\n * instructions, the second sample includes `internalStates` for instructions\n * which occur before the end of the second sample.)\n *\n * In this case, there are 6 samples identified below within `[]`, where each\n * `[` is closed by the closest following `]` (no nesting):\n *\n * `[0x00] [0x01 [0xab01] [0xcd9300]] [[$(OP_3 <0x00> OP_SWAP OP_CAT)] 0x010203]`\n *\n * The ranges for each sample (in terms of nodes) are as follows:\n * - Sample 1: node 1\n * - Sample 2: node 2 + node 3\n * - Sample 3: node 3 + node 4\n * - Sample 4: node 4\n * - Sample 5: node 5\n * - Sample 6: node 5 + node 6\n *\n * Note that the following samples overlap:\n * - Sample 2 and Sample 3\n * - Sample 3 and Sample 4\n * - Sample 5 and Sample 6\n *\n * Finally, note that Sample 4 will have one internal state produced by the\n * `OP_ADD` instruction. Sample 4 then ends with the `OP_0` (`0x00`) instruction\n * at the end of the `0xcd9300` node.\n *\n * ---\n *\n * Note, this implementation relies on the expectation that `trace` begins with\n * the initial program state, contains a single program state per instruction,\n * and ends with the final program state (as produced by `vm.debug`). It also\n * expects the `bytecode` provided by nodes to be parsable by `parseBytecode`.\n *\n * @param evaluationRange - the range of the script node which was evaluated to\n * produce the `trace`\n * @param nodes - an array of reduced nodes to parse\n * @param trace - the `vm.debug` result to map to these nodes\n */\n// eslint-disable-next-line complexity\nconst extractEvaluationSamples = ({ evaluationRange, nodes, trace, }) => {\n const traceWithoutFinalState = trace.length > 1 ? trace.slice(0, -1) : trace.slice();\n if (traceWithoutFinalState.length === 0) {\n return {\n samples: [],\n unmatchedStates: [],\n };\n }\n const samples = [\n {\n evaluationRange,\n internalStates: [],\n range: {\n endColumn: evaluationRange.startColumn,\n endLineNumber: evaluationRange.startLineNumber,\n startColumn: evaluationRange.startColumn,\n startLineNumber: evaluationRange.startLineNumber,\n },\n state: traceWithoutFinalState[0],\n },\n ];\n // eslint-disable-next-line functional/no-let\n let nextState = 1;\n // eslint-disable-next-line functional/no-let\n let nextNode = 0;\n // eslint-disable-next-line functional/no-let, @typescript-eslint/init-declarations\n let incomplete;\n // eslint-disable-next-line functional/no-loop-statement\n while (nextState < traceWithoutFinalState.length && nextNode < nodes.length) {\n const currentNode = nodes[nextNode];\n const { mergedBytecode, mergedRange } = incomplete === undefined\n ? {\n mergedBytecode: currentNode.bytecode,\n mergedRange: currentNode.range,\n }\n : {\n mergedBytecode: (0,_format_hex__WEBPACK_IMPORTED_MODULE_1__.flattenBinArray)([\n incomplete.bytecode,\n currentNode.bytecode,\n ]),\n mergedRange: mergeRanges([incomplete.range, currentNode.range]),\n };\n const parsed = (0,_vm_instruction_sets_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_2__.parseBytecode)(mergedBytecode);\n const hasNonMalformedInstructions = parsed.length !== 0 && !('malformed' in parsed[0]);\n if (hasNonMalformedInstructions) {\n const lastInstruction = parsed[parsed.length - 1];\n const validInstructions = ((0,_vm_instruction_sets_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_2__.authenticationInstructionIsMalformed)(lastInstruction)\n ? parsed.slice(0, parsed.length - 1)\n : parsed);\n const firstUnmatchedStateIndex = nextState + validInstructions.length;\n const matchingStates = traceWithoutFinalState.slice(nextState, firstUnmatchedStateIndex);\n const pairedStates = validInstructions.map((instruction, index) => ({\n instruction,\n state: matchingStates[index],\n }));\n /**\n * Guaranteed to have a defined `state` (or the loop would have exited).\n */\n const firstPairedState = pairedStates[0];\n const closesCurrentlyOpenSample = incomplete !== undefined;\n // eslint-disable-next-line functional/no-conditional-statement\n if (closesCurrentlyOpenSample) {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n samples.push({\n evaluationRange,\n instruction: firstPairedState.instruction,\n internalStates: [],\n range: mergedRange,\n state: firstPairedState.state,\n });\n }\n const firstUndefinedStateIndex = pairedStates.findIndex(({ state }) => state === undefined);\n const sampleHasError = firstUndefinedStateIndex !== -1;\n const sampleClosingIndex = sampleHasError\n ? firstUndefinedStateIndex - 1\n : pairedStates.length - 1;\n const closesASecondSample = !closesCurrentlyOpenSample || sampleClosingIndex > 0;\n // eslint-disable-next-line functional/no-conditional-statement\n if (closesASecondSample) {\n const finalState = pairedStates[sampleClosingIndex];\n const secondSamplePairsBegin = closesCurrentlyOpenSample ? 1 : 0;\n const internalStates = pairedStates.slice(secondSamplePairsBegin, sampleClosingIndex);\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n samples.push({\n evaluationRange,\n instruction: finalState.instruction,\n internalStates,\n range: currentNode.range,\n state: finalState.state,\n });\n }\n // eslint-disable-next-line functional/no-expression-statement\n nextState = firstUnmatchedStateIndex;\n // eslint-disable-next-line functional/no-conditional-statement\n if ((0,_vm_instruction_sets_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_2__.authenticationInstructionIsMalformed)(lastInstruction)) {\n // eslint-disable-next-line functional/no-expression-statement\n incomplete = {\n bytecode: (0,_vm_instruction_sets_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_2__.serializeParsedAuthenticationInstructionMalformed)(lastInstruction),\n range: currentNode.range,\n };\n // eslint-disable-next-line functional/no-conditional-statement\n }\n else {\n // eslint-disable-next-line functional/no-expression-statement\n incomplete = undefined;\n }\n // eslint-disable-next-line functional/no-conditional-statement\n }\n else {\n const lastInstruction = parsed[parsed.length - 1];\n // eslint-disable-next-line functional/no-expression-statement\n incomplete =\n lastInstruction === undefined\n ? undefined\n : {\n bytecode: (0,_vm_instruction_sets_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_2__.serializeParsedAuthenticationInstructionMalformed)(lastInstruction),\n range: mergedRange,\n };\n }\n // eslint-disable-next-line functional/no-expression-statement\n nextNode += 1;\n }\n /**\n * Because we ran out of `trace` states before all `nodes` were matched, we\n * know an error occurred which halted evaluation. This error is indicated in\n * the result by returning an empty array of `unmatchedStates`. Successful\n * evaluations will always return at least one unmatched state: the final\n * \"evaluation result\" state produced by `vm.debug`.\n */\n const errorOccurred = nextNode < nodes.length;\n const unmatchedStates = errorOccurred\n ? []\n : trace.slice(nextState);\n return {\n samples,\n unmatchedStates,\n };\n};\n/**\n * Similar to `extractEvaluationSamples`, but recursively extracts samples from\n * evaluations within the provided array of nodes.\n *\n * Because BTL evaluations are fully self-contained, there should never be\n * unmatched states from evaluations within a script reduction trace tree. (For\n * this reason, this method does not return the `unmatchedStates` from nested\n * evaluations.)\n *\n * Returned samples are ordered by the ending position (line and column) of\n * their range. Samples from BTL evaluations which occur within an outer\n * evaluation appear before their parent sample (which uses their result).\n *\n * @param evaluationRange - the range of the script node which was evaluated to\n * produce the `trace`\n * @param nodes - an array of reduced nodes to parse\n * @param trace - the `vm.debug` result to map to these nodes\n */\nconst extractEvaluationSamplesRecursive = ({ evaluationRange, nodes, trace, }) => {\n const extractEvaluations = (node, depth = 1) => {\n if ('push' in node) {\n return node.push.script.reduce((all, childNode) => [...all, ...extractEvaluations(childNode, depth)], []);\n }\n if ('source' in node) {\n const childSamples = node.source.script.reduce((all, childNode) => [\n ...all,\n ...extractEvaluations(childNode, depth + 1),\n ], []);\n const traceWithoutUnlockingPhase = node.trace.slice(1);\n const evaluationBeginToken = '$(';\n const evaluationEndToken = ')';\n const extracted = extractEvaluationSamples({\n evaluationRange: {\n endColumn: node.range.endColumn - evaluationEndToken.length,\n endLineNumber: node.range.endLineNumber,\n startColumn: node.range.startColumn + evaluationBeginToken.length,\n startLineNumber: node.range.startLineNumber,\n },\n nodes: node.source.script,\n trace: traceWithoutUnlockingPhase,\n });\n return [...extracted.samples, ...childSamples];\n }\n return [];\n };\n const { samples, unmatchedStates } = extractEvaluationSamples({\n evaluationRange,\n nodes,\n trace,\n });\n const childSamples = nodes.reduce((all, node) => [...all, ...extractEvaluations(node)], []);\n const endingOrderedSamples = [...samples, ...childSamples].sort((a, b) => {\n const linesOrdered = a.range.endLineNumber - b.range.endLineNumber;\n return linesOrdered === 0\n ? a.range.endColumn - b.range.endColumn\n : linesOrdered;\n });\n return {\n samples: endingOrderedSamples,\n unmatchedStates,\n };\n};\nconst stateIsExecuting = (state) => state.executionStack.every((item) => item);\n/**\n * Extract an array of ranges which were unused by an evaluation. This is useful\n * in development tooling for fading out or hiding code which is unimportant to\n * the current evaluation being tested.\n *\n * @remarks\n * Only ranges which are guaranteed to be unimportant to an evaluation are\n * returned by this method. These ranges are extracted from samples which:\n * - are preceded by a sample which ends with execution disabled (e.g. an\n * unsuccessful `OP_IF`)\n * - end with execution disabled, and\n * - contain no `internalStates` which enable execution.\n *\n * Note, internal states which temporarily re-enable and then disable execution\n * again can still have an effect on the parent evaluation, so this method\n * conservatively excludes such samples. For example, the hex literal\n * `0x675167`, which encodes `OP_ELSE OP_1 OP_ELSE`, could begin and end with\n * states in which execution is disabled, yet a `1` is pushed to the stack\n * during the sample's evaluation. (Samples like this are unusual, and can\n * almost always be reformatted to clearly separate the executed and unexecuted\n * instructions.)\n *\n * @param samples - an array of samples ordered by the ending position (line and\n * column) of their range.\n * @param evaluationBegins - the line and column at which the initial sample's\n * evaluation range begins (where the preceding state is assumed to be\n * executing), defaults to `1,1`\n */\nconst extractUnexecutedRanges = (samples, evaluationBegins = '1,1') => {\n const reduced = samples.reduce((all, sample) => {\n const { precedingStateSkipsByEvaluation, unexecutedRanges } = all;\n const currentEvaluationStartLineAndColumn = `${sample.evaluationRange.startLineNumber},${sample.evaluationRange.startColumn}`;\n const precedingStateSkips = precedingStateSkipsByEvaluation[currentEvaluationStartLineAndColumn];\n const endsWithSkip = !stateIsExecuting(sample.state);\n const sampleHasNoExecutedInstructions = endsWithSkip &&\n sample.internalStates.every((group) => !stateIsExecuting(group.state));\n if (precedingStateSkips && sampleHasNoExecutedInstructions) {\n return {\n precedingStateSkipsByEvaluation: {\n ...precedingStateSkipsByEvaluation,\n [currentEvaluationStartLineAndColumn]: true,\n },\n unexecutedRanges: [...unexecutedRanges, sample.range],\n };\n }\n return {\n precedingStateSkipsByEvaluation: {\n ...precedingStateSkipsByEvaluation,\n [currentEvaluationStartLineAndColumn]: endsWithSkip,\n },\n unexecutedRanges,\n };\n }, {\n precedingStateSkipsByEvaluation: {\n [evaluationBegins]: false,\n },\n unexecutedRanges: [],\n });\n const canHaveContainedRanges = 2;\n const containedRangesExcluded = reduced.unexecutedRanges.length < canHaveContainedRanges\n ? reduced.unexecutedRanges\n : reduced.unexecutedRanges.slice(0, -1).reduceRight((all, range) => {\n if (containsRange(all[0], range)) {\n return all;\n }\n return [range, ...all];\n }, [reduced.unexecutedRanges[reduced.unexecutedRanges.length - 1]]);\n return containedRangesExcluded;\n};\n//# sourceMappingURL=language-utils.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/language/language-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/language/language.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/language/language.js ***! + \**************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BuiltInVariables: () => (/* reexport safe */ _resolve__WEBPACK_IMPORTED_MODULE_5__.BuiltInVariables),\n/* harmony export */ IdentifierResolutionErrorType: () => (/* reexport safe */ _language_types__WEBPACK_IMPORTED_MODULE_2__.IdentifierResolutionErrorType),\n/* harmony export */ IdentifierResolutionType: () => (/* reexport safe */ _language_types__WEBPACK_IMPORTED_MODULE_2__.IdentifierResolutionType),\n/* harmony export */ allErrorsAreRecoverable: () => (/* reexport safe */ _language_utils__WEBPACK_IMPORTED_MODULE_1__.allErrorsAreRecoverable),\n/* harmony export */ compileBtl: () => (/* reexport safe */ _language_utils__WEBPACK_IMPORTED_MODULE_1__.compileBtl),\n/* harmony export */ compileScript: () => (/* reexport safe */ _compile__WEBPACK_IMPORTED_MODULE_0__.compileScript),\n/* harmony export */ compileScriptContents: () => (/* reexport safe */ _compile__WEBPACK_IMPORTED_MODULE_0__.compileScriptContents),\n/* harmony export */ compileScriptP2shLocking: () => (/* reexport safe */ _compile__WEBPACK_IMPORTED_MODULE_0__.compileScriptP2shLocking),\n/* harmony export */ compileScriptP2shUnlocking: () => (/* reexport safe */ _compile__WEBPACK_IMPORTED_MODULE_0__.compileScriptP2shUnlocking),\n/* harmony export */ compileScriptRaw: () => (/* reexport safe */ _compile__WEBPACK_IMPORTED_MODULE_0__.compileScriptRaw),\n/* harmony export */ containsRange: () => (/* reexport safe */ _language_utils__WEBPACK_IMPORTED_MODULE_1__.containsRange),\n/* harmony export */ createIdentifierResolver: () => (/* reexport safe */ _resolve__WEBPACK_IMPORTED_MODULE_5__.createIdentifierResolver),\n/* harmony export */ describeExpectedInput: () => (/* reexport safe */ _compile__WEBPACK_IMPORTED_MODULE_0__.describeExpectedInput),\n/* harmony export */ extractBytecodeResolutions: () => (/* reexport safe */ _language_utils__WEBPACK_IMPORTED_MODULE_1__.extractBytecodeResolutions),\n/* harmony export */ extractEvaluationSamples: () => (/* reexport safe */ _language_utils__WEBPACK_IMPORTED_MODULE_1__.extractEvaluationSamples),\n/* harmony export */ extractEvaluationSamplesRecursive: () => (/* reexport safe */ _language_utils__WEBPACK_IMPORTED_MODULE_1__.extractEvaluationSamplesRecursive),\n/* harmony export */ extractResolvedVariableBytecodeMap: () => (/* reexport safe */ _language_utils__WEBPACK_IMPORTED_MODULE_1__.extractResolvedVariableBytecodeMap),\n/* harmony export */ extractUnexecutedRanges: () => (/* reexport safe */ _language_utils__WEBPACK_IMPORTED_MODULE_1__.extractUnexecutedRanges),\n/* harmony export */ getResolutionErrors: () => (/* reexport safe */ _language_utils__WEBPACK_IMPORTED_MODULE_1__.getResolutionErrors),\n/* harmony export */ mergeRanges: () => (/* reexport safe */ _language_utils__WEBPACK_IMPORTED_MODULE_1__.mergeRanges),\n/* harmony export */ parseScript: () => (/* reexport safe */ _parse__WEBPACK_IMPORTED_MODULE_3__.parseScript),\n/* harmony export */ reduceScript: () => (/* reexport safe */ _reduce__WEBPACK_IMPORTED_MODULE_4__.reduceScript),\n/* harmony export */ resolveScriptIdentifier: () => (/* reexport safe */ _resolve__WEBPACK_IMPORTED_MODULE_5__.resolveScriptIdentifier),\n/* harmony export */ resolveScriptSegment: () => (/* reexport safe */ _resolve__WEBPACK_IMPORTED_MODULE_5__.resolveScriptSegment),\n/* harmony export */ resolveVariableIdentifier: () => (/* reexport safe */ _resolve__WEBPACK_IMPORTED_MODULE_5__.resolveVariableIdentifier),\n/* harmony export */ stringifyErrors: () => (/* reexport safe */ _language_utils__WEBPACK_IMPORTED_MODULE_1__.stringifyErrors),\n/* harmony export */ verifyBtlEvaluationState: () => (/* reexport safe */ _reduce__WEBPACK_IMPORTED_MODULE_4__.verifyBtlEvaluationState)\n/* harmony export */ });\n/* harmony import */ var _compile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compile */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/compile.js\");\n/* harmony import */ var _language_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./language-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/language-utils.js\");\n/* harmony import */ var _language_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./language-types */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/language-types.js\");\n/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parse */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/parse.js\");\n/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./reduce */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/reduce.js\");\n/* harmony import */ var _resolve__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./resolve */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/resolve.js\");\n\n\n\n\n\n\n//# sourceMappingURL=language.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/language/language.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/language/parse.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/language/parse.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ parseScript: () => (/* binding */ parseScript)\n/* harmony export */ });\n/* harmony import */ var _parsimmon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parsimmon */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/parsimmon.js\");\n\n/* eslint-disable sort-keys, @typescript-eslint/naming-convention, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */\nconst authenticationScriptParser = _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.createLanguage({\n script: (r) => _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.seqMap(_parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.optWhitespace, r.expression.sepBy(_parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.optWhitespace), _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.optWhitespace, (_, expressions) => expressions).node('Script'),\n expression: (r) => _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.alt(r.comment, r.push, r.evaluation, r.utf8, r.binary, r.hex, r.bigint, r.identifier),\n comment: (r) => _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.alt(r.singleLineComment, r.multiLineComment).node('Comment'),\n singleLineComment: () => _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.seqMap(_parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.string('//').desc(\"the start of a single-line comment ('//')\"), _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.regexp(/[^\\n]*/u), (__, comment) => comment.trim()),\n multiLineComment: () => _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.seqMap(_parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.string('/*').desc(\"the start of a multi-line comment ('/*')\"), _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.regexp(/[\\s\\S]*?\\*\\//u).desc(\"the end of this multi-line comment ('*/')\"), (__, comment) => comment.slice(0, -'*/'.length).trim()),\n push: (r) => _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.seqMap(_parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.string('<').desc(\"the start of a push statement ('<')\"), r.script, _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.string('>').desc(\"the end of this push statement ('>')\"), (_, push) => push).node('Push'),\n evaluation: (r) => _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.seqMap(_parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.string('$').desc(\"the start of an evaluation ('$')\"), _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.string('(').desc(\"the opening parenthesis of this evaluation ('(')\"), r.script, _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.string(')').desc(\"the closing parenthesis of this evaluation (')')\"), (_, __, evaluation) => evaluation).node('Evaluation'),\n identifier: () => _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.regexp(/[a-zA-Z_][.a-zA-Z0-9_-]*/u)\n .desc('a valid identifier')\n .node('Identifier'),\n utf8: () => _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.alt(_parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.seqMap(_parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.string('\"').desc('a double quote (\")'), _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.regexp(/[^\"]*/u), _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.string('\"').desc('a closing double quote (\")'), (__, literal) => literal), _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.seqMap(_parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.string(\"'\").desc(\"a single quote (')\"), _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.regexp(/[^']*/u), _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.string(\"'\").desc(\"a closing single quote (')\"), (__, literal) => literal)).node('UTF8Literal'),\n hex: () => _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.seqMap(_parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.string('0x').desc(\"a hex literal ('0x...')\"), _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.regexp(/[0-9a-f]_*(?:_*[0-9a-f]_*[0-9a-f]_*)*[0-9a-f]/iu).desc('a valid hexadecimal string'), (__, literal) => literal).node('HexLiteral'),\n binary: () => _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.seqMap(_parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.string('0b').desc(\"a binary literal ('0b...')\"), _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.regexp(/[01]+(?:[01_]*[01]+)*/iu).desc('a string of binary digits'), (__, literal) => literal).node('BinaryLiteral'),\n bigint: () => _parsimmon__WEBPACK_IMPORTED_MODULE_0__.P.regexp(/-?[0-9]+(?:[0-9_]*[0-9]+)*/u)\n .desc('an integer literal')\n .node('BigIntLiteral'),\n});\n/* eslint-enable sort-keys, @typescript-eslint/naming-convention, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */\nconst parseScript = (script) => authenticationScriptParser.script.parse(script);\n//# sourceMappingURL=parse.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/language/parse.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/language/parsimmon.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/language/parsimmon.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ P: () => (/* binding */ P)\n/* harmony export */ });\n/**\n * This file is derived from https://github.com/jneen/parsimmon and\n * https://github.com/DefinitelyTyped/DefinitelyTyped.\n */\n/* eslint-disable prefer-destructuring, @typescript-eslint/unified-signatures, functional/no-method-signature, functional/no-throw-statement, functional/no-conditional-statement, @typescript-eslint/no-this-alias, consistent-this, @typescript-eslint/ban-ts-comment, prefer-spread, @typescript-eslint/restrict-template-expressions, func-names, @typescript-eslint/init-declarations, new-cap, @typescript-eslint/require-array-sort-compare, guard-for-in, no-plusplus, functional/no-let, functional/no-loop-statement, @typescript-eslint/prefer-for-of, @typescript-eslint/restrict-plus-operands, functional/immutable-data, @typescript-eslint/no-use-before-define, @typescript-eslint/strict-boolean-expressions, no-param-reassign, functional/no-expression-statement, functional/no-this-expression, @typescript-eslint/no-explicit-any, func-style, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return, @typescript-eslint/naming-convention, @typescript-eslint/method-signature-style */\n// cspell: ignore accum\nfunction Parsimmon(action) {\n // @ts-expect-error\n if (!(this instanceof Parsimmon)) {\n // @ts-expect-error\n return new Parsimmon(action);\n }\n // @ts-expect-error\n this._ = action;\n}\nconst _ = Parsimmon.prototype;\n// -*- Helpers -*-\nfunction makeSuccess(index, value) {\n return {\n expected: [],\n furthest: -1,\n index,\n status: true,\n value,\n };\n}\nfunction makeFailure(index, expected) {\n expected = [expected];\n return {\n expected,\n furthest: index,\n index: -1,\n status: false,\n value: null,\n };\n}\nfunction mergeReplies(result, last) {\n if (!last) {\n return result;\n }\n if (result.furthest > last.furthest) {\n return result;\n }\n const expected = result.furthest === last.furthest\n ? union(result.expected, last.expected)\n : last.expected;\n return {\n expected,\n furthest: last.furthest,\n index: result.index,\n status: result.status,\n value: result.value,\n };\n}\nfunction makeLineColumnIndex(input, i) {\n const lines = input.slice(0, i).split('\\n');\n /*\n * Note that unlike the character offset, the line and column offsets are\n * 1-based.\n */\n const lineWeAreUpTo = lines.length;\n const columnWeAreUpTo = lines[lines.length - 1].length + 1;\n return {\n column: columnWeAreUpTo,\n line: lineWeAreUpTo,\n offset: i,\n };\n}\n// Returns the sorted set union of two arrays of strings\nfunction union(xs, ys) {\n const obj = {};\n for (let i = 0; i < xs.length; i++) {\n // @ts-expect-error\n obj[xs[i]] = true;\n }\n for (let j = 0; j < ys.length; j++) {\n // @ts-expect-error\n obj[ys[j]] = true;\n }\n const keys = [];\n for (const k in obj) {\n keys.push(k);\n }\n keys.sort();\n return keys;\n}\n// -*- Error Formatting -*-\nfunction flags(re) {\n const s = String(re);\n return s.slice(s.lastIndexOf('/') + 1);\n}\nfunction anchoredRegexp(re) {\n return RegExp(`^(?:${re.source})`, flags(re));\n}\n// -*- Combinators -*-\nfunction seq(...params) {\n const parsers = [].slice.call(params);\n const numParsers = parsers.length;\n return Parsimmon(function (input, i) {\n let result;\n const accum = new Array(numParsers);\n for (let j = 0; j < numParsers; j += 1) {\n result = mergeReplies(parsers[j]._(input, i), result);\n if (!result.status) {\n return result;\n }\n accum[j] = result.value;\n i = result.index;\n }\n return mergeReplies(makeSuccess(i, accum), result);\n });\n}\nfunction seqMap(...params) {\n const args = [].slice.call(params);\n const mapper = args.pop();\n return seq.apply(null, args).map(function (results) {\n // @ts-expect-error\n return mapper.apply(null, results);\n });\n}\nfunction createLanguage(parsers) {\n const language = {};\n for (const key in parsers) {\n (function (rule) {\n const func = function () {\n // @ts-expect-error\n return parsers[rule](language);\n };\n // @ts-expect-error\n language[rule] = lazy(func);\n })(key);\n }\n return language;\n}\nfunction alt(...params) {\n const parsers = [].slice.call(params);\n return Parsimmon(function (input, i) {\n let result;\n for (let j = 0; j < parsers.length; j += 1) {\n result = mergeReplies(parsers[j]._(input, i), result);\n if (result.status) {\n return result;\n }\n }\n return result;\n });\n}\nfunction sepBy(parser, separator) {\n return sepBy1(parser, separator).or(succeed([]));\n}\nfunction sepBy1(parser, separator) {\n const pairs = separator.then(parser).many();\n return seqMap(parser, pairs, function (r, rs) {\n return [r].concat(rs);\n });\n}\n// -*- Core Parsing Methods -*-\n_.parse = function (input) {\n const result = this.skip(eof)._(input, 0);\n if (result.status) {\n return {\n status: true,\n value: result.value,\n };\n }\n return {\n expected: result.expected,\n index: makeLineColumnIndex(input, result.furthest),\n status: false,\n };\n};\n// -*- Other Methods -*-\n_.or = function (alternative) {\n return alt(this, alternative);\n};\n_.then = function (next) {\n return seq(this, next).map(function (results) {\n return results[1];\n });\n};\n_.many = function () {\n const self = this;\n return Parsimmon(function (input, i) {\n const accum = [];\n let result;\n for (;;) {\n result = mergeReplies(self._(input, i), result);\n if (result.status) {\n /* istanbul ignore if */ if (i === result.index) {\n throw new Error('infinite loop detected in .many() parser --- calling .many() on ' +\n 'a parser which can accept zero characters is usually the cause');\n }\n i = result.index;\n accum.push(result.value);\n }\n else {\n return mergeReplies(makeSuccess(i, accum), result);\n }\n }\n });\n};\n_.map = function (fn) {\n const self = this;\n return Parsimmon(function (input, i) {\n const result = self._(input, i);\n if (!result.status) {\n return result;\n }\n return mergeReplies(makeSuccess(result.index, fn(result.value)), result);\n });\n};\n_.skip = function (next) {\n return seq(this, next).map(function (results) {\n return results[0];\n });\n};\n_.node = function (name) {\n return seqMap(index, this, index, function (start, value, end) {\n return {\n end,\n name,\n start,\n value,\n };\n });\n};\n_.sepBy = function (separator) {\n return sepBy(this, separator);\n};\n_.desc = function (expected) {\n expected = [expected];\n const self = this;\n return Parsimmon(function (input, i) {\n const reply = self._(input, i);\n if (!reply.status) {\n reply.expected = expected;\n }\n return reply;\n });\n};\n// -*- Constructors -*-\nfunction string(str) {\n const expected = `'${str}'`;\n return Parsimmon(function (input, i) {\n const j = i + str.length;\n const head = input.slice(i, j);\n if (head === str) {\n return makeSuccess(j, head);\n }\n return makeFailure(i, expected);\n });\n}\nfunction regexp(re, group = 0) {\n const anchored = anchoredRegexp(re);\n const expected = String(re);\n return Parsimmon(function (input, i) {\n const match = anchored.exec(input.slice(i));\n if (match) {\n const fullMatch = match[0];\n const groupMatch = match[group];\n return makeSuccess(i + fullMatch.length, groupMatch);\n }\n return makeFailure(i, expected);\n });\n}\nfunction succeed(value) {\n return Parsimmon(function (__, i) {\n return makeSuccess(i, value);\n });\n}\nfunction lazy(f) {\n const parser = Parsimmon(function (input, i) {\n parser._ = f()._;\n return parser._(input, i);\n });\n return parser;\n}\n// -*- Base Parsers -*-\nconst index = Parsimmon(function (input, i) {\n return makeSuccess(i, makeLineColumnIndex(input, i));\n});\nconst eof = Parsimmon(function (input, i) {\n if (i < input.length) {\n return makeFailure(i, 'EOF');\n }\n return makeSuccess(i, null);\n});\nconst optWhitespace = regexp(/\\s*/u).desc('optional whitespace');\nconst whitespace = regexp(/\\s+/u).desc('whitespace');\nconst P = {\n alt,\n createLanguage,\n index,\n lazy,\n makeFailure,\n makeSuccess,\n of: succeed,\n optWhitespace,\n regexp,\n sepBy,\n sepBy1,\n seq,\n seqMap,\n string,\n succeed,\n whitespace,\n};\n//# sourceMappingURL=parsimmon.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/language/parsimmon.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/language/reduce.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/language/reduce.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ reduceScript: () => (/* binding */ reduceScript),\n/* harmony export */ verifyBtlEvaluationState: () => (/* binding */ verifyBtlEvaluationState)\n/* harmony export */ });\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vm/instruction-sets/instruction-sets */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js\");\n/* harmony import */ var _vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../vm/instruction-sets/instruction-sets */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/push.js\");\n/* harmony import */ var _language_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./language-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/language-utils.js\");\n\n\n\nconst emptyReductionTraceNode = (range) => ({\n bytecode: Uint8Array.of(),\n range,\n});\n/**\n * Perform the standard verification of BTL evaluation results. This ensures\n * that evaluations complete as expected: if an error occurs while computing an\n * evaluation, script compilation should fail.\n *\n * Three requirements are enforced:\n * - the evaluation may not produce an `error`\n * - the resulting stack must contain exactly 1 item\n * - the resulting execution stack must be empty (no missing `OP_ENDIF`s)\n *\n * This differs from the virtual machine's built-in `vm.verify` in that it is\n * often more lenient, for example, evaluations can succeed with an non-truthy\n * value on top of the stack.\n *\n * @param state - the final program state to verify\n */\nconst verifyBtlEvaluationState = (state) => {\n if (state.error !== undefined) {\n return state.error;\n }\n if (state.executionStack.length !== 0) {\n return _vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.nonEmptyExecutionStack;\n }\n if (state.stack.length !== 1) {\n return _vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.requiresCleanStack;\n }\n return true;\n};\n/**\n * Reduce a resolved script, returning the resulting bytecode and a trace of the\n * reduction process.\n *\n * This method will return an error if provided a `resolvedScript` with\n * resolution errors. To check for resolution errors, use `getResolutionErrors`.\n *\n * @param resolvedScript - the `CompiledScript` to reduce\n * @param vm - the `AuthenticationVirtualMachine` to use for evaluations\n * @param createEvaluationProgram - a method which accepts the compiled bytecode\n * of an evaluation and returns the authentication program used to evaluate it\n */\nconst reduceScript = (resolvedScript, vm, createEvaluationProgram) => {\n const script = resolvedScript.map((segment) => {\n switch (segment.type) {\n case 'bytecode':\n return { bytecode: segment.value, range: segment.range };\n case 'push': {\n const push = reduceScript(segment.value, vm, createEvaluationProgram);\n const bytecode = (0,_vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_1__.encodeDataPush)(push.bytecode);\n return {\n bytecode,\n ...(push.errors === undefined ? undefined : { errors: push.errors }),\n push,\n range: segment.range,\n };\n }\n case 'evaluation': {\n if (typeof vm === 'undefined' ||\n typeof createEvaluationProgram === 'undefined') {\n return {\n errors: [\n {\n error: 'Both a VM and a createState method are required to reduce evaluations.',\n range: segment.range,\n },\n ],\n ...emptyReductionTraceNode(segment.range),\n };\n }\n const reductionTrace = reduceScript(segment.value, vm, createEvaluationProgram);\n if (reductionTrace.errors !== undefined) {\n return {\n ...emptyReductionTraceNode(segment.range),\n errors: reductionTrace.errors,\n source: reductionTrace,\n trace: [],\n };\n }\n const trace = vm.debug(createEvaluationProgram(reductionTrace.bytecode));\n /**\n * `vm.debug` should always return at least one state.\n */\n const lastState = trace[trace.length - 1];\n const result = verifyBtlEvaluationState(lastState);\n const bytecode = lastState.stack[lastState.stack.length - 1];\n return {\n ...(typeof result === 'string'\n ? {\n bytecode: Uint8Array.of(),\n errors: [\n {\n error: `Failed to reduce evaluation: ${result}`,\n range: segment.range,\n },\n ],\n }\n : {\n bytecode,\n }),\n range: segment.range,\n source: reductionTrace,\n trace,\n };\n }\n case 'comment':\n return emptyReductionTraceNode(segment.range);\n case 'error':\n return {\n errors: [\n {\n error: `Tried to reduce a BTL script with resolution errors: ${segment.value}`,\n range: segment.range,\n },\n ],\n ...emptyReductionTraceNode(segment.range),\n };\n // eslint-disable-next-line functional/no-conditional-statement\n default:\n // eslint-disable-next-line functional/no-throw-statement, @typescript-eslint/no-throw-literal, no-throw-literal\n throw new Error(`\"${segment.type}\" is not a known segment type.`);\n }\n });\n const reduction = script.reduce((all, segment) => ({\n bytecode: [...all.bytecode, segment.bytecode],\n ranges: [...all.ranges, segment.range],\n ...(all.errors !== undefined || segment.errors !== undefined\n ? {\n errors: [\n ...(all.errors === undefined ? [] : all.errors),\n ...(segment.errors === undefined ? [] : segment.errors),\n ],\n }\n : undefined),\n }), { bytecode: [], ranges: [] });\n return {\n ...(reduction.errors === undefined\n ? undefined\n : { errors: reduction.errors }),\n bytecode: (0,_format_format__WEBPACK_IMPORTED_MODULE_2__.flattenBinArray)(reduction.bytecode),\n range: (0,_language_utils__WEBPACK_IMPORTED_MODULE_3__.mergeRanges)(reduction.ranges, resolvedScript.length === 0 ? undefined : resolvedScript[0].range),\n script,\n };\n};\n//# sourceMappingURL=reduce.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/language/reduce.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/language/resolve.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/language/resolve.js ***! + \*************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BuiltInVariables: () => (/* binding */ BuiltInVariables),\n/* harmony export */ createIdentifierResolver: () => (/* binding */ createIdentifierResolver),\n/* harmony export */ resolveScriptIdentifier: () => (/* binding */ resolveScriptIdentifier),\n/* harmony export */ resolveScriptSegment: () => (/* binding */ resolveScriptSegment),\n/* harmony export */ resolveVariableIdentifier: () => (/* binding */ resolveVariableIdentifier)\n/* harmony export */ });\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/utf8.js\");\n/* harmony import */ var _vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../vm/instruction-sets/instruction-sets */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n/* harmony import */ var _compile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./compile */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/compile.js\");\n/* harmony import */ var _language_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./language-types */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/language-types.js\");\n/* harmony import */ var _language_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./language-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/language-utils.js\");\n\n\n\n\n\nconst pluckRange = (node) => ({\n endColumn: node.end.column,\n endLineNumber: node.end.line,\n startColumn: node.start.column,\n startLineNumber: node.start.line,\n});\nconst removeNumericSeparators = (numericLiteral) => numericLiteral.replace(/_/gu, '');\nconst resolveScriptSegment = (segment, resolveIdentifiers) => {\n // eslint-disable-next-line complexity\n const resolved = segment.value.map((child) => {\n const range = pluckRange(child);\n switch (child.name) {\n case 'Identifier': {\n const identifier = child.value;\n const result = resolveIdentifiers(identifier);\n const ret = result.status\n ? {\n range,\n type: 'bytecode',\n value: result.bytecode,\n ...(result.type === _language_types__WEBPACK_IMPORTED_MODULE_0__.IdentifierResolutionType.opcode\n ? {\n opcode: identifier,\n }\n : result.type === _language_types__WEBPACK_IMPORTED_MODULE_0__.IdentifierResolutionType.variable\n ? {\n ...('debug' in result ? { debug: result.debug } : {}),\n ...('signature' in result\n ? { signature: result.signature }\n : {}),\n variable: identifier,\n }\n : // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n result.type === _language_types__WEBPACK_IMPORTED_MODULE_0__.IdentifierResolutionType.script\n ? { script: identifier, source: result.source }\n : { unknown: identifier }),\n }\n : {\n ...('debug' in result ? { debug: result.debug } : {}),\n ...('recoverable' in result && result.recoverable\n ? {\n missingIdentifier: identifier,\n owningEntity: result.entityOwnership,\n }\n : {}),\n range,\n type: 'error',\n value: result.error,\n };\n return ret;\n }\n case 'Push':\n return {\n range,\n type: 'push',\n value: resolveScriptSegment(child.value, resolveIdentifiers),\n };\n case 'Evaluation':\n return {\n range,\n type: 'evaluation',\n value: resolveScriptSegment(child.value, resolveIdentifiers),\n };\n case 'BigIntLiteral':\n return {\n literal: child.value,\n literalType: 'BigIntLiteral',\n range,\n type: 'bytecode',\n value: (0,_vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(BigInt(removeNumericSeparators(child.value))),\n };\n case 'BinaryLiteral':\n return {\n literal: child.value,\n literalType: 'BinaryLiteral',\n range,\n type: 'bytecode',\n value: (0,_vm_instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(BigInt(`0b${removeNumericSeparators(child.value)}`)),\n };\n case 'HexLiteral':\n return {\n literal: child.value,\n literalType: 'HexLiteral',\n range,\n type: 'bytecode',\n value: (0,_format_format__WEBPACK_IMPORTED_MODULE_2__.hexToBin)(removeNumericSeparators(child.value)),\n };\n case 'UTF8Literal':\n return {\n literal: child.value,\n literalType: 'UTF8Literal',\n range,\n type: 'bytecode',\n value: (0,_format_format__WEBPACK_IMPORTED_MODULE_3__.utf8ToBin)(child.value),\n };\n case 'Comment':\n return {\n range,\n type: 'comment',\n value: child.value,\n };\n default:\n return {\n range,\n type: 'error',\n value: `Unrecognized segment: ${child.name}`,\n };\n }\n });\n return resolved.length === 0\n ? [{ range: pluckRange(segment), type: 'comment', value: '' }]\n : resolved;\n};\nvar BuiltInVariables;\n(function (BuiltInVariables) {\n BuiltInVariables[\"currentBlockTime\"] = \"current_block_time\";\n BuiltInVariables[\"currentBlockHeight\"] = \"current_block_height\";\n BuiltInVariables[\"signingSerialization\"] = \"signing_serialization\";\n})(BuiltInVariables || (BuiltInVariables = {}));\nconst attemptCompilerOperation = ({ data, environment, identifier, matchingOperations, operationExample = 'operation_identifier', operationId, variableId, variableType, }) => {\n if (matchingOperations === undefined) {\n return {\n error: `The \"${variableId}\" variable type can not be resolved because the \"${variableType}\" operation has not been included in this compiler's CompilationEnvironment.`,\n status: 'error',\n };\n }\n if (typeof matchingOperations === 'function') {\n const operation = matchingOperations;\n return operation(identifier, data, environment);\n }\n if (operationId === undefined) {\n return {\n error: `This \"${variableId}\" variable could not be resolved because this compiler's \"${variableType}\" operations require an operation identifier, e.g. '${variableId}.${operationExample}'.`,\n status: 'error',\n };\n }\n const operation = matchingOperations[operationId];\n if (operation === undefined) {\n return {\n error: `The identifier \"${identifier}\" could not be resolved because the \"${variableId}.${operationId}\" operation is not available to this compiler.`,\n status: 'error',\n };\n }\n return operation(identifier, data, environment);\n};\n/**\n * If the identifer can be successfully resolved as a variable, the result is\n * returned as a Uint8Array. If the identifier references a known variable, but\n * an error occurs in resolving it, the error is returned as a string.\n * Otherwise, the identifier is not recognized as a variable, and this method\n * simply returns `false`.\n *\n * @param identifier - The full identifier used to describe this operation, e.g.\n * `owner.signature.all_outputs`.\n * @param data - The `CompilationData` provided to the compiler\n * @param environment - The `CompilationEnvironment` provided to the compiler\n */\nconst resolveVariableIdentifier = ({ data, environment, identifier, }) => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const [variableId, operationId] = identifier.split('.');\n switch (variableId) {\n case BuiltInVariables.currentBlockHeight:\n return attemptCompilerOperation({\n data,\n environment,\n identifier,\n matchingOperations: (_a = environment.operations) === null || _a === void 0 ? void 0 : _a.currentBlockHeight,\n operationId,\n variableId,\n variableType: 'currentBlockHeight',\n });\n case BuiltInVariables.currentBlockTime:\n return attemptCompilerOperation({\n data,\n environment,\n identifier,\n matchingOperations: (_b = environment.operations) === null || _b === void 0 ? void 0 : _b.currentBlockTime,\n operationId,\n variableId,\n variableType: 'currentBlockTime',\n });\n case BuiltInVariables.signingSerialization:\n return attemptCompilerOperation({\n data,\n environment,\n identifier,\n matchingOperations: (_c = environment.operations) === null || _c === void 0 ? void 0 : _c.signingSerialization,\n operationExample: 'version',\n operationId,\n variableId,\n variableType: 'signingSerialization',\n });\n default: {\n const expectedVariable = (_d = environment.variables) === null || _d === void 0 ? void 0 : _d[variableId];\n if (expectedVariable === undefined) {\n return { status: 'skip' };\n }\n return attemptCompilerOperation({\n data,\n environment,\n identifier,\n operationId,\n variableId,\n ...{\n // eslint-disable-next-line @typescript-eslint/naming-convention\n AddressData: {\n matchingOperations: (_e = environment.operations) === null || _e === void 0 ? void 0 : _e.addressData,\n variableType: 'addressData',\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HdKey: {\n matchingOperations: (_f = environment.operations) === null || _f === void 0 ? void 0 : _f.hdKey,\n operationExample: 'public_key',\n variableType: 'hdKey',\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Key: {\n matchingOperations: (_g = environment.operations) === null || _g === void 0 ? void 0 : _g.key,\n operationExample: 'public_key',\n variableType: 'key',\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n WalletData: {\n matchingOperations: (_h = environment.operations) === null || _h === void 0 ? void 0 : _h.walletData,\n variableType: 'walletData',\n },\n }[expectedVariable.type],\n });\n }\n }\n};\n/**\n * Compile an internal script identifier.\n *\n * @remarks\n * If the identifer can be successfully resolved as a script, the script is\n * compiled and returned as a CompilationResultSuccess. If an error occurs in\n * compiling it, the error is returned as a string.\n *\n * Otherwise, the identifier is not recognized as a script, and this method\n * simply returns `false`.\n *\n * @param identifier - the identifier of the script to be resolved\n * @param data - the provided CompilationData\n * @param environment - the provided CompilationEnvironment\n * @param parentIdentifier - the identifier of the script which references the\n * script being resolved (for detecting circular dependencies)\n */\nconst resolveScriptIdentifier = ({ data, environment, identifier, }) => {\n if (environment.scripts[identifier] === undefined) {\n return false;\n }\n const result = (0,_compile__WEBPACK_IMPORTED_MODULE_4__.compileScriptRaw)({ data, environment, scriptId: identifier });\n if (result.success) {\n return result;\n }\n return `Compilation error in resolved script \"${identifier}\": ${(0,_language_utils__WEBPACK_IMPORTED_MODULE_5__.stringifyErrors)(result.errors)}`;\n /*\n * result.errors.reduce(\n * (all, { error, range }) =>\n * `${\n * all === '' ? '' : `${all}; `\n * } [${\n * range.startLineNumber\n * }, ${range.startColumn}]: ${error}`,\n * ''\n * );\n */\n};\n/**\n * Return an `IdentifierResolutionFunction` for use in `resolveScriptSegment`.\n *\n * @param scriptId - the `id` of the script for which the resulting\n * `IdentifierResolutionFunction` will be used.\n * @param environment - a snapshot of the context around `scriptId`. See\n * `CompilationEnvironment` for details.\n * @param data - the actual variable values (private keys, shared wallet data,\n * shared address data, etc.) to use in resolving variables.\n */\nconst createIdentifierResolver = ({ data, environment, }) => \n// eslint-disable-next-line complexity\n(identifier) => {\n var _a;\n const opcodeResult = (_a = environment.opcodes) === null || _a === void 0 ? void 0 : _a[identifier];\n if (opcodeResult !== undefined) {\n return {\n bytecode: opcodeResult,\n status: true,\n type: _language_types__WEBPACK_IMPORTED_MODULE_0__.IdentifierResolutionType.opcode,\n };\n }\n const variableResult = resolveVariableIdentifier({\n data,\n environment,\n identifier,\n });\n if (variableResult.status !== 'skip') {\n return variableResult.status === 'error'\n ? {\n ...('debug' in variableResult\n ? { debug: variableResult.debug }\n : {}),\n error: variableResult.error,\n ...(environment.entityOwnership === undefined\n ? {}\n : {\n entityOwnership: environment.entityOwnership[identifier.split('.')[0]],\n }),\n recoverable: 'recoverable' in variableResult,\n status: false,\n type: _language_types__WEBPACK_IMPORTED_MODULE_0__.IdentifierResolutionErrorType.variable,\n }\n : {\n ...('debug' in variableResult\n ? { debug: variableResult.debug }\n : {}),\n bytecode: variableResult.bytecode,\n ...('signature' in variableResult\n ? {\n signature: variableResult.signature,\n }\n : {}),\n status: true,\n type: _language_types__WEBPACK_IMPORTED_MODULE_0__.IdentifierResolutionType.variable,\n };\n }\n const scriptResult = resolveScriptIdentifier({\n data,\n environment,\n identifier,\n });\n if (scriptResult !== false) {\n return typeof scriptResult === 'string'\n ? {\n error: scriptResult,\n scriptId: identifier,\n status: false,\n type: _language_types__WEBPACK_IMPORTED_MODULE_0__.IdentifierResolutionErrorType.script,\n }\n : {\n bytecode: scriptResult.bytecode,\n source: scriptResult.resolve,\n status: true,\n type: _language_types__WEBPACK_IMPORTED_MODULE_0__.IdentifierResolutionType.script,\n };\n }\n return {\n error: `Unknown identifier \"${identifier}\".`,\n status: false,\n type: _language_types__WEBPACK_IMPORTED_MODULE_0__.IdentifierResolutionErrorType.unknown,\n };\n};\n//# sourceMappingURL=resolve.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/language/resolve.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/scenarios.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/scenarios.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ extendCompilationDataWithScenarioBytecode: () => (/* binding */ extendCompilationDataWithScenarioBytecode),\n/* harmony export */ extendScenarioDefinition: () => (/* binding */ extendScenarioDefinition),\n/* harmony export */ extendScenarioDefinitionData: () => (/* binding */ extendScenarioDefinitionData),\n/* harmony export */ extendedScenarioDefinitionToCompilationData: () => (/* binding */ extendedScenarioDefinitionToCompilationData),\n/* harmony export */ generateDefaultScenarioDefinition: () => (/* binding */ generateDefaultScenarioDefinition),\n/* harmony export */ generateExtendedScenario: () => (/* binding */ generateExtendedScenario),\n/* harmony export */ generateScenarioCommon: () => (/* binding */ generateScenarioCommon)\n/* harmony export */ });\n/* harmony import */ var _format_hex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../format/hex */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _format_numbers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../format/numbers */ \"./node_modules/@bitauth/libauth/build/module/lib/format/numbers.js\");\n/* harmony import */ var _key_hd_key__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../key/hd-key */ \"./node_modules/@bitauth/libauth/build/module/lib/key/hd-key.js\");\n/* harmony import */ var _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./compiler-defaults */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-defaults.js\");\n/* harmony import */ var _language_compile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./language/compile */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/compile.js\");\n/* harmony import */ var _language_language_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./language/language-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/language-utils.js\");\n\n\n\n\n\n\n/*\n * & {\n * value: Uint8Array;\n * };\n */\n/**\n * Given a compilation environment, generate the default scenario which is\n * extended by all the environments scenarios.\n *\n * For details on default scenario generation, see\n * `AuthenticationTemplateScenario.extends`.\n *\n * @param environment - the compilation environment from which to generate the\n * default scenario\n */\n// eslint-disable-next-line complexity\nconst generateDefaultScenarioDefinition = (environment) => {\n const { variables, entityOwnership } = environment;\n const keyVariableIds = variables === undefined\n ? []\n : Object.entries(variables)\n .filter((entry) => entry[1].type === 'Key')\n .map(([id]) => id);\n const entityIds = entityOwnership === undefined\n ? []\n : Object.keys(Object.values(entityOwnership).reduce((all, entityId) => ({ ...all, [entityId]: true }), {}));\n const valueMap = [...keyVariableIds, ...entityIds]\n .sort(([idA], [idB]) => idA.localeCompare(idB))\n .reduce((all, id, index) => ({\n ...all,\n [id]: (0,_format_numbers__WEBPACK_IMPORTED_MODULE_0__.bigIntToBinUint256BEClamped)(BigInt(index + 1)),\n }), {});\n const privateKeys = variables === undefined\n ? undefined\n : Object.entries(variables).reduce((all, [variableId, variable]) => variable.type === 'Key'\n ? {\n ...all,\n [variableId]: (0,_format_hex__WEBPACK_IMPORTED_MODULE_1__.binToHex)(valueMap[variableId]),\n }\n : all, {});\n const defaultScenario = {\n data: {\n currentBlockHeight: _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.defaultScenarioCurrentBlockHeight,\n currentBlockTime: _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.defaultScenarioCurrentBlockTime,\n ...(privateKeys === undefined || Object.keys(privateKeys).length === 0\n ? {}\n : { keys: { privateKeys } }),\n },\n transaction: {\n inputs: [{ unlockingBytecode: null }],\n locktime: _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.defaultScenarioTransactionLocktime,\n outputs: [\n {\n lockingBytecode: _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.defaultScenarioTransactionOutputsLockingBytecodeHex,\n },\n ],\n version: _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.defaultScenarioTransactionVersion,\n },\n value: _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.defaultScenarioValue,\n };\n const hasHdKeys = variables === undefined\n ? false\n : Object.values(variables).findIndex((variable) => variable.type === 'HdKey') !== -1;\n if (!hasHdKeys) {\n return defaultScenario;\n }\n const { sha256, sha512 } = environment;\n if (sha256 === undefined) {\n return 'An implementations of \"sha256\" is required to generate defaults for HD keys, but the \"sha256\" property is not included in this compilation environment.';\n }\n if (sha512 === undefined) {\n return 'An implementations of \"sha512\" is required to generate defaults for HD keys, but the \"sha512\" property is not included in this compilation environment.';\n }\n const crypto = { sha256, sha512 };\n const hdPrivateKeys = entityIds.reduce((all, entityId) => {\n /**\n * The first 5,000,000,000 seeds have been tested, scenarios are\n * unlikely to exceed this number of entities.\n */\n const assumeValid = true;\n const masterNode = (0,_key_hd_key__WEBPACK_IMPORTED_MODULE_3__.deriveHdPrivateNodeFromSeed)(crypto, valueMap[entityId], assumeValid);\n const hdPrivateKey = (0,_key_hd_key__WEBPACK_IMPORTED_MODULE_3__.encodeHdPrivateKey)(crypto, {\n network: 'mainnet',\n node: masterNode,\n });\n return { ...all, [entityId]: hdPrivateKey };\n }, {});\n return {\n ...defaultScenario,\n data: {\n ...defaultScenario.data,\n hdKeys: {\n addressIndex: _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.defaultScenarioAddressIndex,\n hdPrivateKeys,\n },\n },\n };\n};\n/**\n * Extend the `data` property of a scenario definition with values from a parent\n * scenario definition. Returns the extended value for `data`.\n *\n * @param parentData - the scenario `data` which is extended by the child\n * scenario\n * @param childData - the scenario `data` which may override values from the\n * parent scenario\n */\n// eslint-disable-next-line complexity\nconst extendScenarioDefinitionData = (parentData, childData) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n return {\n ...parentData,\n ...childData,\n ...(parentData.bytecode === undefined && childData.bytecode === undefined\n ? {}\n : {\n bytecode: {\n ...parentData.bytecode,\n ...childData.bytecode,\n },\n }),\n ...(parentData.hdKeys === undefined && childData.hdKeys === undefined\n ? {}\n : {\n hdKeys: {\n ...parentData.hdKeys,\n ...childData.hdKeys,\n ...(((_a = parentData.hdKeys) === null || _a === void 0 ? void 0 : _a.hdPrivateKeys) === undefined &&\n ((_b = childData.hdKeys) === null || _b === void 0 ? void 0 : _b.hdPrivateKeys) === undefined\n ? {}\n : {\n hdPrivateKeys: {\n ...(_c = parentData.hdKeys) === null || _c === void 0 ? void 0 : _c.hdPrivateKeys,\n ...(_d = childData.hdKeys) === null || _d === void 0 ? void 0 : _d.hdPrivateKeys,\n },\n }),\n ...(((_e = parentData.hdKeys) === null || _e === void 0 ? void 0 : _e.hdPublicKeys) === undefined &&\n ((_f = childData.hdKeys) === null || _f === void 0 ? void 0 : _f.hdPublicKeys) === undefined\n ? {}\n : {\n hdPublicKeys: {\n ...(_g = parentData.hdKeys) === null || _g === void 0 ? void 0 : _g.hdPublicKeys,\n ...(_h = childData.hdKeys) === null || _h === void 0 ? void 0 : _h.hdPublicKeys,\n },\n }),\n },\n }),\n ...(parentData.keys === undefined && childData.keys === undefined\n ? {}\n : {\n keys: {\n privateKeys: {\n ...(_j = parentData.keys) === null || _j === void 0 ? void 0 : _j.privateKeys,\n ...(_k = childData.keys) === null || _k === void 0 ? void 0 : _k.privateKeys,\n },\n },\n }),\n };\n};\n/**\n * Extend a child scenario definition with values from a parent scenario\n * definition. Returns the extended values for `data`, `transaction`, and\n * `value`.\n *\n * @param parentScenario - the scenario which is extended by the child scenario\n * @param childScenario - the scenario which may override values from the parent\n * scenario\n */\n// eslint-disable-next-line complexity\nconst extendScenarioDefinition = (parentScenario, childScenario) => {\n var _a, _b, _c;\n return {\n ...(parentScenario.data === undefined && childScenario.data === undefined\n ? {}\n : {\n data: extendScenarioDefinitionData((_a = parentScenario.data) !== null && _a !== void 0 ? _a : {}, (_b = childScenario.data) !== null && _b !== void 0 ? _b : {}),\n }),\n ...(parentScenario.transaction === undefined &&\n childScenario.transaction === undefined\n ? {}\n : {\n transaction: {\n ...parentScenario.transaction,\n ...childScenario.transaction,\n },\n }),\n ...(parentScenario.value === undefined && childScenario.value === undefined\n ? {}\n : { value: (_c = childScenario.value) !== null && _c !== void 0 ? _c : parentScenario.value }),\n };\n};\n/**\n * Generate the full scenario which is extended by the provided scenario\n * identifier. Scenarios for which `extends` is `undefined` extend the default\n * scenario for the provided compilation environment.\n *\n * @param scenarioId - the identifier of the scenario for from which to select\n * the extended scenario\n * @param environment - the compilation environment from which to generate the\n * extended scenario\n * @param sourceScenarioIds - an array of scenario identifiers indicating the\n * path taken to arrive at the current scenario - used to detect and prevent\n * cycles in extending scenarios (defaults to `[]`)\n */\n// eslint-disable-next-line complexity\nconst generateExtendedScenario = ({ environment, scenarioId, sourceScenarioIds = [], }) => {\n var _a;\n if (scenarioId === undefined) {\n return generateDefaultScenarioDefinition(environment);\n }\n if (sourceScenarioIds.includes(scenarioId)) {\n return `Cannot extend scenario \"${scenarioId}\": scenario \"${scenarioId}\" extends itself. Scenario inheritance path: ${sourceScenarioIds.join(' → ')}`;\n }\n const scenario = (_a = environment.scenarios) === null || _a === void 0 ? void 0 : _a[scenarioId];\n if (scenario === undefined) {\n return `Cannot extend scenario \"${scenarioId}\": a scenario with the identifier ${scenarioId} is not included in this compilation environment.`;\n }\n const parentScenario = scenario.extends === undefined\n ? generateDefaultScenarioDefinition(environment)\n : generateExtendedScenario({\n environment,\n scenarioId: scenario.extends,\n sourceScenarioIds: [...sourceScenarioIds, scenarioId],\n });\n if (typeof parentScenario === 'string') {\n return parentScenario;\n }\n return extendScenarioDefinition(parentScenario, scenario);\n};\n/**\n * Derive standard `CompilationData` properties from an extended scenario\n * definition.\n * @param definition - a scenario definition which has been extended by the\n * default scenario definition\n */\n// eslint-disable-next-line complexity\nconst extendedScenarioDefinitionToCompilationData = (definition) => {\n var _a;\n return ({\n ...(definition.data.currentBlockHeight === undefined\n ? {}\n : {\n currentBlockHeight: definition.data.currentBlockHeight,\n }),\n ...(definition.data.currentBlockTime === undefined\n ? {}\n : {\n currentBlockTime: definition.data.currentBlockTime,\n }),\n ...(definition.data.hdKeys === undefined\n ? {}\n : {\n hdKeys: {\n ...(definition.data.hdKeys.addressIndex === undefined\n ? {}\n : {\n addressIndex: definition.data.hdKeys.addressIndex,\n }),\n ...(definition.data.hdKeys.hdPrivateKeys !== undefined &&\n Object.keys(definition.data.hdKeys.hdPrivateKeys).length > 0\n ? {\n hdPrivateKeys: definition.data.hdKeys.hdPrivateKeys,\n }\n : {}),\n ...(definition.data.hdKeys.hdPublicKeys === undefined\n ? {}\n : {\n hdPublicKeys: definition.data.hdKeys.hdPublicKeys,\n }),\n },\n }),\n ...(((_a = definition.data.keys) === null || _a === void 0 ? void 0 : _a.privateKeys) !== undefined &&\n Object.keys(definition.data.keys.privateKeys).length > 0\n ? {\n keys: {\n privateKeys: Object.entries(definition.data.keys.privateKeys).reduce((all, [id, hex]) => ({ ...all, [id]: (0,_format_hex__WEBPACK_IMPORTED_MODULE_1__.hexToBin)(hex) }), {}),\n },\n }\n : {}),\n });\n};\n/**\n * Extend a `CompilationData` object with the compiled result of the bytecode\n * scripts provided by a `AuthenticationTemplateScenarioData`.\n *\n * @param compilationData - the compilation data to extend\n * @param environment - the compilation environment in which to compile the\n * scripts\n * @param scenarioDataBytecodeScripts - the `data.bytecode` property of an\n * `AuthenticationTemplateScenarioData`\n */\nconst extendCompilationDataWithScenarioBytecode = ({ compilationData, environment, scenarioDataBytecodeScripts, }) => {\n const prefixBytecodeScriptId = (id) => `${_compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.scenarioBytecodeScriptPrefix}${id}`;\n const bytecodeScripts = Object.entries(scenarioDataBytecodeScripts).reduce((all, [id, script]) => {\n return {\n ...all,\n [prefixBytecodeScriptId(id)]: script,\n };\n }, {});\n const bytecodeScriptExtendedEnvironment = {\n ...environment,\n scripts: {\n ...environment.scripts,\n ...bytecodeScripts,\n },\n };\n const bytecodeCompilations = Object.keys(scenarioDataBytecodeScripts).map((id) => {\n const result = (0,_language_compile__WEBPACK_IMPORTED_MODULE_4__.compileScriptRaw)({\n data: compilationData,\n environment: bytecodeScriptExtendedEnvironment,\n scriptId: prefixBytecodeScriptId(id),\n });\n if (result.success) {\n return {\n bytecode: result.bytecode,\n id,\n };\n }\n return {\n errors: result.errors,\n id,\n };\n });\n const failedResults = bytecodeCompilations.filter((result) => 'errors' in result);\n if (failedResults.length > 0) {\n return `${failedResults\n .map((result) => `Compilation error while generating bytecode for \"${result.id}\": ${(0,_language_language_utils__WEBPACK_IMPORTED_MODULE_5__.stringifyErrors)(result.errors)}`)\n .join('; ')}`;\n }\n const compiledBytecode = bytecodeCompilations.reduce((all, result) => ({ ...all, [result.id]: result.bytecode }), {});\n return {\n ...(Object.keys(compiledBytecode).length > 0\n ? { bytecode: compiledBytecode }\n : {}),\n ...compilationData,\n };\n};\n/**\n * The default `lockingBytecode` value for scenario outputs is a new empty\n * object (`{}`).\n */\nconst getScenarioOutputDefaultLockingBytecode = () => ({});\n/**\n * Generate a scenario given a compilation environment. If neither `scenarioId`\n * or `unlockingScriptId` are provided, the default scenario for the compilation\n * environment will be generated.\n *\n * Returns either the full `CompilationData` for the selected scenario or an\n * error message (as a `string`).\n *\n * @param scenarioId - the ID of the scenario to generate – if `undefined`, the\n * default scenario\n * @param unlockingScriptId - the ID of the unlocking script under test by this\n * scenario – if `undefined` but required by the scenario, an error will be\n * produced\n * @param environment - the compilation environment from which to generate the\n * scenario\n */\n// eslint-disable-next-line complexity\nconst generateScenarioCommon = ({ environment, scenarioId, unlockingScriptId, }) => {\n var _a, _b;\n const { scenario, scenarioName } = scenarioId === undefined\n ? { scenario: {}, scenarioName: `the default scenario` }\n : {\n scenario: (_a = environment.scenarios) === null || _a === void 0 ? void 0 : _a[scenarioId],\n scenarioName: `scenario \"${scenarioId}\"`,\n };\n if (scenario === undefined) {\n return `Cannot generate ${scenarioName}: a scenario with the identifier ${scenarioId} is not included in this compilation environment.`;\n }\n const parentScenario = generateExtendedScenario({ environment, scenarioId });\n if (typeof parentScenario === 'string') {\n return `Cannot generate ${scenarioName}: ${parentScenario}`;\n }\n const extendedScenario = extendScenarioDefinition(parentScenario, scenario);\n const partialCompilationData = extendedScenarioDefinitionToCompilationData(extendedScenario);\n const fullCompilationData = extendCompilationDataWithScenarioBytecode({\n compilationData: partialCompilationData,\n environment,\n scenarioDataBytecodeScripts: (_b = extendedScenario.data.bytecode) !== null && _b !== void 0 ? _b : {},\n });\n if (typeof fullCompilationData === 'string') {\n return `Cannot generate ${scenarioName}: ${fullCompilationData}`;\n }\n const testedInputs = extendedScenario.transaction.inputs.filter((input) => input.unlockingBytecode === null);\n if (testedInputs.length !== 1) {\n return `Cannot generate ${scenarioName}: the specific input under test in this scenario is ambiguous – \"transaction.inputs\" must include exactly one input which has \"unlockingBytecode\" set to \"null\".`;\n }\n const testedInputIndex = extendedScenario.transaction.inputs.findIndex((input) => input.unlockingBytecode === null);\n const outputs = extendedScenario.transaction.outputs.map((output) => {\n var _a, _b;\n return ({\n lockingBytecode: (_a = output.lockingBytecode) !== null && _a !== void 0 ? _a : getScenarioOutputDefaultLockingBytecode(),\n satoshis: (_b = output.satoshis) !== null && _b !== void 0 ? _b : _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.defaultScenarioOutputSatoshis,\n });\n });\n const compiledOutputResults = outputs.map(\n // eslint-disable-next-line complexity\n (output, index) => {\n var _a, _b;\n const satoshis = typeof output.satoshis === 'string'\n ? (0,_format_hex__WEBPACK_IMPORTED_MODULE_1__.hexToBin)(output.satoshis)\n : (0,_format_numbers__WEBPACK_IMPORTED_MODULE_0__.bigIntToBinUint64LE)(BigInt(output.satoshis));\n if (typeof output.lockingBytecode === 'string') {\n return {\n lockingBytecode: (0,_format_hex__WEBPACK_IMPORTED_MODULE_1__.hexToBin)(output.lockingBytecode),\n satoshis,\n };\n }\n const specifiedLockingScriptId = output.lockingBytecode.script;\n const impliedLockingScriptId = unlockingScriptId === undefined\n ? undefined\n : (_a = environment.unlockingScripts) === null || _a === void 0 ? void 0 : _a[unlockingScriptId];\n const scriptId = typeof specifiedLockingScriptId === 'string'\n ? specifiedLockingScriptId\n : impliedLockingScriptId;\n if (scriptId === undefined) {\n if (unlockingScriptId === undefined) {\n return `Cannot generate locking bytecode for output ${index}: this output is set to use the script unlocked by the unlocking script under test, but an unlocking script ID was not provided for scenario generation.`;\n }\n return `Cannot generate locking bytecode for output ${index}: the locking script unlocked by \"${unlockingScriptId}\" is not provided in this compilation environment.`;\n }\n const overriddenDataDefinition = output.lockingBytecode.overrides === undefined\n ? undefined\n : extendScenarioDefinitionData(extendedScenario.data, output.lockingBytecode.overrides);\n const overriddenCompilationData = overriddenDataDefinition === undefined\n ? undefined\n : extendCompilationDataWithScenarioBytecode({\n compilationData: extendedScenarioDefinitionToCompilationData({\n data: overriddenDataDefinition,\n }),\n environment,\n scenarioDataBytecodeScripts: (_b = overriddenDataDefinition.bytecode) !== null && _b !== void 0 ? _b : {},\n });\n if (typeof overriddenCompilationData === 'string') {\n return `Cannot generate locking bytecode for output ${index}: ${overriddenCompilationData}`;\n }\n const data = overriddenCompilationData === undefined\n ? fullCompilationData\n : overriddenCompilationData;\n const result = (0,_language_compile__WEBPACK_IMPORTED_MODULE_4__.compileScript)(scriptId, data, environment);\n if (!result.success) {\n return `Cannot generate locking bytecode for output ${index}: ${(0,_language_language_utils__WEBPACK_IMPORTED_MODULE_5__.stringifyErrors)(result.errors)}`;\n }\n return { lockingBytecode: result.bytecode, satoshis };\n });\n const outputCompilationErrors = compiledOutputResults.filter((result) => typeof result === 'string');\n if (outputCompilationErrors.length > 0) {\n return `Cannot generate ${scenarioName}: ${outputCompilationErrors.join('; ')}`;\n }\n const compiledOutputs = compiledOutputResults;\n const sourceSatoshis = typeof extendedScenario.value === 'number'\n ? (0,_format_numbers__WEBPACK_IMPORTED_MODULE_0__.bigIntToBinUint64LE)(BigInt(extendedScenario.value))\n : (0,_format_hex__WEBPACK_IMPORTED_MODULE_1__.hexToBin)(extendedScenario.value);\n const unlockingBytecodeUnderTest = undefined;\n return {\n data: fullCompilationData,\n program: {\n inputIndex: testedInputIndex,\n sourceOutput: { satoshis: sourceSatoshis },\n spendingTransaction: {\n // eslint-disable-next-line complexity\n inputs: extendedScenario.transaction.inputs.map((input) => {\n var _a, _b, _c;\n return ({\n outpointIndex: (_a = input.outpointIndex) !== null && _a !== void 0 ? _a : _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.defaultScenarioInputOutpointIndex,\n outpointTransactionHash: (0,_format_hex__WEBPACK_IMPORTED_MODULE_1__.hexToBin)((_b = input.outpointTransactionHash) !== null && _b !== void 0 ? _b : _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.defaultScenarioInputOutpointTransactionHash),\n sequenceNumber: (_c = input.sequenceNumber) !== null && _c !== void 0 ? _c : _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.defaultScenarioInputSequenceNumber,\n unlockingBytecode: input.unlockingBytecode === null\n ? unlockingBytecodeUnderTest\n : (0,_format_hex__WEBPACK_IMPORTED_MODULE_1__.hexToBin)(typeof input.unlockingBytecode === 'string'\n ? input.unlockingBytecode\n : _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.defaultScenarioInputUnlockingBytecodeHex),\n });\n }),\n locktime: extendedScenario.transaction.locktime,\n outputs: compiledOutputs,\n version: extendedScenario.transaction.version,\n },\n },\n };\n};\n//# sourceMappingURL=scenarios.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/scenarios.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/standard/p2pkh.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/standard/p2pkh.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ authenticationTemplateP2pkh: () => (/* binding */ authenticationTemplateP2pkh),\n/* harmony export */ authenticationTemplateP2pkhNonHd: () => (/* binding */ authenticationTemplateP2pkhNonHd)\n/* harmony export */ });\n/**\n * A standard single-factor authentication template which uses\n * Pay-to-Public-Key-Hash (P2PKH), the most common authentication scheme in use\n * on the network.\n *\n * This P2PKH template uses BCH Schnorr signatures, reducing the size of\n * transactions.\n *\n * Note, this authentication template uses only a single `Key`. For HD key\n * support, see `authenticationTemplateP2pkhHd`.\n */\nconst authenticationTemplateP2pkhNonHd = {\n $schema: 'https://bitauth.com/schemas/authentication-template-v0.schema.json',\n description: 'A standard single-factor authentication template which uses Pay-to-Public-Key-Hash (P2PKH), the most common authentication scheme in use on the network.\\n\\nThis P2PKH template uses BCH Schnorr signatures, reducing the size of transactions.',\n entities: {\n owner: {\n description: 'The individual who can spend from this wallet.',\n name: 'Owner',\n scripts: ['lock', 'unlock'],\n variables: {\n key: {\n description: 'The private key which controls this wallet.',\n name: 'Key',\n type: 'Key',\n },\n },\n },\n },\n name: 'Single Signature (P2PKH)',\n scripts: {\n lock: {\n lockingType: 'standard',\n name: 'P2PKH Lock',\n script: 'OP_DUP\\nOP_HASH160 <$( OP_HASH160\\n)> OP_EQUALVERIFY\\nOP_CHECKSIG',\n },\n unlock: {\n name: 'Unlock',\n script: '\\n',\n unlocks: 'lock',\n },\n },\n supported: ['BCH_2019_05', 'BCH_2019_11', 'BCH_2020_05'],\n version: 0,\n};\n/**\n * A standard single-factor authentication template which uses\n * Pay-to-Public-Key-Hash (P2PKH), the most common authentication scheme in use\n * on the network.\n *\n * This P2PKH template uses BCH Schnorr signatures, reducing the size of\n * transactions.\n *\n * Because the template uses a Hierarchical Deterministic (HD) key, it also\n * supports an \"Observer (Watch-Only)\" entity.\n */\nconst authenticationTemplateP2pkh = {\n $schema: 'https://bitauth.com/schemas/authentication-template-v0.schema.json',\n description: 'A standard single-factor authentication template which uses Pay-to-Public-Key-Hash (P2PKH), the most common authentication scheme in use on the network.\\n\\nThis P2PKH template uses BCH Schnorr signatures, reducing the size of transactions. Because the template uses a Hierarchical Deterministic (HD) key, it also supports an \"Observer (Watch-Only)\" entity.',\n entities: {\n observer: {\n description: 'An entity which can generate addresses but cannot spend funds from this wallet.',\n name: 'Observer (Watch-Only)',\n scripts: ['lock'],\n },\n owner: {\n description: 'The individual who can spend from this wallet.',\n name: 'Owner',\n scripts: ['lock', 'unlock'],\n variables: {\n key: {\n description: 'The private key which controls this wallet.',\n name: 'Key',\n type: 'HdKey',\n },\n },\n },\n },\n name: 'Single Signature (P2PKH)',\n scripts: {\n lock: {\n lockingType: 'standard',\n name: 'P2PKH Lock',\n script: 'OP_DUP\\nOP_HASH160 <$( OP_HASH160\\n)> OP_EQUALVERIFY\\nOP_CHECKSIG',\n },\n unlock: {\n name: 'Unlock',\n script: '\\n',\n unlocks: 'lock',\n },\n },\n supported: ['BCH_2019_05', 'BCH_2019_11', 'BCH_2020_05'],\n version: 0,\n};\n//# sourceMappingURL=p2pkh.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/standard/p2pkh.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/standard/standard.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/standard/standard.js ***! + \**************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ authenticationTemplateP2pkh: () => (/* reexport safe */ _p2pkh__WEBPACK_IMPORTED_MODULE_0__.authenticationTemplateP2pkh),\n/* harmony export */ authenticationTemplateP2pkhNonHd: () => (/* reexport safe */ _p2pkh__WEBPACK_IMPORTED_MODULE_0__.authenticationTemplateP2pkhNonHd)\n/* harmony export */ });\n/* harmony import */ var _p2pkh__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./p2pkh */ \"./node_modules/@bitauth/libauth/build/module/lib/template/standard/p2pkh.js\");\n\n//# sourceMappingURL=standard.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/standard/standard.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/template-types.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/template-types.js ***! + \***********************************************************************************/ +/***/ (() => { + +eval("/* eslint-disable max-lines */\n/**\n * Because this file is consumed by the `doc:generate-json-schema` package\n * script to produce a JSON schema, large sections of the below documentation\n * are copied from this libraries `Transaction` and `CompilationData` types.\n *\n * This is preferable to importing those types, as most documentation needs to\n * be slightly modified for this context, and avoiding imports in this file\n * makes it easier to provide a stable API.\n */\n//# sourceMappingURL=template-types.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/template-types.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/template-validation.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/template-validation.js ***! + \****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ parseAuthenticationTemplateEntities: () => (/* binding */ parseAuthenticationTemplateEntities),\n/* harmony export */ parseAuthenticationTemplateScenarioData: () => (/* binding */ parseAuthenticationTemplateScenarioData),\n/* harmony export */ parseAuthenticationTemplateScenarioDataHdKeys: () => (/* binding */ parseAuthenticationTemplateScenarioDataHdKeys),\n/* harmony export */ parseAuthenticationTemplateScenarioDataKeys: () => (/* binding */ parseAuthenticationTemplateScenarioDataKeys),\n/* harmony export */ parseAuthenticationTemplateScenarioTransaction: () => (/* binding */ parseAuthenticationTemplateScenarioTransaction),\n/* harmony export */ parseAuthenticationTemplateScenarioTransactionInputs: () => (/* binding */ parseAuthenticationTemplateScenarioTransactionInputs),\n/* harmony export */ parseAuthenticationTemplateScenarioTransactionOutputLockingBytecode: () => (/* binding */ parseAuthenticationTemplateScenarioTransactionOutputLockingBytecode),\n/* harmony export */ parseAuthenticationTemplateScenarioTransactionOutputs: () => (/* binding */ parseAuthenticationTemplateScenarioTransactionOutputs),\n/* harmony export */ parseAuthenticationTemplateScenarios: () => (/* binding */ parseAuthenticationTemplateScenarios),\n/* harmony export */ parseAuthenticationTemplateScripts: () => (/* binding */ parseAuthenticationTemplateScripts),\n/* harmony export */ parseAuthenticationTemplateVariable: () => (/* binding */ parseAuthenticationTemplateVariable),\n/* harmony export */ validateAuthenticationTemplate: () => (/* binding */ validateAuthenticationTemplate)\n/* harmony export */ });\n/* harmony import */ var _format_hex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../format/hex */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _key_key_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../key/key-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/key/key-utils.js\");\n/* harmony import */ var _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./compiler-defaults */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-defaults.js\");\n/* harmony import */ var _language_resolve__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./language/resolve */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/resolve.js\");\n/* eslint-disable max-lines, @typescript-eslint/ban-types */\n\n\n\n\nconst listIds = (ids) => ids\n .map((id) => `\"${id}\"`)\n .sort((a, b) => a.localeCompare(b))\n .join(', ');\n/**\n * Verify that the provided value is an array which is not sparse.\n */\nconst isDenseArray = (maybeArray) => Array.isArray(maybeArray) && !maybeArray.includes(undefined);\n/**\n * Check that a value is an array which contains only strings and has no empty\n * items (is not a sparse array, e.g. `[1, , 3]`).\n */\nconst isStringArray = (maybeArray) => isDenseArray(maybeArray) &&\n !maybeArray.some((item) => typeof item !== 'string');\nconst isObject = (maybeObject) => typeof maybeObject === 'object' && maybeObject !== null;\nconst isStringObject = (maybeStringObject) => !Object.values(maybeStringObject).some((value) => typeof value !== 'string');\nconst hasNonHexCharacter = /[^a-fA-F0-9]/u;\nconst isHexString = (maybeHexString) => typeof maybeHexString === 'string' &&\n !hasNonHexCharacter.test(maybeHexString);\nconst characterLength32BytePrivateKey = 64;\nconst isObjectOfValidPrivateKeys = (maybePrivateKeysObject) => !Object.values(maybePrivateKeysObject).some((value) => !isHexString(value) ||\n value.length !== characterLength32BytePrivateKey ||\n !(0,_key_key_utils__WEBPACK_IMPORTED_MODULE_0__.validateSecp256k1PrivateKey)((0,_format_hex__WEBPACK_IMPORTED_MODULE_1__.hexToBin)(value)));\nconst isInteger = (value) => typeof value === 'number' && Number.isInteger(value);\nconst isPositiveInteger = (value) => isInteger(value) && value >= 0;\nconst isRangedInteger = (value, minimum, maximum) => isInteger(value) && value >= minimum && value <= maximum;\n/**\n * Verify that a value is a valid `satoshi` value: either a number between `0`\n * and `Number.MAX_SAFE_INTEGER` or a 16-character, hexadecimal-encoded string.\n *\n * @param maybeSatoshis - the value to verify\n */\nconst isValidSatoshisValue = (maybeSatoshis) => {\n const uint64HexLength = 16;\n if (maybeSatoshis === undefined ||\n isRangedInteger(maybeSatoshis, 0, Number.MAX_SAFE_INTEGER) ||\n (isHexString(maybeSatoshis) && maybeSatoshis.length === uint64HexLength)) {\n return true;\n }\n return false;\n};\n/**\n * Parse an authentication template `scripts` object into its component scripts,\n * validating the shape of each script object. Returns either an error message\n * as a string or an object of cloned and sorted scripts.\n *\n * @param scripts - the `scripts` property of an `AuthenticationTemplate`\n */\n// eslint-disable-next-line complexity\nconst parseAuthenticationTemplateScripts = (scripts) => {\n const unknownScripts = Object.entries(scripts).map(([id, script]) => ({ id, script }));\n const nonObjectScripts = unknownScripts\n .filter(({ script }) => typeof script !== 'object' || script === null)\n .map(({ id }) => id);\n if (nonObjectScripts.length > 0) {\n return `All authentication template scripts must be objects, but the following scripts are not objects: ${listIds(nonObjectScripts)}.`;\n }\n const allScripts = unknownScripts;\n const unlockingResults = allScripts\n .filter(({ script }) => 'unlocks' in script)\n // eslint-disable-next-line complexity\n .map(({ id, script }) => {\n const { ageLock, estimate, fails, invalid, name, passes, script: scriptContents, timeLockType, unlocks, } = script;\n if (typeof unlocks !== 'string') {\n return `The \"unlocks\" property of unlocking script \"${id}\" must be a string.`;\n }\n if (typeof scriptContents !== 'string') {\n return `The \"script\" property of unlocking script \"${id}\" must be a string.`;\n }\n if (ageLock !== undefined && typeof ageLock !== 'string') {\n return `If defined, the \"ageLock\" property of unlocking script \"${id}\" must be a string.`;\n }\n if (estimate !== undefined && typeof estimate !== 'string') {\n return `If defined, the \"estimate\" property of unlocking script \"${id}\" must be a string.`;\n }\n if (name !== undefined && typeof name !== 'string') {\n return `If defined, the \"name\" property of unlocking script \"${id}\" must be a string.`;\n }\n if (fails !== undefined && !isStringArray(fails)) {\n return `If defined, the \"fails\" property of unlocking script \"${id}\" must be an array containing only scenario identifiers (strings).`;\n }\n if (invalid !== undefined && !isStringArray(invalid)) {\n return `If defined, the \"invalid\" property of unlocking script \"${id}\" must be an array containing only scenario identifiers (strings).`;\n }\n if (passes !== undefined && !isStringArray(passes)) {\n return `If defined, the \"passes\" property of unlocking script \"${id}\" must be an array containing only scenario identifiers (strings).`;\n }\n if (timeLockType !== undefined &&\n timeLockType !== 'timestamp' &&\n timeLockType !== 'height') {\n return `If defined, the \"timeLockType\" property of unlocking script \"${id}\" must be either \"timestamp\" or \"height\".`;\n }\n return {\n id,\n script: {\n ...(ageLock === undefined ? {} : { ageLock }),\n ...(estimate === undefined ? {} : { estimate }),\n ...(fails === undefined ? {} : { fails }),\n ...(invalid === undefined ? {} : { invalid }),\n ...(passes === undefined ? {} : { passes }),\n ...(name === undefined ? {} : { name }),\n script: scriptContents,\n ...(timeLockType === undefined ? {} : { timeLockType }),\n unlocks,\n },\n };\n });\n const invalidUnlockingResults = unlockingResults.filter((result) => typeof result === 'string');\n if (invalidUnlockingResults.length > 0) {\n return invalidUnlockingResults.join(' ');\n }\n const validUnlockingResults = unlockingResults;\n const unlocking = validUnlockingResults.reduce((all, result) => ({ ...all, [result.id]: result.script }), {});\n const unlockingIds = validUnlockingResults.map(({ id }) => id);\n const impliedLockingIds = validUnlockingResults.map(({ script }) => script.unlocks);\n const lockingResults = allScripts\n .filter(({ id, script }) => 'lockingType' in script || impliedLockingIds.includes(id))\n // eslint-disable-next-line complexity\n .map(({ id, script }) => {\n const { lockingType, script: scriptContents, name } = script;\n if (lockingType !== 'standard' && lockingType !== 'p2sh') {\n return `The \"lockingType\" property of locking script \"${id}\" must be either \"standard\" or \"p2sh\".`;\n }\n if (typeof scriptContents !== 'string') {\n return `The \"script\" property of locking script \"${id}\" must be a string.`;\n }\n if (name !== undefined && typeof name !== 'string') {\n return `If defined, the \"name\" property of locking script \"${id}\" must be a string.`;\n }\n return {\n id,\n script: {\n lockingType,\n ...(name === undefined ? {} : { name }),\n script: scriptContents,\n },\n };\n });\n const invalidLockingResults = lockingResults.filter((result) => typeof result === 'string');\n if (invalidLockingResults.length > 0) {\n return invalidLockingResults.join(' ');\n }\n const validLockingResults = lockingResults;\n const locking = validLockingResults.reduce((all, result) => ({ ...all, [result.id]: result.script }), {});\n const lockingIds = validLockingResults.map(({ id }) => id);\n const unknownLockingIds = Object.values(unlocking)\n .map((script) => script.unlocks)\n .filter((unlocks) => !lockingIds.includes(unlocks));\n if (unknownLockingIds.length > 0) {\n return `The following locking scripts (referenced in \"unlocks\" properties) were not provided: ${listIds(unknownLockingIds)}.`;\n }\n const testedResults = allScripts\n .filter(({ script }) => 'tests' in script)\n // eslint-disable-next-line complexity\n .map(({ id, script }) => {\n const { tests, script: scriptContents, name, pushed } = script;\n if (typeof scriptContents !== 'string') {\n return `The \"script\" property of tested script \"${id}\" must be a string.`;\n }\n if (name !== undefined && typeof name !== 'string') {\n return `If defined, the \"name\" property of tested script \"${id}\" must be a string.`;\n }\n if (pushed !== undefined && pushed !== true && pushed !== false) {\n return `If defined, the \"pushed\" property of tested script \"${id}\" must be a boolean value.`;\n }\n if (!Array.isArray(tests)) {\n return `If defined, the \"tests\" property of tested script \"${id}\" must be an array.`;\n }\n const extractedTests = \n // eslint-disable-next-line complexity\n tests.map((test) => {\n const { check, fails, invalid, name: testName, passes, setup, } = test;\n if (typeof check !== 'string') {\n return `The \"check\" properties of all tests in tested script \"${id}\" must be a strings.`;\n }\n if (testName !== undefined && typeof testName !== 'string') {\n return `If defined, the \"name\" properties of all tests in tested script \"${id}\" must be strings.`;\n }\n if (setup !== undefined && typeof setup !== 'string') {\n return `If defined, the \"setup\" properties of all tests in tested script \"${id}\" must be strings.`;\n }\n if (fails !== undefined && !isStringArray(fails)) {\n return `If defined, the \"fails\" property of each test in tested script \"${id}\" must be an array containing only scenario identifiers (strings).`;\n }\n if (invalid !== undefined && !isStringArray(invalid)) {\n return `If defined, the \"invalid\" property of each test in tested script \"${id}\" must be an array containing only scenario identifiers (strings).`;\n }\n if (passes !== undefined && !isStringArray(passes)) {\n return `If defined, the \"passes\" property of each test in tested script \"${id}\" must be an array containing only scenario identifiers (strings).`;\n }\n return {\n check,\n ...(fails === undefined ? {} : { fails }),\n ...(invalid === undefined ? {} : { invalid }),\n ...(passes === undefined ? {} : { passes }),\n ...(testName === undefined ? {} : { name: testName }),\n ...(setup === undefined ? {} : { setup }),\n };\n });\n const invalidTests = extractedTests.filter((result) => typeof result === 'string');\n if (invalidTests.length > 0) {\n return invalidTests.join(' ');\n }\n const validTests = extractedTests;\n return {\n id,\n script: {\n ...(name === undefined ? {} : { name }),\n ...(pushed === undefined ? {} : { pushed }),\n script: scriptContents,\n tests: validTests,\n },\n };\n });\n const invalidTestedResults = testedResults.filter((result) => typeof result === 'string');\n if (invalidTestedResults.length > 0) {\n return invalidTestedResults.join(' ');\n }\n const validTestedResults = testedResults;\n const tested = validTestedResults.reduce((all, result) => ({ ...all, [result.id]: result.script }), {});\n const testedIds = validTestedResults.map(({ id }) => id);\n const lockingAndUnlockingIds = [...lockingIds, ...unlockingIds];\n const lockingAndUnlockingIdsWithTests = lockingAndUnlockingIds.filter((id) => testedIds.includes(id));\n if (lockingAndUnlockingIdsWithTests.length > 0) {\n return `Locking and unlocking scripts may not have tests, but the following scripts include a \"tests\" property: ${listIds(lockingAndUnlockingIdsWithTests)}`;\n }\n const alreadySortedIds = [...lockingAndUnlockingIds, testedIds];\n const otherResults = allScripts\n .filter(({ id }) => !alreadySortedIds.includes(id))\n .map(({ id, script }) => {\n const { script: scriptContents, name } = script;\n if (typeof scriptContents !== 'string') {\n return `The \"script\" property of script \"${id}\" must be a string.`;\n }\n if (name !== undefined && typeof name !== 'string') {\n return `If defined, the \"name\" property of script \"${id}\" must be a string.`;\n }\n return {\n id,\n script: {\n ...(name === undefined ? {} : { name }),\n script: scriptContents,\n },\n };\n });\n const invalidOtherResults = otherResults.filter((result) => typeof result === 'string');\n if (invalidOtherResults.length > 0) {\n return invalidOtherResults.join(' ');\n }\n const validOtherResults = otherResults;\n const other = validOtherResults.reduce((all, result) => ({ ...all, [result.id]: result.script }), {});\n return {\n locking,\n other,\n tested,\n unlocking,\n };\n};\nconst authenticationTemplateVariableTypes = [\n 'AddressData',\n 'HdKey',\n 'Key',\n 'WalletData',\n];\nconst isAuthenticationTemplateVariableType = (type) => authenticationTemplateVariableTypes.includes(type);\n/**\n * Parse an authentication template entity `variables` object into its component\n * variables, validating the shape of each variable object. Returns either an\n * error message as a string or the cloned variables object.\n *\n * @param scripts - the `scripts` property of an `AuthenticationTemplate`\n */\nconst parseAuthenticationTemplateVariable = (variables, entityId) => {\n const unknownVariables = Object.entries(variables).map(([id, variable]) => ({ id, variable }));\n const nonObjectVariables = unknownVariables\n .filter(({ variable }) => typeof variable !== 'object' || variable === null)\n .map(({ id }) => id);\n if (nonObjectVariables.length > 0) {\n return `All authentication template variables must be objects, but the following variables owned by entity \"${entityId}\" are not objects: ${listIds(nonObjectVariables)}.`;\n }\n const allEntities = unknownVariables;\n const variableResults = allEntities\n // eslint-disable-next-line complexity\n .map(({ id, variable }) => {\n const { description, name, type } = variable;\n if (!isAuthenticationTemplateVariableType(type)) {\n return `The \"type\" property of variable \"${id}\" must be a valid authentication template variable type. Available types are: ${listIds(authenticationTemplateVariableTypes)}.`;\n }\n if (description !== undefined && typeof description !== 'string') {\n return `If defined, the \"description\" property of variable \"${id}\" must be a string.`;\n }\n if (name !== undefined && typeof name !== 'string') {\n return `If defined, the \"name\" property of variable \"${id}\" must be a string.`;\n }\n if (type === 'HdKey') {\n const { addressOffset, hdPublicKeyDerivationPath, privateDerivationPath, publicDerivationPath, } = variable;\n if (addressOffset !== undefined && typeof addressOffset !== 'number') {\n return `If defined, the \"addressOffset\" property of HdKey \"${id}\" must be a number.`;\n }\n if (hdPublicKeyDerivationPath !== undefined &&\n typeof hdPublicKeyDerivationPath !== 'string') {\n return `If defined, the \"hdPublicKeyDerivationPath\" property of HdKey \"${id}\" must be a string.`;\n }\n if (privateDerivationPath !== undefined &&\n typeof privateDerivationPath !== 'string') {\n return `If defined, the \"privateDerivationPath\" property of HdKey \"${id}\" must be a string.`;\n }\n if (publicDerivationPath !== undefined &&\n typeof publicDerivationPath !== 'string') {\n return `If defined, the \"publicDerivationPath\" property of HdKey \"${id}\" must be a string.`;\n }\n const hdPublicKeyPath = hdPublicKeyDerivationPath !== null && hdPublicKeyDerivationPath !== void 0 ? hdPublicKeyDerivationPath : _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.hdKeyHdPublicKeyDerivationPath;\n const privatePath = privateDerivationPath !== null && privateDerivationPath !== void 0 ? privateDerivationPath : _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults.hdKeyPrivateDerivationPath;\n const publicPath = publicDerivationPath !== null && publicDerivationPath !== void 0 ? publicDerivationPath : privatePath.replace('m', 'M');\n const validPrivatePathWithIndex = /^m(?:\\/(?:[0-9]+|i)'?)*$/u;\n const validPrivatePath = /^m(?:\\/[0-9]+'?)*$/u;\n const replacedPrivatePath = privatePath.replace('i', '0');\n if (!validPrivatePathWithIndex.test(privatePath) &&\n !validPrivatePath.test(replacedPrivatePath)) {\n return `If defined, the \"privateDerivationPath\" property of HdKey \"${id}\" must be a valid private derivation path, but the provided value is \"${hdPublicKeyPath}\". A valid path must begin with \"m\" and include only \"/\", \"'\", a single \"i\" address index character, and numbers.`;\n }\n if (!validPrivatePath.test(hdPublicKeyPath)) {\n return `If defined, the \"hdPublicKeyDerivationPath\" property of an HdKey must be a valid private derivation path for the HdKey's HD public node, but the provided value for HdKey \"${id}\" is \"${hdPublicKeyPath}\". A valid path must begin with \"m\" and include only \"/\", \"'\", and numbers (the \"i\" character cannot be used in \"hdPublicKeyDerivationPath\").`;\n }\n const validPublicPathWithIndex = /^M(?:\\/(?:[0-9]+|i))*$/u;\n const validPublicPath = /^M(?:\\/[0-9]+)*$/u;\n const replacedPublicPath = publicPath.replace('i', '0');\n if (!validPublicPathWithIndex.test(publicPath) &&\n !validPublicPath.test(replacedPublicPath)) {\n return `The \"publicDerivationPath\" property of HdKey \"${id}\" must be a valid public derivation path, but the current value is \"${publicPath}\". Public derivation paths must begin with \"M\" and include only \"/\", a single \"i\" address index character, and numbers. If the \"privateDerivationPath\" uses hardened derivation, the \"publicDerivationPath\" should be set to enable public derivation from the \"hdPublicKeyDerivationPath\".`;\n }\n const publicPathSuffix = publicPath.replace('M/', '');\n const impliedPrivatePath = `${hdPublicKeyPath}/${publicPathSuffix}`;\n if (impliedPrivatePath !== privatePath) {\n return `The \"privateDerivationPath\" property of HdKey \"${id}\" is \"${privatePath}\", but the implied private derivation path of \"hdPublicKeyDerivationPath\" and \"publicDerivationPath\" is \"${impliedPrivatePath}\". The \"publicDerivationPath\" property must be set to allow for public derivation of the same HD node derived by \"privateDerivationPath\" beginning from the HD public key derived at \"hdPublicKeyDerivationPath\".`;\n }\n return {\n id,\n variable: {\n ...(addressOffset === undefined ? {} : { addressOffset }),\n ...(description === undefined ? {} : { description }),\n ...(hdPublicKeyDerivationPath === undefined\n ? {}\n : { hdPublicKeyDerivationPath }),\n ...(name === undefined ? {} : { name }),\n ...(privateDerivationPath === undefined\n ? {}\n : { privateDerivationPath }),\n ...(publicDerivationPath === undefined\n ? {}\n : { publicDerivationPath }),\n type,\n },\n };\n }\n return {\n id,\n variable: {\n ...(description === undefined ? {} : { description }),\n ...(name === undefined ? {} : { name }),\n type,\n },\n };\n });\n const invalidVariableResults = variableResults.filter((result) => typeof result === 'string');\n if (invalidVariableResults.length > 0) {\n return invalidVariableResults.join(' ');\n }\n const validVariableResults = variableResults;\n const clonedVariables = validVariableResults.reduce((all, result) => ({ ...all, [result.id]: result.variable }), {});\n return clonedVariables;\n};\n/**\n * Parse an authentication template `entities` object into its component\n * entities, validating the shape of each entity object. Returns either an error\n * message as a string or the cloned entities object.\n *\n * @param scripts - the `scripts` property of an `AuthenticationTemplate`\n */\nconst parseAuthenticationTemplateEntities = (entities) => {\n const unknownEntities = Object.entries(entities).map(([id, entity]) => ({ entity, id }));\n const nonObjectEntities = unknownEntities\n .filter(({ entity }) => typeof entity !== 'object' || entity === null)\n .map(({ id }) => id);\n if (nonObjectEntities.length > 0) {\n return `All authentication template entities must be objects, but the following entities are not objects: ${listIds(nonObjectEntities)}.`;\n }\n const allEntities = unknownEntities;\n const entityResults = allEntities\n // eslint-disable-next-line complexity\n .map(({ id, entity }) => {\n const { description, name, scripts, variables } = entity;\n if (description !== undefined && typeof description !== 'string') {\n return `If defined, the \"description\" property of entity \"${id}\" must be a string.`;\n }\n if (name !== undefined && typeof name !== 'string') {\n return `If defined, the \"name\" property of entity \"${id}\" must be a string.`;\n }\n if (scripts !== undefined && !isStringArray(scripts)) {\n return `If defined, the \"scripts\" property of entity \"${id}\" must be an array containing only script identifiers (strings).`;\n }\n if (variables !== undefined && !isObject(variables)) {\n return `If defined, the \"variables\" property of entity \"${id}\" must be an object.`;\n }\n const variableResult = variables === undefined\n ? undefined\n : parseAuthenticationTemplateVariable(variables, id);\n if (typeof variableResult === 'string') {\n return variableResult;\n }\n return {\n entity: {\n ...(description === undefined ? {} : { description }),\n ...(name === undefined ? {} : { name }),\n ...(scripts === undefined ? {} : { scripts }),\n ...(variableResult === undefined\n ? {}\n : { variables: variableResult }),\n },\n id,\n };\n });\n const invalidEntityResults = entityResults.filter((result) => typeof result === 'string');\n if (invalidEntityResults.length > 0) {\n return invalidEntityResults.join(' ');\n }\n const validEntityResults = entityResults;\n const clonedEntities = validEntityResults.reduce((all, result) => ({ ...all, [result.id]: result.entity }), {});\n return clonedEntities;\n};\n/**\n * Validate and clone an Authentication Template Scenario `data.hdKeys` object.\n *\n * @param hdKeys - the `data.hdKeys` object to validate and clone\n * @param location - the location of the error to specify in error messages,\n * e.g. `scenario \"test\"` or\n * `'lockingBytecode.override' in output 2 of scenario \"test\"`\n */\n// eslint-disable-next-line complexity\nconst parseAuthenticationTemplateScenarioDataHdKeys = (hdKeys, location) => {\n const { addressIndex, hdPublicKeys, hdPrivateKeys } = hdKeys;\n const maximumAddressIndex = 2147483648;\n if (addressIndex !== undefined &&\n !isRangedInteger(addressIndex, 0, maximumAddressIndex)) {\n return `If defined, the \"data.hdKeys.addressIndex\" property of ${location} must be a positive integer between 0 and 2,147,483,648 (inclusive).`;\n }\n if (hdPublicKeys !== undefined &&\n !(isObject(hdPublicKeys) && isStringObject(hdPublicKeys))) {\n return `If defined, the \"data.hdKeys.hdPublicKeys\" property of ${location} must be an object, and each value must be a string.`;\n }\n if (hdPrivateKeys !== undefined &&\n !(isObject(hdPrivateKeys) && isStringObject(hdPrivateKeys))) {\n return `If defined, the \"data.hdKeys.hdPrivateKeys\" property of ${location} must be an object, and each value must be a string.`;\n }\n return {\n ...(addressIndex === undefined ? {} : { addressIndex }),\n ...(hdPublicKeys === undefined\n ? {}\n : { hdPublicKeys: { ...hdPublicKeys } }),\n ...(hdPrivateKeys === undefined\n ? {}\n : { hdPrivateKeys: { ...hdPrivateKeys } }),\n };\n};\n/**\n * Validate and clone an Authentication Template Scenario `data.keys` object.\n *\n * @param keys - the `data.keys` object to validate and clone\n * @param location - the location of the error to specify in error messages,\n * e.g. `scenario \"test\"` or\n * `'lockingBytecode.override' in output 2 of scenario \"test\"`\n */\nconst parseAuthenticationTemplateScenarioDataKeys = (keys, location) => {\n const { privateKeys } = keys;\n if (privateKeys !== undefined &&\n !(isObject(privateKeys) && isObjectOfValidPrivateKeys(privateKeys))) {\n return `If defined, the \"data.keys.privateKeys\" property of ${location} must be an object, and each value must be a 32-byte, hexadecimal-encoded private key.`;\n }\n return { ...(privateKeys === undefined ? {} : { privateKeys }) };\n};\n/**\n * Validate and clone an Authentication Template Scenario `data` object.\n *\n * @param data - the `data` object to validate and clone\n * @param location - the location of the error to specify in error messages,\n * e.g. `scenario \"test\"` or\n * `'lockingBytecode.override' in output 2 of scenario \"test\"`\n */\n// eslint-disable-next-line complexity\nconst parseAuthenticationTemplateScenarioData = (data, location) => {\n const { bytecode, currentBlockHeight, currentBlockTime, hdKeys, keys, } = data;\n if (bytecode !== undefined &&\n (!isObject(bytecode) || !isStringObject(bytecode))) {\n return `If defined, the \"data.bytecode\" property of ${location} must be an object, and each value must be a string.`;\n }\n const minimumBlockTime = 500000000;\n const maximumBlockTime = 4294967295;\n if (currentBlockHeight !== undefined &&\n !isRangedInteger(currentBlockHeight, 0, minimumBlockTime - 1)) {\n return `If defined, the \"currentBlockHeight\" property of ${location} must be a positive integer from 0 to 499,999,999 (inclusive).`;\n }\n if (currentBlockTime !== undefined &&\n !isRangedInteger(currentBlockTime, minimumBlockTime, maximumBlockTime)) {\n return `If defined, the \"currentBlockTime\" property of ${location} must be a positive integer from 500,000,000 to 4,294,967,295 (inclusive).`;\n }\n const hdKeysResult = hdKeys === undefined\n ? undefined\n : isObject(hdKeys)\n ? parseAuthenticationTemplateScenarioDataHdKeys(hdKeys, location)\n : `If defined, the \"data.hdKeys\" property of ${location} must be an object.`;\n if (typeof hdKeysResult === 'string') {\n return hdKeysResult;\n }\n const keysResult = keys === undefined\n ? undefined\n : isObject(keys)\n ? parseAuthenticationTemplateScenarioDataKeys(keys, location)\n : `If defined, the \"data.keys\" property of ${location} must be an object.`;\n if (typeof keysResult === 'string') {\n return keysResult;\n }\n return {\n ...(bytecode === undefined ? {} : { bytecode: { ...bytecode } }),\n ...(currentBlockHeight === undefined ? {} : { currentBlockHeight }),\n ...(currentBlockTime === undefined ? {} : { currentBlockTime }),\n ...(hdKeysResult === undefined ? {} : { hdKeys: hdKeysResult }),\n ...(keysResult === undefined ? {} : { keys: keysResult }),\n };\n};\n/**\n * Validate and clone an Authentication Template Scenario `transaction.inputs`\n * array.\n *\n * @param inputs - the `transaction.inputs` array to validate and clone\n * @param location - the location of the error to specify in error messages,\n * e.g. `scenario \"test\"`\n */\nconst parseAuthenticationTemplateScenarioTransactionInputs = (inputs, location) => {\n if (inputs === undefined) {\n return undefined;\n }\n if (!isDenseArray(inputs)) {\n return `If defined, the \"transaction.inputs\" property of ${location} must be an array of scenario input objects.`;\n }\n const inputResults = inputs\n // eslint-disable-next-line complexity\n .map((maybeInput, inputIndex) => {\n const { outpointIndex, outpointTransactionHash, sequenceNumber, unlockingBytecode, } = maybeInput;\n const newLocation = `input ${inputIndex} in ${location}`;\n if (outpointIndex !== undefined && !isPositiveInteger(outpointIndex)) {\n return `If defined, the \"outpointIndex\" property of ${newLocation} must be a positive integer.`;\n }\n const characterLength32ByteHash = 64;\n if (outpointTransactionHash !== undefined &&\n !(isHexString(outpointTransactionHash) &&\n outpointTransactionHash.length === characterLength32ByteHash)) {\n return `If defined, the \"outpointTransactionHash\" property of ${newLocation} must be a 32-byte, hexadecimal-encoded hash (string).`;\n }\n const maxSequenceNumber = 0xffffffff;\n if (sequenceNumber !== undefined &&\n !isRangedInteger(sequenceNumber, 0, maxSequenceNumber)) {\n return `If defined, the \"sequenceNumber\" property of ${newLocation} must be a number between 0 and 4294967295 (inclusive).`;\n }\n if (unlockingBytecode !== undefined &&\n unlockingBytecode !== null &&\n !isHexString(unlockingBytecode)) {\n return `If defined, the \"unlockingBytecode\" property of ${newLocation} must be either a null value or a hexadecimal-encoded string.`;\n }\n return {\n ...(outpointIndex === undefined ? {} : { outpointIndex }),\n ...(outpointTransactionHash === undefined\n ? {}\n : { outpointTransactionHash }),\n ...(sequenceNumber === undefined ? {} : { sequenceNumber }),\n ...(unlockingBytecode === undefined ? {} : { unlockingBytecode }),\n };\n });\n const invalidInputResults = inputResults.filter((result) => typeof result === 'string');\n if (invalidInputResults.length > 0) {\n return invalidInputResults.join(' ');\n }\n const clonedInputs = inputResults;\n return clonedInputs;\n};\n/**\n * Validate and clone an Authentication Template Scenario transaction output\n * `lockingBytecode` object.\n *\n * @param outputs - the `transaction.outputs[outputIndex].lockingBytecode`\n * object to validate and clone\n * @param location - the location of the error to specify in error messages,\n * e.g. `output 2 in scenario \"test\"`\n */\n// eslint-disable-next-line complexity\nconst parseAuthenticationTemplateScenarioTransactionOutputLockingBytecode = (lockingBytecode, location) => {\n const { overrides, script } = lockingBytecode;\n if (script !== undefined && script !== null && !isHexString(script)) {\n return `If defined, the \"script\" property of ${location} must be a hexadecimal-encoded string or \"null\".`;\n }\n const clonedOverrides = overrides === undefined\n ? undefined\n : isObject(overrides)\n ? parseAuthenticationTemplateScenarioData(overrides, `'lockingBytecode.override' in ${location}`)\n : `If defined, the \"overrides\" property of ${location} must be an object.`;\n if (typeof clonedOverrides === 'string') {\n return clonedOverrides;\n }\n return {\n ...(script === undefined ? {} : { script }),\n ...(clonedOverrides === undefined ? {} : { overrides: clonedOverrides }),\n };\n};\n/**\n * Validate and clone an Authentication Template Scenario `transaction.outputs`\n * array.\n *\n * @param outputs - the `transaction.outputs` array to validate and clone\n * @param location - the location of the error to specify in error messages,\n * e.g. `of output 2 in scenario \"test\"`\n */\nconst parseAuthenticationTemplateScenarioTransactionOutputs = (outputs, location) => {\n if (outputs === undefined) {\n return undefined;\n }\n if (!isDenseArray(outputs)) {\n return `If defined, the \"transaction.outputs\" property of ${location} must be an array of scenario output objects.`;\n }\n const outputResults = outputs\n // eslint-disable-next-line complexity\n .map((maybeOutput, outputIndex) => {\n const { lockingBytecode, satoshis } = maybeOutput;\n const newLocation = `output ${outputIndex} in ${location}`;\n if (lockingBytecode !== undefined &&\n typeof lockingBytecode !== 'string' &&\n !isObject(lockingBytecode)) {\n return `If defined, the \"lockingBytecode\" property of ${newLocation} must be a string or an object.`;\n }\n if (typeof lockingBytecode === 'string' &&\n !isHexString(lockingBytecode)) {\n return `If the \"lockingBytecode\" property of ${newLocation} is a string, it must be a valid, hexadecimal-encoded locking bytecode.`;\n }\n const clonedLockingBytecode = lockingBytecode === undefined || typeof lockingBytecode === 'string'\n ? undefined\n : parseAuthenticationTemplateScenarioTransactionOutputLockingBytecode(lockingBytecode, newLocation);\n if (typeof clonedLockingBytecode === 'string') {\n return clonedLockingBytecode;\n }\n if (!isValidSatoshisValue(satoshis)) {\n return `If defined, the \"satoshis\" property of ${newLocation} must be either a number or a little-endian, unsigned 64-bit integer as a hexadecimal-encoded string (16 characters).`;\n }\n return {\n ...(lockingBytecode === undefined\n ? {}\n : typeof lockingBytecode === 'string'\n ? { lockingBytecode }\n : { lockingBytecode: clonedLockingBytecode }),\n ...(satoshis === undefined ? {} : { satoshis }),\n };\n });\n const invalidOutputResults = outputResults.filter((result) => typeof result === 'string');\n if (invalidOutputResults.length > 0) {\n return invalidOutputResults.join(' ');\n }\n const clonedOutputs = outputResults;\n if (clonedOutputs.length === 0) {\n return `If defined, the \"transaction.outputs\" property of ${location} must be have at least one output.`;\n }\n return clonedOutputs;\n};\n/**\n * Validate and clone an Authentication Template Scenario `transaction` object.\n *\n * @param transaction - the `transaction` object to validate and clone\n * @param location - the location of the error to specify in error messages,\n * e.g. `of output 2 in scenario \"test\"`\n */\n// eslint-disable-next-line complexity\nconst parseAuthenticationTemplateScenarioTransaction = (transaction, location) => {\n const { inputs, locktime, outputs, version } = transaction;\n const maximumLocktime = 4294967295;\n if (locktime !== undefined &&\n !isRangedInteger(locktime, 0, maximumLocktime)) {\n return `If defined, the \"locktime\" property of ${location} must be an integer between 0 and 4,294,967,295 (inclusive).`;\n }\n const maximumVersion = 4294967295;\n if (version !== undefined && !isRangedInteger(version, 0, maximumVersion)) {\n return `If defined, the \"version\" property of ${location} must be an integer between 0 and 4,294,967,295 (inclusive).`;\n }\n const clonedInputs = parseAuthenticationTemplateScenarioTransactionInputs(inputs, location);\n if (typeof clonedInputs === 'string') {\n return clonedInputs;\n }\n const clonedOutputs = parseAuthenticationTemplateScenarioTransactionOutputs(outputs, location);\n if (typeof clonedOutputs === 'string') {\n return clonedOutputs;\n }\n return {\n ...(locktime === undefined ? {} : { locktime }),\n ...(clonedInputs === undefined ? {} : { inputs: clonedInputs }),\n ...(clonedOutputs === undefined ? {} : { outputs: clonedOutputs }),\n ...(version === undefined ? {} : { version }),\n };\n};\n/**\n * Validate and clone an object of Authentication Template scenarios.\n *\n * @param scenarios - the scenarios object to validate and clone\n */\nconst parseAuthenticationTemplateScenarios = (scenarios) => {\n const unknownScenarios = Object.entries(scenarios).map(([id, scenario]) => ({ id, scenario }));\n const nonObjectScenarios = unknownScenarios\n .filter(({ scenario }) => typeof scenario !== 'object' || scenario === null)\n .map(({ id }) => id);\n if (nonObjectScenarios.length > 0) {\n return `All authentication template scenarios must be objects, but the following scenarios are not objects: ${listIds(nonObjectScenarios)}.`;\n }\n const allScenarios = unknownScenarios;\n const scenarioResults = allScenarios\n // eslint-disable-next-line complexity\n .map(({ id, scenario }) => {\n var _a;\n const { data, description, extends: extendsProp, name, transaction, value, } = scenario;\n const location = `scenario \"${id}\"`;\n if (description !== undefined && typeof description !== 'string') {\n return `If defined, the \"description\" property of ${location} must be a string.`;\n }\n if (name !== undefined && typeof name !== 'string') {\n return `If defined, the \"name\" property of ${location} must be a string.`;\n }\n if (extendsProp !== undefined && typeof extendsProp !== 'string') {\n return `If defined, the \"extends\" property of ${location} must be a string.`;\n }\n if (!isValidSatoshisValue(value)) {\n return `If defined, the \"value\" property of ${location} must be either a number or a little-endian, unsigned 64-bit integer as a hexadecimal-encoded string (16 characters).`;\n }\n if (data !== undefined && !isObject(data)) {\n return `If defined, the \"data\" property of ${location} must be an object.`;\n }\n if (transaction !== undefined && !isObject(transaction)) {\n return `If defined, the \"transaction\" property of ${location} must be an object.`;\n }\n const dataResult = data === undefined\n ? undefined\n : parseAuthenticationTemplateScenarioData(data, location);\n if (typeof dataResult === 'string') {\n return dataResult;\n }\n const transactionResult = transaction === undefined\n ? undefined\n : parseAuthenticationTemplateScenarioTransaction(transaction, location);\n if (typeof transactionResult === 'string') {\n return transactionResult;\n }\n const inputsUnderTest = (_a = transactionResult === null || transactionResult === void 0 ? void 0 : transactionResult.inputs) === null || _a === void 0 ? void 0 : _a.filter((input) => input.unlockingBytecode === undefined ||\n input.unlockingBytecode === null);\n if (inputsUnderTest !== undefined && inputsUnderTest.length !== 1) {\n return `If defined, the \"transaction.inputs\" array of ${location} must have exactly one input under test (an \"unlockingBytecode\" set to \"null\").`;\n }\n return {\n id,\n scenario: {\n ...(dataResult === undefined ? {} : { data: dataResult }),\n ...(description === undefined ? {} : { description }),\n ...(extendsProp === undefined ? {} : { extends: extendsProp }),\n ...(name === undefined ? {} : { name }),\n ...(transactionResult === undefined\n ? {}\n : { transaction: transactionResult }),\n ...(value === undefined ? {} : { value }),\n },\n };\n });\n const invalidScenarioResults = scenarioResults.filter((result) => typeof result === 'string');\n if (invalidScenarioResults.length > 0) {\n return invalidScenarioResults.join(' ');\n }\n const validScenarioResults = scenarioResults;\n const clonedScenarios = validScenarioResults.reduce((all, result) => ({ ...all, [result.id]: result.scenario }), {});\n const unknownExtends = Object.values(clonedScenarios).reduce((all, scenario) => scenario.extends !== undefined &&\n clonedScenarios[scenario.extends] === undefined\n ? [...all, scenario.extends]\n : all, []);\n if (unknownExtends.length > 0) {\n return `If defined, each scenario ID referenced by another scenario's \"extends\" property must exist. Unknown scenario IDs: ${listIds(unknownExtends)}.`;\n }\n return clonedScenarios;\n};\nconst isVersion0 = (maybeTemplate) => maybeTemplate.version === 0;\nconst schemaIsOptionalString = (maybeTemplate) => {\n const property = maybeTemplate.$schema;\n return property === undefined || typeof property === 'string';\n};\nconst nameIsOptionalString = (maybeTemplate) => {\n const property = maybeTemplate.name;\n return property === undefined || typeof property === 'string';\n};\nconst descriptionIsOptionalString = (maybeTemplate) => {\n const property = maybeTemplate.description;\n return property === undefined || typeof property === 'string';\n};\nconst supportsOnlyValidVmIdentifiers = (maybeTemplate, availableIdentifiers) => {\n const { supported } = maybeTemplate;\n return (Array.isArray(supported) &&\n supported.every((value) => availableIdentifiers.includes(value)));\n};\n/**\n * Parse and validate an authentication template, returning either an error\n * message as a string or a valid, safely-cloned `AuthenticationTemplate`.\n *\n * This method validates both the structure and the contents of a template:\n * - All properties and sub-properties are verified to be of the expected type.\n * - The ID of each entity, script, and scenario is confirmed to be unique.\n * - Script IDs referenced by entities and other scripts (via `unlocks`) are\n * confirmed to exist.\n * - The derivation paths of each HdKey are validated against each other.\n *\n * This method does not validate the BTL contents of scripts (by attempting\n * compilation, evaluate `AuthenticationTemplateScriptTest`s, or test scenario\n * generation. Unknown properties are ignored and excluded from the final\n * result.\n *\n * @param maybeTemplate - object to validate as an authentication template\n */\n// eslint-disable-next-line complexity\nconst validateAuthenticationTemplate = (maybeTemplate) => {\n if (typeof maybeTemplate !== 'object' || maybeTemplate === null) {\n return 'A valid authentication template must be an object.';\n }\n if (!isVersion0(maybeTemplate)) {\n return 'Only version 0 authentication templates are currently supported.';\n }\n const vmIdentifiers = [\n 'BCH_2022_11_SPEC',\n 'BCH_2022_11',\n 'BCH_2022_05_SPEC',\n 'BCH_2022_05',\n 'BCH_2021_11_SPEC',\n 'BCH_2021_11',\n 'BCH_2021_05_SPEC',\n 'BCH_2021_05',\n 'BCH_2020_11_SPEC',\n 'BCH_2020_11',\n 'BCH_2020_05',\n 'BCH_2019_11',\n 'BCH_2019_05',\n 'BSV_2018_11',\n 'BTC_2017_08',\n ];\n if (!supportsOnlyValidVmIdentifiers(maybeTemplate, vmIdentifiers) ||\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n maybeTemplate.supported.includes(undefined)) {\n return `Version 0 authentication templates must include a \"supported\" list of authentication virtual machine versions. Available identifiers are: ${vmIdentifiers.join(', ')}.`;\n }\n if (!schemaIsOptionalString(maybeTemplate)) {\n return 'The \"$schema\" property of an authentication template must be a string.';\n }\n if (!nameIsOptionalString(maybeTemplate)) {\n return 'The \"name\" property of an authentication template must be a string.';\n }\n if (!descriptionIsOptionalString(maybeTemplate)) {\n return 'The \"description\" property of an authentication template must be a string.';\n }\n const { entities, scenarios, scripts } = maybeTemplate;\n if (typeof entities !== 'object' || entities === null) {\n return `The \"entities\" property of an authentication template must be an object.`;\n }\n if (typeof scripts !== 'object' || scripts === null) {\n return `The \"scripts\" property of an authentication template must be an object.`;\n }\n if (scenarios !== undefined &&\n (typeof scenarios !== 'object' || scenarios === null)) {\n return `If defined, the \"scenarios\" property of an authentication template must be an object.`;\n }\n const parsedScripts = parseAuthenticationTemplateScripts(scripts);\n if (typeof parsedScripts === 'string') {\n return parsedScripts;\n }\n const clonedScripts = [\n ...Object.entries(parsedScripts.locking),\n ...Object.entries(parsedScripts.other),\n ...Object.entries(parsedScripts.tested),\n ...Object.entries(parsedScripts.unlocking),\n ].reduce((all, [id, script]) => ({ ...all, [id]: script }), {});\n const clonedEntities = parseAuthenticationTemplateEntities(entities);\n if (typeof clonedEntities === 'string') {\n return clonedEntities;\n }\n const clonedScenarios = scenarios === undefined\n ? undefined\n : parseAuthenticationTemplateScenarios(scenarios);\n if (typeof clonedScenarios === 'string') {\n return clonedScenarios;\n }\n const variableIds = Object.values(clonedEntities).reduce((all, entity) => entity.variables === undefined\n ? all\n : [...all, ...Object.keys(entity.variables)], []);\n const entityIds = Object.keys(clonedEntities);\n const scriptIds = Object.keys(clonedScripts);\n const scenarioIds = clonedScenarios === undefined ? [] : Object.keys(clonedScenarios);\n const usedIds = [...variableIds, ...entityIds, ...scriptIds, ...scenarioIds];\n const builtInIds = [\n _language_resolve__WEBPACK_IMPORTED_MODULE_3__.BuiltInVariables.currentBlockHeight,\n _language_resolve__WEBPACK_IMPORTED_MODULE_3__.BuiltInVariables.currentBlockTime,\n _language_resolve__WEBPACK_IMPORTED_MODULE_3__.BuiltInVariables.signingSerialization,\n ];\n const usedBuiltInIds = builtInIds.filter((builtInIdentifier) => usedIds.includes(builtInIdentifier));\n if (usedBuiltInIds.length > 0) {\n return `Built-in identifiers may not be re-used by any entity, variable, script, or scenario. The following built-in identifiers are re-used: ${listIds(usedBuiltInIds)}.`;\n }\n const idUsageCount = usedIds.reduce((count, id) => {\n var _a;\n return ({\n ...count,\n [id]: ((_a = count[id]) !== null && _a !== void 0 ? _a : 0) + 1,\n });\n }, {});\n const duplicateIds = Object.entries(idUsageCount)\n .filter(([, count]) => count > 1)\n .map(([id]) => id);\n if (duplicateIds.length > 0) {\n return `The ID of each entity, variable, script, and scenario in an authentication template must be unique. The following IDs are re-used: ${listIds(duplicateIds)}.`;\n }\n const unknownScriptIds = Object.values(clonedEntities)\n .reduce((all, entity) => entity.scripts === undefined ? all : [...all, ...entity.scripts], [])\n .reduce((unique, id) => scriptIds.includes(id) || unique.includes(id)\n ? unique\n : [...unique, id], []);\n if (unknownScriptIds.length > 0) {\n return `Only known scripts may be assigned to entities. The following script IDs are not provided in this template: ${listIds(unknownScriptIds)}.`;\n }\n const unknownScenarioIds = [\n ...Object.values(parsedScripts.unlocking).reduce((all, script) => [\n ...all,\n ...(script.estimate === undefined ? [] : [script.estimate]),\n ...(script.fails === undefined ? [] : script.fails),\n ...(script.invalid === undefined ? [] : script.invalid),\n ...(script.passes === undefined ? [] : script.passes),\n ], []),\n ...Object.values(parsedScripts.tested).reduce((all, script) => [\n ...all,\n ...script.tests.reduce((fromScript, test) => [\n ...fromScript,\n ...(test.fails === undefined ? [] : test.fails),\n ...(test.invalid === undefined ? [] : test.invalid),\n ...(test.passes === undefined ? [] : test.passes),\n ], []),\n ], []),\n ].reduce((unique, id) => scenarioIds.includes(id) || unique.includes(id)\n ? unique\n : [...unique, id], []);\n if (unknownScenarioIds.length > 0) {\n return `Only known scenarios may be referenced by scripts. The following scenario IDs are not provided in this template: ${listIds(unknownScenarioIds)}.`;\n }\n const entityIdsReferencedByScenarioData = (data) => {\n var _a, _b;\n const hdPublicKeyEntityIds = ((_a = data === null || data === void 0 ? void 0 : data.hdKeys) === null || _a === void 0 ? void 0 : _a.hdPublicKeys) === undefined\n ? []\n : Object.keys(data.hdKeys.hdPublicKeys);\n const hdPrivateKeyEntityIds = ((_b = data === null || data === void 0 ? void 0 : data.hdKeys) === null || _b === void 0 ? void 0 : _b.hdPrivateKeys) === undefined\n ? []\n : Object.keys(data.hdKeys.hdPrivateKeys);\n return [...hdPublicKeyEntityIds, ...hdPrivateKeyEntityIds];\n };\n const unknownEntityIds = clonedScenarios === undefined\n ? []\n : Object.values(clonedScenarios)\n .reduce((all, scenario) => {\n var _a, _b;\n return [\n ...all,\n ...entityIdsReferencedByScenarioData(scenario.data),\n ...((_b = (_a = scenario.transaction) === null || _a === void 0 ? void 0 : _a.outputs) !== null && _b !== void 0 ? _b : []).reduce((fromOverrides, output) => isObject(output.lockingBytecode)\n ? [\n ...fromOverrides,\n ...entityIdsReferencedByScenarioData(output.lockingBytecode.overrides),\n ]\n : fromOverrides, []),\n ];\n }, [])\n .reduce((unique, id) => entityIds.includes(id) || unique.includes(id)\n ? unique\n : [...unique, id], []);\n if (unknownEntityIds.length > 0) {\n return `Only known entities may be referenced by hdKeys properties within scenarios. The following entity IDs are not provided in this template: ${listIds(unknownEntityIds)}.`;\n }\n return {\n ...(maybeTemplate.$schema === undefined\n ? {}\n : { $schema: maybeTemplate.$schema }),\n ...(maybeTemplate.description === undefined\n ? {}\n : { description: maybeTemplate.description }),\n entities: clonedEntities,\n ...(maybeTemplate.name === undefined ? {} : { name: maybeTemplate.name }),\n scenarios: clonedScenarios,\n scripts: clonedScripts,\n supported: maybeTemplate.supported,\n version: maybeTemplate.version,\n };\n};\n//# sourceMappingURL=template-validation.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/template-validation.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/template/template.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/template/template.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BuiltInVariables: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.BuiltInVariables),\n/* harmony export */ CompilerDefaults: () => (/* reexport safe */ _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__.CompilerDefaults),\n/* harmony export */ IdentifierResolutionErrorType: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.IdentifierResolutionErrorType),\n/* harmony export */ IdentifierResolutionType: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.IdentifierResolutionType),\n/* harmony export */ SigningSerializationAlgorithmIdentifier: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.SigningSerializationAlgorithmIdentifier),\n/* harmony export */ allErrorsAreRecoverable: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.allErrorsAreRecoverable),\n/* harmony export */ attemptCompilerOperations: () => (/* reexport safe */ _compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_3__.attemptCompilerOperations),\n/* harmony export */ authenticationTemplateP2pkh: () => (/* reexport safe */ _standard_standard__WEBPACK_IMPORTED_MODULE_8__.authenticationTemplateP2pkh),\n/* harmony export */ authenticationTemplateP2pkhNonHd: () => (/* reexport safe */ _standard_standard__WEBPACK_IMPORTED_MODULE_8__.authenticationTemplateP2pkhNonHd),\n/* harmony export */ authenticationTemplateToCompilationEnvironment: () => (/* reexport safe */ _compiler__WEBPACK_IMPORTED_MODULE_6__.authenticationTemplateToCompilationEnvironment),\n/* harmony export */ authenticationTemplateToCompilationEnvironmentVirtualizedTests: () => (/* reexport safe */ _compiler__WEBPACK_IMPORTED_MODULE_6__.authenticationTemplateToCompilationEnvironmentVirtualizedTests),\n/* harmony export */ authenticationTemplateToCompilerBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.authenticationTemplateToCompilerBCH),\n/* harmony export */ compileBtl: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.compileBtl),\n/* harmony export */ compileScript: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.compileScript),\n/* harmony export */ compileScriptContents: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.compileScriptContents),\n/* harmony export */ compileScriptP2shLocking: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.compileScriptP2shLocking),\n/* harmony export */ compileScriptP2shUnlocking: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.compileScriptP2shUnlocking),\n/* harmony export */ compileScriptRaw: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.compileScriptRaw),\n/* harmony export */ compilerOperationAddressData: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationAddressData),\n/* harmony export */ compilerOperationAttemptBytecodeResolution: () => (/* reexport safe */ _compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_3__.compilerOperationAttemptBytecodeResolution),\n/* harmony export */ compilerOperationCurrentBlockHeight: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationCurrentBlockHeight),\n/* harmony export */ compilerOperationCurrentBlockTime: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationCurrentBlockTime),\n/* harmony export */ compilerOperationHdKeyEcdsaDataSignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHdKeyEcdsaDataSignatureBCH),\n/* harmony export */ compilerOperationHdKeyEcdsaSignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHdKeyEcdsaSignatureBCH),\n/* harmony export */ compilerOperationHdKeyPublicKeyCommon: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationHdKeyPublicKeyCommon),\n/* harmony export */ compilerOperationHdKeySchnorrDataSignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHdKeySchnorrDataSignatureBCH),\n/* harmony export */ compilerOperationHdKeySchnorrSignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHdKeySchnorrSignatureBCH),\n/* harmony export */ compilerOperationHelperAddressIndex: () => (/* reexport safe */ _compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_3__.compilerOperationHelperAddressIndex),\n/* harmony export */ compilerOperationHelperCompileScript: () => (/* reexport safe */ _compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_3__.compilerOperationHelperCompileScript),\n/* harmony export */ compilerOperationHelperComputeDataSignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHelperComputeDataSignatureBCH),\n/* harmony export */ compilerOperationHelperComputeSignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHelperComputeSignatureBCH),\n/* harmony export */ compilerOperationHelperDeriveHdKeyPrivate: () => (/* reexport safe */ _compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_3__.compilerOperationHelperDeriveHdKeyPrivate),\n/* harmony export */ compilerOperationHelperDeriveHdPrivateNode: () => (/* reexport safe */ _compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_3__.compilerOperationHelperDeriveHdPrivateNode),\n/* harmony export */ compilerOperationHelperGenerateCoveredBytecode: () => (/* reexport safe */ _compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_3__.compilerOperationHelperGenerateCoveredBytecode),\n/* harmony export */ compilerOperationHelperHdKeyDataSignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHelperHdKeyDataSignatureBCH),\n/* harmony export */ compilerOperationHelperHdKeySignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHelperHdKeySignatureBCH),\n/* harmony export */ compilerOperationHelperKeyDataSignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHelperKeyDataSignatureBCH),\n/* harmony export */ compilerOperationHelperKeySignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationHelperKeySignatureBCH),\n/* harmony export */ compilerOperationHelperUnknownEntity: () => (/* reexport safe */ _compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_3__.compilerOperationHelperUnknownEntity),\n/* harmony export */ compilerOperationKeyEcdsaDataSignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationKeyEcdsaDataSignatureBCH),\n/* harmony export */ compilerOperationKeyEcdsaSignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationKeyEcdsaSignatureBCH),\n/* harmony export */ compilerOperationKeyPublicKeyCommon: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationKeyPublicKeyCommon),\n/* harmony export */ compilerOperationKeySchnorrDataSignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationKeySchnorrDataSignatureBCH),\n/* harmony export */ compilerOperationKeySchnorrSignatureBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationKeySchnorrSignatureBCH),\n/* harmony export */ compilerOperationRequires: () => (/* reexport safe */ _compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_3__.compilerOperationRequires),\n/* harmony export */ compilerOperationSigningSerializationCorrespondingOutput: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationCorrespondingOutput),\n/* harmony export */ compilerOperationSigningSerializationCorrespondingOutputHash: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationCorrespondingOutputHash),\n/* harmony export */ compilerOperationSigningSerializationCoveredBytecode: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationCoveredBytecode),\n/* harmony export */ compilerOperationSigningSerializationCoveredBytecodeLength: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationCoveredBytecodeLength),\n/* harmony export */ compilerOperationSigningSerializationFullBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationSigningSerializationFullBCH),\n/* harmony export */ compilerOperationSigningSerializationLocktime: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationLocktime),\n/* harmony export */ compilerOperationSigningSerializationOutpointIndex: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationOutpointIndex),\n/* harmony export */ compilerOperationSigningSerializationOutpointTransactionHash: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationOutpointTransactionHash),\n/* harmony export */ compilerOperationSigningSerializationOutputValue: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationOutputValue),\n/* harmony export */ compilerOperationSigningSerializationSequenceNumber: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationSequenceNumber),\n/* harmony export */ compilerOperationSigningSerializationTransactionOutpoints: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationTransactionOutpoints),\n/* harmony export */ compilerOperationSigningSerializationTransactionOutpointsHash: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationTransactionOutpointsHash),\n/* harmony export */ compilerOperationSigningSerializationTransactionOutputs: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationTransactionOutputs),\n/* harmony export */ compilerOperationSigningSerializationTransactionOutputsHash: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationTransactionOutputsHash),\n/* harmony export */ compilerOperationSigningSerializationTransactionSequenceNumbers: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationTransactionSequenceNumbers),\n/* harmony export */ compilerOperationSigningSerializationTransactionSequenceNumbersHash: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationTransactionSequenceNumbersHash),\n/* harmony export */ compilerOperationSigningSerializationVersion: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationSigningSerializationVersion),\n/* harmony export */ compilerOperationWalletData: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationWalletData),\n/* harmony export */ compilerOperationsBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.compilerOperationsBCH),\n/* harmony export */ compilerOperationsCommon: () => (/* reexport safe */ _compiler_operations__WEBPACK_IMPORTED_MODULE_4__.compilerOperationsCommon),\n/* harmony export */ containsRange: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.containsRange),\n/* harmony export */ createAuthenticationProgramEvaluationCommon: () => (/* reexport safe */ _compiler__WEBPACK_IMPORTED_MODULE_6__.createAuthenticationProgramEvaluationCommon),\n/* harmony export */ createCompiler: () => (/* reexport safe */ _compiler__WEBPACK_IMPORTED_MODULE_6__.createCompiler),\n/* harmony export */ createCompilerBCH: () => (/* reexport safe */ _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__.createCompilerBCH),\n/* harmony export */ createCompilerCommonSynchronous: () => (/* reexport safe */ _compiler__WEBPACK_IMPORTED_MODULE_6__.createCompilerCommonSynchronous),\n/* harmony export */ createIdentifierResolver: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.createIdentifierResolver),\n/* harmony export */ describeExpectedInput: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.describeExpectedInput),\n/* harmony export */ extendCompilationDataWithScenarioBytecode: () => (/* reexport safe */ _scenarios__WEBPACK_IMPORTED_MODULE_7__.extendCompilationDataWithScenarioBytecode),\n/* harmony export */ extendScenarioDefinition: () => (/* reexport safe */ _scenarios__WEBPACK_IMPORTED_MODULE_7__.extendScenarioDefinition),\n/* harmony export */ extendScenarioDefinitionData: () => (/* reexport safe */ _scenarios__WEBPACK_IMPORTED_MODULE_7__.extendScenarioDefinitionData),\n/* harmony export */ extendedScenarioDefinitionToCompilationData: () => (/* reexport safe */ _scenarios__WEBPACK_IMPORTED_MODULE_7__.extendedScenarioDefinitionToCompilationData),\n/* harmony export */ extractBytecodeResolutions: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.extractBytecodeResolutions),\n/* harmony export */ extractEvaluationSamples: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.extractEvaluationSamples),\n/* harmony export */ extractEvaluationSamplesRecursive: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.extractEvaluationSamplesRecursive),\n/* harmony export */ extractResolvedVariableBytecodeMap: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.extractResolvedVariableBytecodeMap),\n/* harmony export */ extractUnexecutedRanges: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.extractUnexecutedRanges),\n/* harmony export */ generateDefaultScenarioDefinition: () => (/* reexport safe */ _scenarios__WEBPACK_IMPORTED_MODULE_7__.generateDefaultScenarioDefinition),\n/* harmony export */ generateExtendedScenario: () => (/* reexport safe */ _scenarios__WEBPACK_IMPORTED_MODULE_7__.generateExtendedScenario),\n/* harmony export */ generateScenarioCommon: () => (/* reexport safe */ _scenarios__WEBPACK_IMPORTED_MODULE_7__.generateScenarioCommon),\n/* harmony export */ getResolutionErrors: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.getResolutionErrors),\n/* harmony export */ mergeRanges: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.mergeRanges),\n/* harmony export */ parseAuthenticationTemplateEntities: () => (/* reexport safe */ _template_validation__WEBPACK_IMPORTED_MODULE_10__.parseAuthenticationTemplateEntities),\n/* harmony export */ parseAuthenticationTemplateScenarioData: () => (/* reexport safe */ _template_validation__WEBPACK_IMPORTED_MODULE_10__.parseAuthenticationTemplateScenarioData),\n/* harmony export */ parseAuthenticationTemplateScenarioDataHdKeys: () => (/* reexport safe */ _template_validation__WEBPACK_IMPORTED_MODULE_10__.parseAuthenticationTemplateScenarioDataHdKeys),\n/* harmony export */ parseAuthenticationTemplateScenarioDataKeys: () => (/* reexport safe */ _template_validation__WEBPACK_IMPORTED_MODULE_10__.parseAuthenticationTemplateScenarioDataKeys),\n/* harmony export */ parseAuthenticationTemplateScenarioTransaction: () => (/* reexport safe */ _template_validation__WEBPACK_IMPORTED_MODULE_10__.parseAuthenticationTemplateScenarioTransaction),\n/* harmony export */ parseAuthenticationTemplateScenarioTransactionInputs: () => (/* reexport safe */ _template_validation__WEBPACK_IMPORTED_MODULE_10__.parseAuthenticationTemplateScenarioTransactionInputs),\n/* harmony export */ parseAuthenticationTemplateScenarioTransactionOutputLockingBytecode: () => (/* reexport safe */ _template_validation__WEBPACK_IMPORTED_MODULE_10__.parseAuthenticationTemplateScenarioTransactionOutputLockingBytecode),\n/* harmony export */ parseAuthenticationTemplateScenarioTransactionOutputs: () => (/* reexport safe */ _template_validation__WEBPACK_IMPORTED_MODULE_10__.parseAuthenticationTemplateScenarioTransactionOutputs),\n/* harmony export */ parseAuthenticationTemplateScenarios: () => (/* reexport safe */ _template_validation__WEBPACK_IMPORTED_MODULE_10__.parseAuthenticationTemplateScenarios),\n/* harmony export */ parseAuthenticationTemplateScripts: () => (/* reexport safe */ _template_validation__WEBPACK_IMPORTED_MODULE_10__.parseAuthenticationTemplateScripts),\n/* harmony export */ parseAuthenticationTemplateVariable: () => (/* reexport safe */ _template_validation__WEBPACK_IMPORTED_MODULE_10__.parseAuthenticationTemplateVariable),\n/* harmony export */ parseScript: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.parseScript),\n/* harmony export */ reduceScript: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.reduceScript),\n/* harmony export */ resolveScriptIdentifier: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.resolveScriptIdentifier),\n/* harmony export */ resolveScriptSegment: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.resolveScriptSegment),\n/* harmony export */ resolveVariableIdentifier: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.resolveVariableIdentifier),\n/* harmony export */ stringifyErrors: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.stringifyErrors),\n/* harmony export */ validateAuthenticationTemplate: () => (/* reexport safe */ _template_validation__WEBPACK_IMPORTED_MODULE_10__.validateAuthenticationTemplate),\n/* harmony export */ verifyBtlEvaluationState: () => (/* reexport safe */ _language_language__WEBPACK_IMPORTED_MODULE_1__.verifyBtlEvaluationState)\n/* harmony export */ });\n/* harmony import */ var _compiler_bch_compiler_bch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compiler-bch/compiler-bch */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-bch/compiler-bch.js\");\n/* harmony import */ var _language_language__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./language/language */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/language.js\");\n/* harmony import */ var _compiler_defaults__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./compiler-defaults */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-defaults.js\");\n/* harmony import */ var _compiler_operation_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./compiler-operation-helpers */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-operation-helpers.js\");\n/* harmony import */ var _compiler_operations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./compiler-operations */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-operations.js\");\n/* harmony import */ var _compiler_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./compiler-types */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler-types.js\");\n/* harmony import */ var _compiler_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_compiler_types__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _compiler_types__WEBPACK_IMPORTED_MODULE_5__) if([\"default\",\"SigningSerializationAlgorithmIdentifier\",\"authenticationTemplateToCompilerBCH\",\"compilerOperationHdKeyEcdsaDataSignatureBCH\",\"compilerOperationHdKeyEcdsaSignatureBCH\",\"compilerOperationHdKeySchnorrDataSignatureBCH\",\"compilerOperationHdKeySchnorrSignatureBCH\",\"compilerOperationHelperComputeDataSignatureBCH\",\"compilerOperationHelperComputeSignatureBCH\",\"compilerOperationHelperHdKeyDataSignatureBCH\",\"compilerOperationHelperHdKeySignatureBCH\",\"compilerOperationHelperKeyDataSignatureBCH\",\"compilerOperationHelperKeySignatureBCH\",\"compilerOperationKeyEcdsaDataSignatureBCH\",\"compilerOperationKeyEcdsaSignatureBCH\",\"compilerOperationKeySchnorrDataSignatureBCH\",\"compilerOperationKeySchnorrSignatureBCH\",\"compilerOperationSigningSerializationFullBCH\",\"compilerOperationsBCH\",\"createCompilerBCH\",\"BuiltInVariables\",\"IdentifierResolutionErrorType\",\"IdentifierResolutionType\",\"allErrorsAreRecoverable\",\"compileBtl\",\"compileScript\",\"compileScriptContents\",\"compileScriptP2shLocking\",\"compileScriptP2shUnlocking\",\"compileScriptRaw\",\"containsRange\",\"createIdentifierResolver\",\"describeExpectedInput\",\"extractBytecodeResolutions\",\"extractEvaluationSamples\",\"extractEvaluationSamplesRecursive\",\"extractResolvedVariableBytecodeMap\",\"extractUnexecutedRanges\",\"getResolutionErrors\",\"mergeRanges\",\"parseScript\",\"reduceScript\",\"resolveScriptIdentifier\",\"resolveScriptSegment\",\"resolveVariableIdentifier\",\"stringifyErrors\",\"verifyBtlEvaluationState\",\"CompilerDefaults\",\"attemptCompilerOperations\",\"compilerOperationAttemptBytecodeResolution\",\"compilerOperationHelperAddressIndex\",\"compilerOperationHelperCompileScript\",\"compilerOperationHelperDeriveHdKeyPrivate\",\"compilerOperationHelperDeriveHdPrivateNode\",\"compilerOperationHelperGenerateCoveredBytecode\",\"compilerOperationHelperUnknownEntity\",\"compilerOperationRequires\",\"compilerOperationAddressData\",\"compilerOperationCurrentBlockHeight\",\"compilerOperationCurrentBlockTime\",\"compilerOperationHdKeyPublicKeyCommon\",\"compilerOperationKeyPublicKeyCommon\",\"compilerOperationSigningSerializationCorrespondingOutput\",\"compilerOperationSigningSerializationCorrespondingOutputHash\",\"compilerOperationSigningSerializationCoveredBytecode\",\"compilerOperationSigningSerializationCoveredBytecodeLength\",\"compilerOperationSigningSerializationLocktime\",\"compilerOperationSigningSerializationOutpointIndex\",\"compilerOperationSigningSerializationOutpointTransactionHash\",\"compilerOperationSigningSerializationOutputValue\",\"compilerOperationSigningSerializationSequenceNumber\",\"compilerOperationSigningSerializationTransactionOutpoints\",\"compilerOperationSigningSerializationTransactionOutpointsHash\",\"compilerOperationSigningSerializationTransactionOutputs\",\"compilerOperationSigningSerializationTransactionOutputsHash\",\"compilerOperationSigningSerializationTransactionSequenceNumbers\",\"compilerOperationSigningSerializationTransactionSequenceNumbersHash\",\"compilerOperationSigningSerializationVersion\",\"compilerOperationWalletData\",\"compilerOperationsCommon\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _compiler_types__WEBPACK_IMPORTED_MODULE_5__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _compiler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./compiler */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler.js\");\n/* harmony import */ var _scenarios__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./scenarios */ \"./node_modules/@bitauth/libauth/build/module/lib/template/scenarios.js\");\n/* harmony import */ var _standard_standard__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./standard/standard */ \"./node_modules/@bitauth/libauth/build/module/lib/template/standard/standard.js\");\n/* harmony import */ var _template_types__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./template-types */ \"./node_modules/@bitauth/libauth/build/module/lib/template/template-types.js\");\n/* harmony import */ var _template_types__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_template_types__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _template_types__WEBPACK_IMPORTED_MODULE_9__) if([\"default\",\"SigningSerializationAlgorithmIdentifier\",\"authenticationTemplateToCompilerBCH\",\"compilerOperationHdKeyEcdsaDataSignatureBCH\",\"compilerOperationHdKeyEcdsaSignatureBCH\",\"compilerOperationHdKeySchnorrDataSignatureBCH\",\"compilerOperationHdKeySchnorrSignatureBCH\",\"compilerOperationHelperComputeDataSignatureBCH\",\"compilerOperationHelperComputeSignatureBCH\",\"compilerOperationHelperHdKeyDataSignatureBCH\",\"compilerOperationHelperHdKeySignatureBCH\",\"compilerOperationHelperKeyDataSignatureBCH\",\"compilerOperationHelperKeySignatureBCH\",\"compilerOperationKeyEcdsaDataSignatureBCH\",\"compilerOperationKeyEcdsaSignatureBCH\",\"compilerOperationKeySchnorrDataSignatureBCH\",\"compilerOperationKeySchnorrSignatureBCH\",\"compilerOperationSigningSerializationFullBCH\",\"compilerOperationsBCH\",\"createCompilerBCH\",\"BuiltInVariables\",\"IdentifierResolutionErrorType\",\"IdentifierResolutionType\",\"allErrorsAreRecoverable\",\"compileBtl\",\"compileScript\",\"compileScriptContents\",\"compileScriptP2shLocking\",\"compileScriptP2shUnlocking\",\"compileScriptRaw\",\"containsRange\",\"createIdentifierResolver\",\"describeExpectedInput\",\"extractBytecodeResolutions\",\"extractEvaluationSamples\",\"extractEvaluationSamplesRecursive\",\"extractResolvedVariableBytecodeMap\",\"extractUnexecutedRanges\",\"getResolutionErrors\",\"mergeRanges\",\"parseScript\",\"reduceScript\",\"resolveScriptIdentifier\",\"resolveScriptSegment\",\"resolveVariableIdentifier\",\"stringifyErrors\",\"verifyBtlEvaluationState\",\"CompilerDefaults\",\"attemptCompilerOperations\",\"compilerOperationAttemptBytecodeResolution\",\"compilerOperationHelperAddressIndex\",\"compilerOperationHelperCompileScript\",\"compilerOperationHelperDeriveHdKeyPrivate\",\"compilerOperationHelperDeriveHdPrivateNode\",\"compilerOperationHelperGenerateCoveredBytecode\",\"compilerOperationHelperUnknownEntity\",\"compilerOperationRequires\",\"compilerOperationAddressData\",\"compilerOperationCurrentBlockHeight\",\"compilerOperationCurrentBlockTime\",\"compilerOperationHdKeyPublicKeyCommon\",\"compilerOperationKeyPublicKeyCommon\",\"compilerOperationSigningSerializationCorrespondingOutput\",\"compilerOperationSigningSerializationCorrespondingOutputHash\",\"compilerOperationSigningSerializationCoveredBytecode\",\"compilerOperationSigningSerializationCoveredBytecodeLength\",\"compilerOperationSigningSerializationLocktime\",\"compilerOperationSigningSerializationOutpointIndex\",\"compilerOperationSigningSerializationOutpointTransactionHash\",\"compilerOperationSigningSerializationOutputValue\",\"compilerOperationSigningSerializationSequenceNumber\",\"compilerOperationSigningSerializationTransactionOutpoints\",\"compilerOperationSigningSerializationTransactionOutpointsHash\",\"compilerOperationSigningSerializationTransactionOutputs\",\"compilerOperationSigningSerializationTransactionOutputsHash\",\"compilerOperationSigningSerializationTransactionSequenceNumbers\",\"compilerOperationSigningSerializationTransactionSequenceNumbersHash\",\"compilerOperationSigningSerializationVersion\",\"compilerOperationWalletData\",\"compilerOperationsCommon\",\"authenticationTemplateToCompilationEnvironment\",\"authenticationTemplateToCompilationEnvironmentVirtualizedTests\",\"createAuthenticationProgramEvaluationCommon\",\"createCompiler\",\"createCompilerCommonSynchronous\",\"extendCompilationDataWithScenarioBytecode\",\"extendScenarioDefinition\",\"extendScenarioDefinitionData\",\"extendedScenarioDefinitionToCompilationData\",\"generateDefaultScenarioDefinition\",\"generateExtendedScenario\",\"generateScenarioCommon\",\"authenticationTemplateP2pkh\",\"authenticationTemplateP2pkhNonHd\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _template_types__WEBPACK_IMPORTED_MODULE_9__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _template_validation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./template-validation */ \"./node_modules/@bitauth/libauth/build/module/lib/template/template-validation.js\");\n\n\n\n\n\n\n\n\n\n\n\n//# sourceMappingURL=template.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/template/template.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/transaction/generate-transaction.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/transaction/generate-transaction.js ***! + \********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ compileInputTemplate: () => (/* binding */ compileInputTemplate),\n/* harmony export */ compileOutputTemplate: () => (/* binding */ compileOutputTemplate),\n/* harmony export */ extractMissingVariables: () => (/* binding */ extractMissingVariables),\n/* harmony export */ extractResolvedVariables: () => (/* binding */ extractResolvedVariables),\n/* harmony export */ generateTransaction: () => (/* binding */ generateTransaction),\n/* harmony export */ safelyExtendCompilationData: () => (/* binding */ safelyExtendCompilationData)\n/* harmony export */ });\n/* harmony import */ var _template_language_language_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../template/language/language-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/template/language/language-utils.js\");\n/* harmony import */ var _transaction_serialization__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transaction-serialization */ \"./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction-serialization.js\");\n\n\nconst returnFailedCompilationDirective = ({ index, result, type, }) => {\n return {\n errors: result.errors.map((error) => ({\n ...error,\n error: `Failed compilation of ${type} directive at index \"${index}\": ${error.error}`,\n })),\n index,\n ...(result.errorType === 'parse' ? {} : { resolved: result.resolve }),\n type,\n };\n};\nconst compileOutputTemplate = ({ outputTemplate, index, }) => {\n if ('script' in outputTemplate.lockingBytecode) {\n const directive = outputTemplate.lockingBytecode;\n const data = directive.data === undefined ? {} : directive.data;\n const result = directive.compiler.generateBytecode(directive.script, data, true);\n return result.success\n ? {\n lockingBytecode: result.bytecode,\n satoshis: outputTemplate.satoshis,\n }\n : returnFailedCompilationDirective({ index, result, type: 'locking' });\n }\n return {\n lockingBytecode: outputTemplate.lockingBytecode.slice(),\n satoshis: outputTemplate.satoshis,\n };\n};\nconst compileInputTemplate = ({ inputTemplate, index, outputs, template, transactionOutpoints, transactionSequenceNumbers, }) => {\n if ('script' in inputTemplate.unlockingBytecode) {\n const directive = inputTemplate.unlockingBytecode;\n const correspondingOutput = outputs[index];\n const result = directive.compiler.generateBytecode(directive.script, {\n ...directive.data,\n transactionContext: {\n correspondingOutput: correspondingOutput === undefined\n ? undefined\n : (0,_transaction_serialization__WEBPACK_IMPORTED_MODULE_0__.encodeOutput)(correspondingOutput),\n locktime: template.locktime,\n outpointIndex: inputTemplate.outpointIndex,\n outpointTransactionHash: inputTemplate.outpointTransactionHash.slice(),\n outputValue: directive.satoshis,\n sequenceNumber: inputTemplate.sequenceNumber,\n transactionOutpoints: transactionOutpoints.slice(),\n transactionOutputs: (0,_transaction_serialization__WEBPACK_IMPORTED_MODULE_0__.encodeOutputsForSigning)(outputs),\n transactionSequenceNumbers: transactionSequenceNumbers.slice(),\n version: template.version,\n },\n }, true);\n return result.success\n ? {\n outpointIndex: inputTemplate.outpointIndex,\n outpointTransactionHash: inputTemplate.outpointTransactionHash.slice(),\n sequenceNumber: inputTemplate.sequenceNumber,\n unlockingBytecode: result.bytecode,\n }\n : returnFailedCompilationDirective({ index, result, type: 'unlocking' });\n }\n return {\n outpointIndex: inputTemplate.outpointIndex,\n outpointTransactionHash: inputTemplate.outpointTransactionHash.slice(),\n sequenceNumber: inputTemplate.sequenceNumber,\n unlockingBytecode: inputTemplate.unlockingBytecode.slice(),\n };\n};\n/**\n * Generate a `Transaction` given a `TransactionTemplate` and any applicable\n * compilers and compilation data.\n *\n * Returns either a `Transaction` or an array of compilation errors.\n *\n * For each `CompilationDirective`, the `transactionContext` property will be\n * automatically provided to the compiler. All other necessary `CompilationData`\n * properties must be specified in the `TransactionTemplate`.\n *\n * @param template - the `TransactionTemplate` from which to create the\n * `Transaction`\n */\nconst generateTransaction = (template) => {\n const outputResults = template.outputs.map((outputTemplate, index) => compileOutputTemplate({\n index,\n outputTemplate,\n }));\n const outputCompilationErrors = outputResults.filter((result) => 'errors' in result);\n if (outputCompilationErrors.length > 0) {\n const outputCompletions = outputResults\n .map((result, index) => 'lockingBytecode' in result\n ? { index, output: result, type: 'output' }\n : result)\n .filter((result) => 'output' in result);\n return {\n completions: outputCompletions,\n errors: outputCompilationErrors,\n stage: 'outputs',\n success: false,\n };\n }\n const outputs = outputResults;\n const inputSerializationElements = template.inputs.map((inputTemplate) => ({\n outpointIndex: inputTemplate.outpointIndex,\n outpointTransactionHash: inputTemplate.outpointTransactionHash.slice(),\n sequenceNumber: inputTemplate.sequenceNumber,\n }));\n const transactionOutpoints = (0,_transaction_serialization__WEBPACK_IMPORTED_MODULE_0__.encodeOutpoints)(inputSerializationElements);\n const transactionSequenceNumbers = (0,_transaction_serialization__WEBPACK_IMPORTED_MODULE_0__.encodeSequenceNumbersForSigning)(inputSerializationElements);\n const inputResults = template.inputs.map((inputTemplate, index) => compileInputTemplate({\n index,\n inputTemplate,\n outputs,\n template,\n transactionOutpoints,\n transactionSequenceNumbers,\n }));\n const inputCompilationErrors = inputResults.filter((result) => 'errors' in result);\n if (inputCompilationErrors.length > 0) {\n const inputCompletions = inputResults\n .map((result, index) => 'unlockingBytecode' in result\n ? { index, input: result, type: 'input' }\n : result)\n .filter((result) => 'input' in result);\n return {\n completions: inputCompletions,\n errors: inputCompilationErrors,\n stage: 'inputs',\n success: false,\n };\n }\n const inputs = inputResults;\n return {\n success: true,\n transaction: {\n inputs,\n locktime: template.locktime,\n outputs,\n version: template.version,\n },\n };\n};\n/**\n * TODO: fundamentally unsound, migrate to PST format\n *\n * Extract a map of successfully resolved variables to their resolved bytecode.\n *\n * @param transactionGenerationError - a transaction generation attempt where\n * `success` is `false`\n */\nconst extractResolvedVariables = (transactionGenerationError) => transactionGenerationError.errors.reduce((all, error) => error.resolved === undefined\n ? all\n : { ...all, ...(0,_template_language_language_utils__WEBPACK_IMPORTED_MODULE_1__.extractResolvedVariableBytecodeMap)(error.resolved) }, {});\n/**\n * TODO: fundamentally unsound, migrate to PST format\n *\n * Given an unsuccessful transaction generation result, extract a map of the\n * identifiers missing from the compilation mapped to the entity which owns each\n * variable.\n *\n * Returns `false` if any errors are fatal (the error either cannot be resolved\n * by providing a variable, or the entity ownership of the required variable was\n * not provided in the compilation data).\n *\n * @param transactionGenerationError - a transaction generation result where\n * `success` is `false`\n */\nconst extractMissingVariables = (transactionGenerationError) => {\n const allErrors = transactionGenerationError.errors.reduce((all, error) => [...all, ...error.errors], []);\n if (!(0,_template_language_language_utils__WEBPACK_IMPORTED_MODULE_1__.allErrorsAreRecoverable)(allErrors)) {\n return false;\n }\n return allErrors.reduce((all, error) => ({\n ...all,\n [error.missingIdentifier]: error.owningEntity,\n }), {});\n};\n/**\n * TODO: fundamentally unsound, migrate to PST format\n *\n * Safely extend a compilation data with resolutions provided by other entities\n * (via `extractResolvedVariables`).\n *\n * It is security-critical that compilation data only be extended with expected\n * identifiers from the proper owning entity of each variable. See\n * `CompilationData.bytecode` for details.\n *\n * Returns `false` if any errors are fatal (the error either cannot be resolved\n * by providing a variable, or the entity ownership of the required variable was\n * not provided in the compilation data).\n *\n * @remarks\n * To determine which identifiers are required by a given compilation, the\n * compilation is first attempted with only trusted variables: variables owned\n * or previously verified (like `WalletData`) by the compiling entity. If this\n * compilation produces a `TransactionGenerationError`, the error can be\n * provided to `safelyExtendCompilationData`, along with the trusted compilation\n * data and a mapping of untrusted resolutions (where the result of\n * `extractResolvedVariables` is assigned to the entity ID of the entity from\n * which they were received).\n *\n * The first compilation must use only trusted compilation data\n */\nconst safelyExtendCompilationData = (transactionGenerationError, trustedCompilationData, untrustedResolutions) => {\n const missing = extractMissingVariables(transactionGenerationError);\n if (missing === false)\n return false;\n const selectedResolutions = Object.entries(missing).reduce((all, [identifier, entityId]) => {\n const entityResolution = untrustedResolutions[entityId];\n if (entityResolution === undefined) {\n return all;\n }\n const resolution = entityResolution[identifier];\n if (resolution === undefined) {\n return all;\n }\n return { ...all, [identifier]: resolution };\n }, {});\n return {\n ...trustedCompilationData,\n bytecode: {\n ...selectedResolutions,\n ...trustedCompilationData.bytecode,\n },\n };\n};\n//# sourceMappingURL=generate-transaction.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/transaction/generate-transaction.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction-serialization.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction-serialization.js ***! + \*************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TransactionDecodingError: () => (/* binding */ TransactionDecodingError),\n/* harmony export */ decodeTransaction: () => (/* binding */ decodeTransaction),\n/* harmony export */ decodeTransactionUnsafe: () => (/* binding */ decodeTransactionUnsafe),\n/* harmony export */ encodeInput: () => (/* binding */ encodeInput),\n/* harmony export */ encodeInputs: () => (/* binding */ encodeInputs),\n/* harmony export */ encodeOutpoints: () => (/* binding */ encodeOutpoints),\n/* harmony export */ encodeOutput: () => (/* binding */ encodeOutput),\n/* harmony export */ encodeOutputsForSigning: () => (/* binding */ encodeOutputsForSigning),\n/* harmony export */ encodeOutputsForTransaction: () => (/* binding */ encodeOutputsForTransaction),\n/* harmony export */ encodeSequenceNumbersForSigning: () => (/* binding */ encodeSequenceNumbersForSigning),\n/* harmony export */ encodeTransaction: () => (/* binding */ encodeTransaction),\n/* harmony export */ getTransactionHash: () => (/* binding */ getTransactionHash),\n/* harmony export */ getTransactionHashBE: () => (/* binding */ getTransactionHashBE),\n/* harmony export */ getTransactionHashLE: () => (/* binding */ getTransactionHashLE),\n/* harmony export */ readTransactionInput: () => (/* binding */ readTransactionInput),\n/* harmony export */ readTransactionOutput: () => (/* binding */ readTransactionOutput)\n/* harmony export */ });\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/numbers.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n\n/**\n * @param bin - the raw transaction from which to read the input\n * @param offset - the offset at which the input begins\n */\nconst readTransactionInput = (bin, offset) => {\n const sha256HashBytes = 32;\n const uint32Bytes = 4;\n const offsetAfterTxHash = offset + sha256HashBytes;\n const outpointTransactionHash = bin\n .slice(offset, offsetAfterTxHash)\n .reverse();\n const offsetAfterOutpointIndex = offsetAfterTxHash + uint32Bytes;\n const outpointIndex = (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.binToNumberUint32LE)(bin.subarray(offsetAfterTxHash, offsetAfterOutpointIndex));\n const { nextOffset: offsetAfterBytecodeLength, value: bytecodeLength, } = (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.readBitcoinVarInt)(bin, offsetAfterOutpointIndex);\n const offsetAfterBytecode = offsetAfterBytecodeLength + Number(bytecodeLength);\n const unlockingBytecode = bin.slice(offsetAfterBytecodeLength, offsetAfterBytecode);\n const nextOffset = offsetAfterBytecode + uint32Bytes;\n const sequenceNumber = (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.binToNumberUint32LE)(bin.subarray(offsetAfterBytecode, nextOffset));\n return {\n input: {\n outpointIndex,\n outpointTransactionHash,\n sequenceNumber,\n unlockingBytecode,\n },\n nextOffset,\n };\n};\n/**\n * Encode a single input for inclusion in an encoded transaction.\n *\n * @param output - the input to encode\n */\nconst encodeInput = (input) => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.flattenBinArray)([\n input.outpointTransactionHash.slice().reverse(),\n (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.numberToBinUint32LE)(input.outpointIndex),\n (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.bigIntToBitcoinVarInt)(BigInt(input.unlockingBytecode.length)),\n input.unlockingBytecode,\n (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.numberToBinUint32LE)(input.sequenceNumber),\n]);\n/**\n * Encode a set of inputs for inclusion in an encoded transaction including\n * the prefixed number of inputs.\n *\n * Format: [BitcoinVarInt: input count] [encoded inputs]\n *\n * @param inputs - the set of inputs to encode\n */\nconst encodeInputs = (inputs) => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.flattenBinArray)([\n (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.bigIntToBitcoinVarInt)(BigInt(inputs.length)),\n ...inputs.map(encodeInput),\n]);\n/**\n * Read a single transaction output from an encoded transaction.\n *\n * @param bin - the raw transaction from which to read the output\n * @param offset - the offset at which the output begins\n */\nconst readTransactionOutput = (bin, offset) => {\n const uint64Bytes = 8;\n const offsetAfterSatoshis = offset + uint64Bytes;\n const satoshis = bin.slice(offset, offsetAfterSatoshis);\n const { nextOffset: offsetAfterScriptLength, value } = (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.readBitcoinVarInt)(bin, offsetAfterSatoshis);\n const bytecodeLength = Number(value);\n const nextOffset = offsetAfterScriptLength + bytecodeLength;\n const lockingBytecode = bytecodeLength === 0\n ? new Uint8Array()\n : bin.slice(offsetAfterScriptLength, nextOffset);\n return {\n nextOffset,\n output: {\n lockingBytecode,\n satoshis,\n },\n };\n};\n/**\n * Encode a single output for inclusion in an encoded transaction.\n *\n * @param output - the output to encode\n */\nconst encodeOutput = (output) => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.flattenBinArray)([\n output.satoshis,\n (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.bigIntToBitcoinVarInt)(BigInt(output.lockingBytecode.length)),\n output.lockingBytecode,\n]);\n/**\n * Encode a set of outputs for inclusion in an encoded transaction\n * including the prefixed number of outputs.\n *\n * Format: [BitcoinVarInt: output count] [encoded outputs]\n *\n * @param outputs - the set of outputs to encode\n */\nconst encodeOutputsForTransaction = (outputs) => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.flattenBinArray)([\n (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.bigIntToBitcoinVarInt)(BigInt(outputs.length)),\n ...outputs.map(encodeOutput),\n]);\n/**\n * Decode a `Uint8Array` using the version 1 or 2 raw transaction format.\n *\n * Note: this method throws runtime errors when attempting to decode messages\n * which do not properly follow the transaction format. If the input is\n * untrusted, use `decodeTransaction`.\n *\n * @param bin - the raw message to decode\n */\nconst decodeTransactionUnsafe = (bin) => {\n const uint32Bytes = 4;\n const version = (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.binToNumberUint32LE)(bin.subarray(0, uint32Bytes));\n const offsetAfterVersion = uint32Bytes;\n const { nextOffset: offsetAfterInputCount, value: inputCount, } = (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.readBitcoinVarInt)(bin, offsetAfterVersion);\n // eslint-disable-next-line functional/no-let\n let cursor = offsetAfterInputCount;\n const inputs = [];\n // eslint-disable-next-line functional/no-let, functional/no-loop-statement, no-plusplus\n for (let i = 0; i < Number(inputCount); i++) {\n const { input, nextOffset } = readTransactionInput(bin, cursor);\n // eslint-disable-next-line functional/no-expression-statement\n cursor = nextOffset;\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n inputs.push(input);\n }\n const { nextOffset: offsetAfterOutputCount, value: outputCount, } = (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.readBitcoinVarInt)(bin, cursor);\n // eslint-disable-next-line functional/no-expression-statement\n cursor = offsetAfterOutputCount;\n const outputs = [];\n // eslint-disable-next-line functional/no-let, functional/no-loop-statement, no-plusplus\n for (let i = 0; i < Number(outputCount); i++) {\n const { output, nextOffset } = readTransactionOutput(bin, cursor);\n // eslint-disable-next-line functional/no-expression-statement\n cursor = nextOffset;\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n outputs.push(output);\n }\n const locktime = (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.binToNumberUint32LE)(bin.subarray(cursor, cursor + uint32Bytes));\n return {\n inputs,\n locktime,\n outputs,\n version,\n };\n};\nvar TransactionDecodingError;\n(function (TransactionDecodingError) {\n TransactionDecodingError[\"invalidFormat\"] = \"Transaction decoding error: message does not follow the version 1 or version 2 transaction format.\";\n})(TransactionDecodingError || (TransactionDecodingError = {}));\n/**\n * Decode a `Uint8Array` using the version 1 or 2 raw transaction format.\n *\n * @param bin - the raw message to decode\n */\nconst decodeTransaction = (bin) => {\n // eslint-disable-next-line functional/no-try-statement\n try {\n return decodeTransactionUnsafe(bin);\n }\n catch {\n return TransactionDecodingError.invalidFormat;\n }\n};\n/**\n * Encode a `Transaction` using the standard P2P network format. This\n * serialization is also used when computing the transaction's hash (A.K.A.\n * \"transaction ID\" or \"TXID\").\n */\nconst encodeTransaction = (tx) => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.flattenBinArray)([\n (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.numberToBinUint32LE)(tx.version),\n encodeInputs(tx.inputs),\n encodeOutputsForTransaction(tx.outputs),\n (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.numberToBinUint32LE)(tx.locktime),\n]);\n/**\n * Compute a transaction hash (A.K.A. \"transaction ID\" or \"TXID\") from an\n * encoded transaction in big-endian byte order. This is the byte order\n * typically used by block explorers and other user interfaces.\n *\n * @returns the transaction hash as a string\n *\n * @param transaction - the encoded transaction\n * @param sha256 - an implementation of sha256\n */\nconst getTransactionHashBE = (sha256, transaction) => sha256.hash(sha256.hash(transaction));\n/**\n * Compute a transaction hash (A.K.A. \"transaction ID\" or \"TXID\") from an\n * encoded transaction in little-endian byte order. This is the byte order\n * used in P2P network messages.\n *\n * @remarks\n * The result of sha256 is defined by its specification as big-endian, but\n * bitcoin message formats always reverse the order of this result for\n * serialization in P2P network messages.\n *\n * @returns the transaction hash in little-endian byte order\n *\n * @param transaction - the encoded transaction\n * @param sha256 - an implementation of sha256\n */\nconst getTransactionHashLE = (sha256, transaction) => getTransactionHashBE(sha256, transaction).reverse();\n/**\n * Return a `Transaction`'s hash as a string (in big-endian byte order as is\n * common for user interfaces).\n *\n * @param transaction - the encoded transaction\n * @param sha256 - an implementation of sha256\n */\nconst getTransactionHash = (sha256, transaction) => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.binToHex)(getTransactionHashBE(sha256, transaction));\n/**\n * Get the hash of all outpoints in a series of inputs. (For use in\n * `hashTransactionOutpoints`.)\n *\n * @param inputs - the series of inputs from which to extract the outpoints\n * @param sha256 - an implementation of sha256\n */\nconst encodeOutpoints = (inputs) => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.flattenBinArray)(inputs.map((i) => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.flattenBinArray)([\n i.outpointTransactionHash.slice().reverse(),\n (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.numberToBinUint32LE)(i.outpointIndex),\n])));\n/**\n * Encode an array of transaction outputs for use in transaction signing\n * serializations.\n *\n * @param outputs - the array of outputs to encode\n */\nconst encodeOutputsForSigning = (outputs) => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.flattenBinArray)(outputs.map(encodeOutput));\n/**\n * Encode an array of input sequence numbers for use in transaction signing\n * serializations.\n *\n * @param inputs - the array of inputs from which to extract the sequence\n * numbers\n */\nconst encodeSequenceNumbersForSigning = (inputs) => (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.flattenBinArray)(inputs.map((i) => (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.numberToBinUint32LE)(i.sequenceNumber)));\n//# sourceMappingURL=transaction-serialization.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction-serialization.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction-types.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction-types.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ invalidSatoshis: () => (/* binding */ invalidSatoshis)\n/* harmony export */ });\n/**\n * The maximum uint64 value – an impossibly large, intentionally invalid value\n * for `satoshis`. See `Transaction.satoshis` for details.\n */\n// prettier-ignore\n// eslint-disable-next-line @typescript-eslint/no-magic-numbers\nconst invalidSatoshis = Uint8Array.from([255, 255, 255, 255, 255, 255, 255, 255]);\n//# sourceMappingURL=transaction-types.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction-types.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TransactionDecodingError: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.TransactionDecodingError),\n/* harmony export */ compileInputTemplate: () => (/* reexport safe */ _generate_transaction__WEBPACK_IMPORTED_MODULE_0__.compileInputTemplate),\n/* harmony export */ compileOutputTemplate: () => (/* reexport safe */ _generate_transaction__WEBPACK_IMPORTED_MODULE_0__.compileOutputTemplate),\n/* harmony export */ decodeTransaction: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.decodeTransaction),\n/* harmony export */ decodeTransactionUnsafe: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.decodeTransactionUnsafe),\n/* harmony export */ encodeInput: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.encodeInput),\n/* harmony export */ encodeInputs: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.encodeInputs),\n/* harmony export */ encodeOutpoints: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.encodeOutpoints),\n/* harmony export */ encodeOutput: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.encodeOutput),\n/* harmony export */ encodeOutputsForSigning: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.encodeOutputsForSigning),\n/* harmony export */ encodeOutputsForTransaction: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.encodeOutputsForTransaction),\n/* harmony export */ encodeSequenceNumbersForSigning: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.encodeSequenceNumbersForSigning),\n/* harmony export */ encodeTransaction: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.encodeTransaction),\n/* harmony export */ extractMissingVariables: () => (/* reexport safe */ _generate_transaction__WEBPACK_IMPORTED_MODULE_0__.extractMissingVariables),\n/* harmony export */ extractResolvedVariables: () => (/* reexport safe */ _generate_transaction__WEBPACK_IMPORTED_MODULE_0__.extractResolvedVariables),\n/* harmony export */ generateTransaction: () => (/* reexport safe */ _generate_transaction__WEBPACK_IMPORTED_MODULE_0__.generateTransaction),\n/* harmony export */ getTransactionHash: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.getTransactionHash),\n/* harmony export */ getTransactionHashBE: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.getTransactionHashBE),\n/* harmony export */ getTransactionHashLE: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.getTransactionHashLE),\n/* harmony export */ invalidSatoshis: () => (/* reexport safe */ _transaction_types__WEBPACK_IMPORTED_MODULE_2__.invalidSatoshis),\n/* harmony export */ readTransactionInput: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.readTransactionInput),\n/* harmony export */ readTransactionOutput: () => (/* reexport safe */ _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.readTransactionOutput),\n/* harmony export */ safelyExtendCompilationData: () => (/* reexport safe */ _generate_transaction__WEBPACK_IMPORTED_MODULE_0__.safelyExtendCompilationData),\n/* harmony export */ verifyTransaction: () => (/* reexport safe */ _verify_transaction__WEBPACK_IMPORTED_MODULE_3__.verifyTransaction)\n/* harmony export */ });\n/* harmony import */ var _generate_transaction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./generate-transaction */ \"./node_modules/@bitauth/libauth/build/module/lib/transaction/generate-transaction.js\");\n/* harmony import */ var _transaction_serialization__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transaction-serialization */ \"./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction-serialization.js\");\n/* harmony import */ var _transaction_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transaction-types */ \"./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction-types.js\");\n/* harmony import */ var _verify_transaction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./verify-transaction */ \"./node_modules/@bitauth/libauth/build/module/lib/transaction/verify-transaction.js\");\n\n\n\n\n//# sourceMappingURL=transaction.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/transaction/verify-transaction.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/transaction/verify-transaction.js ***! + \******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ verifyTransaction: () => (/* binding */ verifyTransaction)\n/* harmony export */ });\n/**\n * Statelessly verify a transaction given an `AuthenticationVirtualMachine` and\n * a list of spent outputs (the `lockingBytecode` and `satoshis` being spent by\n * each input).\n *\n * Note, while the virtual machine will evaluate locktime-related operations\n * against the transactions own `locktime`, this method does not verify the\n * transaction's `locktime` property itself (allowing verification to be\n * stateless).\n *\n * Before a statelessly verified transaction can be added to the blockchain,\n * node implementations must confirm that:\n * - all `spentOutputs` are still unspent, and\n * - both relative and absolute locktime consensus requirements have been met.\n * (See BIP65, BIP68, and BIP112 for details.)\n *\n * @param spentOutputs - an array of the `Output`s spent by the transaction's\n * `inputs` in matching order (`inputs[0]` spends `spentOutputs[0]`, etc.)\n * @param transaction - the transaction to verify\n * @param vm - the authentication virtual machine to use in validation\n */\nconst verifyTransaction = ({ spentOutputs, transaction, vm, }) => {\n if (transaction.inputs.length !== spentOutputs.length) {\n return [\n 'Unable to verify transaction: a spent output must be provided for each transaction input.',\n ];\n }\n const errors = transaction.inputs.reduce((all, _, index) => {\n const program = {\n inputIndex: index,\n sourceOutput: spentOutputs[index],\n spendingTransaction: transaction,\n };\n const state = vm.evaluate(program);\n const verify = vm.verify(state);\n if (verify === true) {\n return all;\n }\n return [...all, `Error in evaluating input index \"${index}\": ${verify}`];\n }, []);\n return errors.length === 0 ? true : errors;\n};\n//# sourceMappingURL=verify-transaction.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/transaction/verify-transaction.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-descriptions.js": +/*!****************************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-descriptions.js ***! + \****************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OpcodeDescriptionsBCH: () => (/* binding */ OpcodeDescriptionsBCH),\n/* harmony export */ OpcodeDescriptionsUniqueBCH: () => (/* binding */ OpcodeDescriptionsUniqueBCH)\n/* harmony export */ });\n/* harmony import */ var _common_descriptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/descriptions */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/descriptions.js\");\n\nvar OpcodeDescriptionsUniqueBCH;\n(function (OpcodeDescriptionsUniqueBCH) {\n OpcodeDescriptionsUniqueBCH[\"OP_CAT\"] = \"Pop the top 2 items from the stack and concatenate them, pushing the result.\";\n OpcodeDescriptionsUniqueBCH[\"OP_SPLIT\"] = \"Pop the top item from the stack as an index (Script Number) and the next item as a byte array. Split the byte array into two stack items at the index (zero-based), pushing the results.\";\n OpcodeDescriptionsUniqueBCH[\"OP_NUM2BIN\"] = \"Pop the top item from the stack as an item length (Script Number) and the next item as a Script Number (without encoding restrictions). Re-encode the number using a byte array of the provided length, filling any unused bytes with zeros. (If the requested length is too short to encode the number, error.)\";\n OpcodeDescriptionsUniqueBCH[\"OP_BIN2NUM\"] = \"Pop the top item from the stack as a Script Number without encoding restrictions. Minimally-encode the number and push the result. (If the number can't be encoded in 4 bytes or less, error.)\";\n OpcodeDescriptionsUniqueBCH[\"OP_AND\"] = \"Pop the top 2 items from the stack and perform a bitwise AND on each byte, pushing the result. If the length of the items are not equal, error.\";\n OpcodeDescriptionsUniqueBCH[\"OP_OR\"] = \"Pop the top 2 items from the stack and perform a bitwise OR on each byte, pushing the result. If the length of the items are not equal, error.\";\n OpcodeDescriptionsUniqueBCH[\"OP_XOR\"] = \"Pop the top 2 items from the stack and perform a bitwise XOR on each byte, pushing the result. If the length of the items are not equal, error.\";\n OpcodeDescriptionsUniqueBCH[\"OP_DIV\"] = \"Pop the top item from the stack as a denominator (Script Number) and the next as a numerator (Script Number). Divide and push the result to the stack.\";\n OpcodeDescriptionsUniqueBCH[\"OP_MOD\"] = \"Pop the top item from the stack as a denominator (Script Number) and the next as a numerator (Script Number). Divide and push the remainder to the stack.\";\n OpcodeDescriptionsUniqueBCH[\"OP_CHECKDATASIG\"] = \"Pop the top 3 items from the stack. Treat the top as a public key, the second as a message, and the third as a signature. If the signature is valid, push a Script Number 1, otherwise push a Script Number 0.\";\n OpcodeDescriptionsUniqueBCH[\"OP_CHECKDATASIGVERIFY\"] = \"Pop the top 3 items from the stack. Treat the top as a public key, the second as a message, and the third as a signature. If the signature is not valid, error. (This operation is a combination of OP_CHECKDATASIG followed by OP_VERIFY.)\";\n OpcodeDescriptionsUniqueBCH[\"OP_REVERSEBYTES\"] = \"Pop the top item from the stack and reverse it, pushing the result.\";\n})(OpcodeDescriptionsUniqueBCH || (OpcodeDescriptionsUniqueBCH = {}));\n/**\n * A map of descriptions for each Bitcoin Cash opcode.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst OpcodeDescriptionsBCH = {\n ..._common_descriptions__WEBPACK_IMPORTED_MODULE_0__.OpcodeDescriptionsCommon,\n ...OpcodeDescriptionsUniqueBCH,\n};\n//# sourceMappingURL=bch-descriptions.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-descriptions.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-errors.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-errors.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AuthenticationErrorBCH: () => (/* binding */ AuthenticationErrorBCH)\n/* harmony export */ });\nvar AuthenticationErrorBCH;\n(function (AuthenticationErrorBCH) {\n AuthenticationErrorBCH[\"exceededMaximumOperationCount\"] = \"Program exceeded the maximum operation count (201 operations).\";\n AuthenticationErrorBCH[\"exceededMaximumStackItemLength\"] = \"Program attempted to push a stack item which exceeded the maximum stack item length (520 bytes).\";\n AuthenticationErrorBCH[\"exceededMaximumScriptNumberLength\"] = \"Program attempted an OP_BIN2NUM operation on a byte sequence which cannot be encoded within the maximum Script Number length (4 bytes).\";\n AuthenticationErrorBCH[\"divisionByZero\"] = \"Program attempted to divide a number by zero.\";\n AuthenticationErrorBCH[\"insufficientLength\"] = \"Program called an OP_NUM2BIN operation with an insufficient byte length to re-encode the provided number.\";\n AuthenticationErrorBCH[\"invalidSplitIndex\"] = \"Program called an OP_SPLIT operation with an invalid index.\";\n AuthenticationErrorBCH[\"malformedP2shBytecode\"] = \"Redeem bytecode was malformed prior to P2SH evaluation.\";\n AuthenticationErrorBCH[\"mismatchedBitwiseOperandLength\"] = \"Program attempted a bitwise operation on operands of different lengths.\";\n AuthenticationErrorBCH[\"requiresPushOnly\"] = \"Unlocking bytecode may contain only push operations.\";\n})(AuthenticationErrorBCH || (AuthenticationErrorBCH = {}));\n//# sourceMappingURL=bch-errors.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-errors.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-instruction-sets.js": +/*!********************************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-instruction-sets.js ***! + \********************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ InstructionSetBCH: () => (/* binding */ InstructionSetBCH),\n/* harmony export */ OpcodesBCH: () => (/* reexport safe */ _bch_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesBCH),\n/* harmony export */ createInstructionSetBCH: () => (/* binding */ createInstructionSetBCH),\n/* harmony export */ getFlagsForInstructionSetBCH: () => (/* binding */ getFlagsForInstructionSetBCH),\n/* harmony export */ instructionSetBCHCurrentStrict: () => (/* binding */ instructionSetBCHCurrentStrict),\n/* harmony export */ isPayToScriptHash: () => (/* binding */ isPayToScriptHash),\n/* harmony export */ isWitnessProgram: () => (/* binding */ isWitnessProgram)\n/* harmony export */ });\n/* harmony import */ var _common_combinators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/combinators */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/combinators.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/common.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n/* harmony import */ var _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../instruction-sets-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-utils.js\");\n/* harmony import */ var _bch_errors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bch-errors */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-errors.js\");\n/* harmony import */ var _bch_opcodes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bch-opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-opcodes.js\");\n/* harmony import */ var _bch_operations__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./bch-operations */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-operations.js\");\n\n\n\n\n\n\n\nconst isPayToScriptHash = (verificationInstructions) => verificationInstructions.length === 3 /* length */ &&\n verificationInstructions[0].opcode ===\n _bch_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesBCH.OP_HASH160 &&\n verificationInstructions[1].opcode ===\n _bch_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesBCH.OP_PUSHBYTES_20 &&\n verificationInstructions[2 /* lastElement */]\n .opcode === _bch_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesBCH.OP_EQUAL;\n/**\n * Test a stack item for the SegWit Recovery Rules activated in `BCH_2019_05`.\n *\n * @param bytecode - the stack item to test\n */\n// eslint-disable-next-line complexity\nconst isWitnessProgram = (bytecode) => {\n const correctLength = bytecode.length >= 4 /* minimumLength */ &&\n bytecode.length <= 42 /* maximumLength */;\n const validVersionPush = bytecode[0] === 0 /* OP_0 */ ||\n (bytecode[0] >= 81 /* OP_1 */ && bytecode[0] <= 96 /* OP_16 */);\n const correctLengthByte = bytecode[1] + 2 /* versionAndLengthBytes */ === bytecode.length;\n return correctLength && validVersionPush && correctLengthByte;\n};\n/**\n * From C++ implementation:\n * Note that IsPushOnly() *does* consider OP_RESERVED to be a push-type\n * opcode, however execution of OP_RESERVED fails, so it's not relevant to\n * P2SH/BIP62 as the scriptSig would fail prior to the P2SH special\n * validation code being executed.\n */\nconst isPushOperation = (opcode) => opcode < _bch_opcodes__WEBPACK_IMPORTED_MODULE_0__.OpcodesBCH.OP_16;\n/**\n * This library's supported versions of the BCH virtual machine. \"Strict\"\n * versions (A.K.A. `isStandard` from the C++ implementations) enable additional\n * validation which is commonly used on the P2P network before relaying\n * transactions. Transactions which fail these rules are often called\n * \"non-standard\" – the transactions can technically be included by miners in\n * valid blocks, but most network nodes will refuse to relay them.\n *\n * BCH instruction sets marked `SPEC` (\"specification\") have not yet been\n * deployed on the main network and are subject to change. After deployment, the\n * `SPEC` suffix is removed. This change only effects the name of the TypeScript\n * enum member – the value remains the same. E.g.\n * `InstructionSetBCH.BCH_2020_05_SPEC` became `InstructionSetBCH.BCH_2020_05`,\n * but the value remained `BCH_2020_05`.\n *\n * This allows consumers to select an upgrade policy: when a version of Libauth\n * is released in which compatibility with a deployed virtual machine is\n * confirmed, this change can help to identify downstream code which requires\n * review.\n * - Consumers which prefer to upgrade manually should specify a `SPEC` type,\n * e.g. `InstructionSetBCH.BCH_2020_05_SPEC`.\n * - Consumers which prefer full compatibility between Libauth version should\n * specify a precise instruction set value (e.g. `BCH_2020_05`) or use the\n * dedicated \"current\" value: `instructionSetBCHCurrentStrict`.\n */\nvar InstructionSetBCH;\n(function (InstructionSetBCH) {\n InstructionSetBCH[\"BCH_2019_05\"] = \"BCH_2019_05\";\n InstructionSetBCH[\"BCH_2019_05_STRICT\"] = \"BCH_2019_05_STRICT\";\n InstructionSetBCH[\"BCH_2019_11\"] = \"BCH_2019_11\";\n InstructionSetBCH[\"BCH_2019_11_STRICT\"] = \"BCH_2019_11_STRICT\";\n InstructionSetBCH[\"BCH_2020_05\"] = \"BCH_2020_05\";\n InstructionSetBCH[\"BCH_2020_05_STRICT\"] = \"BCH_2020_05_STRICT\";\n InstructionSetBCH[\"BCH_2020_11_SPEC\"] = \"BCH_2020_11\";\n InstructionSetBCH[\"BCH_2020_11_STRICT_SPEC\"] = \"BCH_2020_11_STRICT\";\n InstructionSetBCH[\"BCH_2021_05_SPEC\"] = \"BCH_2021_05\";\n InstructionSetBCH[\"BCH_2021_05_STRICT_SPEC\"] = \"BCH_2021_05_STRICT\";\n InstructionSetBCH[\"BCH_2021_11_SPEC\"] = \"BCH_2021_11\";\n InstructionSetBCH[\"BCH_2021_11_STRICT_SPEC\"] = \"BCH_2021_11_STRICT\";\n InstructionSetBCH[\"BCH_2022_05_SPEC\"] = \"BCH_2022_05\";\n InstructionSetBCH[\"BCH_2022_05_STRICT_SPEC\"] = \"BCH_2022_05_STRICT\";\n InstructionSetBCH[\"BCH_2022_11_SPEC\"] = \"BCH_2022_11\";\n InstructionSetBCH[\"BCH_2022_11_STRICT_SPEC\"] = \"BCH_2022_11_STRICT\";\n})(InstructionSetBCH || (InstructionSetBCH = {}));\n/**\n * The current strict virtual machine version used by the Bitcoin Cash (BCH)\n * network.\n */\nconst instructionSetBCHCurrentStrict = InstructionSetBCH.BCH_2020_05_STRICT;\n// eslint-disable-next-line complexity\nconst getFlagsForInstructionSetBCH = (instructionSet) => {\n switch (instructionSet) {\n case InstructionSetBCH.BCH_2019_05:\n return {\n disallowUpgradableNops: false,\n opReverseBytes: false,\n requireBugValueZero: false,\n requireMinimalEncoding: false,\n requireNullSignatureFailures: true,\n };\n case InstructionSetBCH.BCH_2019_05_STRICT:\n return {\n disallowUpgradableNops: true,\n opReverseBytes: false,\n requireBugValueZero: false,\n requireMinimalEncoding: true,\n requireNullSignatureFailures: true,\n };\n case InstructionSetBCH.BCH_2019_11:\n return {\n disallowUpgradableNops: false,\n opReverseBytes: false,\n requireBugValueZero: true,\n requireMinimalEncoding: true,\n requireNullSignatureFailures: true,\n };\n case InstructionSetBCH.BCH_2019_11_STRICT:\n return {\n disallowUpgradableNops: true,\n opReverseBytes: false,\n requireBugValueZero: true,\n requireMinimalEncoding: true,\n requireNullSignatureFailures: true,\n };\n case InstructionSetBCH.BCH_2020_05:\n return {\n disallowUpgradableNops: false,\n opReverseBytes: true,\n requireBugValueZero: false,\n requireMinimalEncoding: false,\n requireNullSignatureFailures: true,\n };\n case InstructionSetBCH.BCH_2020_05_STRICT:\n return {\n disallowUpgradableNops: true,\n opReverseBytes: true,\n requireBugValueZero: true,\n requireMinimalEncoding: true,\n requireNullSignatureFailures: true,\n };\n default:\n return new Error(`${instructionSet} is not a known instruction set.`);\n }\n};\n/**\n * Initialize a new instruction set for the BCH virtual machine.\n *\n * @param flags - an object configuring the flags for this vm (see\n * `getFlagsForInstructionSetBCH`)\n * @param sha1 - a Sha1 implementation\n * @param sha256 - a Sha256 implementation\n * @param ripemd160 - a Ripemd160 implementation\n * @param secp256k1 - a Secp256k1 implementation\n */\nconst createInstructionSetBCH = ({ flags, ripemd160, secp256k1, sha1, sha256, }) => ({\n clone: _common_common__WEBPACK_IMPORTED_MODULE_1__.cloneAuthenticationProgramStateCommon,\n continue: (state) => state.error === undefined && state.ip < state.instructions.length,\n // eslint-disable-next-line complexity\n evaluate: (program, stateEvaluate) => {\n var _a;\n const { unlockingBytecode } = program.spendingTransaction.inputs[program.inputIndex];\n const { lockingBytecode } = program.sourceOutput;\n const unlockingInstructions = (0,_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_2__.parseBytecode)(unlockingBytecode);\n const lockingInstructions = (0,_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_2__.parseBytecode)(lockingBytecode);\n const externalState = (0,_common_common__WEBPACK_IMPORTED_MODULE_1__.createTransactionContextCommon)(program);\n const initialState = (0,_common_common__WEBPACK_IMPORTED_MODULE_1__.createAuthenticationProgramStateCommon)({\n instructions: unlockingInstructions,\n stack: [],\n transactionContext: externalState,\n });\n const unlockingResult = unlockingBytecode.length > _common_common__WEBPACK_IMPORTED_MODULE_1__.ConsensusCommon.maximumBytecodeLength\n ? (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.applyError)(_common_common__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorCommon.exceededMaximumBytecodeLengthUnlocking, initialState)\n : (0,_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_2__.authenticationInstructionsAreMalformed)(unlockingInstructions)\n ? (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.applyError)(_common_common__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorCommon.malformedUnlockingBytecode, initialState)\n : lockingBytecode.length > _common_common__WEBPACK_IMPORTED_MODULE_1__.ConsensusCommon.maximumBytecodeLength\n ? (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.applyError)(_common_common__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorCommon.exceededMaximumBytecodeLengthLocking, initialState)\n : (0,_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_2__.authenticationInstructionsAreMalformed)(lockingInstructions)\n ? (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.applyError)(_common_common__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorCommon.malformedLockingBytecode, initialState)\n : initialState.instructions.every((instruction) => isPushOperation(instruction.opcode))\n ? stateEvaluate(initialState)\n : (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.applyError)(_bch_errors__WEBPACK_IMPORTED_MODULE_4__.AuthenticationErrorBCH.requiresPushOnly, initialState);\n if (unlockingResult.error !== undefined) {\n return unlockingResult;\n }\n const lockingResult = stateEvaluate((0,_common_common__WEBPACK_IMPORTED_MODULE_1__.createAuthenticationProgramStateCommon)({\n instructions: lockingInstructions,\n stack: unlockingResult.stack,\n transactionContext: externalState,\n }));\n if (!isPayToScriptHash(lockingInstructions)) {\n return lockingResult;\n }\n const p2shStack = (0,_common_common__WEBPACK_IMPORTED_MODULE_1__.cloneStack)(unlockingResult.stack);\n // eslint-disable-next-line functional/immutable-data\n const p2shScript = (_a = p2shStack.pop()) !== null && _a !== void 0 ? _a : Uint8Array.of();\n if (p2shStack.length === 0 && isWitnessProgram(p2shScript)) {\n return lockingResult;\n }\n const p2shInstructions = (0,_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_2__.parseBytecode)(p2shScript);\n return (0,_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_2__.authenticationInstructionsAreMalformed)(p2shInstructions)\n ? {\n ...lockingResult,\n error: _bch_errors__WEBPACK_IMPORTED_MODULE_4__.AuthenticationErrorBCH.malformedP2shBytecode,\n }\n : stateEvaluate((0,_common_common__WEBPACK_IMPORTED_MODULE_1__.createAuthenticationProgramStateCommon)({\n instructions: p2shInstructions,\n stack: p2shStack,\n transactionContext: externalState,\n }));\n },\n operations: {\n ...(0,_common_common__WEBPACK_IMPORTED_MODULE_1__.commonOperations)({ flags, ripemd160, secp256k1, sha1, sha256 }),\n ...(0,_common_combinators__WEBPACK_IMPORTED_MODULE_5__.mapOverOperations)((0,_bch_operations__WEBPACK_IMPORTED_MODULE_6__.bitcoinCashOperations)({\n flags,\n secp256k1,\n sha256,\n }), _common_combinators__WEBPACK_IMPORTED_MODULE_5__.conditionallyEvaluate, _common_combinators__WEBPACK_IMPORTED_MODULE_5__.incrementOperationCount, _common_common__WEBPACK_IMPORTED_MODULE_1__.checkLimitsCommon),\n },\n ...(0,_common_common__WEBPACK_IMPORTED_MODULE_1__.undefinedOperation)(),\n verify: (state) => {\n if (state.error !== undefined) {\n return state.error;\n }\n if (state.executionStack.length !== 0) {\n return _common_common__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorCommon.nonEmptyExecutionStack;\n }\n if (state.stack.length !== 1) {\n return _common_common__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorCommon.requiresCleanStack;\n }\n if (!(0,_common_common__WEBPACK_IMPORTED_MODULE_7__.stackItemIsTruthy)(state.stack[0])) {\n return _common_common__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorCommon.unsuccessfulEvaluation;\n }\n return true;\n },\n});\n//# sourceMappingURL=bch-instruction-sets.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-instruction-sets.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-opcodes.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-opcodes.js ***! + \***********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OpcodeAlternateNamesBCH: () => (/* binding */ OpcodeAlternateNamesBCH),\n/* harmony export */ OpcodesBCH: () => (/* binding */ OpcodesBCH)\n/* harmony export */ });\nvar OpcodesBCH;\n(function (OpcodesBCH) {\n /**\n * A.K.A. `OP_FALSE` or `OP_PUSHBYTES_0`\n */\n OpcodesBCH[OpcodesBCH[\"OP_0\"] = 0] = \"OP_0\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_1\"] = 1] = \"OP_PUSHBYTES_1\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_2\"] = 2] = \"OP_PUSHBYTES_2\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_3\"] = 3] = \"OP_PUSHBYTES_3\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_4\"] = 4] = \"OP_PUSHBYTES_4\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_5\"] = 5] = \"OP_PUSHBYTES_5\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_6\"] = 6] = \"OP_PUSHBYTES_6\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_7\"] = 7] = \"OP_PUSHBYTES_7\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_8\"] = 8] = \"OP_PUSHBYTES_8\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_9\"] = 9] = \"OP_PUSHBYTES_9\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_10\"] = 10] = \"OP_PUSHBYTES_10\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_11\"] = 11] = \"OP_PUSHBYTES_11\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_12\"] = 12] = \"OP_PUSHBYTES_12\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_13\"] = 13] = \"OP_PUSHBYTES_13\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_14\"] = 14] = \"OP_PUSHBYTES_14\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_15\"] = 15] = \"OP_PUSHBYTES_15\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_16\"] = 16] = \"OP_PUSHBYTES_16\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_17\"] = 17] = \"OP_PUSHBYTES_17\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_18\"] = 18] = \"OP_PUSHBYTES_18\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_19\"] = 19] = \"OP_PUSHBYTES_19\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_20\"] = 20] = \"OP_PUSHBYTES_20\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_21\"] = 21] = \"OP_PUSHBYTES_21\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_22\"] = 22] = \"OP_PUSHBYTES_22\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_23\"] = 23] = \"OP_PUSHBYTES_23\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_24\"] = 24] = \"OP_PUSHBYTES_24\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_25\"] = 25] = \"OP_PUSHBYTES_25\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_26\"] = 26] = \"OP_PUSHBYTES_26\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_27\"] = 27] = \"OP_PUSHBYTES_27\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_28\"] = 28] = \"OP_PUSHBYTES_28\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_29\"] = 29] = \"OP_PUSHBYTES_29\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_30\"] = 30] = \"OP_PUSHBYTES_30\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_31\"] = 31] = \"OP_PUSHBYTES_31\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_32\"] = 32] = \"OP_PUSHBYTES_32\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_33\"] = 33] = \"OP_PUSHBYTES_33\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_34\"] = 34] = \"OP_PUSHBYTES_34\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_35\"] = 35] = \"OP_PUSHBYTES_35\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_36\"] = 36] = \"OP_PUSHBYTES_36\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_37\"] = 37] = \"OP_PUSHBYTES_37\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_38\"] = 38] = \"OP_PUSHBYTES_38\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_39\"] = 39] = \"OP_PUSHBYTES_39\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_40\"] = 40] = \"OP_PUSHBYTES_40\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_41\"] = 41] = \"OP_PUSHBYTES_41\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_42\"] = 42] = \"OP_PUSHBYTES_42\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_43\"] = 43] = \"OP_PUSHBYTES_43\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_44\"] = 44] = \"OP_PUSHBYTES_44\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_45\"] = 45] = \"OP_PUSHBYTES_45\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_46\"] = 46] = \"OP_PUSHBYTES_46\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_47\"] = 47] = \"OP_PUSHBYTES_47\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_48\"] = 48] = \"OP_PUSHBYTES_48\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_49\"] = 49] = \"OP_PUSHBYTES_49\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_50\"] = 50] = \"OP_PUSHBYTES_50\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_51\"] = 51] = \"OP_PUSHBYTES_51\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_52\"] = 52] = \"OP_PUSHBYTES_52\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_53\"] = 53] = \"OP_PUSHBYTES_53\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_54\"] = 54] = \"OP_PUSHBYTES_54\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_55\"] = 55] = \"OP_PUSHBYTES_55\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_56\"] = 56] = \"OP_PUSHBYTES_56\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_57\"] = 57] = \"OP_PUSHBYTES_57\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_58\"] = 58] = \"OP_PUSHBYTES_58\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_59\"] = 59] = \"OP_PUSHBYTES_59\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_60\"] = 60] = \"OP_PUSHBYTES_60\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_61\"] = 61] = \"OP_PUSHBYTES_61\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_62\"] = 62] = \"OP_PUSHBYTES_62\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_63\"] = 63] = \"OP_PUSHBYTES_63\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_64\"] = 64] = \"OP_PUSHBYTES_64\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_65\"] = 65] = \"OP_PUSHBYTES_65\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_66\"] = 66] = \"OP_PUSHBYTES_66\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_67\"] = 67] = \"OP_PUSHBYTES_67\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_68\"] = 68] = \"OP_PUSHBYTES_68\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_69\"] = 69] = \"OP_PUSHBYTES_69\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_70\"] = 70] = \"OP_PUSHBYTES_70\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_71\"] = 71] = \"OP_PUSHBYTES_71\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_72\"] = 72] = \"OP_PUSHBYTES_72\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_73\"] = 73] = \"OP_PUSHBYTES_73\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_74\"] = 74] = \"OP_PUSHBYTES_74\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHBYTES_75\"] = 75] = \"OP_PUSHBYTES_75\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHDATA_1\"] = 76] = \"OP_PUSHDATA_1\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHDATA_2\"] = 77] = \"OP_PUSHDATA_2\";\n OpcodesBCH[OpcodesBCH[\"OP_PUSHDATA_4\"] = 78] = \"OP_PUSHDATA_4\";\n OpcodesBCH[OpcodesBCH[\"OP_1NEGATE\"] = 79] = \"OP_1NEGATE\";\n OpcodesBCH[OpcodesBCH[\"OP_RESERVED\"] = 80] = \"OP_RESERVED\";\n /**\n * A.K.A. `OP_TRUE`\n */\n OpcodesBCH[OpcodesBCH[\"OP_1\"] = 81] = \"OP_1\";\n OpcodesBCH[OpcodesBCH[\"OP_2\"] = 82] = \"OP_2\";\n OpcodesBCH[OpcodesBCH[\"OP_3\"] = 83] = \"OP_3\";\n OpcodesBCH[OpcodesBCH[\"OP_4\"] = 84] = \"OP_4\";\n OpcodesBCH[OpcodesBCH[\"OP_5\"] = 85] = \"OP_5\";\n OpcodesBCH[OpcodesBCH[\"OP_6\"] = 86] = \"OP_6\";\n OpcodesBCH[OpcodesBCH[\"OP_7\"] = 87] = \"OP_7\";\n OpcodesBCH[OpcodesBCH[\"OP_8\"] = 88] = \"OP_8\";\n OpcodesBCH[OpcodesBCH[\"OP_9\"] = 89] = \"OP_9\";\n OpcodesBCH[OpcodesBCH[\"OP_10\"] = 90] = \"OP_10\";\n OpcodesBCH[OpcodesBCH[\"OP_11\"] = 91] = \"OP_11\";\n OpcodesBCH[OpcodesBCH[\"OP_12\"] = 92] = \"OP_12\";\n OpcodesBCH[OpcodesBCH[\"OP_13\"] = 93] = \"OP_13\";\n OpcodesBCH[OpcodesBCH[\"OP_14\"] = 94] = \"OP_14\";\n OpcodesBCH[OpcodesBCH[\"OP_15\"] = 95] = \"OP_15\";\n OpcodesBCH[OpcodesBCH[\"OP_16\"] = 96] = \"OP_16\";\n OpcodesBCH[OpcodesBCH[\"OP_NOP\"] = 97] = \"OP_NOP\";\n OpcodesBCH[OpcodesBCH[\"OP_VER\"] = 98] = \"OP_VER\";\n OpcodesBCH[OpcodesBCH[\"OP_IF\"] = 99] = \"OP_IF\";\n OpcodesBCH[OpcodesBCH[\"OP_NOTIF\"] = 100] = \"OP_NOTIF\";\n OpcodesBCH[OpcodesBCH[\"OP_VERIF\"] = 101] = \"OP_VERIF\";\n OpcodesBCH[OpcodesBCH[\"OP_VERNOTIF\"] = 102] = \"OP_VERNOTIF\";\n OpcodesBCH[OpcodesBCH[\"OP_ELSE\"] = 103] = \"OP_ELSE\";\n OpcodesBCH[OpcodesBCH[\"OP_ENDIF\"] = 104] = \"OP_ENDIF\";\n OpcodesBCH[OpcodesBCH[\"OP_VERIFY\"] = 105] = \"OP_VERIFY\";\n OpcodesBCH[OpcodesBCH[\"OP_RETURN\"] = 106] = \"OP_RETURN\";\n OpcodesBCH[OpcodesBCH[\"OP_TOALTSTACK\"] = 107] = \"OP_TOALTSTACK\";\n OpcodesBCH[OpcodesBCH[\"OP_FROMALTSTACK\"] = 108] = \"OP_FROMALTSTACK\";\n OpcodesBCH[OpcodesBCH[\"OP_2DROP\"] = 109] = \"OP_2DROP\";\n OpcodesBCH[OpcodesBCH[\"OP_2DUP\"] = 110] = \"OP_2DUP\";\n OpcodesBCH[OpcodesBCH[\"OP_3DUP\"] = 111] = \"OP_3DUP\";\n OpcodesBCH[OpcodesBCH[\"OP_2OVER\"] = 112] = \"OP_2OVER\";\n OpcodesBCH[OpcodesBCH[\"OP_2ROT\"] = 113] = \"OP_2ROT\";\n OpcodesBCH[OpcodesBCH[\"OP_2SWAP\"] = 114] = \"OP_2SWAP\";\n OpcodesBCH[OpcodesBCH[\"OP_IFDUP\"] = 115] = \"OP_IFDUP\";\n OpcodesBCH[OpcodesBCH[\"OP_DEPTH\"] = 116] = \"OP_DEPTH\";\n OpcodesBCH[OpcodesBCH[\"OP_DROP\"] = 117] = \"OP_DROP\";\n OpcodesBCH[OpcodesBCH[\"OP_DUP\"] = 118] = \"OP_DUP\";\n OpcodesBCH[OpcodesBCH[\"OP_NIP\"] = 119] = \"OP_NIP\";\n OpcodesBCH[OpcodesBCH[\"OP_OVER\"] = 120] = \"OP_OVER\";\n OpcodesBCH[OpcodesBCH[\"OP_PICK\"] = 121] = \"OP_PICK\";\n OpcodesBCH[OpcodesBCH[\"OP_ROLL\"] = 122] = \"OP_ROLL\";\n OpcodesBCH[OpcodesBCH[\"OP_ROT\"] = 123] = \"OP_ROT\";\n OpcodesBCH[OpcodesBCH[\"OP_SWAP\"] = 124] = \"OP_SWAP\";\n OpcodesBCH[OpcodesBCH[\"OP_TUCK\"] = 125] = \"OP_TUCK\";\n OpcodesBCH[OpcodesBCH[\"OP_CAT\"] = 126] = \"OP_CAT\";\n OpcodesBCH[OpcodesBCH[\"OP_SPLIT\"] = 127] = \"OP_SPLIT\";\n OpcodesBCH[OpcodesBCH[\"OP_NUM2BIN\"] = 128] = \"OP_NUM2BIN\";\n OpcodesBCH[OpcodesBCH[\"OP_BIN2NUM\"] = 129] = \"OP_BIN2NUM\";\n OpcodesBCH[OpcodesBCH[\"OP_SIZE\"] = 130] = \"OP_SIZE\";\n OpcodesBCH[OpcodesBCH[\"OP_INVERT\"] = 131] = \"OP_INVERT\";\n OpcodesBCH[OpcodesBCH[\"OP_AND\"] = 132] = \"OP_AND\";\n OpcodesBCH[OpcodesBCH[\"OP_OR\"] = 133] = \"OP_OR\";\n OpcodesBCH[OpcodesBCH[\"OP_XOR\"] = 134] = \"OP_XOR\";\n OpcodesBCH[OpcodesBCH[\"OP_EQUAL\"] = 135] = \"OP_EQUAL\";\n OpcodesBCH[OpcodesBCH[\"OP_EQUALVERIFY\"] = 136] = \"OP_EQUALVERIFY\";\n OpcodesBCH[OpcodesBCH[\"OP_RESERVED1\"] = 137] = \"OP_RESERVED1\";\n OpcodesBCH[OpcodesBCH[\"OP_RESERVED2\"] = 138] = \"OP_RESERVED2\";\n OpcodesBCH[OpcodesBCH[\"OP_1ADD\"] = 139] = \"OP_1ADD\";\n OpcodesBCH[OpcodesBCH[\"OP_1SUB\"] = 140] = \"OP_1SUB\";\n OpcodesBCH[OpcodesBCH[\"OP_2MUL\"] = 141] = \"OP_2MUL\";\n OpcodesBCH[OpcodesBCH[\"OP_2DIV\"] = 142] = \"OP_2DIV\";\n OpcodesBCH[OpcodesBCH[\"OP_NEGATE\"] = 143] = \"OP_NEGATE\";\n OpcodesBCH[OpcodesBCH[\"OP_ABS\"] = 144] = \"OP_ABS\";\n OpcodesBCH[OpcodesBCH[\"OP_NOT\"] = 145] = \"OP_NOT\";\n OpcodesBCH[OpcodesBCH[\"OP_0NOTEQUAL\"] = 146] = \"OP_0NOTEQUAL\";\n OpcodesBCH[OpcodesBCH[\"OP_ADD\"] = 147] = \"OP_ADD\";\n OpcodesBCH[OpcodesBCH[\"OP_SUB\"] = 148] = \"OP_SUB\";\n OpcodesBCH[OpcodesBCH[\"OP_MUL\"] = 149] = \"OP_MUL\";\n OpcodesBCH[OpcodesBCH[\"OP_DIV\"] = 150] = \"OP_DIV\";\n OpcodesBCH[OpcodesBCH[\"OP_MOD\"] = 151] = \"OP_MOD\";\n OpcodesBCH[OpcodesBCH[\"OP_LSHIFT\"] = 152] = \"OP_LSHIFT\";\n OpcodesBCH[OpcodesBCH[\"OP_RSHIFT\"] = 153] = \"OP_RSHIFT\";\n OpcodesBCH[OpcodesBCH[\"OP_BOOLAND\"] = 154] = \"OP_BOOLAND\";\n OpcodesBCH[OpcodesBCH[\"OP_BOOLOR\"] = 155] = \"OP_BOOLOR\";\n OpcodesBCH[OpcodesBCH[\"OP_NUMEQUAL\"] = 156] = \"OP_NUMEQUAL\";\n OpcodesBCH[OpcodesBCH[\"OP_NUMEQUALVERIFY\"] = 157] = \"OP_NUMEQUALVERIFY\";\n OpcodesBCH[OpcodesBCH[\"OP_NUMNOTEQUAL\"] = 158] = \"OP_NUMNOTEQUAL\";\n OpcodesBCH[OpcodesBCH[\"OP_LESSTHAN\"] = 159] = \"OP_LESSTHAN\";\n OpcodesBCH[OpcodesBCH[\"OP_GREATERTHAN\"] = 160] = \"OP_GREATERTHAN\";\n OpcodesBCH[OpcodesBCH[\"OP_LESSTHANOREQUAL\"] = 161] = \"OP_LESSTHANOREQUAL\";\n OpcodesBCH[OpcodesBCH[\"OP_GREATERTHANOREQUAL\"] = 162] = \"OP_GREATERTHANOREQUAL\";\n OpcodesBCH[OpcodesBCH[\"OP_MIN\"] = 163] = \"OP_MIN\";\n OpcodesBCH[OpcodesBCH[\"OP_MAX\"] = 164] = \"OP_MAX\";\n OpcodesBCH[OpcodesBCH[\"OP_WITHIN\"] = 165] = \"OP_WITHIN\";\n OpcodesBCH[OpcodesBCH[\"OP_RIPEMD160\"] = 166] = \"OP_RIPEMD160\";\n OpcodesBCH[OpcodesBCH[\"OP_SHA1\"] = 167] = \"OP_SHA1\";\n OpcodesBCH[OpcodesBCH[\"OP_SHA256\"] = 168] = \"OP_SHA256\";\n OpcodesBCH[OpcodesBCH[\"OP_HASH160\"] = 169] = \"OP_HASH160\";\n OpcodesBCH[OpcodesBCH[\"OP_HASH256\"] = 170] = \"OP_HASH256\";\n OpcodesBCH[OpcodesBCH[\"OP_CODESEPARATOR\"] = 171] = \"OP_CODESEPARATOR\";\n OpcodesBCH[OpcodesBCH[\"OP_CHECKSIG\"] = 172] = \"OP_CHECKSIG\";\n OpcodesBCH[OpcodesBCH[\"OP_CHECKSIGVERIFY\"] = 173] = \"OP_CHECKSIGVERIFY\";\n OpcodesBCH[OpcodesBCH[\"OP_CHECKMULTISIG\"] = 174] = \"OP_CHECKMULTISIG\";\n OpcodesBCH[OpcodesBCH[\"OP_CHECKMULTISIGVERIFY\"] = 175] = \"OP_CHECKMULTISIGVERIFY\";\n OpcodesBCH[OpcodesBCH[\"OP_NOP1\"] = 176] = \"OP_NOP1\";\n /**\n * Previously `OP_NOP2`\n */\n OpcodesBCH[OpcodesBCH[\"OP_CHECKLOCKTIMEVERIFY\"] = 177] = \"OP_CHECKLOCKTIMEVERIFY\";\n /**\n * Previously `OP_NOP2`\n */\n OpcodesBCH[OpcodesBCH[\"OP_CHECKSEQUENCEVERIFY\"] = 178] = \"OP_CHECKSEQUENCEVERIFY\";\n OpcodesBCH[OpcodesBCH[\"OP_NOP4\"] = 179] = \"OP_NOP4\";\n OpcodesBCH[OpcodesBCH[\"OP_NOP5\"] = 180] = \"OP_NOP5\";\n OpcodesBCH[OpcodesBCH[\"OP_NOP6\"] = 181] = \"OP_NOP6\";\n OpcodesBCH[OpcodesBCH[\"OP_NOP7\"] = 182] = \"OP_NOP7\";\n OpcodesBCH[OpcodesBCH[\"OP_NOP8\"] = 183] = \"OP_NOP8\";\n OpcodesBCH[OpcodesBCH[\"OP_NOP9\"] = 184] = \"OP_NOP9\";\n OpcodesBCH[OpcodesBCH[\"OP_NOP10\"] = 185] = \"OP_NOP10\";\n /**\n * Previously `OP_UNKNOWN186`\n */\n OpcodesBCH[OpcodesBCH[\"OP_CHECKDATASIG\"] = 186] = \"OP_CHECKDATASIG\";\n /**\n * Previously `OP_UNKNOWN187`\n */\n OpcodesBCH[OpcodesBCH[\"OP_CHECKDATASIGVERIFY\"] = 187] = \"OP_CHECKDATASIGVERIFY\";\n /**\n * Previously `OP_UNKNOWN188`\n */\n OpcodesBCH[OpcodesBCH[\"OP_REVERSEBYTES\"] = 188] = \"OP_REVERSEBYTES\";\n /**\n * A.K.A. `FIRST_UNDEFINED_OP_VALUE`\n */\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN189\"] = 189] = \"OP_UNKNOWN189\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN190\"] = 190] = \"OP_UNKNOWN190\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN191\"] = 191] = \"OP_UNKNOWN191\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN192\"] = 192] = \"OP_UNKNOWN192\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN193\"] = 193] = \"OP_UNKNOWN193\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN194\"] = 194] = \"OP_UNKNOWN194\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN195\"] = 195] = \"OP_UNKNOWN195\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN196\"] = 196] = \"OP_UNKNOWN196\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN197\"] = 197] = \"OP_UNKNOWN197\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN198\"] = 198] = \"OP_UNKNOWN198\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN199\"] = 199] = \"OP_UNKNOWN199\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN200\"] = 200] = \"OP_UNKNOWN200\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN201\"] = 201] = \"OP_UNKNOWN201\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN202\"] = 202] = \"OP_UNKNOWN202\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN203\"] = 203] = \"OP_UNKNOWN203\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN204\"] = 204] = \"OP_UNKNOWN204\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN205\"] = 205] = \"OP_UNKNOWN205\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN206\"] = 206] = \"OP_UNKNOWN206\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN207\"] = 207] = \"OP_UNKNOWN207\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN208\"] = 208] = \"OP_UNKNOWN208\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN209\"] = 209] = \"OP_UNKNOWN209\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN210\"] = 210] = \"OP_UNKNOWN210\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN211\"] = 211] = \"OP_UNKNOWN211\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN212\"] = 212] = \"OP_UNKNOWN212\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN213\"] = 213] = \"OP_UNKNOWN213\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN214\"] = 214] = \"OP_UNKNOWN214\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN215\"] = 215] = \"OP_UNKNOWN215\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN216\"] = 216] = \"OP_UNKNOWN216\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN217\"] = 217] = \"OP_UNKNOWN217\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN218\"] = 218] = \"OP_UNKNOWN218\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN219\"] = 219] = \"OP_UNKNOWN219\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN220\"] = 220] = \"OP_UNKNOWN220\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN221\"] = 221] = \"OP_UNKNOWN221\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN222\"] = 222] = \"OP_UNKNOWN222\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN223\"] = 223] = \"OP_UNKNOWN223\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN224\"] = 224] = \"OP_UNKNOWN224\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN225\"] = 225] = \"OP_UNKNOWN225\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN226\"] = 226] = \"OP_UNKNOWN226\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN227\"] = 227] = \"OP_UNKNOWN227\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN228\"] = 228] = \"OP_UNKNOWN228\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN229\"] = 229] = \"OP_UNKNOWN229\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN230\"] = 230] = \"OP_UNKNOWN230\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN231\"] = 231] = \"OP_UNKNOWN231\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN232\"] = 232] = \"OP_UNKNOWN232\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN233\"] = 233] = \"OP_UNKNOWN233\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN234\"] = 234] = \"OP_UNKNOWN234\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN235\"] = 235] = \"OP_UNKNOWN235\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN236\"] = 236] = \"OP_UNKNOWN236\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN237\"] = 237] = \"OP_UNKNOWN237\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN238\"] = 238] = \"OP_UNKNOWN238\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN239\"] = 239] = \"OP_UNKNOWN239\";\n /**\n * A.K.A. `OP_PREFIX_BEGIN`\n */\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN240\"] = 240] = \"OP_UNKNOWN240\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN241\"] = 241] = \"OP_UNKNOWN241\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN242\"] = 242] = \"OP_UNKNOWN242\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN243\"] = 243] = \"OP_UNKNOWN243\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN244\"] = 244] = \"OP_UNKNOWN244\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN245\"] = 245] = \"OP_UNKNOWN245\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN246\"] = 246] = \"OP_UNKNOWN246\";\n /**\n * A.K.A. `OP_PREFIX_END`\n */\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN247\"] = 247] = \"OP_UNKNOWN247\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN248\"] = 248] = \"OP_UNKNOWN248\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN249\"] = 249] = \"OP_UNKNOWN249\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN250\"] = 250] = \"OP_UNKNOWN250\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN251\"] = 251] = \"OP_UNKNOWN251\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN252\"] = 252] = \"OP_UNKNOWN252\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN253\"] = 253] = \"OP_UNKNOWN253\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN254\"] = 254] = \"OP_UNKNOWN254\";\n OpcodesBCH[OpcodesBCH[\"OP_UNKNOWN255\"] = 255] = \"OP_UNKNOWN255\";\n})(OpcodesBCH || (OpcodesBCH = {}));\nvar OpcodeAlternateNamesBCH;\n(function (OpcodeAlternateNamesBCH) {\n /**\n * A.K.A. `OP_0`\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_FALSE\"] = 0] = \"OP_FALSE\";\n /**\n * A.K.A. `OP_0`\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_PUSHBYTES_0\"] = 0] = \"OP_PUSHBYTES_0\";\n /**\n * A.K.A. `OP_1`\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_TRUE\"] = 81] = \"OP_TRUE\";\n /**\n * A.K.A. `OP_CHECKLOCKTIMEVERIFY`\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_NOP2\"] = 177] = \"OP_NOP2\";\n /**\n * A.K.A. `OP_CHECKSEQUENCEVERIFY`\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_NOP3\"] = 178] = \"OP_NOP3\";\n /**\n * A.K.A. `OP_CHECKDATASIG`\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_UNKNOWN186\"] = 186] = \"OP_UNKNOWN186\";\n /**\n * A.K.A. `OP_CHECKDATASIGVERIFY`\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_UNKNOWN187\"] = 187] = \"OP_UNKNOWN187\";\n /**\n * A.K.A. `OP_UNKNOWN189`\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"FIRST_UNDEFINED_OP_VALUE\"] = 189] = \"FIRST_UNDEFINED_OP_VALUE\";\n /**\n * A.K.A. `OP_UNKNOWN240`. Some implementations have reserved opcodes\n * `0xf0` through `0xf7` for a future range of multi-byte opcodes, though none\n * are yet available on the network.\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_PREFIX_BEGIN\"] = 240] = \"OP_PREFIX_BEGIN\";\n /**\n * A.K.A. `OP_UNKNOWN247`. Some implementations have reserved opcodes\n * `0xf0` through `0xf7` for a future range of multi-byte opcodes, though none\n * are yet available on the network.\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_PREFIX_END\"] = 247] = \"OP_PREFIX_END\";\n /**\n * `OP_SMALLINTEGER` is used internally for template matching in the C++\n * implementation. When found on the network, it is `OP_UNKNOWN250`.\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_SMALLINTEGER\"] = 250] = \"OP_SMALLINTEGER\";\n /**\n * `OP_PUBKEYS` is used internally for template matching in the C++\n * implementation. When found on the network, it is `OP_UNKNOWN251`.\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_PUBKEYS\"] = 251] = \"OP_PUBKEYS\";\n /**\n * `OP_PUBKEYHASH` is used internally for template matching in the C++\n * implementation. When found on the network, it is `OP_UNKNOWN253`.\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_PUBKEYHASH\"] = 253] = \"OP_PUBKEYHASH\";\n /**\n * `OP_PUBKEY` is used internally for template matching in the C++\n * implementation. When found on the network, it is `OP_UNKNOWN254`.\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_PUBKEY\"] = 254] = \"OP_PUBKEY\";\n /**\n * `OP_INVALIDOPCODE` is described as such for testing in the C++\n * implementation. When found on the network, it is `OP_UNKNOWN255`.\n */\n OpcodeAlternateNamesBCH[OpcodeAlternateNamesBCH[\"OP_INVALIDOPCODE\"] = 255] = \"OP_INVALIDOPCODE\";\n})(OpcodeAlternateNamesBCH || (OpcodeAlternateNamesBCH = {}));\n//# sourceMappingURL=bch-opcodes.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-opcodes.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-operations.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-operations.js ***! + \**************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ bitcoinCashOperations: () => (/* binding */ bitcoinCashOperations),\n/* harmony export */ bitwiseOperation: () => (/* binding */ bitwiseOperation),\n/* harmony export */ isValidSignatureEncodingBCHRaw: () => (/* binding */ isValidSignatureEncodingBCHRaw),\n/* harmony export */ opAnd: () => (/* binding */ opAnd),\n/* harmony export */ opBin2Num: () => (/* binding */ opBin2Num),\n/* harmony export */ opCat: () => (/* binding */ opCat),\n/* harmony export */ opCheckDataSig: () => (/* binding */ opCheckDataSig),\n/* harmony export */ opCheckDataSigVerify: () => (/* binding */ opCheckDataSigVerify),\n/* harmony export */ opDiv: () => (/* binding */ opDiv),\n/* harmony export */ opMod: () => (/* binding */ opMod),\n/* harmony export */ opNum2Bin: () => (/* binding */ opNum2Bin),\n/* harmony export */ opOr: () => (/* binding */ opOr),\n/* harmony export */ opReverseBytes: () => (/* binding */ opReverseBytes),\n/* harmony export */ opSplit: () => (/* binding */ opSplit),\n/* harmony export */ opXor: () => (/* binding */ opXor),\n/* harmony export */ padMinimallyEncodedScriptNumber: () => (/* binding */ padMinimallyEncodedScriptNumber)\n/* harmony export */ });\n/* harmony import */ var _format_hex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../format/hex */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _common_combinators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/combinators */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/combinators.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/common.js\");\n/* harmony import */ var _common_encoding__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/encoding */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/encoding.js\");\n/* harmony import */ var _common_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/errors */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js\");\n/* harmony import */ var _common_flow_control__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/flow-control */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/flow-control.js\");\n/* harmony import */ var _common_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/types */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n/* harmony import */ var _bch_errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bch-errors */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-errors.js\");\n/* harmony import */ var _bch_opcodes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./bch-opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-opcodes.js\");\n/* harmony import */ var _bch_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./bch-types */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-types.js\");\n\n\n\n\n\n\n\n\n\n\nconst opCat = () => (state) => (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoStackItems)(state, (nextState, [a, b]) => a.length + b.length > _common_common__WEBPACK_IMPORTED_MODULE_1__.ConsensusCommon.maximumStackItemLength\n ? (0,_common_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_bch_errors__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorBCH.exceededMaximumStackItemLength, nextState)\n : (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_format_hex__WEBPACK_IMPORTED_MODULE_4__.flattenBinArray)([a, b])));\nconst opSplit = ({ requireMinimalEncoding, }) => (state) => (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(state, (nextState, value) => {\n const index = Number(value);\n return (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(nextState, (finalState, [item]) => index < 0 || index > item.length\n ? (0,_common_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_bch_errors__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorBCH.invalidSplitIndex, finalState)\n : (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(finalState, item.slice(0, index), item.slice(index)));\n}, { requireMinimalEncoding });\nvar Constants;\n(function (Constants) {\n Constants[Constants[\"positiveSign\"] = 0] = \"positiveSign\";\n Constants[Constants[\"negativeSign\"] = 128] = \"negativeSign\";\n})(Constants || (Constants = {}));\nconst padMinimallyEncodedScriptNumber = (scriptNumber, length) => {\n // eslint-disable-next-line functional/no-let\n let signBit = Constants.positiveSign;\n // eslint-disable-next-line functional/no-conditional-statement\n if (scriptNumber.length > 0) {\n // eslint-disable-next-line functional/no-expression-statement, no-bitwise\n signBit = scriptNumber[scriptNumber.length - 1] & Constants.negativeSign;\n // eslint-disable-next-line functional/no-expression-statement, no-bitwise, functional/immutable-data\n scriptNumber[scriptNumber.length - 1] &= Constants.negativeSign - 1;\n }\n const result = Array.from(scriptNumber);\n // eslint-disable-next-line functional/no-loop-statement\n while (result.length < length - 1) {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n result.push(0);\n }\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n result.push(signBit);\n return Uint8Array.from(result);\n};\nconst opNum2Bin = () => (state) => (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(state, (nextState, value) => {\n const targetLength = Number(value);\n return targetLength > _common_common__WEBPACK_IMPORTED_MODULE_1__.ConsensusCommon.maximumStackItemLength\n ? (0,_common_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_bch_errors__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorBCH.exceededMaximumStackItemLength, nextState)\n : (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(nextState, (finalState, [target]) => {\n const minimallyEncoded = (0,_common_types__WEBPACK_IMPORTED_MODULE_5__.bigIntToScriptNumber)(target);\n return minimallyEncoded.length > targetLength\n ? (0,_common_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_bch_errors__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorBCH.insufficientLength, finalState)\n : minimallyEncoded.length === targetLength\n ? (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(finalState, minimallyEncoded)\n : (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(finalState, padMinimallyEncodedScriptNumber(minimallyEncoded, targetLength));\n }, {\n maximumScriptNumberByteLength: \n // TODO: is this right?\n _common_common__WEBPACK_IMPORTED_MODULE_1__.ConsensusCommon.maximumStackItemLength,\n requireMinimalEncoding: false,\n });\n}, { requireMinimalEncoding: true });\nconst opBin2Num = () => (state) => (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(state, (nextState, [target]) => {\n const minimallyEncoded = (0,_common_types__WEBPACK_IMPORTED_MODULE_5__.bigIntToScriptNumber)(target);\n return minimallyEncoded.length > _common_common__WEBPACK_IMPORTED_MODULE_1__.ConsensusCommon.maximumScriptNumberLength\n ? (0,_common_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_bch_errors__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorBCH.exceededMaximumScriptNumberLength, nextState)\n : (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, minimallyEncoded);\n}, {\n // TODO: is this right?\n maximumScriptNumberByteLength: _common_common__WEBPACK_IMPORTED_MODULE_1__.ConsensusCommon.maximumStackItemLength,\n requireMinimalEncoding: false,\n});\nconst bitwiseOperation = (combine) => (state) => (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoStackItems)(state, (nextState, [a, b]) => a.length === b.length\n ? (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, combine(a, b))\n : (0,_common_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_bch_errors__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorBCH.mismatchedBitwiseOperandLength, nextState));\nconst opAnd = () => bitwiseOperation((a, b) => a.map((v, i) => v & b[i]));\nconst opOr = () => bitwiseOperation((a, b) => a.map((v, i) => v | b[i]));\nconst opXor = () => bitwiseOperation((a, b) => a.map((v, i) => v ^ b[i]));\nconst opDiv = ({ requireMinimalEncoding, }) => (state) => (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [a, b]) => b === BigInt(0)\n ? (0,_common_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_bch_errors__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorBCH.divisionByZero, nextState)\n : (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_common_types__WEBPACK_IMPORTED_MODULE_5__.bigIntToScriptNumber)(a / b)), { requireMinimalEncoding });\nconst opMod = ({ requireMinimalEncoding, }) => (state) => (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [a, b]) => b === BigInt(0)\n ? (0,_common_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_bch_errors__WEBPACK_IMPORTED_MODULE_3__.AuthenticationErrorBCH.divisionByZero, nextState)\n : (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_common_types__WEBPACK_IMPORTED_MODULE_5__.bigIntToScriptNumber)(a % b)), { requireMinimalEncoding });\n/**\n * Validate the encoding of a raw signature – a signature without a signing\n * serialization type byte (A.K.A. \"sighash\" byte).\n *\n * @param signature - the raw signature\n */\nconst isValidSignatureEncodingBCHRaw = (signature) => signature.length === 0 ||\n signature.length === _bch_types__WEBPACK_IMPORTED_MODULE_6__.ConsensusBCH.schnorrSignatureLength ||\n (0,_common_encoding__WEBPACK_IMPORTED_MODULE_7__.isValidSignatureEncodingDER)(signature);\nconst opCheckDataSig = ({ secp256k1, sha256, }) => (state) => \n// eslint-disable-next-line complexity\n(0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.useThreeStackItems)(state, (nextState, [signature, message, publicKey]) => {\n if (!isValidSignatureEncodingBCHRaw(signature)) {\n return (0,_common_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_common_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.invalidSignatureEncoding, nextState);\n }\n if (!(0,_common_encoding__WEBPACK_IMPORTED_MODULE_7__.isValidPublicKeyEncoding)(publicKey)) {\n return (0,_common_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_common_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.invalidPublicKeyEncoding, nextState);\n }\n const digest = sha256.hash(message);\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n nextState.signedMessages.push(message);\n const useSchnorr = signature.length === _bch_types__WEBPACK_IMPORTED_MODULE_6__.ConsensusBCH.schnorrSignatureLength;\n const success = useSchnorr\n ? secp256k1.verifySignatureSchnorr(signature, publicKey, digest)\n : secp256k1.verifySignatureDERLowS(signature, publicKey, digest);\n return !success && signature.length !== 0\n ? (0,_common_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_common_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.nonNullSignatureFailure, nextState)\n : (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_common_types__WEBPACK_IMPORTED_MODULE_5__.booleanToScriptNumber)(success));\n});\nconst opCheckDataSigVerify = ({ secp256k1, sha256, }) => (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.combineOperations)(opCheckDataSig({ secp256k1, sha256 }), (0,_common_flow_control__WEBPACK_IMPORTED_MODULE_8__.opVerify)());\nconst opReverseBytes = () => (state) => (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(state, (nextState, [item]) => (0,_common_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, item.slice().reverse()));\nconst bitcoinCashOperations = ({ flags, secp256k1, sha256, }) => {\n const operations = {\n [_bch_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesBCH.OP_CAT]: opCat(),\n [_bch_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesBCH.OP_SPLIT]: opSplit(flags),\n [_bch_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesBCH.OP_NUM2BIN]: opNum2Bin(),\n [_bch_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesBCH.OP_BIN2NUM]: opBin2Num(),\n [_bch_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesBCH.OP_AND]: opAnd(),\n [_bch_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesBCH.OP_OR]: opOr(),\n [_bch_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesBCH.OP_XOR]: opXor(),\n [_bch_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesBCH.OP_DIV]: opDiv(flags),\n [_bch_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesBCH.OP_MOD]: opMod(flags),\n [_bch_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesBCH.OP_CHECKDATASIG]: opCheckDataSig({\n secp256k1,\n sha256,\n }),\n [_bch_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesBCH.OP_CHECKDATASIGVERIFY]: opCheckDataSigVerify({ secp256k1, sha256 }),\n };\n return flags.opReverseBytes\n ? { ...operations, [_bch_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesBCH.OP_REVERSEBYTES]: opReverseBytes() }\n : operations;\n};\n//# sourceMappingURL=bch-operations.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-operations.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-types.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-types.js ***! + \*********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ConsensusBCH: () => (/* binding */ ConsensusBCH),\n/* harmony export */ createTestAuthenticationProgramBCH: () => (/* binding */ createTestAuthenticationProgramBCH)\n/* harmony export */ });\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _transaction_transaction_serialization__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../transaction/transaction-serialization */ \"./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction-serialization.js\");\n\n\nvar ConsensusBCH;\n(function (ConsensusBCH) {\n ConsensusBCH[ConsensusBCH[\"schnorrSignatureLength\"] = 64] = \"schnorrSignatureLength\";\n})(ConsensusBCH || (ConsensusBCH = {}));\nconst createTestAuthenticationProgramBCH = ({ lockingBytecode, satoshis, sha256, unlockingBytecode, }) => {\n const testFundingTransaction = {\n inputs: [\n {\n outpointIndex: 0xffffffff,\n outpointTransactionHash: (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.hexToBin)('0000000000000000000000000000000000000000000000000000000000000000'),\n sequenceNumber: 0xffffffff,\n unlockingBytecode: Uint8Array.of(0, 0),\n },\n ],\n locktime: 0,\n outputs: [{ lockingBytecode, satoshis }],\n version: 1,\n };\n const testSpendingTransaction = {\n inputs: [\n {\n outpointIndex: 0,\n outpointTransactionHash: (0,_transaction_transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.getTransactionHashBE)(sha256, (0,_transaction_transaction_serialization__WEBPACK_IMPORTED_MODULE_1__.encodeTransaction)(testFundingTransaction)),\n sequenceNumber: 0xffffffff,\n unlockingBytecode,\n },\n ],\n locktime: 0,\n outputs: [{ lockingBytecode: Uint8Array.of(), satoshis }],\n version: 1,\n };\n return {\n inputIndex: 0,\n sourceOutput: testFundingTransaction.outputs[0],\n spendingTransaction: testSpendingTransaction,\n };\n};\n//# sourceMappingURL=bch-types.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-types.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AuthenticationErrorBCH: () => (/* reexport safe */ _bch_errors__WEBPACK_IMPORTED_MODULE_1__.AuthenticationErrorBCH),\n/* harmony export */ ConsensusBCH: () => (/* reexport safe */ _bch_types__WEBPACK_IMPORTED_MODULE_5__.ConsensusBCH),\n/* harmony export */ InstructionSetBCH: () => (/* reexport safe */ _bch_instruction_sets__WEBPACK_IMPORTED_MODULE_2__.InstructionSetBCH),\n/* harmony export */ OpcodeAlternateNamesBCH: () => (/* reexport safe */ _bch_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodeAlternateNamesBCH),\n/* harmony export */ OpcodeDescriptionsBCH: () => (/* reexport safe */ _bch_descriptions__WEBPACK_IMPORTED_MODULE_0__.OpcodeDescriptionsBCH),\n/* harmony export */ OpcodeDescriptionsUniqueBCH: () => (/* reexport safe */ _bch_descriptions__WEBPACK_IMPORTED_MODULE_0__.OpcodeDescriptionsUniqueBCH),\n/* harmony export */ OpcodesBCH: () => (/* reexport safe */ _bch_instruction_sets__WEBPACK_IMPORTED_MODULE_2__.OpcodesBCH),\n/* harmony export */ assembleBitcoinABCScript: () => (/* reexport safe */ _fixtures_bitcoin_abc_bitcoin_abc_utils__WEBPACK_IMPORTED_MODULE_6__.assembleBitcoinABCScript),\n/* harmony export */ bitcoinABCOpcodes: () => (/* reexport safe */ _fixtures_bitcoin_abc_bitcoin_abc_utils__WEBPACK_IMPORTED_MODULE_6__.bitcoinABCOpcodes),\n/* harmony export */ bitcoinCashOperations: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.bitcoinCashOperations),\n/* harmony export */ bitwiseOperation: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.bitwiseOperation),\n/* harmony export */ createInstructionSetBCH: () => (/* reexport safe */ _bch_instruction_sets__WEBPACK_IMPORTED_MODULE_2__.createInstructionSetBCH),\n/* harmony export */ createTestAuthenticationProgramBCH: () => (/* reexport safe */ _bch_types__WEBPACK_IMPORTED_MODULE_5__.createTestAuthenticationProgramBCH),\n/* harmony export */ getFlagsForInstructionSetBCH: () => (/* reexport safe */ _bch_instruction_sets__WEBPACK_IMPORTED_MODULE_2__.getFlagsForInstructionSetBCH),\n/* harmony export */ instantiateVirtualMachineBCH: () => (/* binding */ instantiateVirtualMachineBCH),\n/* harmony export */ instructionSetBCHCurrentStrict: () => (/* reexport safe */ _bch_instruction_sets__WEBPACK_IMPORTED_MODULE_2__.instructionSetBCHCurrentStrict),\n/* harmony export */ isPayToScriptHash: () => (/* reexport safe */ _bch_instruction_sets__WEBPACK_IMPORTED_MODULE_2__.isPayToScriptHash),\n/* harmony export */ isValidSignatureEncodingBCHRaw: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.isValidSignatureEncodingBCHRaw),\n/* harmony export */ isWitnessProgram: () => (/* reexport safe */ _bch_instruction_sets__WEBPACK_IMPORTED_MODULE_2__.isWitnessProgram),\n/* harmony export */ opAnd: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.opAnd),\n/* harmony export */ opBin2Num: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.opBin2Num),\n/* harmony export */ opCat: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.opCat),\n/* harmony export */ opCheckDataSig: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.opCheckDataSig),\n/* harmony export */ opCheckDataSigVerify: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.opCheckDataSigVerify),\n/* harmony export */ opDiv: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.opDiv),\n/* harmony export */ opMod: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.opMod),\n/* harmony export */ opNum2Bin: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.opNum2Bin),\n/* harmony export */ opOr: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.opOr),\n/* harmony export */ opReverseBytes: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.opReverseBytes),\n/* harmony export */ opSplit: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.opSplit),\n/* harmony export */ opXor: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.opXor),\n/* harmony export */ padMinimallyEncodedScriptNumber: () => (/* reexport safe */ _bch_operations__WEBPACK_IMPORTED_MODULE_4__.padMinimallyEncodedScriptNumber)\n/* harmony export */ });\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/sha1.js\");\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/sha256.js\");\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/ripemd160.js\");\n/* harmony import */ var _crypto_crypto__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../crypto/crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/crypto/secp256k1.js\");\n/* harmony import */ var _virtual_machine__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../virtual-machine */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/virtual-machine.js\");\n/* harmony import */ var _bch_instruction_sets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bch-instruction-sets */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-instruction-sets.js\");\n/* harmony import */ var _bch_descriptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bch-descriptions */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-descriptions.js\");\n/* harmony import */ var _bch_errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bch-errors */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-errors.js\");\n/* harmony import */ var _bch_opcodes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bch-opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-opcodes.js\");\n/* harmony import */ var _bch_operations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bch-operations */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-operations.js\");\n/* harmony import */ var _bch_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./bch-types */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-types.js\");\n/* harmony import */ var _fixtures_bitcoin_abc_bitcoin_abc_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./fixtures/bitcoin-abc/bitcoin-abc-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/fixtures/bitcoin-abc/bitcoin-abc-utils.js\");\n\n\n\n\n\n\n\n\n\n\n/**\n * Initialize a virtual machine using the provided BCH instruction set.\n *\n * @param instructionSet - the VM version to instantiate – by default, the\n * current \"strict\" VM is used (`instructionSetBCHCurrentStrict`)\n */\nconst instantiateVirtualMachineBCH = async (instructionSet = _bch_instruction_sets__WEBPACK_IMPORTED_MODULE_2__.instructionSetBCHCurrentStrict) => {\n const [sha1, sha256, ripemd160, secp256k1] = await Promise.all([\n (0,_crypto_crypto__WEBPACK_IMPORTED_MODULE_7__.instantiateSha1)(),\n (0,_crypto_crypto__WEBPACK_IMPORTED_MODULE_8__.instantiateSha256)(),\n (0,_crypto_crypto__WEBPACK_IMPORTED_MODULE_9__.instantiateRipemd160)(),\n (0,_crypto_crypto__WEBPACK_IMPORTED_MODULE_10__.instantiateSecp256k1)(),\n ]);\n return (0,_virtual_machine__WEBPACK_IMPORTED_MODULE_11__.createAuthenticationVirtualMachine)((0,_bch_instruction_sets__WEBPACK_IMPORTED_MODULE_2__.createInstructionSetBCH)({\n flags: (0,_bch_instruction_sets__WEBPACK_IMPORTED_MODULE_2__.getFlagsForInstructionSetBCH)(instructionSet),\n ripemd160,\n secp256k1,\n sha1,\n sha256,\n }));\n};\n//# sourceMappingURL=bch.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/fixtures/bitcoin-abc/bitcoin-abc-utils.js": +/*!**************************************************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/fixtures/bitcoin-abc/bitcoin-abc-utils.js ***! + \**************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ assembleBitcoinABCScript: () => (/* binding */ assembleBitcoinABCScript),\n/* harmony export */ bitcoinABCOpcodes: () => (/* binding */ bitcoinABCOpcodes)\n/* harmony export */ });\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/utf8.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/common */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/push.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/common */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n/* harmony import */ var _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../instruction-sets-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-utils.js\");\n/* harmony import */ var _bch_opcodes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../bch-opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-opcodes.js\");\n\n\n\n\nconst bitcoinABCOpcodes = Object.entries((0,_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_0__.generateBytecodeMap)(_bch_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesBCH)).reduce((acc, cur) => ({ ...acc, [cur[0].slice('OP_'.length)]: cur[1] }), {\n PUSHDATA1: Uint8Array.of(_bch_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesBCH.OP_PUSHDATA_1),\n PUSHDATA2: Uint8Array.of(_bch_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesBCH.OP_PUSHDATA_2),\n PUSHDATA4: Uint8Array.of(_bch_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesBCH.OP_PUSHDATA_4),\n});\n/**\n * Convert a string from Bitcoin ABC's `script_tests.json` text-format to\n * bytecode. The string must be valid – this method attempts to convert all\n * unmatched tokens to `BigInt`s.\n *\n * @privateRemarks\n * This method doesn't use {@link compileScript} because of a slight\n * incompatibility in the languages. In BTL, BigIntLiterals are a primitive\n * type, and must be surrounded by a push statement (e.g. `<100>`) to push a\n * number to the stack. In the `script_tests.json` text-format, numbers are\n * assumed to be pushed. We could implement a transformation after the\n * compiler's parse step, but because this format doesn't require any other\n * features of the compiler, we opt to implement this as a simple method.\n * @param abcScript - the script in Bitcoin ABC's `script_tests.json` text\n * format\n */\nconst assembleBitcoinABCScript = (abcScript) => (0,_format_format__WEBPACK_IMPORTED_MODULE_2__.flattenBinArray)(abcScript\n .split(' ')\n .filter((token) => token !== '')\n .map((token) => token.startsWith('0x')\n ? (0,_format_format__WEBPACK_IMPORTED_MODULE_2__.hexToBin)(token.slice('0x'.length))\n : token.startsWith(\"'\")\n ? (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.encodeDataPush)((0,_format_format__WEBPACK_IMPORTED_MODULE_4__.utf8ToBin)(token.slice(1, token.length - 1)))\n : bitcoinABCOpcodes[token] === undefined\n ? (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.encodeDataPush)((0,_common_common__WEBPACK_IMPORTED_MODULE_5__.bigIntToScriptNumber)(BigInt(token)))\n : bitcoinABCOpcodes[token]));\n//# sourceMappingURL=bitcoin-abc-utils.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/fixtures/bitcoin-abc/bitcoin-abc-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/btc/btc.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/btc/btc.js ***! + \***************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OpcodesBTC: () => (/* binding */ OpcodesBTC)\n/* harmony export */ });\nvar OpcodesBTC;\n(function (OpcodesBTC) {\n OpcodesBTC[OpcodesBTC[\"OP_0\"] = 0] = \"OP_0\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_1\"] = 1] = \"OP_PUSHBYTES_1\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_2\"] = 2] = \"OP_PUSHBYTES_2\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_3\"] = 3] = \"OP_PUSHBYTES_3\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_4\"] = 4] = \"OP_PUSHBYTES_4\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_5\"] = 5] = \"OP_PUSHBYTES_5\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_6\"] = 6] = \"OP_PUSHBYTES_6\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_7\"] = 7] = \"OP_PUSHBYTES_7\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_8\"] = 8] = \"OP_PUSHBYTES_8\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_9\"] = 9] = \"OP_PUSHBYTES_9\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_10\"] = 10] = \"OP_PUSHBYTES_10\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_11\"] = 11] = \"OP_PUSHBYTES_11\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_12\"] = 12] = \"OP_PUSHBYTES_12\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_13\"] = 13] = \"OP_PUSHBYTES_13\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_14\"] = 14] = \"OP_PUSHBYTES_14\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_15\"] = 15] = \"OP_PUSHBYTES_15\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_16\"] = 16] = \"OP_PUSHBYTES_16\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_17\"] = 17] = \"OP_PUSHBYTES_17\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_18\"] = 18] = \"OP_PUSHBYTES_18\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_19\"] = 19] = \"OP_PUSHBYTES_19\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_20\"] = 20] = \"OP_PUSHBYTES_20\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_21\"] = 21] = \"OP_PUSHBYTES_21\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_22\"] = 22] = \"OP_PUSHBYTES_22\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_23\"] = 23] = \"OP_PUSHBYTES_23\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_24\"] = 24] = \"OP_PUSHBYTES_24\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_25\"] = 25] = \"OP_PUSHBYTES_25\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_26\"] = 26] = \"OP_PUSHBYTES_26\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_27\"] = 27] = \"OP_PUSHBYTES_27\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_28\"] = 28] = \"OP_PUSHBYTES_28\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_29\"] = 29] = \"OP_PUSHBYTES_29\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_30\"] = 30] = \"OP_PUSHBYTES_30\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_31\"] = 31] = \"OP_PUSHBYTES_31\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_32\"] = 32] = \"OP_PUSHBYTES_32\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_33\"] = 33] = \"OP_PUSHBYTES_33\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_34\"] = 34] = \"OP_PUSHBYTES_34\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_35\"] = 35] = \"OP_PUSHBYTES_35\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_36\"] = 36] = \"OP_PUSHBYTES_36\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_37\"] = 37] = \"OP_PUSHBYTES_37\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_38\"] = 38] = \"OP_PUSHBYTES_38\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_39\"] = 39] = \"OP_PUSHBYTES_39\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_40\"] = 40] = \"OP_PUSHBYTES_40\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_41\"] = 41] = \"OP_PUSHBYTES_41\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_42\"] = 42] = \"OP_PUSHBYTES_42\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_43\"] = 43] = \"OP_PUSHBYTES_43\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_44\"] = 44] = \"OP_PUSHBYTES_44\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_45\"] = 45] = \"OP_PUSHBYTES_45\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_46\"] = 46] = \"OP_PUSHBYTES_46\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_47\"] = 47] = \"OP_PUSHBYTES_47\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_48\"] = 48] = \"OP_PUSHBYTES_48\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_49\"] = 49] = \"OP_PUSHBYTES_49\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_50\"] = 50] = \"OP_PUSHBYTES_50\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_51\"] = 51] = \"OP_PUSHBYTES_51\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_52\"] = 52] = \"OP_PUSHBYTES_52\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_53\"] = 53] = \"OP_PUSHBYTES_53\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_54\"] = 54] = \"OP_PUSHBYTES_54\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_55\"] = 55] = \"OP_PUSHBYTES_55\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_56\"] = 56] = \"OP_PUSHBYTES_56\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_57\"] = 57] = \"OP_PUSHBYTES_57\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_58\"] = 58] = \"OP_PUSHBYTES_58\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_59\"] = 59] = \"OP_PUSHBYTES_59\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_60\"] = 60] = \"OP_PUSHBYTES_60\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_61\"] = 61] = \"OP_PUSHBYTES_61\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_62\"] = 62] = \"OP_PUSHBYTES_62\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_63\"] = 63] = \"OP_PUSHBYTES_63\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_64\"] = 64] = \"OP_PUSHBYTES_64\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_65\"] = 65] = \"OP_PUSHBYTES_65\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_66\"] = 66] = \"OP_PUSHBYTES_66\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_67\"] = 67] = \"OP_PUSHBYTES_67\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_68\"] = 68] = \"OP_PUSHBYTES_68\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_69\"] = 69] = \"OP_PUSHBYTES_69\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_70\"] = 70] = \"OP_PUSHBYTES_70\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_71\"] = 71] = \"OP_PUSHBYTES_71\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_72\"] = 72] = \"OP_PUSHBYTES_72\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_73\"] = 73] = \"OP_PUSHBYTES_73\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_74\"] = 74] = \"OP_PUSHBYTES_74\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHBYTES_75\"] = 75] = \"OP_PUSHBYTES_75\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHDATA_1\"] = 76] = \"OP_PUSHDATA_1\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHDATA_2\"] = 77] = \"OP_PUSHDATA_2\";\n OpcodesBTC[OpcodesBTC[\"OP_PUSHDATA_4\"] = 78] = \"OP_PUSHDATA_4\";\n OpcodesBTC[OpcodesBTC[\"OP_1NEGATE\"] = 79] = \"OP_1NEGATE\";\n OpcodesBTC[OpcodesBTC[\"OP_RESERVED\"] = 80] = \"OP_RESERVED\";\n OpcodesBTC[OpcodesBTC[\"OP_1\"] = 81] = \"OP_1\";\n OpcodesBTC[OpcodesBTC[\"OP_2\"] = 82] = \"OP_2\";\n OpcodesBTC[OpcodesBTC[\"OP_3\"] = 83] = \"OP_3\";\n OpcodesBTC[OpcodesBTC[\"OP_4\"] = 84] = \"OP_4\";\n OpcodesBTC[OpcodesBTC[\"OP_5\"] = 85] = \"OP_5\";\n OpcodesBTC[OpcodesBTC[\"OP_6\"] = 86] = \"OP_6\";\n OpcodesBTC[OpcodesBTC[\"OP_7\"] = 87] = \"OP_7\";\n OpcodesBTC[OpcodesBTC[\"OP_8\"] = 88] = \"OP_8\";\n OpcodesBTC[OpcodesBTC[\"OP_9\"] = 89] = \"OP_9\";\n OpcodesBTC[OpcodesBTC[\"OP_10\"] = 90] = \"OP_10\";\n OpcodesBTC[OpcodesBTC[\"OP_11\"] = 91] = \"OP_11\";\n OpcodesBTC[OpcodesBTC[\"OP_12\"] = 92] = \"OP_12\";\n OpcodesBTC[OpcodesBTC[\"OP_13\"] = 93] = \"OP_13\";\n OpcodesBTC[OpcodesBTC[\"OP_14\"] = 94] = \"OP_14\";\n OpcodesBTC[OpcodesBTC[\"OP_15\"] = 95] = \"OP_15\";\n OpcodesBTC[OpcodesBTC[\"OP_16\"] = 96] = \"OP_16\";\n OpcodesBTC[OpcodesBTC[\"OP_NOP\"] = 97] = \"OP_NOP\";\n OpcodesBTC[OpcodesBTC[\"OP_VER\"] = 98] = \"OP_VER\";\n OpcodesBTC[OpcodesBTC[\"OP_IF\"] = 99] = \"OP_IF\";\n OpcodesBTC[OpcodesBTC[\"OP_NOTIF\"] = 100] = \"OP_NOTIF\";\n OpcodesBTC[OpcodesBTC[\"OP_VERIF\"] = 101] = \"OP_VERIF\";\n OpcodesBTC[OpcodesBTC[\"OP_VERNOTIF\"] = 102] = \"OP_VERNOTIF\";\n OpcodesBTC[OpcodesBTC[\"OP_ELSE\"] = 103] = \"OP_ELSE\";\n OpcodesBTC[OpcodesBTC[\"OP_ENDIF\"] = 104] = \"OP_ENDIF\";\n OpcodesBTC[OpcodesBTC[\"OP_VERIFY\"] = 105] = \"OP_VERIFY\";\n OpcodesBTC[OpcodesBTC[\"OP_RETURN\"] = 106] = \"OP_RETURN\";\n OpcodesBTC[OpcodesBTC[\"OP_TOALTSTACK\"] = 107] = \"OP_TOALTSTACK\";\n OpcodesBTC[OpcodesBTC[\"OP_FROMALTSTACK\"] = 108] = \"OP_FROMALTSTACK\";\n OpcodesBTC[OpcodesBTC[\"OP_2DROP\"] = 109] = \"OP_2DROP\";\n OpcodesBTC[OpcodesBTC[\"OP_2DUP\"] = 110] = \"OP_2DUP\";\n OpcodesBTC[OpcodesBTC[\"OP_3DUP\"] = 111] = \"OP_3DUP\";\n OpcodesBTC[OpcodesBTC[\"OP_2OVER\"] = 112] = \"OP_2OVER\";\n OpcodesBTC[OpcodesBTC[\"OP_2ROT\"] = 113] = \"OP_2ROT\";\n OpcodesBTC[OpcodesBTC[\"OP_2SWAP\"] = 114] = \"OP_2SWAP\";\n OpcodesBTC[OpcodesBTC[\"OP_IFDUP\"] = 115] = \"OP_IFDUP\";\n OpcodesBTC[OpcodesBTC[\"OP_DEPTH\"] = 116] = \"OP_DEPTH\";\n OpcodesBTC[OpcodesBTC[\"OP_DROP\"] = 117] = \"OP_DROP\";\n OpcodesBTC[OpcodesBTC[\"OP_DUP\"] = 118] = \"OP_DUP\";\n OpcodesBTC[OpcodesBTC[\"OP_NIP\"] = 119] = \"OP_NIP\";\n OpcodesBTC[OpcodesBTC[\"OP_OVER\"] = 120] = \"OP_OVER\";\n OpcodesBTC[OpcodesBTC[\"OP_PICK\"] = 121] = \"OP_PICK\";\n OpcodesBTC[OpcodesBTC[\"OP_ROLL\"] = 122] = \"OP_ROLL\";\n OpcodesBTC[OpcodesBTC[\"OP_ROT\"] = 123] = \"OP_ROT\";\n OpcodesBTC[OpcodesBTC[\"OP_SWAP\"] = 124] = \"OP_SWAP\";\n OpcodesBTC[OpcodesBTC[\"OP_TUCK\"] = 125] = \"OP_TUCK\";\n OpcodesBTC[OpcodesBTC[\"OP_CAT\"] = 126] = \"OP_CAT\";\n OpcodesBTC[OpcodesBTC[\"OP_SUBSTR\"] = 127] = \"OP_SUBSTR\";\n OpcodesBTC[OpcodesBTC[\"OP_LEFT\"] = 128] = \"OP_LEFT\";\n OpcodesBTC[OpcodesBTC[\"OP_RIGHT\"] = 129] = \"OP_RIGHT\";\n OpcodesBTC[OpcodesBTC[\"OP_SIZE\"] = 130] = \"OP_SIZE\";\n OpcodesBTC[OpcodesBTC[\"OP_INVERT\"] = 131] = \"OP_INVERT\";\n OpcodesBTC[OpcodesBTC[\"OP_AND\"] = 132] = \"OP_AND\";\n OpcodesBTC[OpcodesBTC[\"OP_OR\"] = 133] = \"OP_OR\";\n OpcodesBTC[OpcodesBTC[\"OP_XOR\"] = 134] = \"OP_XOR\";\n OpcodesBTC[OpcodesBTC[\"OP_EQUAL\"] = 135] = \"OP_EQUAL\";\n OpcodesBTC[OpcodesBTC[\"OP_EQUALVERIFY\"] = 136] = \"OP_EQUALVERIFY\";\n OpcodesBTC[OpcodesBTC[\"OP_RESERVED1\"] = 137] = \"OP_RESERVED1\";\n OpcodesBTC[OpcodesBTC[\"OP_RESERVED2\"] = 138] = \"OP_RESERVED2\";\n OpcodesBTC[OpcodesBTC[\"OP_1ADD\"] = 139] = \"OP_1ADD\";\n OpcodesBTC[OpcodesBTC[\"OP_1SUB\"] = 140] = \"OP_1SUB\";\n OpcodesBTC[OpcodesBTC[\"OP_2MUL\"] = 141] = \"OP_2MUL\";\n OpcodesBTC[OpcodesBTC[\"OP_2DIV\"] = 142] = \"OP_2DIV\";\n OpcodesBTC[OpcodesBTC[\"OP_NEGATE\"] = 143] = \"OP_NEGATE\";\n OpcodesBTC[OpcodesBTC[\"OP_ABS\"] = 144] = \"OP_ABS\";\n OpcodesBTC[OpcodesBTC[\"OP_NOT\"] = 145] = \"OP_NOT\";\n OpcodesBTC[OpcodesBTC[\"OP_0NOTEQUAL\"] = 146] = \"OP_0NOTEQUAL\";\n OpcodesBTC[OpcodesBTC[\"OP_ADD\"] = 147] = \"OP_ADD\";\n OpcodesBTC[OpcodesBTC[\"OP_SUB\"] = 148] = \"OP_SUB\";\n OpcodesBTC[OpcodesBTC[\"OP_MUL\"] = 149] = \"OP_MUL\";\n OpcodesBTC[OpcodesBTC[\"OP_DIV\"] = 150] = \"OP_DIV\";\n OpcodesBTC[OpcodesBTC[\"OP_MOD\"] = 151] = \"OP_MOD\";\n OpcodesBTC[OpcodesBTC[\"OP_LSHIFT\"] = 152] = \"OP_LSHIFT\";\n OpcodesBTC[OpcodesBTC[\"OP_RSHIFT\"] = 153] = \"OP_RSHIFT\";\n OpcodesBTC[OpcodesBTC[\"OP_BOOLAND\"] = 154] = \"OP_BOOLAND\";\n OpcodesBTC[OpcodesBTC[\"OP_BOOLOR\"] = 155] = \"OP_BOOLOR\";\n OpcodesBTC[OpcodesBTC[\"OP_NUMEQUAL\"] = 156] = \"OP_NUMEQUAL\";\n OpcodesBTC[OpcodesBTC[\"OP_NUMEQUALVERIFY\"] = 157] = \"OP_NUMEQUALVERIFY\";\n OpcodesBTC[OpcodesBTC[\"OP_NUMNOTEQUAL\"] = 158] = \"OP_NUMNOTEQUAL\";\n OpcodesBTC[OpcodesBTC[\"OP_LESSTHAN\"] = 159] = \"OP_LESSTHAN\";\n OpcodesBTC[OpcodesBTC[\"OP_GREATERTHAN\"] = 160] = \"OP_GREATERTHAN\";\n OpcodesBTC[OpcodesBTC[\"OP_LESSTHANOREQUAL\"] = 161] = \"OP_LESSTHANOREQUAL\";\n OpcodesBTC[OpcodesBTC[\"OP_GREATERTHANOREQUAL\"] = 162] = \"OP_GREATERTHANOREQUAL\";\n OpcodesBTC[OpcodesBTC[\"OP_MIN\"] = 163] = \"OP_MIN\";\n OpcodesBTC[OpcodesBTC[\"OP_MAX\"] = 164] = \"OP_MAX\";\n OpcodesBTC[OpcodesBTC[\"OP_WITHIN\"] = 165] = \"OP_WITHIN\";\n OpcodesBTC[OpcodesBTC[\"OP_RIPEMD160\"] = 166] = \"OP_RIPEMD160\";\n OpcodesBTC[OpcodesBTC[\"OP_SHA1\"] = 167] = \"OP_SHA1\";\n OpcodesBTC[OpcodesBTC[\"OP_SHA256\"] = 168] = \"OP_SHA256\";\n OpcodesBTC[OpcodesBTC[\"OP_HASH160\"] = 169] = \"OP_HASH160\";\n OpcodesBTC[OpcodesBTC[\"OP_HASH256\"] = 170] = \"OP_HASH256\";\n OpcodesBTC[OpcodesBTC[\"OP_CODESEPARATOR\"] = 171] = \"OP_CODESEPARATOR\";\n OpcodesBTC[OpcodesBTC[\"OP_CHECKSIG\"] = 172] = \"OP_CHECKSIG\";\n OpcodesBTC[OpcodesBTC[\"OP_CHECKSIGVERIFY\"] = 173] = \"OP_CHECKSIGVERIFY\";\n OpcodesBTC[OpcodesBTC[\"OP_CHECKMULTISIG\"] = 174] = \"OP_CHECKMULTISIG\";\n OpcodesBTC[OpcodesBTC[\"OP_CHECKMULTISIGVERIFY\"] = 175] = \"OP_CHECKMULTISIGVERIFY\";\n OpcodesBTC[OpcodesBTC[\"OP_NOP1\"] = 176] = \"OP_NOP1\";\n OpcodesBTC[OpcodesBTC[\"OP_CHECKLOCKTIMEVERIFY\"] = 177] = \"OP_CHECKLOCKTIMEVERIFY\";\n OpcodesBTC[OpcodesBTC[\"OP_CHECKSEQUENCEVERIFY\"] = 178] = \"OP_CHECKSEQUENCEVERIFY\";\n OpcodesBTC[OpcodesBTC[\"OP_NOP4\"] = 179] = \"OP_NOP4\";\n OpcodesBTC[OpcodesBTC[\"OP_NOP5\"] = 180] = \"OP_NOP5\";\n OpcodesBTC[OpcodesBTC[\"OP_NOP6\"] = 181] = \"OP_NOP6\";\n OpcodesBTC[OpcodesBTC[\"OP_NOP7\"] = 182] = \"OP_NOP7\";\n OpcodesBTC[OpcodesBTC[\"OP_NOP8\"] = 183] = \"OP_NOP8\";\n OpcodesBTC[OpcodesBTC[\"OP_NOP9\"] = 184] = \"OP_NOP9\";\n OpcodesBTC[OpcodesBTC[\"OP_NOP10\"] = 185] = \"OP_NOP10\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN186\"] = 186] = \"OP_UNKNOWN186\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN187\"] = 187] = \"OP_UNKNOWN187\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN188\"] = 188] = \"OP_UNKNOWN188\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN189\"] = 189] = \"OP_UNKNOWN189\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN190\"] = 190] = \"OP_UNKNOWN190\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN191\"] = 191] = \"OP_UNKNOWN191\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN192\"] = 192] = \"OP_UNKNOWN192\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN193\"] = 193] = \"OP_UNKNOWN193\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN194\"] = 194] = \"OP_UNKNOWN194\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN195\"] = 195] = \"OP_UNKNOWN195\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN196\"] = 196] = \"OP_UNKNOWN196\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN197\"] = 197] = \"OP_UNKNOWN197\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN198\"] = 198] = \"OP_UNKNOWN198\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN199\"] = 199] = \"OP_UNKNOWN199\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN200\"] = 200] = \"OP_UNKNOWN200\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN201\"] = 201] = \"OP_UNKNOWN201\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN202\"] = 202] = \"OP_UNKNOWN202\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN203\"] = 203] = \"OP_UNKNOWN203\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN204\"] = 204] = \"OP_UNKNOWN204\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN205\"] = 205] = \"OP_UNKNOWN205\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN206\"] = 206] = \"OP_UNKNOWN206\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN207\"] = 207] = \"OP_UNKNOWN207\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN208\"] = 208] = \"OP_UNKNOWN208\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN209\"] = 209] = \"OP_UNKNOWN209\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN210\"] = 210] = \"OP_UNKNOWN210\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN211\"] = 211] = \"OP_UNKNOWN211\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN212\"] = 212] = \"OP_UNKNOWN212\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN213\"] = 213] = \"OP_UNKNOWN213\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN214\"] = 214] = \"OP_UNKNOWN214\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN215\"] = 215] = \"OP_UNKNOWN215\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN216\"] = 216] = \"OP_UNKNOWN216\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN217\"] = 217] = \"OP_UNKNOWN217\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN218\"] = 218] = \"OP_UNKNOWN218\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN219\"] = 219] = \"OP_UNKNOWN219\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN220\"] = 220] = \"OP_UNKNOWN220\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN221\"] = 221] = \"OP_UNKNOWN221\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN222\"] = 222] = \"OP_UNKNOWN222\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN223\"] = 223] = \"OP_UNKNOWN223\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN224\"] = 224] = \"OP_UNKNOWN224\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN225\"] = 225] = \"OP_UNKNOWN225\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN226\"] = 226] = \"OP_UNKNOWN226\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN227\"] = 227] = \"OP_UNKNOWN227\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN228\"] = 228] = \"OP_UNKNOWN228\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN229\"] = 229] = \"OP_UNKNOWN229\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN230\"] = 230] = \"OP_UNKNOWN230\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN231\"] = 231] = \"OP_UNKNOWN231\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN232\"] = 232] = \"OP_UNKNOWN232\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN233\"] = 233] = \"OP_UNKNOWN233\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN234\"] = 234] = \"OP_UNKNOWN234\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN235\"] = 235] = \"OP_UNKNOWN235\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN236\"] = 236] = \"OP_UNKNOWN236\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN237\"] = 237] = \"OP_UNKNOWN237\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN238\"] = 238] = \"OP_UNKNOWN238\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN239\"] = 239] = \"OP_UNKNOWN239\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN240\"] = 240] = \"OP_UNKNOWN240\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN241\"] = 241] = \"OP_UNKNOWN241\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN242\"] = 242] = \"OP_UNKNOWN242\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN243\"] = 243] = \"OP_UNKNOWN243\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN244\"] = 244] = \"OP_UNKNOWN244\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN245\"] = 245] = \"OP_UNKNOWN245\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN246\"] = 246] = \"OP_UNKNOWN246\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN247\"] = 247] = \"OP_UNKNOWN247\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN248\"] = 248] = \"OP_UNKNOWN248\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN249\"] = 249] = \"OP_UNKNOWN249\";\n /**\n * Used internally in the C++ implementation.\n */\n OpcodesBTC[OpcodesBTC[\"OP_SMALLINTEGER\"] = 250] = \"OP_SMALLINTEGER\";\n /**\n * Used internally in the C++ implementation.\n */\n OpcodesBTC[OpcodesBTC[\"OP_PUBKEYS\"] = 251] = \"OP_PUBKEYS\";\n OpcodesBTC[OpcodesBTC[\"OP_UNKNOWN252\"] = 252] = \"OP_UNKNOWN252\";\n /**\n * Used internally in the C++ implementation.\n */\n OpcodesBTC[OpcodesBTC[\"OP_PUBKEYHASH\"] = 253] = \"OP_PUBKEYHASH\";\n /**\n * Used internally in the C++ implementation.\n */\n OpcodesBTC[OpcodesBTC[\"OP_PUBKEY\"] = 254] = \"OP_PUBKEY\";\n /**\n * Used internally in the C++ implementation.\n */\n OpcodesBTC[OpcodesBTC[\"OP_INVALIDOPCODE\"] = 255] = \"OP_INVALIDOPCODE\";\n})(OpcodesBTC || (OpcodesBTC = {}));\n//# sourceMappingURL=btc.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/btc/btc.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/arithmetic.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/arithmetic.js ***! + \*************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ arithmeticOperations: () => (/* binding */ arithmeticOperations),\n/* harmony export */ op0NotEqual: () => (/* binding */ op0NotEqual),\n/* harmony export */ op1Add: () => (/* binding */ op1Add),\n/* harmony export */ op1Sub: () => (/* binding */ op1Sub),\n/* harmony export */ opAbs: () => (/* binding */ opAbs),\n/* harmony export */ opAdd: () => (/* binding */ opAdd),\n/* harmony export */ opBoolAnd: () => (/* binding */ opBoolAnd),\n/* harmony export */ opBoolOr: () => (/* binding */ opBoolOr),\n/* harmony export */ opGreaterThan: () => (/* binding */ opGreaterThan),\n/* harmony export */ opGreaterThanOrEqual: () => (/* binding */ opGreaterThanOrEqual),\n/* harmony export */ opLessThan: () => (/* binding */ opLessThan),\n/* harmony export */ opLessThanOrEqual: () => (/* binding */ opLessThanOrEqual),\n/* harmony export */ opMax: () => (/* binding */ opMax),\n/* harmony export */ opMin: () => (/* binding */ opMin),\n/* harmony export */ opNegate: () => (/* binding */ opNegate),\n/* harmony export */ opNot: () => (/* binding */ opNot),\n/* harmony export */ opNumEqual: () => (/* binding */ opNumEqual),\n/* harmony export */ opNumEqualVerify: () => (/* binding */ opNumEqualVerify),\n/* harmony export */ opNumNotEqual: () => (/* binding */ opNumNotEqual),\n/* harmony export */ opSub: () => (/* binding */ opSub),\n/* harmony export */ opWithin: () => (/* binding */ opWithin)\n/* harmony export */ });\n/* harmony import */ var _combinators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./combinators */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/combinators.js\");\n/* harmony import */ var _flow_control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flow-control */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/flow-control.js\");\n/* harmony import */ var _opcodes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n\n\n\n\nconst op1Add = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(state, (nextState, [value]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(value + BigInt(1))), { requireMinimalEncoding });\nconst op1Sub = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(state, (nextState, [value]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(value - BigInt(1))), { requireMinimalEncoding });\nconst opNegate = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(state, (nextState, [value]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(-value)), { requireMinimalEncoding });\nconst opAbs = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(state, (nextState, [value]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(value < 0 ? -value : value)), { requireMinimalEncoding });\nconst opNot = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(state, (nextState, [value]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, value === BigInt(0)\n ? (0,_types__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(BigInt(1))\n : (0,_types__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(BigInt(0))), { requireMinimalEncoding });\nconst op0NotEqual = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(state, (nextState, [value]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, value === BigInt(0)\n ? (0,_types__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(BigInt(0))\n : (0,_types__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(BigInt(1))), { requireMinimalEncoding });\nconst opAdd = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [firstValue, secondValue]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(firstValue + secondValue)), { requireMinimalEncoding });\nconst opSub = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [firstValue, secondValue]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(firstValue - secondValue)), { requireMinimalEncoding });\nconst opBoolAnd = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [firstValue, secondValue]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.booleanToScriptNumber)(firstValue !== BigInt(0) && secondValue !== BigInt(0))), { requireMinimalEncoding });\nconst opBoolOr = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [firstValue, secondValue]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.booleanToScriptNumber)(firstValue !== BigInt(0) || secondValue !== BigInt(0))), { requireMinimalEncoding });\nconst opNumEqual = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [firstValue, secondValue]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.booleanToScriptNumber)(firstValue === secondValue)), { requireMinimalEncoding });\nconst opNumEqualVerify = (flags) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.combineOperations)(opNumEqual(flags), (0,_flow_control__WEBPACK_IMPORTED_MODULE_2__.opVerify)());\nconst opNumNotEqual = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [firstValue, secondValue]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.booleanToScriptNumber)(firstValue !== secondValue)), { requireMinimalEncoding });\nconst opLessThan = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [firstValue, secondValue]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.booleanToScriptNumber)(firstValue < secondValue)), { requireMinimalEncoding });\nconst opLessThanOrEqual = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [firstValue, secondValue]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.booleanToScriptNumber)(firstValue <= secondValue)), { requireMinimalEncoding });\nconst opGreaterThan = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [firstValue, secondValue]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.booleanToScriptNumber)(firstValue > secondValue)), { requireMinimalEncoding });\nconst opGreaterThanOrEqual = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [firstValue, secondValue]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.booleanToScriptNumber)(firstValue >= secondValue)), { requireMinimalEncoding });\nconst opMin = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [firstValue, secondValue]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(firstValue < secondValue ? firstValue : secondValue)), { requireMinimalEncoding });\nconst opMax = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoScriptNumbers)(state, (nextState, [firstValue, secondValue]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(firstValue > secondValue ? firstValue : secondValue)), { requireMinimalEncoding });\nconst opWithin = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useThreeScriptNumbers)(state, (nextState, [firstValue, secondValue, thirdValue]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.booleanToScriptNumber)(secondValue <= firstValue && firstValue < thirdValue)), { requireMinimalEncoding });\nconst arithmeticOperations = (flags) => ({\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_1ADD]: op1Add(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_1SUB]: op1Sub(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_NEGATE]: opNegate(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_ABS]: opAbs(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_NOT]: opNot(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_0NOTEQUAL]: op0NotEqual(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_ADD]: opAdd(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_SUB]: opSub(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_BOOLAND]: opBoolAnd(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_BOOLOR]: opBoolOr(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_NUMEQUAL]: opNumEqual(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_NUMEQUALVERIFY]: opNumEqualVerify(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_NUMNOTEQUAL]: opNumNotEqual(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_LESSTHAN]: opLessThan(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_LESSTHANOREQUAL]: opLessThanOrEqual(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_GREATERTHAN]: opGreaterThan(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_GREATERTHANOREQUAL]: opGreaterThanOrEqual(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_MIN]: opMin(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_MAX]: opMax(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_WITHIN]: opWithin(flags),\n});\n//# sourceMappingURL=arithmetic.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/arithmetic.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/bitwise.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/bitwise.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ bitwiseOperations: () => (/* binding */ bitwiseOperations),\n/* harmony export */ opEqual: () => (/* binding */ opEqual),\n/* harmony export */ opEqualVerify: () => (/* binding */ opEqualVerify)\n/* harmony export */ });\n/* harmony import */ var _combinators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./combinators */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/combinators.js\");\n/* harmony import */ var _flow_control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flow-control */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/flow-control.js\");\n/* harmony import */ var _opcodes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n\n\n\n\nconst areEqual = (a, b) => {\n if (a.length !== b.length) {\n return false;\n }\n // eslint-disable-next-line functional/no-let, functional/no-loop-statement, no-plusplus\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n};\nconst opEqual = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoStackItems)(state, (nextState, [element1, element2]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, (0,_types__WEBPACK_IMPORTED_MODULE_1__.booleanToScriptNumber)(areEqual(element1, element2))));\nconst opEqualVerify = () => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.combineOperations)(opEqual(), (0,_flow_control__WEBPACK_IMPORTED_MODULE_2__.opVerify)());\nconst bitwiseOperations = () => ({\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_EQUAL]: opEqual(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_EQUALVERIFY]: opEqualVerify(),\n});\n//# sourceMappingURL=bitwise.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/bitwise.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/combinators.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/combinators.js ***! + \**************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ combineOperations: () => (/* binding */ combineOperations),\n/* harmony export */ conditionallyEvaluate: () => (/* binding */ conditionallyEvaluate),\n/* harmony export */ incrementOperationCount: () => (/* binding */ incrementOperationCount),\n/* harmony export */ mapOverOperations: () => (/* binding */ mapOverOperations),\n/* harmony export */ pushToStack: () => (/* binding */ pushToStack),\n/* harmony export */ useFourStackItems: () => (/* binding */ useFourStackItems),\n/* harmony export */ useOneScriptNumber: () => (/* binding */ useOneScriptNumber),\n/* harmony export */ useOneStackItem: () => (/* binding */ useOneStackItem),\n/* harmony export */ useSixStackItems: () => (/* binding */ useSixStackItems),\n/* harmony export */ useThreeScriptNumbers: () => (/* binding */ useThreeScriptNumbers),\n/* harmony export */ useThreeStackItems: () => (/* binding */ useThreeStackItems),\n/* harmony export */ useTwoScriptNumbers: () => (/* binding */ useTwoScriptNumbers),\n/* harmony export */ useTwoStackItems: () => (/* binding */ useTwoStackItems)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js\");\n\n\nconst incrementOperationCount = (operation) => (state) => {\n const nextState = operation(state);\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n nextState.operationCount += 1;\n return nextState;\n};\nconst conditionallyEvaluate = (operation) => (state) => state.executionStack.every((item) => item) ? operation(state) : state;\n/**\n * Map a function over each operation in an `InstructionSet.operations` object,\n * assigning the result to the same `opcode` in the resulting object.\n * @param operations - an operations map from an `InstructionSet`\n * @param combinator - a function to apply to each operation\n */\nconst mapOverOperations = (operations, ...combinators) => Object.keys(operations).reduce((result, operation) => ({\n ...result,\n [operation]: combinators.reduce((op, combinator) => combinator(op), operations[parseInt(operation, 10)]),\n}), {});\n/**\n * Pop one stack item off of `state.stack` and provide that item to `operation`.\n */\nconst useOneStackItem = (state, operation) => {\n // eslint-disable-next-line functional/immutable-data\n const item = state.stack.pop();\n if (item === undefined) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.emptyStack, state);\n }\n return operation(state, [item]);\n};\nconst useTwoStackItems = (state, operation) => useOneStackItem(state, (nextState, [valueTwo]) => useOneStackItem(nextState, (lastState, [valueTop]) => operation(lastState, [valueTop, valueTwo])));\nconst useThreeStackItems = (state, operation) => useOneStackItem(state, (nextState, [valueThree]) => useTwoStackItems(nextState, (lastState, [valueTop, valueTwo]) => operation(lastState, [valueTop, valueTwo, valueThree])));\nconst useFourStackItems = (state, operation) => useTwoStackItems(state, (nextState, [valueThree, valueFour]) => useTwoStackItems(nextState, (lastState, [valueTop, valueTwo]) => operation(lastState, [valueTop, valueTwo, valueThree, valueFour])));\nconst useSixStackItems = (state, operation) => useFourStackItems(state, (nextState, [valueThree, valueFour, valueFive, valueSix]) => useTwoStackItems(nextState, (lastState, [valueTop, valueTwo]) => operation(lastState, [\n valueTop,\n valueTwo,\n valueThree,\n valueFour,\n valueFive,\n valueSix,\n])));\nconst normalMaximumScriptNumberByteLength = 4;\nconst useOneScriptNumber = (state, operation, { requireMinimalEncoding, maximumScriptNumberByteLength = normalMaximumScriptNumberByteLength, }) => useOneStackItem(state, (nextState, [item]) => {\n const value = (0,_common__WEBPACK_IMPORTED_MODULE_1__.parseBytesAsScriptNumber)(item, {\n maximumScriptNumberByteLength,\n requireMinimalEncoding,\n });\n if ((0,_common__WEBPACK_IMPORTED_MODULE_1__.isScriptNumberError)(value)) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.invalidScriptNumber, state);\n }\n return operation(nextState, [value]);\n});\nconst useTwoScriptNumbers = (state, operation, { requireMinimalEncoding, maximumScriptNumberByteLength = normalMaximumScriptNumberByteLength, }) => useOneScriptNumber(state, (nextState, [secondValue]) => useOneScriptNumber(nextState, (lastState, [firstValue]) => operation(lastState, [firstValue, secondValue]), { maximumScriptNumberByteLength, requireMinimalEncoding }), { maximumScriptNumberByteLength, requireMinimalEncoding });\nconst useThreeScriptNumbers = (state, operation, { requireMinimalEncoding, maximumScriptNumberByteLength = normalMaximumScriptNumberByteLength, }) => useTwoScriptNumbers(state, (nextState, [secondValue, thirdValue]) => useOneScriptNumber(nextState, (lastState, [firstValue]) => operation(lastState, [firstValue, secondValue, thirdValue]), { maximumScriptNumberByteLength, requireMinimalEncoding }), { maximumScriptNumberByteLength, requireMinimalEncoding });\n/**\n * Return the provided state with the provided value pushed to its stack.\n * @param state - the state to update and return\n * @param data - the value to push to the stack\n */\nconst pushToStack = (state, ...data) => {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n state.stack.push(...data);\n return state;\n};\n// TODO: if firstOperation errors, secondOperation might overwrite the error\nconst combineOperations = (firstOperation, secondOperation) => (state) => secondOperation(firstOperation(state));\n//# sourceMappingURL=combinators.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/combinators.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/common.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/common.js ***! + \*********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AuthenticationErrorCommon: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_6__.AuthenticationErrorCommon),\n/* harmony export */ ConsensusCommon: () => (/* binding */ ConsensusCommon),\n/* harmony export */ OpcodeDescriptionsCommon: () => (/* reexport safe */ _descriptions__WEBPACK_IMPORTED_MODULE_4__.OpcodeDescriptionsCommon),\n/* harmony export */ OpcodesCommon: () => (/* reexport safe */ _opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesCommon),\n/* harmony export */ PushOperationConstants: () => (/* reexport safe */ _push__WEBPACK_IMPORTED_MODULE_10__.PushOperationConstants),\n/* harmony export */ ScriptNumberError: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_15__.ScriptNumberError),\n/* harmony export */ SigningSerializationFlag: () => (/* reexport safe */ _signing_serialization__WEBPACK_IMPORTED_MODULE_11__.SigningSerializationFlag),\n/* harmony export */ applyError: () => (/* reexport safe */ _errors__WEBPACK_IMPORTED_MODULE_6__.applyError),\n/* harmony export */ arithmeticOperations: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.arithmeticOperations),\n/* harmony export */ bigIntToScriptNumber: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_15__.bigIntToScriptNumber),\n/* harmony export */ bitwiseOperations: () => (/* reexport safe */ _bitwise__WEBPACK_IMPORTED_MODULE_1__.bitwiseOperations),\n/* harmony export */ booleanToScriptNumber: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_15__.booleanToScriptNumber),\n/* harmony export */ checkLimitsCommon: () => (/* binding */ checkLimitsCommon),\n/* harmony export */ cloneAuthenticationProgramStateCommon: () => (/* binding */ cloneAuthenticationProgramStateCommon),\n/* harmony export */ cloneStack: () => (/* binding */ cloneStack),\n/* harmony export */ combineOperations: () => (/* reexport safe */ _combinators__WEBPACK_IMPORTED_MODULE_2__.combineOperations),\n/* harmony export */ commonOperations: () => (/* binding */ commonOperations),\n/* harmony export */ conditionalFlowControlOperations: () => (/* reexport safe */ _flow_control__WEBPACK_IMPORTED_MODULE_7__.conditionalFlowControlOperations),\n/* harmony export */ conditionallyEvaluate: () => (/* reexport safe */ _combinators__WEBPACK_IMPORTED_MODULE_2__.conditionallyEvaluate),\n/* harmony export */ createAuthenticationProgramInternalStateCommon: () => (/* binding */ createAuthenticationProgramInternalStateCommon),\n/* harmony export */ createAuthenticationProgramStateCommon: () => (/* binding */ createAuthenticationProgramStateCommon),\n/* harmony export */ createAuthenticationProgramStateCommonEmpty: () => (/* binding */ createAuthenticationProgramStateCommonEmpty),\n/* harmony export */ createTransactionContextCommon: () => (/* binding */ createTransactionContextCommon),\n/* harmony export */ createTransactionContextCommonEmpty: () => (/* binding */ createTransactionContextCommonEmpty),\n/* harmony export */ createTransactionContextCommonTesting: () => (/* binding */ createTransactionContextCommonTesting),\n/* harmony export */ cryptoOperations: () => (/* reexport safe */ _crypto__WEBPACK_IMPORTED_MODULE_3__.cryptoOperations),\n/* harmony export */ decodeBitcoinSignature: () => (/* reexport safe */ _encoding__WEBPACK_IMPORTED_MODULE_5__.decodeBitcoinSignature),\n/* harmony export */ disabledOperation: () => (/* reexport safe */ _nop__WEBPACK_IMPORTED_MODULE_8__.disabledOperation),\n/* harmony export */ disabledOperations: () => (/* reexport safe */ _nop__WEBPACK_IMPORTED_MODULE_8__.disabledOperations),\n/* harmony export */ encodeDataPush: () => (/* reexport safe */ _push__WEBPACK_IMPORTED_MODULE_10__.encodeDataPush),\n/* harmony export */ generateSigningSerializationBCH: () => (/* reexport safe */ _signing_serialization__WEBPACK_IMPORTED_MODULE_11__.generateSigningSerializationBCH),\n/* harmony export */ hashOutputs: () => (/* reexport safe */ _signing_serialization__WEBPACK_IMPORTED_MODULE_11__.hashOutputs),\n/* harmony export */ hashPrevouts: () => (/* reexport safe */ _signing_serialization__WEBPACK_IMPORTED_MODULE_11__.hashPrevouts),\n/* harmony export */ hashSequence: () => (/* reexport safe */ _signing_serialization__WEBPACK_IMPORTED_MODULE_11__.hashSequence),\n/* harmony export */ incrementOperationCount: () => (/* reexport safe */ _combinators__WEBPACK_IMPORTED_MODULE_2__.incrementOperationCount),\n/* harmony export */ isDefinedSigningSerializationType: () => (/* reexport safe */ _signing_serialization__WEBPACK_IMPORTED_MODULE_11__.isDefinedSigningSerializationType),\n/* harmony export */ isLegacySigningSerialization: () => (/* reexport safe */ _signing_serialization__WEBPACK_IMPORTED_MODULE_11__.isLegacySigningSerialization),\n/* harmony export */ isMinimalDataPush: () => (/* reexport safe */ _push__WEBPACK_IMPORTED_MODULE_10__.isMinimalDataPush),\n/* harmony export */ isScriptNumberError: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_15__.isScriptNumberError),\n/* harmony export */ isValidCompressedPublicKeyEncoding: () => (/* reexport safe */ _encoding__WEBPACK_IMPORTED_MODULE_5__.isValidCompressedPublicKeyEncoding),\n/* harmony export */ isValidPublicKeyEncoding: () => (/* reexport safe */ _encoding__WEBPACK_IMPORTED_MODULE_5__.isValidPublicKeyEncoding),\n/* harmony export */ isValidSignatureEncodingBCHTransaction: () => (/* reexport safe */ _encoding__WEBPACK_IMPORTED_MODULE_5__.isValidSignatureEncodingBCHTransaction),\n/* harmony export */ isValidSignatureEncodingDER: () => (/* reexport safe */ _encoding__WEBPACK_IMPORTED_MODULE_5__.isValidSignatureEncodingDER),\n/* harmony export */ isValidUncompressedPublicKeyEncoding: () => (/* reexport safe */ _encoding__WEBPACK_IMPORTED_MODULE_5__.isValidUncompressedPublicKeyEncoding),\n/* harmony export */ mapOverOperations: () => (/* reexport safe */ _combinators__WEBPACK_IMPORTED_MODULE_2__.mapOverOperations),\n/* harmony export */ nonOperations: () => (/* reexport safe */ _nop__WEBPACK_IMPORTED_MODULE_8__.nonOperations),\n/* harmony export */ op0NotEqual: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.op0NotEqual),\n/* harmony export */ op1Add: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.op1Add),\n/* harmony export */ op1Sub: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.op1Sub),\n/* harmony export */ op2Drop: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.op2Drop),\n/* harmony export */ op2Dup: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.op2Dup),\n/* harmony export */ op2Over: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.op2Over),\n/* harmony export */ op2Rot: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.op2Rot),\n/* harmony export */ op2Swap: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.op2Swap),\n/* harmony export */ op3Dup: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.op3Dup),\n/* harmony export */ opAbs: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opAbs),\n/* harmony export */ opAdd: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opAdd),\n/* harmony export */ opBoolAnd: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opBoolAnd),\n/* harmony export */ opBoolOr: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opBoolOr),\n/* harmony export */ opCheckLockTimeVerify: () => (/* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_14__.opCheckLockTimeVerify),\n/* harmony export */ opCheckMultiSig: () => (/* reexport safe */ _crypto__WEBPACK_IMPORTED_MODULE_3__.opCheckMultiSig),\n/* harmony export */ opCheckMultiSigVerify: () => (/* reexport safe */ _crypto__WEBPACK_IMPORTED_MODULE_3__.opCheckMultiSigVerify),\n/* harmony export */ opCheckSequenceVerify: () => (/* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_14__.opCheckSequenceVerify),\n/* harmony export */ opCheckSig: () => (/* reexport safe */ _crypto__WEBPACK_IMPORTED_MODULE_3__.opCheckSig),\n/* harmony export */ opCheckSigVerify: () => (/* reexport safe */ _crypto__WEBPACK_IMPORTED_MODULE_3__.opCheckSigVerify),\n/* harmony export */ opCodeSeparator: () => (/* reexport safe */ _crypto__WEBPACK_IMPORTED_MODULE_3__.opCodeSeparator),\n/* harmony export */ opDepth: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.opDepth),\n/* harmony export */ opDrop: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.opDrop),\n/* harmony export */ opDup: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.opDup),\n/* harmony export */ opElse: () => (/* reexport safe */ _flow_control__WEBPACK_IMPORTED_MODULE_7__.opElse),\n/* harmony export */ opEndIf: () => (/* reexport safe */ _flow_control__WEBPACK_IMPORTED_MODULE_7__.opEndIf),\n/* harmony export */ opEqual: () => (/* reexport safe */ _bitwise__WEBPACK_IMPORTED_MODULE_1__.opEqual),\n/* harmony export */ opEqualVerify: () => (/* reexport safe */ _bitwise__WEBPACK_IMPORTED_MODULE_1__.opEqualVerify),\n/* harmony export */ opFromAltStack: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.opFromAltStack),\n/* harmony export */ opGreaterThan: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opGreaterThan),\n/* harmony export */ opGreaterThanOrEqual: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opGreaterThanOrEqual),\n/* harmony export */ opHash160: () => (/* reexport safe */ _crypto__WEBPACK_IMPORTED_MODULE_3__.opHash160),\n/* harmony export */ opHash256: () => (/* reexport safe */ _crypto__WEBPACK_IMPORTED_MODULE_3__.opHash256),\n/* harmony export */ opIf: () => (/* reexport safe */ _flow_control__WEBPACK_IMPORTED_MODULE_7__.opIf),\n/* harmony export */ opIfDup: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.opIfDup),\n/* harmony export */ opLessThan: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opLessThan),\n/* harmony export */ opLessThanOrEqual: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opLessThanOrEqual),\n/* harmony export */ opMax: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opMax),\n/* harmony export */ opMin: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opMin),\n/* harmony export */ opNegate: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opNegate),\n/* harmony export */ opNip: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.opNip),\n/* harmony export */ opNop: () => (/* reexport safe */ _nop__WEBPACK_IMPORTED_MODULE_8__.opNop),\n/* harmony export */ opNot: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opNot),\n/* harmony export */ opNotIf: () => (/* reexport safe */ _flow_control__WEBPACK_IMPORTED_MODULE_7__.opNotIf),\n/* harmony export */ opNumEqual: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opNumEqual),\n/* harmony export */ opNumEqualVerify: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opNumEqualVerify),\n/* harmony export */ opNumNotEqual: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opNumNotEqual),\n/* harmony export */ opOver: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.opOver),\n/* harmony export */ opPick: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.opPick),\n/* harmony export */ opReturn: () => (/* reexport safe */ _flow_control__WEBPACK_IMPORTED_MODULE_7__.opReturn),\n/* harmony export */ opRipemd160: () => (/* reexport safe */ _crypto__WEBPACK_IMPORTED_MODULE_3__.opRipemd160),\n/* harmony export */ opRoll: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.opRoll),\n/* harmony export */ opRot: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.opRot),\n/* harmony export */ opSha1: () => (/* reexport safe */ _crypto__WEBPACK_IMPORTED_MODULE_3__.opSha1),\n/* harmony export */ opSha256: () => (/* reexport safe */ _crypto__WEBPACK_IMPORTED_MODULE_3__.opSha256),\n/* harmony export */ opSize: () => (/* reexport safe */ _splice__WEBPACK_IMPORTED_MODULE_12__.opSize),\n/* harmony export */ opSub: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opSub),\n/* harmony export */ opSwap: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.opSwap),\n/* harmony export */ opToAltStack: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.opToAltStack),\n/* harmony export */ opTuck: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.opTuck),\n/* harmony export */ opVerify: () => (/* reexport safe */ _flow_control__WEBPACK_IMPORTED_MODULE_7__.opVerify),\n/* harmony export */ opWithin: () => (/* reexport safe */ _arithmetic__WEBPACK_IMPORTED_MODULE_0__.opWithin),\n/* harmony export */ parseBytesAsScriptNumber: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_15__.parseBytesAsScriptNumber),\n/* harmony export */ pushByteOpcodes: () => (/* reexport safe */ _push__WEBPACK_IMPORTED_MODULE_10__.pushByteOpcodes),\n/* harmony export */ pushNumberOpcodes: () => (/* reexport safe */ _push__WEBPACK_IMPORTED_MODULE_10__.pushNumberOpcodes),\n/* harmony export */ pushNumberOperations: () => (/* reexport safe */ _push__WEBPACK_IMPORTED_MODULE_10__.pushNumberOperations),\n/* harmony export */ pushOperation: () => (/* reexport safe */ _push__WEBPACK_IMPORTED_MODULE_10__.pushOperation),\n/* harmony export */ pushOperations: () => (/* reexport safe */ _push__WEBPACK_IMPORTED_MODULE_10__.pushOperations),\n/* harmony export */ pushToStack: () => (/* reexport safe */ _combinators__WEBPACK_IMPORTED_MODULE_2__.pushToStack),\n/* harmony export */ readLocktime: () => (/* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_14__.readLocktime),\n/* harmony export */ reservedOperation: () => (/* reexport safe */ _flow_control__WEBPACK_IMPORTED_MODULE_7__.reservedOperation),\n/* harmony export */ spliceOperations: () => (/* reexport safe */ _splice__WEBPACK_IMPORTED_MODULE_12__.spliceOperations),\n/* harmony export */ stackItemIsTruthy: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_15__.stackItemIsTruthy),\n/* harmony export */ stackOperations: () => (/* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_13__.stackOperations),\n/* harmony export */ timeOperations: () => (/* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_14__.timeOperations),\n/* harmony export */ unconditionalFlowControlOperations: () => (/* reexport safe */ _flow_control__WEBPACK_IMPORTED_MODULE_7__.unconditionalFlowControlOperations),\n/* harmony export */ undefinedOperation: () => (/* binding */ undefinedOperation),\n/* harmony export */ useFourStackItems: () => (/* reexport safe */ _combinators__WEBPACK_IMPORTED_MODULE_2__.useFourStackItems),\n/* harmony export */ useOneScriptNumber: () => (/* reexport safe */ _combinators__WEBPACK_IMPORTED_MODULE_2__.useOneScriptNumber),\n/* harmony export */ useOneStackItem: () => (/* reexport safe */ _combinators__WEBPACK_IMPORTED_MODULE_2__.useOneStackItem),\n/* harmony export */ useSixStackItems: () => (/* reexport safe */ _combinators__WEBPACK_IMPORTED_MODULE_2__.useSixStackItems),\n/* harmony export */ useThreeScriptNumbers: () => (/* reexport safe */ _combinators__WEBPACK_IMPORTED_MODULE_2__.useThreeScriptNumbers),\n/* harmony export */ useThreeStackItems: () => (/* reexport safe */ _combinators__WEBPACK_IMPORTED_MODULE_2__.useThreeStackItems),\n/* harmony export */ useTwoScriptNumbers: () => (/* reexport safe */ _combinators__WEBPACK_IMPORTED_MODULE_2__.useTwoScriptNumbers),\n/* harmony export */ useTwoStackItems: () => (/* reexport safe */ _combinators__WEBPACK_IMPORTED_MODULE_2__.useTwoStackItems)\n/* harmony export */ });\n/* harmony import */ var _transaction_transaction_serialization__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../transaction/transaction-serialization */ \"./node_modules/@bitauth/libauth/build/module/lib/transaction/transaction-serialization.js\");\n/* harmony import */ var _arithmetic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arithmetic */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/arithmetic.js\");\n/* harmony import */ var _bitwise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bitwise */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/bitwise.js\");\n/* harmony import */ var _combinators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./combinators */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/combinators.js\");\n/* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./crypto */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/crypto.js\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./errors */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js\");\n/* harmony import */ var _flow_control__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flow-control */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/flow-control.js\");\n/* harmony import */ var _nop__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./nop */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/nop.js\");\n/* harmony import */ var _opcodes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js\");\n/* harmony import */ var _push__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./push */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/push.js\");\n/* harmony import */ var _splice__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./splice */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/splice.js\");\n/* harmony import */ var _stack__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./stack */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/stack.js\");\n/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./time */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/time.js\");\n/* harmony import */ var _descriptions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./descriptions */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/descriptions.js\");\n/* harmony import */ var _encoding__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./encoding */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/encoding.js\");\n/* harmony import */ var _signing_serialization__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./signing-serialization */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/signing-serialization.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./types */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar ConsensusCommon;\n(function (ConsensusCommon) {\n /**\n * A.K.A. `MAX_SCRIPT_ELEMENT_SIZE`\n */\n ConsensusCommon[ConsensusCommon[\"maximumStackItemLength\"] = 520] = \"maximumStackItemLength\";\n ConsensusCommon[ConsensusCommon[\"maximumScriptNumberLength\"] = 4] = \"maximumScriptNumberLength\";\n /**\n * A.K.A. `MAX_OPS_PER_SCRIPT`\n */\n ConsensusCommon[ConsensusCommon[\"maximumOperationCount\"] = 201] = \"maximumOperationCount\";\n /**\n * A.K.A. `MAX_SCRIPT_SIZE`\n */\n ConsensusCommon[ConsensusCommon[\"maximumBytecodeLength\"] = 10000] = \"maximumBytecodeLength\";\n /**\n * A.K.A. `MAX_STACK_SIZE`\n */\n ConsensusCommon[ConsensusCommon[\"maximumStackDepth\"] = 1000] = \"maximumStackDepth\";\n})(ConsensusCommon || (ConsensusCommon = {}));\nconst undefinedOperation = () => ({\n undefined: (0,_combinators__WEBPACK_IMPORTED_MODULE_2__.conditionallyEvaluate)((state) => (0,_errors__WEBPACK_IMPORTED_MODULE_6__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_6__.AuthenticationErrorCommon.unknownOpcode, state)),\n});\nconst checkLimitsCommon = (operation) => (state) => {\n const nextState = operation(state);\n return nextState.stack.length + nextState.alternateStack.length >\n ConsensusCommon.maximumStackDepth\n ? (0,_errors__WEBPACK_IMPORTED_MODULE_6__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_6__.AuthenticationErrorCommon.exceededMaximumStackDepth, nextState)\n : nextState.operationCount > ConsensusCommon.maximumOperationCount\n ? (0,_errors__WEBPACK_IMPORTED_MODULE_6__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_6__.AuthenticationErrorCommon.exceededMaximumOperationCount, nextState)\n : nextState;\n};\nconst commonOperations = ({ flags, ripemd160, secp256k1, sha1, sha256, }) => {\n const unconditionalOperations = {\n ...(0,_nop__WEBPACK_IMPORTED_MODULE_8__.disabledOperations)(),\n ...(0,_push__WEBPACK_IMPORTED_MODULE_10__.pushOperations)(flags),\n ...(0,_combinators__WEBPACK_IMPORTED_MODULE_2__.mapOverOperations)((0,_flow_control__WEBPACK_IMPORTED_MODULE_7__.unconditionalFlowControlOperations)(flags), _combinators__WEBPACK_IMPORTED_MODULE_2__.incrementOperationCount),\n };\n const conditionalOperations = (0,_combinators__WEBPACK_IMPORTED_MODULE_2__.mapOverOperations)({\n ...(0,_push__WEBPACK_IMPORTED_MODULE_10__.pushNumberOperations)(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesCommon.OP_RESERVED]: (0,_flow_control__WEBPACK_IMPORTED_MODULE_7__.reservedOperation)(),\n }, _combinators__WEBPACK_IMPORTED_MODULE_2__.conditionallyEvaluate);\n const incrementingOperations = (0,_combinators__WEBPACK_IMPORTED_MODULE_2__.mapOverOperations)({\n ...(0,_arithmetic__WEBPACK_IMPORTED_MODULE_0__.arithmeticOperations)(flags),\n ...(0,_bitwise__WEBPACK_IMPORTED_MODULE_1__.bitwiseOperations)(),\n ...(0,_crypto__WEBPACK_IMPORTED_MODULE_3__.cryptoOperations)({\n flags,\n ripemd160,\n secp256k1,\n sha1,\n sha256,\n }),\n ...(0,_flow_control__WEBPACK_IMPORTED_MODULE_7__.conditionalFlowControlOperations)(),\n ...(0,_stack__WEBPACK_IMPORTED_MODULE_13__.stackOperations)(flags),\n ...(0,_splice__WEBPACK_IMPORTED_MODULE_12__.spliceOperations)(),\n ...(0,_time__WEBPACK_IMPORTED_MODULE_14__.timeOperations)(flags),\n ...(0,_nop__WEBPACK_IMPORTED_MODULE_8__.nonOperations)(flags),\n }, _combinators__WEBPACK_IMPORTED_MODULE_2__.conditionallyEvaluate, _combinators__WEBPACK_IMPORTED_MODULE_2__.incrementOperationCount);\n return (0,_combinators__WEBPACK_IMPORTED_MODULE_2__.mapOverOperations)({\n ...unconditionalOperations,\n ...incrementingOperations,\n ...conditionalOperations,\n }, checkLimitsCommon);\n};\nconst cloneStack = (stack) => stack.reduce((newStack, element) => {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n newStack.push(element.slice());\n return newStack;\n}, []);\nconst createAuthenticationProgramInternalStateCommon = ({ instructions, stack = [], }) => ({\n alternateStack: [],\n executionStack: [],\n instructions,\n ip: 0,\n lastCodeSeparator: -1,\n operationCount: 0,\n signatureOperationsCount: 0,\n signedMessages: [],\n stack,\n});\nconst createTransactionContextCommon = (program) => ({\n correspondingOutput: program.inputIndex < program.spendingTransaction.outputs.length\n ? (0,_transaction_transaction_serialization__WEBPACK_IMPORTED_MODULE_16__.encodeOutput)(program.spendingTransaction.outputs[program.inputIndex])\n : undefined,\n locktime: program.spendingTransaction.locktime,\n outpointIndex: program.spendingTransaction.inputs[program.inputIndex].outpointIndex,\n outpointTransactionHash: program.spendingTransaction.inputs[program.inputIndex]\n .outpointTransactionHash,\n outputValue: program.sourceOutput.satoshis,\n sequenceNumber: program.spendingTransaction.inputs[program.inputIndex].sequenceNumber,\n transactionOutpoints: (0,_transaction_transaction_serialization__WEBPACK_IMPORTED_MODULE_16__.encodeOutpoints)(program.spendingTransaction.inputs),\n transactionOutputs: (0,_transaction_transaction_serialization__WEBPACK_IMPORTED_MODULE_16__.encodeOutputsForSigning)(program.spendingTransaction.outputs),\n transactionSequenceNumbers: (0,_transaction_transaction_serialization__WEBPACK_IMPORTED_MODULE_16__.encodeSequenceNumbersForSigning)(program.spendingTransaction.inputs),\n version: program.spendingTransaction.version,\n});\nconst createAuthenticationProgramStateCommon = ({ transactionContext, instructions, stack, }) => ({\n ...createAuthenticationProgramInternalStateCommon({\n instructions,\n stack,\n }),\n ...transactionContext,\n});\n/**\n * Note: this implementation does not safely clone elements within array\n * properties. Mutating values within arrays will mutate those values in cloned\n * program states.\n */\nconst cloneAuthenticationProgramStateCommon = (state) => ({\n ...(state.error === undefined ? {} : { error: state.error }),\n alternateStack: state.alternateStack.slice(),\n correspondingOutput: state.correspondingOutput,\n executionStack: state.executionStack.slice(),\n instructions: state.instructions.slice(),\n ip: state.ip,\n lastCodeSeparator: state.lastCodeSeparator,\n locktime: state.locktime,\n operationCount: state.operationCount,\n outpointIndex: state.outpointIndex,\n outpointTransactionHash: state.outpointTransactionHash.slice(),\n outputValue: state.outputValue,\n sequenceNumber: state.sequenceNumber,\n signatureOperationsCount: state.signatureOperationsCount,\n signedMessages: state.signedMessages.slice(),\n stack: state.stack.slice(),\n transactionOutpoints: state.transactionOutpoints,\n transactionOutputs: state.transactionOutputs,\n transactionSequenceNumbers: state.transactionSequenceNumbers,\n version: state.version,\n});\nconst sha256HashLength = 32;\nconst outputValueLength = 8;\n/**\n * This is a meaningless but complete `TransactionContextCommon` which uses `0`\n * values for each property.\n */\nconst createTransactionContextCommonEmpty = () => ({\n correspondingOutput: Uint8Array.of(0),\n locktime: 0,\n outpointIndex: 0,\n outpointTransactionHash: new Uint8Array(sha256HashLength),\n outputValue: new Uint8Array(outputValueLength),\n sequenceNumber: 0,\n transactionOutpoints: Uint8Array.of(0),\n transactionOutputs: Uint8Array.of(0),\n transactionSequenceNumbers: Uint8Array.of(0),\n version: 0,\n});\nconst correspondingOutput = 1;\nconst transactionOutpoints = 2;\nconst transactionOutputs = 3;\nconst transactionSequenceNumbers = 4;\nconst outpointTransactionHashFill = 5;\n/**\n * This is a meaningless but complete `TransactionContextCommon` which uses a\n * different value for each property. This is useful for testing and debugging.\n */\nconst createTransactionContextCommonTesting = () => ({\n correspondingOutput: Uint8Array.of(correspondingOutput),\n locktime: 0,\n outpointIndex: 0,\n outpointTransactionHash: new Uint8Array(sha256HashLength).fill(outpointTransactionHashFill),\n outputValue: new Uint8Array(outputValueLength),\n sequenceNumber: 0,\n transactionOutpoints: Uint8Array.of(transactionOutpoints),\n transactionOutputs: Uint8Array.of(transactionOutputs),\n transactionSequenceNumbers: Uint8Array.of(transactionSequenceNumbers),\n version: 0,\n});\n/**\n * Create an \"empty\" common authentication program state, suitable for testing a\n * VM/compiler.\n */\nconst createAuthenticationProgramStateCommonEmpty = ({ instructions, stack = [], }) => ({\n ...createAuthenticationProgramInternalStateCommon({ instructions, stack }),\n ...createTransactionContextCommonEmpty(),\n});\n//# sourceMappingURL=common.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/common.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/crypto.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/crypto.js ***! + \*********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ cryptoOperations: () => (/* binding */ cryptoOperations),\n/* harmony export */ opCheckMultiSig: () => (/* binding */ opCheckMultiSig),\n/* harmony export */ opCheckMultiSigVerify: () => (/* binding */ opCheckMultiSigVerify),\n/* harmony export */ opCheckSig: () => (/* binding */ opCheckSig),\n/* harmony export */ opCheckSigVerify: () => (/* binding */ opCheckSigVerify),\n/* harmony export */ opCodeSeparator: () => (/* binding */ opCodeSeparator),\n/* harmony export */ opHash160: () => (/* binding */ opHash160),\n/* harmony export */ opHash256: () => (/* binding */ opHash256),\n/* harmony export */ opRipemd160: () => (/* binding */ opRipemd160),\n/* harmony export */ opSha1: () => (/* binding */ opSha1),\n/* harmony export */ opSha256: () => (/* binding */ opSha256)\n/* harmony export */ });\n/* harmony import */ var _bch_bch_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../bch/bch-types */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-types.js\");\n/* harmony import */ var _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../instruction-sets-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-utils.js\");\n/* harmony import */ var _combinators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./combinators */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/combinators.js\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./common */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./common */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/common.js\");\n/* harmony import */ var _encoding__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./encoding */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/encoding.js\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./errors */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js\");\n/* harmony import */ var _flow_control__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flow-control */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/flow-control.js\");\n/* harmony import */ var _opcodes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js\");\n/* harmony import */ var _signing_serialization__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./signing-serialization */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/signing-serialization.js\");\n\n\n\n\n\n\n\n\n\nconst opRipemd160 = ({ ripemd160, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(state, (nextState, [value]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, ripemd160.hash(value)));\nconst opSha1 = ({ sha1, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(state, (nextState, [value]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, sha1.hash(value)));\nconst opSha256 = ({ sha256, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(state, (nextState, [value]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, sha256.hash(value)));\nconst opHash160 = ({ ripemd160, sha256, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(state, (nextState, [value]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, ripemd160.hash(sha256.hash(value))));\nconst opHash256 = ({ sha256, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(state, (nextState, [value]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, sha256.hash(sha256.hash(value))));\nconst opCodeSeparator = () => (state) => {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n state.lastCodeSeparator = state.ip;\n return state;\n};\nconst opCheckSig = ({ flags, secp256k1, sha256, }) => (s) => \n// eslint-disable-next-line complexity\n(0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoStackItems)(s, (state, [bitcoinEncodedSignature, publicKey]) => {\n if (!(0,_encoding__WEBPACK_IMPORTED_MODULE_1__.isValidPublicKeyEncoding)(publicKey)) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.invalidPublicKeyEncoding, state);\n }\n if (!(0,_encoding__WEBPACK_IMPORTED_MODULE_1__.isValidSignatureEncodingBCHTransaction)(bitcoinEncodedSignature)) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.invalidSignatureEncoding, state);\n }\n const coveredBytecode = (0,_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.serializeAuthenticationInstructions)(state.instructions).subarray(state.lastCodeSeparator + 1);\n const { signingSerializationType, signature } = (0,_encoding__WEBPACK_IMPORTED_MODULE_1__.decodeBitcoinSignature)(bitcoinEncodedSignature);\n const serialization = (0,_signing_serialization__WEBPACK_IMPORTED_MODULE_4__.generateSigningSerializationBCH)({\n correspondingOutput: state.correspondingOutput,\n coveredBytecode,\n locktime: state.locktime,\n outpointIndex: state.outpointIndex,\n outpointTransactionHash: state.outpointTransactionHash,\n outputValue: state.outputValue,\n sequenceNumber: state.sequenceNumber,\n sha256,\n signingSerializationType,\n transactionOutpoints: state.transactionOutpoints,\n transactionOutputs: state.transactionOutputs,\n transactionSequenceNumbers: state.transactionSequenceNumbers,\n version: state.version,\n });\n const digest = sha256.hash(sha256.hash(serialization));\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n state.signedMessages.push(serialization);\n const useSchnorr = signature.length === _bch_bch_types__WEBPACK_IMPORTED_MODULE_5__.ConsensusBCH.schnorrSignatureLength;\n const success = useSchnorr\n ? secp256k1.verifySignatureSchnorr(signature, publicKey, digest)\n : secp256k1.verifySignatureDERLowS(signature, publicKey, digest);\n return !success &&\n flags.requireNullSignatureFailures &&\n signature.length !== 0\n ? (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.nonNullSignatureFailure, state)\n : (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(state, (0,_common__WEBPACK_IMPORTED_MODULE_6__.booleanToScriptNumber)(success));\n});\nconst opCheckMultiSig = ({ flags: { requireMinimalEncoding, requireBugValueZero, requireNullSignatureFailures, }, secp256k1, sha256, }) => (s) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(s, (state, publicKeysValue) => {\n const potentialPublicKeys = Number(publicKeysValue);\n if (potentialPublicKeys < 0) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.invalidNaturalNumber, state);\n }\n if (potentialPublicKeys > 20 /* maximumPublicKeys */) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.exceedsMaximumMultisigPublicKeyCount, state);\n }\n const publicKeys = \n // eslint-disable-next-line functional/immutable-data\n potentialPublicKeys > 0 ? state.stack.splice(-potentialPublicKeys) : [];\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n state.operationCount += potentialPublicKeys;\n return state.operationCount > _common__WEBPACK_IMPORTED_MODULE_7__.ConsensusCommon.maximumOperationCount\n ? (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.exceededMaximumOperationCount, state)\n : (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(state, (nextState, approvingKeys) => {\n const requiredApprovingPublicKeys = Number(approvingKeys);\n if (requiredApprovingPublicKeys < 0) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.invalidNaturalNumber, nextState);\n }\n if (requiredApprovingPublicKeys > potentialPublicKeys) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.insufficientPublicKeys, nextState);\n }\n const signatures = requiredApprovingPublicKeys > 0\n ? // eslint-disable-next-line functional/immutable-data\n nextState.stack.splice(-requiredApprovingPublicKeys)\n : [];\n return (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(nextState, \n // eslint-disable-next-line complexity\n (finalState, [protocolBugValue]) => {\n if (requireBugValueZero && protocolBugValue.length !== 0) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.invalidProtocolBugValue, finalState);\n }\n const coveredBytecode = (0,_instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.serializeAuthenticationInstructions)(finalState.instructions).subarray(finalState.lastCodeSeparator + 1);\n let approvingPublicKeys = 0; // eslint-disable-line functional/no-let\n let remainingSignatures = signatures.length; // eslint-disable-line functional/no-let\n let remainingPublicKeys = publicKeys.length; // eslint-disable-line functional/no-let\n // eslint-disable-next-line functional/no-loop-statement\n while (remainingSignatures > 0 &&\n remainingPublicKeys > 0 &&\n approvingPublicKeys + remainingPublicKeys >=\n remainingSignatures &&\n approvingPublicKeys !== requiredApprovingPublicKeys) {\n const publicKey = publicKeys[remainingPublicKeys - 1];\n const bitcoinEncodedSignature = signatures[remainingSignatures - 1];\n if (!(0,_encoding__WEBPACK_IMPORTED_MODULE_1__.isValidPublicKeyEncoding)(publicKey)) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.invalidPublicKeyEncoding, finalState);\n }\n if (!(0,_encoding__WEBPACK_IMPORTED_MODULE_1__.isValidSignatureEncodingBCHTransaction)(bitcoinEncodedSignature)) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.invalidSignatureEncoding, finalState);\n }\n const { signingSerializationType, signature, } = (0,_encoding__WEBPACK_IMPORTED_MODULE_1__.decodeBitcoinSignature)(bitcoinEncodedSignature);\n const serialization = (0,_signing_serialization__WEBPACK_IMPORTED_MODULE_4__.generateSigningSerializationBCH)({\n correspondingOutput: state.correspondingOutput,\n coveredBytecode,\n locktime: state.locktime,\n outpointIndex: state.outpointIndex,\n outpointTransactionHash: state.outpointTransactionHash,\n outputValue: state.outputValue,\n sequenceNumber: state.sequenceNumber,\n sha256,\n signingSerializationType,\n transactionOutpoints: state.transactionOutpoints,\n transactionOutputs: state.transactionOutputs,\n transactionSequenceNumbers: state.transactionSequenceNumbers,\n version: state.version,\n });\n const digest = sha256.hash(sha256.hash(serialization));\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n finalState.signedMessages.push(serialization);\n if (signature.length === _bch_bch_types__WEBPACK_IMPORTED_MODULE_5__.ConsensusBCH.schnorrSignatureLength) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.schnorrSizedSignatureInCheckMultiSig, finalState);\n }\n const signed = secp256k1.verifySignatureDERLowS(signature, publicKey, digest);\n // eslint-disable-next-line functional/no-conditional-statement\n if (signed) {\n approvingPublicKeys += 1; // eslint-disable-line functional/no-expression-statement\n remainingSignatures -= 1; // eslint-disable-line functional/no-expression-statement\n }\n remainingPublicKeys -= 1; // eslint-disable-line functional/no-expression-statement\n }\n const success = approvingPublicKeys === requiredApprovingPublicKeys;\n if (!success &&\n requireNullSignatureFailures &&\n !signatures.every((signature) => signature.length === 0)) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.nonNullSignatureFailure, finalState);\n }\n return (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(finalState, (0,_common__WEBPACK_IMPORTED_MODULE_6__.booleanToScriptNumber)(success));\n });\n }, { requireMinimalEncoding });\n}, { requireMinimalEncoding });\nconst opCheckSigVerify = ({ flags, secp256k1, sha256, }) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.combineOperations)(opCheckSig({ flags, secp256k1, sha256 }), (0,_flow_control__WEBPACK_IMPORTED_MODULE_8__.opVerify)());\nconst opCheckMultiSigVerify = ({ flags, secp256k1, sha256, }) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.combineOperations)(opCheckMultiSig({ flags, secp256k1, sha256 }), (0,_flow_control__WEBPACK_IMPORTED_MODULE_8__.opVerify)());\nconst cryptoOperations = ({ flags, ripemd160, secp256k1, sha1, sha256, }) => ({\n [_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesCommon.OP_RIPEMD160]: opRipemd160({\n ripemd160,\n }),\n [_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesCommon.OP_SHA1]: opSha1({ sha1 }),\n [_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesCommon.OP_SHA256]: opSha256({ sha256 }),\n [_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesCommon.OP_HASH160]: opHash160({\n ripemd160,\n sha256,\n }),\n [_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesCommon.OP_HASH256]: opHash256({ sha256 }),\n [_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesCommon.OP_CODESEPARATOR]: opCodeSeparator(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesCommon.OP_CHECKSIG]: opCheckSig({\n flags,\n secp256k1,\n sha256,\n }),\n [_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesCommon.OP_CHECKSIGVERIFY]: opCheckSigVerify({\n flags,\n secp256k1,\n sha256,\n }),\n [_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesCommon.OP_CHECKMULTISIG]: opCheckMultiSig({\n flags,\n secp256k1,\n sha256,\n }),\n [_opcodes__WEBPACK_IMPORTED_MODULE_9__.OpcodesCommon.OP_CHECKMULTISIGVERIFY]: opCheckMultiSigVerify({ flags, secp256k1, sha256 }),\n});\n//# sourceMappingURL=crypto.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/crypto.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/descriptions.js": +/*!***************************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/descriptions.js ***! + \***************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OpcodeDescriptionsCommon: () => (/* binding */ OpcodeDescriptionsCommon)\n/* harmony export */ });\nvar OpcodeDescriptionsCommon;\n(function (OpcodeDescriptionsCommon) {\n OpcodeDescriptionsCommon[\"OP_0\"] = \"Push the Script Number 0 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_1\"] = \"Push the next byte onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_2\"] = \"Push the next 2 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_3\"] = \"Push the next 3 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_4\"] = \"Push the next 4 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_5\"] = \"Push the next 5 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_6\"] = \"Push the next 6 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_7\"] = \"Push the next 7 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_8\"] = \"Push the next 8 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_9\"] = \"Push the next 9 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_10\"] = \"Push the next 10 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_11\"] = \"Push the next 11 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_12\"] = \"Push the next 12 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_13\"] = \"Push the next 13 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_14\"] = \"Push the next 14 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_15\"] = \"Push the next 15 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_16\"] = \"Push the next 16 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_17\"] = \"Push the next 17 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_18\"] = \"Push the next 18 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_19\"] = \"Push the next 19 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_20\"] = \"Push the next 20 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_21\"] = \"Push the next 21 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_22\"] = \"Push the next 22 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_23\"] = \"Push the next 23 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_24\"] = \"Push the next 24 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_25\"] = \"Push the next 25 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_26\"] = \"Push the next 26 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_27\"] = \"Push the next 27 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_28\"] = \"Push the next 28 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_29\"] = \"Push the next 29 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_30\"] = \"Push the next 30 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_31\"] = \"Push the next 31 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_32\"] = \"Push the next 32 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_33\"] = \"Push the next 33 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_34\"] = \"Push the next 34 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_35\"] = \"Push the next 35 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_36\"] = \"Push the next 36 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_37\"] = \"Push the next 37 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_38\"] = \"Push the next 38 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_39\"] = \"Push the next 39 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_40\"] = \"Push the next 40 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_41\"] = \"Push the next 41 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_42\"] = \"Push the next 42 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_43\"] = \"Push the next 43 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_44\"] = \"Push the next 44 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_45\"] = \"Push the next 45 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_46\"] = \"Push the next 46 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_47\"] = \"Push the next 47 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_48\"] = \"Push the next 48 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_49\"] = \"Push the next 49 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_50\"] = \"Push the next 50 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_51\"] = \"Push the next 51 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_52\"] = \"Push the next 52 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_53\"] = \"Push the next 53 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_54\"] = \"Push the next 54 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_55\"] = \"Push the next 55 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_56\"] = \"Push the next 56 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_57\"] = \"Push the next 57 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_58\"] = \"Push the next 58 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_59\"] = \"Push the next 59 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_60\"] = \"Push the next 60 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_61\"] = \"Push the next 61 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_62\"] = \"Push the next 62 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_63\"] = \"Push the next 63 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_64\"] = \"Push the next 64 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_65\"] = \"Push the next 65 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_66\"] = \"Push the next 66 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_67\"] = \"Push the next 67 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_68\"] = \"Push the next 68 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_69\"] = \"Push the next 69 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_70\"] = \"Push the next 70 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_71\"] = \"Push the next 71 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_72\"] = \"Push the next 72 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_73\"] = \"Push the next 73 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_74\"] = \"Push the next 74 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHBYTES_75\"] = \"Push the next 75 bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHDATA_1\"] = \"Read the next Uint8 and push that number of bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHDATA_2\"] = \"Read the next little-endian Uint16 and push that number of bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_PUSHDATA_4\"] = \"Read the next little-endian Uint32 and push that number of bytes onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_1NEGATE\"] = \"Push the Script Number -1 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_RESERVED\"] = \"Error unless found in an unexecuted conditional branch. Note: OP_RESERVED does not count toward the opcode limit.\";\n OpcodeDescriptionsCommon[\"OP_1\"] = \"Push the Script Number 1 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_2\"] = \"Push the Script Number 2 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_3\"] = \"Push the Script Number 3 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_4\"] = \"Push the Script Number 4 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_5\"] = \"Push the Script Number 5 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_6\"] = \"Push the Script Number 6 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_7\"] = \"Push the Script Number 7 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_8\"] = \"Push the Script Number 8 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_9\"] = \"Push the Script Number 9 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_10\"] = \"Push the Script Number 10 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_11\"] = \"Push the Script Number 11 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_12\"] = \"Push the Script Number 12 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_13\"] = \"Push the Script Number 13 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_14\"] = \"Push the Script Number 14 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_15\"] = \"Push the Script Number 15 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_16\"] = \"Push the Script Number 16 onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_NOP\"] = \"No operation. Note: OP_NOP counts toward the opcode limit.\";\n OpcodeDescriptionsCommon[\"OP_VER\"] = \"Error unless found in an unexecuted conditional branch. Note: OP_VER counts toward the opcode limit. (Historically, this pushed a protocol version number to the stack.)\";\n OpcodeDescriptionsCommon[\"OP_IF\"] = \"Pop the top item from the stack. If it is not \\\"truthy\\\", skip evaluation until the matching OP_ELSE or OP_ENDIF.\";\n OpcodeDescriptionsCommon[\"OP_NOTIF\"] = \"Evaluate OP_NOT followed by OP_IF.\";\n OpcodeDescriptionsCommon[\"OP_VERIF\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this was a combination of OP_VER and OP_IF.)\";\n OpcodeDescriptionsCommon[\"OP_VERNOTIF\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this was a combination of OP_VER and OP_NOTIF.)\";\n OpcodeDescriptionsCommon[\"OP_ELSE\"] = \"Invert conditional evaluation within the current OP_IF ... OP_ENDIF block. (If evaluation is enabled, disable it, if it is disabled, enable it.)\";\n OpcodeDescriptionsCommon[\"OP_ENDIF\"] = \"End the current OP_IF ... OP_ENDIF block.\";\n OpcodeDescriptionsCommon[\"OP_VERIFY\"] = \"Pop the top item from the stack and error if it isn't \\\"truthy\\\".\";\n OpcodeDescriptionsCommon[\"OP_RETURN\"] = \"Error when executed.\";\n OpcodeDescriptionsCommon[\"OP_TOALTSTACK\"] = \"Pop the top item from the stack and push it onto the alternate stack.\";\n OpcodeDescriptionsCommon[\"OP_FROMALTSTACK\"] = \"Pop the top item from the alternate stack and push it onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_2DROP\"] = \"Pop the top 2 items from the stack and discard them.\";\n OpcodeDescriptionsCommon[\"OP_2DUP\"] = \"Duplicate the top 2 items on the stack. (E.g. [a, b] -> [a, b, a, b])\";\n OpcodeDescriptionsCommon[\"OP_3DUP\"] = \"Duplicate the top 3 items on the stack. (E.g. [a, b, c] -> [a, b, c, a, b, c])\";\n OpcodeDescriptionsCommon[\"OP_2OVER\"] = \"Duplicate the 2 items beginning at a depth of 2 on the stack. (E.g. [a, b, c, d] -> [a, b, c, d, a, b])\";\n OpcodeDescriptionsCommon[\"OP_2ROT\"] = \"Rotate the top 6 items on the stack, bringing the fifth and sixth items to the top. (E.g. [a, b, c, d, e, f] -> [c, d, e, f, a, b])\";\n OpcodeDescriptionsCommon[\"OP_2SWAP\"] = \"Swap the positions of the top two pairs of items on the stack. (E.g. [a, b, c, d] -> [c, d, a, b])\";\n OpcodeDescriptionsCommon[\"OP_IFDUP\"] = \"If the top item on the stack is \\\"truthy\\\", duplicate it.\";\n OpcodeDescriptionsCommon[\"OP_DEPTH\"] = \"Push the current number of stack items as a Script Number.\";\n OpcodeDescriptionsCommon[\"OP_DROP\"] = \"Pop the top item from the stack and discard it. (E.g. [a] -> [])\";\n OpcodeDescriptionsCommon[\"OP_DUP\"] = \"Duplicate the top item on the stack. (E.g. [a] -> [a, a])\";\n OpcodeDescriptionsCommon[\"OP_NIP\"] = \"Remove the second-to-top item from the stack. (E.g. [a, b] -> [b])\";\n OpcodeDescriptionsCommon[\"OP_OVER\"] = \"Duplicate the second-to-top item on the stack. (E.g. [a, b] -> [a, b, a])\";\n OpcodeDescriptionsCommon[\"OP_PICK\"] = \"Pop the top item from the stack as a Script Number. Duplicate the item at that depth (zero-indexed), placing it on top of the stack. (E.g. [a, b, c, 2] -> [a, b, c, a])\";\n OpcodeDescriptionsCommon[\"OP_ROLL\"] = \"Pop the top item from the stack as a Script Number. Move the item at that depth (zero-indexed) to the top of the stack. (E.g. [a, b, c, 2] -> [b, c, a])\";\n OpcodeDescriptionsCommon[\"OP_ROT\"] = \"Rotate the top 3 items on the stack, bringing the third item to the top. (E.g. [a, b, c] -> [b, c, a])\";\n OpcodeDescriptionsCommon[\"OP_SWAP\"] = \"Swap the top two items on the stack. (E.g. [a, b] -> [b, a])\";\n OpcodeDescriptionsCommon[\"OP_TUCK\"] = \"Duplicate the item at the top of the stack, inserting it below the second-to-top item. (E.g. [a, b] -> [b, a, b])\";\n OpcodeDescriptionsCommon[\"OP_CAT\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this concatenated two stack items.)\";\n OpcodeDescriptionsCommon[\"OP_SUBSTR\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this returned a section of a stack item.)\";\n OpcodeDescriptionsCommon[\"OP_LEFT\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this returned a section to the left of a point in a stack item.)\";\n OpcodeDescriptionsCommon[\"OP_RIGHT\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this returned a section to the right of a point in a stack item.)\";\n OpcodeDescriptionsCommon[\"OP_SIZE\"] = \"Push the byte-length of the top stack item as a Script Number.\";\n OpcodeDescriptionsCommon[\"OP_INVERT\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this flipped all the bits in a stack item.)\";\n OpcodeDescriptionsCommon[\"OP_AND\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this performed a boolean AND on each bit in two stack items.)\";\n OpcodeDescriptionsCommon[\"OP_OR\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this performed a boolean OR on each bit in two stack items.)\";\n OpcodeDescriptionsCommon[\"OP_XOR\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this performed a boolean XOR on each bit in two stack items.)\";\n OpcodeDescriptionsCommon[\"OP_EQUAL\"] = \"Pop the top two items from the stack and compare them byte-by-byte. If they are the same, push a Script Number 1, otherwise push a Script Number 0.\";\n OpcodeDescriptionsCommon[\"OP_EQUALVERIFY\"] = \"Pop the top two items from the stack and compare them byte-by-byte. If the values are different, error. (This operation is a combination of OP_EQUAL followed by OP_VERIFY.)\";\n OpcodeDescriptionsCommon[\"OP_RESERVED1\"] = \"Error unless found in an unexecuted conditional branch. Note: OP_RESERVED1 counts toward the opcode limit.\";\n OpcodeDescriptionsCommon[\"OP_RESERVED2\"] = \"Error unless found in an unexecuted conditional branch. Note: OP_RESERVED2 counts toward the opcode limit.\";\n OpcodeDescriptionsCommon[\"OP_1ADD\"] = \"Pop the top item from the stack as a Script Number, add 1, then push the result.\";\n OpcodeDescriptionsCommon[\"OP_1SUB\"] = \"Pop the top item from the stack as a Script Number, subtract 1, then push the result.\";\n OpcodeDescriptionsCommon[\"OP_2MUL\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this multiplied a Script Number by 2.)\";\n OpcodeDescriptionsCommon[\"OP_2DIV\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this divided a Script Number by 2.)\";\n OpcodeDescriptionsCommon[\"OP_NEGATE\"] = \"Pop the top item from the stack as a Script Number, negate it, then push the result.\";\n OpcodeDescriptionsCommon[\"OP_ABS\"] = \"Pop the top item from the stack as a Script Number, take its absolute value, then push the result.\";\n OpcodeDescriptionsCommon[\"OP_NOT\"] = \"Pop the top item from the stack as a Script Number. If its value is 0, push a Script Number 1, otherwise, push a Script Number 0.\";\n OpcodeDescriptionsCommon[\"OP_0NOTEQUAL\"] = \"Pop the top item from the stack as a Script Number. If its value is not 0, push a Script Number 1, otherwise, push a Script Number 0.\";\n OpcodeDescriptionsCommon[\"OP_ADD\"] = \"Pop the top two items from the stack as Script Numbers. Add them, then push the result.\";\n OpcodeDescriptionsCommon[\"OP_SUB\"] = \"Pop the top two items from the stack as Script Numbers. Subtract the top item from the second item, then push the result.\";\n OpcodeDescriptionsCommon[\"OP_MUL\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this multiplied two Script Numbers.)\";\n OpcodeDescriptionsCommon[\"OP_DIV\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this divided two Script Numbers.)\";\n OpcodeDescriptionsCommon[\"OP_MOD\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this returned the remainder after dividing one Script Number by another.)\";\n OpcodeDescriptionsCommon[\"OP_LSHIFT\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this performed a sign-preserving, left bit shift.)\";\n OpcodeDescriptionsCommon[\"OP_RSHIFT\"] = \"Error, even when found in an unexecuted conditional branch. (Historically, this performed a sign-preserving, right bit shift.)\";\n OpcodeDescriptionsCommon[\"OP_BOOLAND\"] = \"Pop the top two items from the stack as Script Numbers. If neither value is a Script Number 0, push a Script Number 1. Otherwise, push a Script Number 0.\";\n OpcodeDescriptionsCommon[\"OP_BOOLOR\"] = \"Pop the top two items from the stack as Script Numbers. If either value is a Script Number 1, push a Script Number 1. Otherwise, push a Script Number 0.\";\n OpcodeDescriptionsCommon[\"OP_NUMEQUAL\"] = \"Pop the top two items from the stack as Script Numbers. If the values are equal, push a Script Number 1. Otherwise, push a Script Number 0.\";\n OpcodeDescriptionsCommon[\"OP_NUMEQUALVERIFY\"] = \"Pop the top two items from the stack as Script Numbers. If the values are different, error. (This operation is a combination of OP_NUMEQUAL followed by OP_VERIFY.)\";\n OpcodeDescriptionsCommon[\"OP_NUMNOTEQUAL\"] = \"Pop the top two items from the stack as Script Numbers. If the values are not equal, push a Script Number 1. Otherwise, push a Script Number 0.\";\n OpcodeDescriptionsCommon[\"OP_LESSTHAN\"] = \"Pop the top two items from the stack as Script Numbers. If the second item is less than top item, push a Script Number 1. Otherwise, push a Script Number 0.\";\n OpcodeDescriptionsCommon[\"OP_GREATERTHAN\"] = \"Pop the top two items from the stack as Script Numbers. If the second item is greater than top item, push a Script Number 1. Otherwise, push a Script Number 0.\";\n OpcodeDescriptionsCommon[\"OP_LESSTHANOREQUAL\"] = \"Pop the top two items from the stack as Script Numbers. If the second item is less than or equal to the top item, push a Script Number 1. Otherwise, push a Script Number 0.\";\n OpcodeDescriptionsCommon[\"OP_GREATERTHANOREQUAL\"] = \"Pop the top two items from the stack as Script Numbers. If the second item is greater than or equal to the top item, push a Script Number 1. Otherwise, push a Script Number 0.\";\n OpcodeDescriptionsCommon[\"OP_MIN\"] = \"Pop the top two items from the stack as Script Numbers. Push the smaller of the two numbers.\";\n OpcodeDescriptionsCommon[\"OP_MAX\"] = \"Pop the top two items from the stack as Script Numbers. Push the larger of the two numbers.\";\n OpcodeDescriptionsCommon[\"OP_WITHIN\"] = \"Pop the top three items from the stack as Script Numbers. If the top number is within the range defined by the following two numbers (left-inclusive), push a Script Number 1. Otherwise, push a Script Number 0. (E.g. for [a, b, c]: if (b <= a), and (a < c), [1]. Else [0].)\";\n OpcodeDescriptionsCommon[\"OP_RIPEMD160\"] = \"Pop the top item from the stack and pass it through ripemd160, pushing the result onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_SHA1\"] = \"Pop the top item from the stack and pass it through sha1, pushing the result onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_SHA256\"] = \"Pop the top item from the stack and pass it through sha256, pushing the result onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_HASH160\"] = \"Pop the top item from the stack and pass it through sha256, then ripemd160, pushing the result onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_HASH256\"] = \"Pop the top item from the stack and pass it through sha256 twice, pushing the result onto the stack.\";\n OpcodeDescriptionsCommon[\"OP_CODESEPARATOR\"] = \"Update the value of lastCodeSeparator to the instruction pointer's current value. (This reduces the coverage of signing serializations used in signature verification operations.)\";\n OpcodeDescriptionsCommon[\"OP_CHECKSIG\"] = \"Pop the top two items from the stack. Treat the top as a signature and the second as a public key. If the signature is valid, push a Script Number 1, otherwise push a Script Number 0.\";\n OpcodeDescriptionsCommon[\"OP_CHECKSIGVERIFY\"] = \"Pop the top two items from the stack. Treat the top as a signature and the second as a public key. If the signature is not valid, error. (This operation is a combination of OP_CHECKSIG followed by OP_VERIFY.)\";\n OpcodeDescriptionsCommon[\"OP_CHECKMULTISIG\"] = \"Pop items from the stack: first pop the Script Number of public keys, then pop each of those public keys. Next, pop the Script Number of required signatures, then pop each of those signatures. Finally, pop a final Script Number which must be 0 due to a protocol bug. Checking each signature against each public key in order, if all signatures are valid \\u2013 and the required number of signatures have been provided \\u2013 push a Script Number 1, otherwise push a Script Number 0.\";\n OpcodeDescriptionsCommon[\"OP_CHECKMULTISIGVERIFY\"] = \"Pop items from the stack: first pop the Script Number of public keys, then pop each of those public keys. Next, pop the Script Number of required signatures, then pop each of those signatures. Finally, (due to a protocol bug) pop an unused final Script Number which must be 0. Checking each signature against each public key in order, if any signatures are invalid \\u2013 or the required number of signatures have not been provided \\u2013 error. (This operation is a combination of OP_CHECKMULTISIG followed by OP_VERIFY.)\";\n OpcodeDescriptionsCommon[\"OP_NOP1\"] = \"No operation (reserved for future expansion). Note: OP_NOP1 counts toward the opcode limit.\";\n OpcodeDescriptionsCommon[\"OP_CHECKLOCKTIMEVERIFY\"] = \"Verify the transaction occurs after an absolute block time or height: read the top item on the stack as a Script Number (without removing it), and compare it to the transaction's locktime. If the required locktime has not passed, or if locktime has been disabled for this input by a maximized sequence number, error.\";\n OpcodeDescriptionsCommon[\"OP_CHECKSEQUENCEVERIFY\"] = \"Verify the transaction occurs after the output being spent has \\\"aged\\\" by a relative block time or block height since it was created: read the top item on the stack as a Script Number (without removing it), and compare it to the age encoded in the input's sequence number. If the required relative locktime has not passed, or if relative locktime has been disabled by the sequence number or the transaction version, error.\";\n OpcodeDescriptionsCommon[\"OP_NOP4\"] = \"No operation (reserved for future expansion). Note: OP_NOP4 counts toward the opcode limit.\";\n OpcodeDescriptionsCommon[\"OP_NOP6\"] = \"No operation (reserved for future expansion). Note: OP_NOP6 counts toward the opcode limit.\";\n OpcodeDescriptionsCommon[\"OP_NOP5\"] = \"No operation (reserved for future expansion). Note: OP_NOP5 counts toward the opcode limit.\";\n OpcodeDescriptionsCommon[\"OP_NOP7\"] = \"No operation (reserved for future expansion). Note: OP_NOP7 counts toward the opcode limit.\";\n OpcodeDescriptionsCommon[\"OP_NOP8\"] = \"No operation (reserved for future expansion). Note: OP_NOP8 counts toward the opcode limit.\";\n OpcodeDescriptionsCommon[\"OP_NOP9\"] = \"No operation (reserved for future expansion). Note: OP_NOP9 counts toward the opcode limit.\";\n OpcodeDescriptionsCommon[\"OP_NOP10\"] = \"No operation (reserved for future expansion). Note: OP_NOP10 counts toward the opcode limit.\";\n})(OpcodeDescriptionsCommon || (OpcodeDescriptionsCommon = {}));\n//# sourceMappingURL=descriptions.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/descriptions.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/encoding.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/encoding.js ***! + \***********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ decodeBitcoinSignature: () => (/* binding */ decodeBitcoinSignature),\n/* harmony export */ isValidCompressedPublicKeyEncoding: () => (/* binding */ isValidCompressedPublicKeyEncoding),\n/* harmony export */ isValidPublicKeyEncoding: () => (/* binding */ isValidPublicKeyEncoding),\n/* harmony export */ isValidSignatureEncodingBCHTransaction: () => (/* binding */ isValidSignatureEncodingBCHTransaction),\n/* harmony export */ isValidSignatureEncodingDER: () => (/* binding */ isValidSignatureEncodingDER),\n/* harmony export */ isValidUncompressedPublicKeyEncoding: () => (/* binding */ isValidUncompressedPublicKeyEncoding)\n/* harmony export */ });\n/* harmony import */ var _bch_bch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bch/bch */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-types.js\");\n/* harmony import */ var _signing_serialization__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./signing-serialization */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/signing-serialization.js\");\n\n\nconst isValidUncompressedPublicKeyEncoding = (publicKey) => publicKey.length === 65 /* uncompressedByteLength */ &&\n publicKey[0] === 4 /* uncompressedHeaderByte */;\nconst isValidCompressedPublicKeyEncoding = (publicKey) => publicKey.length === 33 /* compressedByteLength */ &&\n (publicKey[0] === 2 /* compressedHeaderByteEven */ ||\n publicKey[0] === 3 /* compressedHeaderByteOdd */);\nconst isValidPublicKeyEncoding = (publicKey) => isValidCompressedPublicKeyEncoding(publicKey) ||\n isValidUncompressedPublicKeyEncoding(publicKey);\nconst isNegative = (value) => \n// eslint-disable-next-line no-bitwise\n(value & 128 /* negative */) !== 0;\nconst hasUnnecessaryPadding = (length, firstByte, secondByte) => length > 1 && firstByte === 0 && !isNegative(secondByte);\nconst isValidInteger = (signature, tagIndex, length, valueIndex\n// eslint-disable-next-line max-params\n) => signature[tagIndex] === 2 /* integerTagType */ &&\n length !== 0 &&\n !isNegative(signature[valueIndex]) &&\n !hasUnnecessaryPadding(length, signature[valueIndex], signature[valueIndex + 1]);\n/**\n * Validate a DER-encoded signature.\n *\n * @remarks\n * This function is consensus-critical since BIP66, but differs from the BIP66\n * specification in that it does not validate the existence of a signing\n * serialization type byte at the end of the signature (to support\n * OP_CHECKDATASIG). To validate a bitcoin-encoded signature (including null\n * signatures), use `isValidSignatureEncodingBCH`.\n *\n * @privateRemarks\n * From the Bitcoin ABC C++ implementation:\n *\n * Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]\n * total-length: 1-byte length descriptor of everything that follows,\n * excluding the sighash byte.\n * R-length: 1-byte length descriptor of the R value that follows.\n * R: arbitrary-length big-endian encoded R value. It must use the\n * shortest possible encoding for a positive integers (which means no null\n * bytes at the start, except a single one when the next byte has its highest\n * bit set).\n * S-length: 1-byte length descriptor of the S value that follows.\n * S: arbitrary-length big-endian encoded S value. The same rules apply.\n */\n// eslint-disable-next-line complexity\nconst isValidSignatureEncodingDER = (signature) => {\n const correctLengthRange = signature.length > 8 /* minimumLength */ &&\n signature.length < 72 /* maximumLength */;\n const correctSequenceTagType = signature[0 /* sequenceTagIndex */] === 48 /* sequenceTagType */;\n const correctSequenceLength = signature[1 /* sequenceLengthIndex */] ===\n signature.length - 2 /* sequenceMetadataBytes */;\n const rLength = signature[3 /* rLengthIndex */];\n if (rLength === undefined) {\n return false;\n }\n const consistentRLength = rLength <= signature.length - 7 /* minimumNonRValueBytes */;\n const rIsValid = isValidInteger(signature, 2 /* rTagIndex */, rLength, 4 /* rValueIndex */);\n const sTagIndex = 4 /* rValueIndex */ + rLength; // eslint-disable-line @typescript-eslint/restrict-plus-operands\n const sLengthIndex = sTagIndex + 1;\n const sLength = signature[sLengthIndex];\n if (sLength === undefined) {\n return false;\n }\n const sValueIndex = sLengthIndex + 1;\n const consistentSLength = sValueIndex + sLength === signature.length;\n const sIsValid = isValidInteger(signature, sTagIndex, sLength, sValueIndex);\n return (correctLengthRange &&\n correctSequenceTagType &&\n correctSequenceLength &&\n consistentRLength &&\n rIsValid &&\n consistentSLength &&\n sIsValid);\n};\n/**\n * Validate the encoding of a transaction signature, including a signing\n * serialization type byte (A.K.A. \"sighash\" byte).\n *\n * @param transactionSignature - the full transaction signature\n */\nconst isValidSignatureEncodingBCHTransaction = (transactionSignature) => transactionSignature.length === 0 ||\n transactionSignature.length === _bch_bch__WEBPACK_IMPORTED_MODULE_0__.ConsensusBCH.schnorrSignatureLength + 1 ||\n ((0,_signing_serialization__WEBPACK_IMPORTED_MODULE_1__.isDefinedSigningSerializationType)(transactionSignature[transactionSignature.length - 1]) &&\n isValidSignatureEncodingDER(transactionSignature.slice(0, transactionSignature.length - 1)));\n/**\n * Split a bitcoin-encoded signature into a signature and signing serialization\n * type.\n *\n * While a bitcoin-encoded signature only includes a single byte to encode the\n * signing serialization type, a 3-byte forkId can be appended to the signing\n * serialization to provide replay-protection between different forks. (See\n * Bitcoin Cash's Replay Protected Sighash spec for details.)\n *\n * @param signature - a signature which passes `isValidSignatureEncoding`\n */\nconst decodeBitcoinSignature = (encodedSignature) => ({\n signature: encodedSignature.slice(0, encodedSignature.length - 1),\n signingSerializationType: new Uint8Array([\n encodedSignature[encodedSignature.length - 1],\n ]),\n});\n//# sourceMappingURL=encoding.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/encoding.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js ***! + \*********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AuthenticationErrorCommon: () => (/* binding */ AuthenticationErrorCommon),\n/* harmony export */ applyError: () => (/* binding */ applyError)\n/* harmony export */ });\nvar AuthenticationErrorCommon;\n(function (AuthenticationErrorCommon) {\n AuthenticationErrorCommon[\"calledReserved\"] = \"Program called an unassigned, reserved operation.\";\n AuthenticationErrorCommon[\"calledReturn\"] = \"Program called an OP_RETURN operation.\";\n AuthenticationErrorCommon[\"calledUpgradableNop\"] = \"Program called a disallowed upgradable non-operation (OP_NOP1-OP_NOP10).\";\n AuthenticationErrorCommon[\"checkSequenceUnavailable\"] = \"Program called an OP_CHECKSEQUENCEVERIFY operation, but OP_CHECKSEQUENCEVERIFY requires transaction version 2 or higher.\";\n AuthenticationErrorCommon[\"disabledOpcode\"] = \"Program contains a disabled opcode.\";\n AuthenticationErrorCommon[\"emptyAlternateStack\"] = \"Tried to read from an empty alternate stack.\";\n AuthenticationErrorCommon[\"emptyStack\"] = \"Tried to read from an empty stack.\";\n AuthenticationErrorCommon[\"exceededMaximumBytecodeLengthLocking\"] = \"The provided locking bytecode exceeds the maximum bytecode length (10,000 bytes).\";\n AuthenticationErrorCommon[\"exceededMaximumBytecodeLengthUnlocking\"] = \"The provided unlocking bytecode exceeds the maximum bytecode length (10,000 bytes).\";\n AuthenticationErrorCommon[\"exceededMaximumStackDepth\"] = \"Program exceeded the maximum stack depth (1,000 items).\";\n AuthenticationErrorCommon[\"exceededMaximumOperationCount\"] = \"Program exceeded the maximum operation count (201 operations).\";\n AuthenticationErrorCommon[\"exceedsMaximumMultisigPublicKeyCount\"] = \"Program called an OP_CHECKMULTISIG which exceeds the maximum public key count (20 public keys).\";\n AuthenticationErrorCommon[\"exceedsMaximumPush\"] = \"Push exceeds the push size limit of 520 bytes.\";\n AuthenticationErrorCommon[\"failedVerify\"] = \"Program failed an OP_VERIFY operation.\";\n AuthenticationErrorCommon[\"invalidStackIndex\"] = \"Tried to read from an invalid stack index.\";\n AuthenticationErrorCommon[\"incompatibleLocktimeType\"] = \"Program called an OP_CHECKLOCKTIMEVERIFY operation with an incompatible locktime type. The transaction locktime and required locktime must both refer to either a block height or a block time.\";\n AuthenticationErrorCommon[\"incompatibleSequenceType\"] = \"Program called an OP_CHECKSEQUENCEVERIFY operation with an incompatible sequence type flag. The input sequence number and required sequence number must both use the same sequence locktime type.\";\n AuthenticationErrorCommon[\"insufficientPublicKeys\"] = \"Program called an OP_CHECKMULTISIG operation which requires signatures from more public keys than are provided.\";\n AuthenticationErrorCommon[\"invalidNaturalNumber\"] = \"Invalid input: the key/signature count inputs for OP_CHECKMULTISIG require a natural number (n > 0).\";\n AuthenticationErrorCommon[\"invalidProtocolBugValue\"] = \"The OP_CHECKMULTISIG protocol bug value must be a Script Number 0 (to comply with the \\\"NULLDUMMY\\\" rule).\";\n AuthenticationErrorCommon[\"invalidPublicKeyEncoding\"] = \"Encountered an improperly encoded public key.\";\n AuthenticationErrorCommon[\"invalidScriptNumber\"] = \"Invalid input: this operation requires a valid Script Number.\";\n AuthenticationErrorCommon[\"invalidSignatureEncoding\"] = \"Encountered an improperly encoded signature.\";\n AuthenticationErrorCommon[\"locktimeDisabled\"] = \"Program called an OP_CHECKLOCKTIMEVERIFY operation, but locktime is disabled for this transaction.\";\n AuthenticationErrorCommon[\"malformedLockingBytecode\"] = \"The provided locking bytecode is malformed.\";\n AuthenticationErrorCommon[\"malformedPush\"] = \"Program must be long enough to push the requested number of bytes.\";\n AuthenticationErrorCommon[\"malformedUnlockingBytecode\"] = \"The provided unlocking bytecode is malformed.\";\n AuthenticationErrorCommon[\"negativeLocktime\"] = \"Program called an OP_CHECKLOCKTIMEVERIFY or OP_CHECKSEQUENCEVERIFY operation with a negative locktime.\";\n AuthenticationErrorCommon[\"nonEmptyExecutionStack\"] = \"Program completed with a non-empty execution stack (missing `OP_ENDIF`).\";\n AuthenticationErrorCommon[\"nonMinimalPush\"] = \"Push operations must use the smallest possible encoding.\";\n AuthenticationErrorCommon[\"nonNullSignatureFailure\"] = \"Program failed a signature verification with a non-null signature (violating the \\\"NULLFAIL\\\" rule).\";\n AuthenticationErrorCommon[\"requiresCleanStack\"] = \"Program completed with an unexpected number of items on the stack (must be exactly 1).\";\n AuthenticationErrorCommon[\"schnorrSizedSignatureInCheckMultiSig\"] = \"Program used a schnorr-sized signature (65 bytes) in an OP_CHECKMULTISIG operation.\";\n AuthenticationErrorCommon[\"unexpectedElse\"] = \"Encountered an OP_ELSE outside of an OP_IF ... OP_ENDIF block.\";\n AuthenticationErrorCommon[\"unexpectedEndIf\"] = \"Encountered an OP_ENDIF which is not following a matching OP_IF.\";\n AuthenticationErrorCommon[\"unknownOpcode\"] = \"Called an unknown opcode.\";\n AuthenticationErrorCommon[\"unmatchedSequenceDisable\"] = \"Program called an OP_CHECKSEQUENCEVERIFY operation requiring the disable flag, but the input's sequence number is missing the disable flag.\";\n AuthenticationErrorCommon[\"unsatisfiedLocktime\"] = \"Program called an OP_CHECKLOCKTIMEVERIFY operation which requires a locktime greater than the transaction's locktime.\";\n AuthenticationErrorCommon[\"unsatisfiedSequenceNumber\"] = \"Program called an OP_CHECKSEQUENCEVERIFY operation which requires a sequence number greater than the input's sequence number.\";\n AuthenticationErrorCommon[\"unsuccessfulEvaluation\"] = \"Unsuccessful evaluation: completed with a non-truthy value on top of the stack.\";\n})(AuthenticationErrorCommon || (AuthenticationErrorCommon = {}));\n/**\n * Applies the `error` to a `state`.\n *\n * @remarks\n * If the state already has an error, this method does not override it.\n * (Evaluation should end after the first encountered error, so further errors\n * aren't relevant.)\n */\nconst applyError = (error, state) => ({\n ...state,\n error: state.error === undefined ? error : state.error,\n});\n//# sourceMappingURL=errors.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/flow-control.js": +/*!***************************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/flow-control.js ***! + \***************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ conditionalFlowControlOperations: () => (/* binding */ conditionalFlowControlOperations),\n/* harmony export */ opElse: () => (/* binding */ opElse),\n/* harmony export */ opEndIf: () => (/* binding */ opEndIf),\n/* harmony export */ opIf: () => (/* binding */ opIf),\n/* harmony export */ opNotIf: () => (/* binding */ opNotIf),\n/* harmony export */ opReturn: () => (/* binding */ opReturn),\n/* harmony export */ opVerify: () => (/* binding */ opVerify),\n/* harmony export */ reservedOperation: () => (/* binding */ reservedOperation),\n/* harmony export */ unconditionalFlowControlOperations: () => (/* binding */ unconditionalFlowControlOperations)\n/* harmony export */ });\n/* harmony import */ var _arithmetic__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./arithmetic */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/arithmetic.js\");\n/* harmony import */ var _combinators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./combinators */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/combinators.js\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./errors */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js\");\n/* harmony import */ var _opcodes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js\");\n\n\n\n\n\nconst opVerify = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(state, (nextState, [item]) => (0,_common__WEBPACK_IMPORTED_MODULE_1__.stackItemIsTruthy)(item)\n ? nextState\n : (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.failedVerify, nextState));\nconst reservedOperation = () => (state) => (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.calledReserved, state);\nconst opReturn = () => (state) => (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.calledReturn, state);\nconst conditionalFlowControlOperations = () => ({\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_RESERVED]: reservedOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_VER]: reservedOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_VERIFY]: opVerify(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_RETURN]: opReturn(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_RESERVED1]: reservedOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_RESERVED2]: reservedOperation(),\n});\nconst opIf = () => (state) => {\n if (state.executionStack.every((item) => item)) {\n // eslint-disable-next-line functional/immutable-data\n const element = state.stack.pop();\n if (element === undefined) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.emptyStack, state);\n }\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n state.executionStack.push((0,_common__WEBPACK_IMPORTED_MODULE_1__.stackItemIsTruthy)(element));\n return state;\n }\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n state.executionStack.push(false);\n return state;\n};\nconst opNotIf = (flags) => {\n const not = (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.conditionallyEvaluate)((0,_arithmetic__WEBPACK_IMPORTED_MODULE_4__.opNot)(flags));\n const ifOp = opIf();\n return (state) => ifOp(not(state));\n};\nconst opEndIf = () => (state) => {\n // eslint-disable-next-line functional/immutable-data\n const element = state.executionStack.pop();\n if (element === undefined) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.unexpectedEndIf, state);\n }\n return state;\n};\nconst opElse = () => (state) => {\n const top = state.executionStack[state.executionStack.length - 1];\n if (top === undefined) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.unexpectedElse, state);\n }\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n state.executionStack[state.executionStack.length - 1] = !top;\n return state;\n};\nconst unconditionalFlowControlOperations = (flags) => ({\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_IF]: opIf(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_NOTIF]: opNotIf(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_VERIF]: reservedOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_VERNOTIF]: reservedOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_ELSE]: opElse(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_ENDIF]: opEndIf(),\n});\n//# sourceMappingURL=flow-control.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/flow-control.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/nop.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/nop.js ***! + \******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ disabledOperation: () => (/* binding */ disabledOperation),\n/* harmony export */ disabledOperations: () => (/* binding */ disabledOperations),\n/* harmony export */ nonOperations: () => (/* binding */ nonOperations),\n/* harmony export */ opNop: () => (/* binding */ opNop)\n/* harmony export */ });\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js\");\n/* harmony import */ var _opcodes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js\");\n\n\nconst opNop = (flags) => (state) => flags.disallowUpgradableNops\n ? (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.calledUpgradableNop, state)\n : state;\nconst nonOperations = (flags) => ({\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_NOP]: opNop(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_NOP1]: opNop(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_NOP4]: opNop(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_NOP5]: opNop(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_NOP6]: opNop(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_NOP7]: opNop(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_NOP8]: opNop(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_NOP9]: opNop(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_NOP10]: opNop(flags),\n});\n/**\n * \"Disabled\" operations are explicitly forbidden from occurring anywhere in a\n * script, even within an unexecuted branch.\n */\nconst disabledOperation = () => (state) => (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.unknownOpcode, state);\nconst disabledOperations = () => ({\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_CAT]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_SUBSTR]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_LEFT]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_RIGHT]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_INVERT]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_AND]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_OR]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_XOR]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_2MUL]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_2DIV]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_MUL]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_DIV]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_MOD]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_LSHIFT]: disabledOperation(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_RSHIFT]: disabledOperation(),\n});\n//# sourceMappingURL=nop.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/nop.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js ***! + \**********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OpcodesCommon: () => (/* binding */ OpcodesCommon)\n/* harmony export */ });\nvar OpcodesCommon;\n(function (OpcodesCommon) {\n /**\n * A.K.A. `OP_FALSE` or `OP_PUSHBYTES_0`\n */\n OpcodesCommon[OpcodesCommon[\"OP_0\"] = 0] = \"OP_0\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_1\"] = 1] = \"OP_PUSHBYTES_1\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_2\"] = 2] = \"OP_PUSHBYTES_2\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_3\"] = 3] = \"OP_PUSHBYTES_3\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_4\"] = 4] = \"OP_PUSHBYTES_4\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_5\"] = 5] = \"OP_PUSHBYTES_5\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_6\"] = 6] = \"OP_PUSHBYTES_6\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_7\"] = 7] = \"OP_PUSHBYTES_7\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_8\"] = 8] = \"OP_PUSHBYTES_8\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_9\"] = 9] = \"OP_PUSHBYTES_9\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_10\"] = 10] = \"OP_PUSHBYTES_10\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_11\"] = 11] = \"OP_PUSHBYTES_11\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_12\"] = 12] = \"OP_PUSHBYTES_12\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_13\"] = 13] = \"OP_PUSHBYTES_13\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_14\"] = 14] = \"OP_PUSHBYTES_14\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_15\"] = 15] = \"OP_PUSHBYTES_15\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_16\"] = 16] = \"OP_PUSHBYTES_16\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_17\"] = 17] = \"OP_PUSHBYTES_17\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_18\"] = 18] = \"OP_PUSHBYTES_18\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_19\"] = 19] = \"OP_PUSHBYTES_19\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_20\"] = 20] = \"OP_PUSHBYTES_20\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_21\"] = 21] = \"OP_PUSHBYTES_21\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_22\"] = 22] = \"OP_PUSHBYTES_22\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_23\"] = 23] = \"OP_PUSHBYTES_23\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_24\"] = 24] = \"OP_PUSHBYTES_24\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_25\"] = 25] = \"OP_PUSHBYTES_25\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_26\"] = 26] = \"OP_PUSHBYTES_26\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_27\"] = 27] = \"OP_PUSHBYTES_27\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_28\"] = 28] = \"OP_PUSHBYTES_28\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_29\"] = 29] = \"OP_PUSHBYTES_29\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_30\"] = 30] = \"OP_PUSHBYTES_30\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_31\"] = 31] = \"OP_PUSHBYTES_31\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_32\"] = 32] = \"OP_PUSHBYTES_32\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_33\"] = 33] = \"OP_PUSHBYTES_33\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_34\"] = 34] = \"OP_PUSHBYTES_34\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_35\"] = 35] = \"OP_PUSHBYTES_35\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_36\"] = 36] = \"OP_PUSHBYTES_36\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_37\"] = 37] = \"OP_PUSHBYTES_37\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_38\"] = 38] = \"OP_PUSHBYTES_38\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_39\"] = 39] = \"OP_PUSHBYTES_39\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_40\"] = 40] = \"OP_PUSHBYTES_40\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_41\"] = 41] = \"OP_PUSHBYTES_41\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_42\"] = 42] = \"OP_PUSHBYTES_42\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_43\"] = 43] = \"OP_PUSHBYTES_43\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_44\"] = 44] = \"OP_PUSHBYTES_44\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_45\"] = 45] = \"OP_PUSHBYTES_45\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_46\"] = 46] = \"OP_PUSHBYTES_46\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_47\"] = 47] = \"OP_PUSHBYTES_47\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_48\"] = 48] = \"OP_PUSHBYTES_48\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_49\"] = 49] = \"OP_PUSHBYTES_49\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_50\"] = 50] = \"OP_PUSHBYTES_50\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_51\"] = 51] = \"OP_PUSHBYTES_51\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_52\"] = 52] = \"OP_PUSHBYTES_52\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_53\"] = 53] = \"OP_PUSHBYTES_53\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_54\"] = 54] = \"OP_PUSHBYTES_54\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_55\"] = 55] = \"OP_PUSHBYTES_55\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_56\"] = 56] = \"OP_PUSHBYTES_56\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_57\"] = 57] = \"OP_PUSHBYTES_57\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_58\"] = 58] = \"OP_PUSHBYTES_58\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_59\"] = 59] = \"OP_PUSHBYTES_59\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_60\"] = 60] = \"OP_PUSHBYTES_60\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_61\"] = 61] = \"OP_PUSHBYTES_61\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_62\"] = 62] = \"OP_PUSHBYTES_62\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_63\"] = 63] = \"OP_PUSHBYTES_63\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_64\"] = 64] = \"OP_PUSHBYTES_64\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_65\"] = 65] = \"OP_PUSHBYTES_65\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_66\"] = 66] = \"OP_PUSHBYTES_66\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_67\"] = 67] = \"OP_PUSHBYTES_67\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_68\"] = 68] = \"OP_PUSHBYTES_68\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_69\"] = 69] = \"OP_PUSHBYTES_69\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_70\"] = 70] = \"OP_PUSHBYTES_70\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_71\"] = 71] = \"OP_PUSHBYTES_71\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_72\"] = 72] = \"OP_PUSHBYTES_72\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_73\"] = 73] = \"OP_PUSHBYTES_73\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_74\"] = 74] = \"OP_PUSHBYTES_74\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHBYTES_75\"] = 75] = \"OP_PUSHBYTES_75\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHDATA_1\"] = 76] = \"OP_PUSHDATA_1\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHDATA_2\"] = 77] = \"OP_PUSHDATA_2\";\n OpcodesCommon[OpcodesCommon[\"OP_PUSHDATA_4\"] = 78] = \"OP_PUSHDATA_4\";\n OpcodesCommon[OpcodesCommon[\"OP_1NEGATE\"] = 79] = \"OP_1NEGATE\";\n OpcodesCommon[OpcodesCommon[\"OP_RESERVED\"] = 80] = \"OP_RESERVED\";\n /**\n * A.K.A. `OP_TRUE`\n */\n OpcodesCommon[OpcodesCommon[\"OP_1\"] = 81] = \"OP_1\";\n OpcodesCommon[OpcodesCommon[\"OP_2\"] = 82] = \"OP_2\";\n OpcodesCommon[OpcodesCommon[\"OP_3\"] = 83] = \"OP_3\";\n OpcodesCommon[OpcodesCommon[\"OP_4\"] = 84] = \"OP_4\";\n OpcodesCommon[OpcodesCommon[\"OP_5\"] = 85] = \"OP_5\";\n OpcodesCommon[OpcodesCommon[\"OP_6\"] = 86] = \"OP_6\";\n OpcodesCommon[OpcodesCommon[\"OP_7\"] = 87] = \"OP_7\";\n OpcodesCommon[OpcodesCommon[\"OP_8\"] = 88] = \"OP_8\";\n OpcodesCommon[OpcodesCommon[\"OP_9\"] = 89] = \"OP_9\";\n OpcodesCommon[OpcodesCommon[\"OP_10\"] = 90] = \"OP_10\";\n OpcodesCommon[OpcodesCommon[\"OP_11\"] = 91] = \"OP_11\";\n OpcodesCommon[OpcodesCommon[\"OP_12\"] = 92] = \"OP_12\";\n OpcodesCommon[OpcodesCommon[\"OP_13\"] = 93] = \"OP_13\";\n OpcodesCommon[OpcodesCommon[\"OP_14\"] = 94] = \"OP_14\";\n OpcodesCommon[OpcodesCommon[\"OP_15\"] = 95] = \"OP_15\";\n OpcodesCommon[OpcodesCommon[\"OP_16\"] = 96] = \"OP_16\";\n OpcodesCommon[OpcodesCommon[\"OP_NOP\"] = 97] = \"OP_NOP\";\n OpcodesCommon[OpcodesCommon[\"OP_VER\"] = 98] = \"OP_VER\";\n OpcodesCommon[OpcodesCommon[\"OP_IF\"] = 99] = \"OP_IF\";\n OpcodesCommon[OpcodesCommon[\"OP_NOTIF\"] = 100] = \"OP_NOTIF\";\n OpcodesCommon[OpcodesCommon[\"OP_VERIF\"] = 101] = \"OP_VERIF\";\n OpcodesCommon[OpcodesCommon[\"OP_VERNOTIF\"] = 102] = \"OP_VERNOTIF\";\n OpcodesCommon[OpcodesCommon[\"OP_ELSE\"] = 103] = \"OP_ELSE\";\n OpcodesCommon[OpcodesCommon[\"OP_ENDIF\"] = 104] = \"OP_ENDIF\";\n OpcodesCommon[OpcodesCommon[\"OP_VERIFY\"] = 105] = \"OP_VERIFY\";\n OpcodesCommon[OpcodesCommon[\"OP_RETURN\"] = 106] = \"OP_RETURN\";\n OpcodesCommon[OpcodesCommon[\"OP_TOALTSTACK\"] = 107] = \"OP_TOALTSTACK\";\n OpcodesCommon[OpcodesCommon[\"OP_FROMALTSTACK\"] = 108] = \"OP_FROMALTSTACK\";\n OpcodesCommon[OpcodesCommon[\"OP_2DROP\"] = 109] = \"OP_2DROP\";\n OpcodesCommon[OpcodesCommon[\"OP_2DUP\"] = 110] = \"OP_2DUP\";\n OpcodesCommon[OpcodesCommon[\"OP_3DUP\"] = 111] = \"OP_3DUP\";\n OpcodesCommon[OpcodesCommon[\"OP_2OVER\"] = 112] = \"OP_2OVER\";\n OpcodesCommon[OpcodesCommon[\"OP_2ROT\"] = 113] = \"OP_2ROT\";\n OpcodesCommon[OpcodesCommon[\"OP_2SWAP\"] = 114] = \"OP_2SWAP\";\n OpcodesCommon[OpcodesCommon[\"OP_IFDUP\"] = 115] = \"OP_IFDUP\";\n OpcodesCommon[OpcodesCommon[\"OP_DEPTH\"] = 116] = \"OP_DEPTH\";\n OpcodesCommon[OpcodesCommon[\"OP_DROP\"] = 117] = \"OP_DROP\";\n OpcodesCommon[OpcodesCommon[\"OP_DUP\"] = 118] = \"OP_DUP\";\n OpcodesCommon[OpcodesCommon[\"OP_NIP\"] = 119] = \"OP_NIP\";\n OpcodesCommon[OpcodesCommon[\"OP_OVER\"] = 120] = \"OP_OVER\";\n OpcodesCommon[OpcodesCommon[\"OP_PICK\"] = 121] = \"OP_PICK\";\n OpcodesCommon[OpcodesCommon[\"OP_ROLL\"] = 122] = \"OP_ROLL\";\n OpcodesCommon[OpcodesCommon[\"OP_ROT\"] = 123] = \"OP_ROT\";\n OpcodesCommon[OpcodesCommon[\"OP_SWAP\"] = 124] = \"OP_SWAP\";\n OpcodesCommon[OpcodesCommon[\"OP_TUCK\"] = 125] = \"OP_TUCK\";\n OpcodesCommon[OpcodesCommon[\"OP_CAT\"] = 126] = \"OP_CAT\";\n OpcodesCommon[OpcodesCommon[\"OP_SUBSTR\"] = 127] = \"OP_SUBSTR\";\n OpcodesCommon[OpcodesCommon[\"OP_LEFT\"] = 128] = \"OP_LEFT\";\n OpcodesCommon[OpcodesCommon[\"OP_RIGHT\"] = 129] = \"OP_RIGHT\";\n OpcodesCommon[OpcodesCommon[\"OP_SIZE\"] = 130] = \"OP_SIZE\";\n OpcodesCommon[OpcodesCommon[\"OP_INVERT\"] = 131] = \"OP_INVERT\";\n OpcodesCommon[OpcodesCommon[\"OP_AND\"] = 132] = \"OP_AND\";\n OpcodesCommon[OpcodesCommon[\"OP_OR\"] = 133] = \"OP_OR\";\n OpcodesCommon[OpcodesCommon[\"OP_XOR\"] = 134] = \"OP_XOR\";\n OpcodesCommon[OpcodesCommon[\"OP_EQUAL\"] = 135] = \"OP_EQUAL\";\n OpcodesCommon[OpcodesCommon[\"OP_EQUALVERIFY\"] = 136] = \"OP_EQUALVERIFY\";\n OpcodesCommon[OpcodesCommon[\"OP_RESERVED1\"] = 137] = \"OP_RESERVED1\";\n OpcodesCommon[OpcodesCommon[\"OP_RESERVED2\"] = 138] = \"OP_RESERVED2\";\n OpcodesCommon[OpcodesCommon[\"OP_1ADD\"] = 139] = \"OP_1ADD\";\n OpcodesCommon[OpcodesCommon[\"OP_1SUB\"] = 140] = \"OP_1SUB\";\n OpcodesCommon[OpcodesCommon[\"OP_2MUL\"] = 141] = \"OP_2MUL\";\n OpcodesCommon[OpcodesCommon[\"OP_2DIV\"] = 142] = \"OP_2DIV\";\n OpcodesCommon[OpcodesCommon[\"OP_NEGATE\"] = 143] = \"OP_NEGATE\";\n OpcodesCommon[OpcodesCommon[\"OP_ABS\"] = 144] = \"OP_ABS\";\n OpcodesCommon[OpcodesCommon[\"OP_NOT\"] = 145] = \"OP_NOT\";\n OpcodesCommon[OpcodesCommon[\"OP_0NOTEQUAL\"] = 146] = \"OP_0NOTEQUAL\";\n OpcodesCommon[OpcodesCommon[\"OP_ADD\"] = 147] = \"OP_ADD\";\n OpcodesCommon[OpcodesCommon[\"OP_SUB\"] = 148] = \"OP_SUB\";\n OpcodesCommon[OpcodesCommon[\"OP_MUL\"] = 149] = \"OP_MUL\";\n OpcodesCommon[OpcodesCommon[\"OP_DIV\"] = 150] = \"OP_DIV\";\n OpcodesCommon[OpcodesCommon[\"OP_MOD\"] = 151] = \"OP_MOD\";\n OpcodesCommon[OpcodesCommon[\"OP_LSHIFT\"] = 152] = \"OP_LSHIFT\";\n OpcodesCommon[OpcodesCommon[\"OP_RSHIFT\"] = 153] = \"OP_RSHIFT\";\n OpcodesCommon[OpcodesCommon[\"OP_BOOLAND\"] = 154] = \"OP_BOOLAND\";\n OpcodesCommon[OpcodesCommon[\"OP_BOOLOR\"] = 155] = \"OP_BOOLOR\";\n OpcodesCommon[OpcodesCommon[\"OP_NUMEQUAL\"] = 156] = \"OP_NUMEQUAL\";\n OpcodesCommon[OpcodesCommon[\"OP_NUMEQUALVERIFY\"] = 157] = \"OP_NUMEQUALVERIFY\";\n OpcodesCommon[OpcodesCommon[\"OP_NUMNOTEQUAL\"] = 158] = \"OP_NUMNOTEQUAL\";\n OpcodesCommon[OpcodesCommon[\"OP_LESSTHAN\"] = 159] = \"OP_LESSTHAN\";\n OpcodesCommon[OpcodesCommon[\"OP_GREATERTHAN\"] = 160] = \"OP_GREATERTHAN\";\n OpcodesCommon[OpcodesCommon[\"OP_LESSTHANOREQUAL\"] = 161] = \"OP_LESSTHANOREQUAL\";\n OpcodesCommon[OpcodesCommon[\"OP_GREATERTHANOREQUAL\"] = 162] = \"OP_GREATERTHANOREQUAL\";\n OpcodesCommon[OpcodesCommon[\"OP_MIN\"] = 163] = \"OP_MIN\";\n OpcodesCommon[OpcodesCommon[\"OP_MAX\"] = 164] = \"OP_MAX\";\n OpcodesCommon[OpcodesCommon[\"OP_WITHIN\"] = 165] = \"OP_WITHIN\";\n OpcodesCommon[OpcodesCommon[\"OP_RIPEMD160\"] = 166] = \"OP_RIPEMD160\";\n OpcodesCommon[OpcodesCommon[\"OP_SHA1\"] = 167] = \"OP_SHA1\";\n OpcodesCommon[OpcodesCommon[\"OP_SHA256\"] = 168] = \"OP_SHA256\";\n OpcodesCommon[OpcodesCommon[\"OP_HASH160\"] = 169] = \"OP_HASH160\";\n OpcodesCommon[OpcodesCommon[\"OP_HASH256\"] = 170] = \"OP_HASH256\";\n OpcodesCommon[OpcodesCommon[\"OP_CODESEPARATOR\"] = 171] = \"OP_CODESEPARATOR\";\n OpcodesCommon[OpcodesCommon[\"OP_CHECKSIG\"] = 172] = \"OP_CHECKSIG\";\n OpcodesCommon[OpcodesCommon[\"OP_CHECKSIGVERIFY\"] = 173] = \"OP_CHECKSIGVERIFY\";\n OpcodesCommon[OpcodesCommon[\"OP_CHECKMULTISIG\"] = 174] = \"OP_CHECKMULTISIG\";\n OpcodesCommon[OpcodesCommon[\"OP_CHECKMULTISIGVERIFY\"] = 175] = \"OP_CHECKMULTISIGVERIFY\";\n OpcodesCommon[OpcodesCommon[\"OP_NOP1\"] = 176] = \"OP_NOP1\";\n /**\n * Previously `OP_NOP2`\n */\n OpcodesCommon[OpcodesCommon[\"OP_CHECKLOCKTIMEVERIFY\"] = 177] = \"OP_CHECKLOCKTIMEVERIFY\";\n /**\n * Previously `OP_NOP2`\n */\n OpcodesCommon[OpcodesCommon[\"OP_CHECKSEQUENCEVERIFY\"] = 178] = \"OP_CHECKSEQUENCEVERIFY\";\n OpcodesCommon[OpcodesCommon[\"OP_NOP4\"] = 179] = \"OP_NOP4\";\n OpcodesCommon[OpcodesCommon[\"OP_NOP5\"] = 180] = \"OP_NOP5\";\n OpcodesCommon[OpcodesCommon[\"OP_NOP6\"] = 181] = \"OP_NOP6\";\n OpcodesCommon[OpcodesCommon[\"OP_NOP7\"] = 182] = \"OP_NOP7\";\n OpcodesCommon[OpcodesCommon[\"OP_NOP8\"] = 183] = \"OP_NOP8\";\n OpcodesCommon[OpcodesCommon[\"OP_NOP9\"] = 184] = \"OP_NOP9\";\n OpcodesCommon[OpcodesCommon[\"OP_NOP10\"] = 185] = \"OP_NOP10\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN186\"] = 186] = \"OP_UNKNOWN186\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN187\"] = 187] = \"OP_UNKNOWN187\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN188\"] = 188] = \"OP_UNKNOWN188\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN189\"] = 189] = \"OP_UNKNOWN189\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN190\"] = 190] = \"OP_UNKNOWN190\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN191\"] = 191] = \"OP_UNKNOWN191\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN192\"] = 192] = \"OP_UNKNOWN192\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN193\"] = 193] = \"OP_UNKNOWN193\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN194\"] = 194] = \"OP_UNKNOWN194\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN195\"] = 195] = \"OP_UNKNOWN195\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN196\"] = 196] = \"OP_UNKNOWN196\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN197\"] = 197] = \"OP_UNKNOWN197\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN198\"] = 198] = \"OP_UNKNOWN198\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN199\"] = 199] = \"OP_UNKNOWN199\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN200\"] = 200] = \"OP_UNKNOWN200\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN201\"] = 201] = \"OP_UNKNOWN201\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN202\"] = 202] = \"OP_UNKNOWN202\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN203\"] = 203] = \"OP_UNKNOWN203\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN204\"] = 204] = \"OP_UNKNOWN204\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN205\"] = 205] = \"OP_UNKNOWN205\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN206\"] = 206] = \"OP_UNKNOWN206\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN207\"] = 207] = \"OP_UNKNOWN207\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN208\"] = 208] = \"OP_UNKNOWN208\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN209\"] = 209] = \"OP_UNKNOWN209\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN210\"] = 210] = \"OP_UNKNOWN210\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN211\"] = 211] = \"OP_UNKNOWN211\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN212\"] = 212] = \"OP_UNKNOWN212\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN213\"] = 213] = \"OP_UNKNOWN213\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN214\"] = 214] = \"OP_UNKNOWN214\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN215\"] = 215] = \"OP_UNKNOWN215\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN216\"] = 216] = \"OP_UNKNOWN216\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN217\"] = 217] = \"OP_UNKNOWN217\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN218\"] = 218] = \"OP_UNKNOWN218\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN219\"] = 219] = \"OP_UNKNOWN219\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN220\"] = 220] = \"OP_UNKNOWN220\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN221\"] = 221] = \"OP_UNKNOWN221\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN222\"] = 222] = \"OP_UNKNOWN222\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN223\"] = 223] = \"OP_UNKNOWN223\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN224\"] = 224] = \"OP_UNKNOWN224\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN225\"] = 225] = \"OP_UNKNOWN225\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN226\"] = 226] = \"OP_UNKNOWN226\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN227\"] = 227] = \"OP_UNKNOWN227\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN228\"] = 228] = \"OP_UNKNOWN228\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN229\"] = 229] = \"OP_UNKNOWN229\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN230\"] = 230] = \"OP_UNKNOWN230\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN231\"] = 231] = \"OP_UNKNOWN231\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN232\"] = 232] = \"OP_UNKNOWN232\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN233\"] = 233] = \"OP_UNKNOWN233\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN234\"] = 234] = \"OP_UNKNOWN234\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN235\"] = 235] = \"OP_UNKNOWN235\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN236\"] = 236] = \"OP_UNKNOWN236\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN237\"] = 237] = \"OP_UNKNOWN237\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN238\"] = 238] = \"OP_UNKNOWN238\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN239\"] = 239] = \"OP_UNKNOWN239\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN240\"] = 240] = \"OP_UNKNOWN240\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN241\"] = 241] = \"OP_UNKNOWN241\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN242\"] = 242] = \"OP_UNKNOWN242\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN243\"] = 243] = \"OP_UNKNOWN243\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN244\"] = 244] = \"OP_UNKNOWN244\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN245\"] = 245] = \"OP_UNKNOWN245\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN246\"] = 246] = \"OP_UNKNOWN246\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN247\"] = 247] = \"OP_UNKNOWN247\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN248\"] = 248] = \"OP_UNKNOWN248\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN249\"] = 249] = \"OP_UNKNOWN249\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN250\"] = 250] = \"OP_UNKNOWN250\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN251\"] = 251] = \"OP_UNKNOWN251\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN252\"] = 252] = \"OP_UNKNOWN252\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN253\"] = 253] = \"OP_UNKNOWN253\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN254\"] = 254] = \"OP_UNKNOWN254\";\n OpcodesCommon[OpcodesCommon[\"OP_UNKNOWN255\"] = 255] = \"OP_UNKNOWN255\";\n})(OpcodesCommon || (OpcodesCommon = {}));\n//# sourceMappingURL=opcodes.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/push.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/push.js ***! + \*******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PushOperationConstants: () => (/* binding */ PushOperationConstants),\n/* harmony export */ encodeDataPush: () => (/* binding */ encodeDataPush),\n/* harmony export */ isMinimalDataPush: () => (/* binding */ isMinimalDataPush),\n/* harmony export */ pushByteOpcodes: () => (/* binding */ pushByteOpcodes),\n/* harmony export */ pushNumberOpcodes: () => (/* binding */ pushNumberOpcodes),\n/* harmony export */ pushNumberOperations: () => (/* binding */ pushNumberOperations),\n/* harmony export */ pushOperation: () => (/* binding */ pushOperation),\n/* harmony export */ pushOperations: () => (/* binding */ pushOperations)\n/* harmony export */ });\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/numbers.js\");\n/* harmony import */ var _format_hex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../format/hex */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _combinators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./combinators */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/combinators.js\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./errors */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js\");\n/* harmony import */ var _opcodes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./types */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n\n\n\n\n\n\nvar PushOperationConstants;\n(function (PushOperationConstants) {\n PushOperationConstants[PushOperationConstants[\"OP_0\"] = 0] = \"OP_0\";\n /**\n * OP_PUSHBYTES_75\n */\n PushOperationConstants[PushOperationConstants[\"maximumPushByteOperationSize\"] = 75] = \"maximumPushByteOperationSize\";\n PushOperationConstants[PushOperationConstants[\"OP_PUSHDATA_1\"] = 76] = \"OP_PUSHDATA_1\";\n PushOperationConstants[PushOperationConstants[\"OP_PUSHDATA_2\"] = 77] = \"OP_PUSHDATA_2\";\n PushOperationConstants[PushOperationConstants[\"OP_PUSHDATA_4\"] = 78] = \"OP_PUSHDATA_4\";\n /**\n * OP_PUSHDATA_4\n */\n PushOperationConstants[PushOperationConstants[\"highestPushDataOpcode\"] = 78] = \"highestPushDataOpcode\";\n /**\n * For OP_1 to OP_16, `opcode` is the number offset by `0x50` (80):\n *\n * `OP_N = 0x50 + N`\n *\n * OP_0 is really OP_PUSHBYTES_0 (`0x00`), so it does not follow this pattern.\n */\n PushOperationConstants[PushOperationConstants[\"pushNumberOpcodesOffset\"] = 80] = \"pushNumberOpcodesOffset\";\n /** OP_1 through OP_16 */\n PushOperationConstants[PushOperationConstants[\"pushNumberOpcodes\"] = 16] = \"pushNumberOpcodes\";\n PushOperationConstants[PushOperationConstants[\"negativeOne\"] = 129] = \"negativeOne\";\n PushOperationConstants[PushOperationConstants[\"OP_1NEGATE\"] = 79] = \"OP_1NEGATE\";\n /**\n * 256 - 1\n */\n PushOperationConstants[PushOperationConstants[\"maximumPushData1Size\"] = 255] = \"maximumPushData1Size\";\n /**\n * Standard consensus parameter for most Bitcoin forks.\n */\n PushOperationConstants[PushOperationConstants[\"maximumPushSize\"] = 520] = \"maximumPushSize\";\n /**\n * 256 ** 2 - 1\n */\n PushOperationConstants[PushOperationConstants[\"maximumPushData2Size\"] = 65535] = \"maximumPushData2Size\";\n /**\n * 256 ** 4 - 1\n */\n PushOperationConstants[PushOperationConstants[\"maximumPushData4Size\"] = 4294967295] = \"maximumPushData4Size\";\n})(PushOperationConstants || (PushOperationConstants = {}));\n/**\n * Returns the minimal bytecode required to push the provided `data` to the\n * stack.\n *\n * @remarks\n * This method conservatively encodes a `Uint8Array` as a data push. For Script\n * Numbers which can be pushed using a single opcode (-1 through 16), the\n * equivalent bytecode value is returned. Other `data` values will be prefixed\n * with the proper opcode and push length bytes (if necessary) to create the\n * minimal push instruction.\n *\n * Note, while some single-byte Script Number pushes will be minimally-encoded\n * by this method, all larger inputs will be encoded as-is (it cannot be assumed\n * that inputs are intended to be used as Script Numbers). To encode the push of\n * a Script Number, minimally-encode the number before passing it to this\n * method, e.g.:\n * `encodeDataPush(bigIntToScriptNumber(parseBytesAsScriptNumber(nonMinimalNumber)))`.\n *\n * The maximum `bytecode` length which can be encoded for a push in the Bitcoin\n * system is `4294967295` (~4GB). This method assumes a smaller input – if\n * `bytecode` has the potential to be longer, it should be checked (and the\n * error handled) prior to calling this method.\n *\n * @param data - the Uint8Array to push to the stack\n */\n// eslint-disable-next-line complexity\nconst encodeDataPush = (data) => data.length <= PushOperationConstants.maximumPushByteOperationSize\n ? data.length === 0\n ? Uint8Array.of(0)\n : data.length === 1\n ? data[0] !== 0 && data[0] <= PushOperationConstants.pushNumberOpcodes\n ? Uint8Array.of(data[0] + PushOperationConstants.pushNumberOpcodesOffset)\n : data[0] === PushOperationConstants.negativeOne\n ? Uint8Array.of(PushOperationConstants.OP_1NEGATE)\n : Uint8Array.from([1, ...data])\n : Uint8Array.from([data.length, ...data])\n : data.length <= PushOperationConstants.maximumPushData1Size\n ? Uint8Array.from([\n PushOperationConstants.OP_PUSHDATA_1,\n data.length,\n ...data,\n ])\n : data.length <= PushOperationConstants.maximumPushData2Size\n ? Uint8Array.from([\n PushOperationConstants.OP_PUSHDATA_2,\n ...(0,_format_format__WEBPACK_IMPORTED_MODULE_0__.numberToBinUint16LE)(data.length),\n ...data,\n ])\n : Uint8Array.from([\n PushOperationConstants.OP_PUSHDATA_4,\n ...(0,_format_format__WEBPACK_IMPORTED_MODULE_0__.numberToBinUint32LE)(data.length),\n ...data,\n ]);\n/**\n * Returns true if the provided `data` is minimally-encoded by the provided\n * `opcode`.\n * @param opcode - the opcode used to push `data`\n * @param data - the contents of the push\n */\n// eslint-disable-next-line complexity\nconst isMinimalDataPush = (opcode, data) => data.length === 0\n ? opcode === PushOperationConstants.OP_0\n : data.length === 1\n ? data[0] >= 1 && data[0] <= PushOperationConstants.pushNumberOpcodes\n ? opcode === data[0] + PushOperationConstants.pushNumberOpcodesOffset\n : data[0] === PushOperationConstants.negativeOne\n ? opcode === PushOperationConstants.OP_1NEGATE\n : true\n : data.length <= PushOperationConstants.maximumPushByteOperationSize\n ? opcode === data.length\n : data.length <= PushOperationConstants.maximumPushData1Size\n ? opcode === PushOperationConstants.OP_PUSHDATA_1\n : data.length <= PushOperationConstants.maximumPushData2Size\n ? opcode === PushOperationConstants.OP_PUSHDATA_2\n : true;\nconst pushByteOpcodes = [\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_1,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_2,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_3,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_4,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_5,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_6,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_7,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_8,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_9,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_10,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_11,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_12,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_13,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_14,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_15,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_16,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_17,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_18,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_19,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_20,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_21,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_22,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_23,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_24,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_25,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_26,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_27,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_28,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_29,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_30,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_31,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_32,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_33,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_34,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_35,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_36,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_37,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_38,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_39,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_40,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_41,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_42,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_43,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_44,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_45,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_46,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_47,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_48,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_49,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_50,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_51,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_52,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_53,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_54,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_55,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_56,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_57,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_58,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_59,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_60,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_61,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_62,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_63,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_64,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_65,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_66,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_67,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_68,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_69,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_70,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_71,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_72,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_73,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_74,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_PUSHBYTES_75,\n];\nconst executionIsActive = (state) => state.executionStack.every((item) => item);\nconst pushOperation = (flags, maximumPushSize = PushOperationConstants.maximumPushSize) => (state) => {\n const instruction = state.instructions[state.ip];\n return instruction.data.length > maximumPushSize\n ? (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.exceedsMaximumPush, state)\n : executionIsActive(state)\n ? flags.requireMinimalEncoding &&\n !isMinimalDataPush(instruction.opcode, instruction.data)\n ? (0,_errors__WEBPACK_IMPORTED_MODULE_2__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon.nonMinimalPush, state)\n : (0,_combinators__WEBPACK_IMPORTED_MODULE_3__.pushToStack)(state, instruction.data)\n : state;\n};\nconst pushOperations = (flags, maximumPushSize = PushOperationConstants.maximumPushSize) => {\n const push = pushOperation(flags, maximumPushSize);\n return (0,_format_hex__WEBPACK_IMPORTED_MODULE_4__.range)(PushOperationConstants.highestPushDataOpcode + 1).reduce((group, i) => ({ ...group, [i]: push }), {});\n};\nconst pushNumberOpcodes = [\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_1NEGATE,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_1,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_2,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_3,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_4,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_5,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_6,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_7,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_8,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_9,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_10,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_11,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_12,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_13,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_14,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_15,\n _opcodes__WEBPACK_IMPORTED_MODULE_1__.OpcodesCommon.OP_16,\n];\nconst op1NegateValue = -1;\nconst pushNumberOperations = () => pushNumberOpcodes\n .map((opcode, i) => [\n opcode,\n [op1NegateValue, ...(0,_format_hex__WEBPACK_IMPORTED_MODULE_4__.range)(PushOperationConstants.pushNumberOpcodes, 1)]\n .map(BigInt)\n .map(_types__WEBPACK_IMPORTED_MODULE_5__.bigIntToScriptNumber)[i],\n])\n .reduce((group, pair) => ({\n ...group,\n [pair[0]]: (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_3__.pushToStack)(state, pair[1].slice()),\n}), {});\n//# sourceMappingURL=push.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/push.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/signing-serialization.js": +/*!************************************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/signing-serialization.js ***! + \************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SigningSerializationFlag: () => (/* binding */ SigningSerializationFlag),\n/* harmony export */ generateSigningSerializationBCH: () => (/* binding */ generateSigningSerializationBCH),\n/* harmony export */ hashOutputs: () => (/* binding */ hashOutputs),\n/* harmony export */ hashPrevouts: () => (/* binding */ hashPrevouts),\n/* harmony export */ hashSequence: () => (/* binding */ hashSequence),\n/* harmony export */ isDefinedSigningSerializationType: () => (/* binding */ isDefinedSigningSerializationType),\n/* harmony export */ isLegacySigningSerialization: () => (/* binding */ isLegacySigningSerialization)\n/* harmony export */ });\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/numbers.js\");\n\n/**\n * A.K.A. `sighash` flags\n */\nvar SigningSerializationFlag;\n(function (SigningSerializationFlag) {\n /**\n * A.K.A. `SIGHASH_ALL`\n */\n SigningSerializationFlag[SigningSerializationFlag[\"allOutputs\"] = 1] = \"allOutputs\";\n /**\n * A.K.A `SIGHASH_NONE`\n */\n SigningSerializationFlag[SigningSerializationFlag[\"noOutputs\"] = 2] = \"noOutputs\";\n /**\n * A.K.A. `SIGHASH_SINGLE`\n */\n SigningSerializationFlag[SigningSerializationFlag[\"correspondingOutput\"] = 3] = \"correspondingOutput\";\n SigningSerializationFlag[SigningSerializationFlag[\"forkId\"] = 64] = \"forkId\";\n /**\n * A.K.A `ANYONE_CAN_PAY`\n */\n SigningSerializationFlag[SigningSerializationFlag[\"singleInput\"] = 128] = \"singleInput\";\n})(SigningSerializationFlag || (SigningSerializationFlag = {}));\nconst isDefinedSigningSerializationType = (byte) => {\n const baseType = \n // eslint-disable-next-line no-bitwise\n byte &\n // eslint-disable-next-line no-bitwise\n ~(SigningSerializationFlag.forkId | SigningSerializationFlag.singleInput);\n return (baseType >= SigningSerializationFlag.allOutputs &&\n baseType <= SigningSerializationFlag.correspondingOutput);\n};\nconst match = (type, flag) => \n// eslint-disable-next-line no-bitwise\n(type[0] & flag) !== 0;\nconst equals = (type, flag\n// eslint-disable-next-line no-bitwise\n) => (type[0] & 31 /* mask5Bits */) === flag;\nconst shouldSerializeSingleInput = (type) => match(type, SigningSerializationFlag.singleInput);\nconst shouldSerializeCorrespondingOutput = (type) => equals(type, SigningSerializationFlag.correspondingOutput);\nconst shouldSerializeNoOutputs = (type) => equals(type, SigningSerializationFlag.noOutputs);\nconst emptyHash = () => new Uint8Array(32 /* sha256HashByteLength */).fill(0);\n/**\n * Return the proper `hashPrevouts` value for a given a signing serialization\n * type.\n * @param signingSerializationType - the signing serialization type to test\n * @param transactionOutpoints - see `generateSigningSerializationBCH`\n */\nconst hashPrevouts = ({ sha256, signingSerializationType, transactionOutpoints, }) => shouldSerializeSingleInput(signingSerializationType)\n ? emptyHash()\n : sha256.hash(sha256.hash(transactionOutpoints));\n/**\n * Return the proper `hashSequence` value for a given a signing serialization\n * type.\n * @param signingSerializationType - the signing serialization type to test\n * @param transactionSequenceNumbers - see\n * `generateSigningSerializationBCH`\n */\nconst hashSequence = ({ sha256, signingSerializationType, transactionSequenceNumbers, }) => !shouldSerializeSingleInput(signingSerializationType) &&\n !shouldSerializeCorrespondingOutput(signingSerializationType) &&\n !shouldSerializeNoOutputs(signingSerializationType)\n ? sha256.hash(sha256.hash(transactionSequenceNumbers))\n : emptyHash();\n/**\n * Return the proper `hashOutputs` value for a given a signing serialization\n * type.\n * @param signingSerializationType - the signing serialization type to test\n * @param transactionOutputs - see `generateSigningSerializationBCH`\n * @param correspondingOutput - see `generateSigningSerializationBCH`\n */\nconst hashOutputs = ({ correspondingOutput, sha256, signingSerializationType, transactionOutputs, }) => !shouldSerializeCorrespondingOutput(signingSerializationType) &&\n !shouldSerializeNoOutputs(signingSerializationType)\n ? sha256.hash(sha256.hash(transactionOutputs))\n : shouldSerializeCorrespondingOutput(signingSerializationType)\n ? correspondingOutput === undefined\n ? emptyHash()\n : sha256.hash(sha256.hash(correspondingOutput))\n : emptyHash();\n/**\n * Serialize the signature-protected properties of a transaction following the\n * algorithm required by the `signingSerializationType` of a signature.\n *\n * Note: this implementation re-computes all hashes each time it is called. A\n * performance-critical application could instead use memoization to avoid\n * re-computing these values when validating many signatures within a single\n * transaction. See BIP143 for details.\n */\nconst generateSigningSerializationBCH = ({ correspondingOutput, coveredBytecode, forkId = new Uint8Array([0, 0, 0]), locktime, outpointIndex, outpointTransactionHash, outputValue, sequenceNumber, sha256, signingSerializationType, transactionOutpoints, transactionOutputs, transactionSequenceNumbers, version, }) => (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.flattenBinArray)([\n (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.numberToBinUint32LE)(version),\n hashPrevouts({ sha256, signingSerializationType, transactionOutpoints }),\n hashSequence({\n sha256,\n signingSerializationType,\n transactionSequenceNumbers,\n }),\n outpointTransactionHash.slice().reverse(),\n (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.numberToBinUint32LE)(outpointIndex),\n (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.bigIntToBitcoinVarInt)(BigInt(coveredBytecode.length)),\n coveredBytecode,\n outputValue,\n (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.numberToBinUint32LE)(sequenceNumber),\n hashOutputs({\n correspondingOutput,\n sha256,\n signingSerializationType,\n transactionOutputs,\n }),\n (0,_format_format__WEBPACK_IMPORTED_MODULE_1__.numberToBinUint32LE)(locktime),\n signingSerializationType,\n forkId,\n]);\n/**\n * @param signingSerializationType - the 32-bit number indicating the signing\n * serialization algorithm to use\n */\nconst isLegacySigningSerialization = (signingSerializationType) => {\n // eslint-disable-next-line no-bitwise, @typescript-eslint/no-magic-numbers\n const forkValue = signingSerializationType >> 8;\n // eslint-disable-next-line no-bitwise, @typescript-eslint/no-magic-numbers\n const newForkValue = (forkValue ^ 0xdead) | 0xff0000;\n // eslint-disable-next-line no-bitwise, @typescript-eslint/no-magic-numbers\n const sighashType = (newForkValue << 8) | (signingSerializationType & 0xff);\n // eslint-disable-next-line no-bitwise\n return (sighashType & SigningSerializationFlag.forkId) === 0;\n};\n//# sourceMappingURL=signing-serialization.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/signing-serialization.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/splice.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/splice.js ***! + \*********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ opSize: () => (/* binding */ opSize),\n/* harmony export */ spliceOperations: () => (/* binding */ spliceOperations)\n/* harmony export */ });\n/* harmony import */ var _combinators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./combinators */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/combinators.js\");\n/* harmony import */ var _opcodes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n\n\n\nconst opSize = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(state, (nextState, [item]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, item, (0,_types__WEBPACK_IMPORTED_MODULE_1__.bigIntToScriptNumber)(BigInt(item.length))));\nconst spliceOperations = () => ({\n [_opcodes__WEBPACK_IMPORTED_MODULE_2__.OpcodesCommon.OP_SIZE]: opSize(),\n});\n//# sourceMappingURL=splice.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/splice.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/stack.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/stack.js ***! + \********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ op2Drop: () => (/* binding */ op2Drop),\n/* harmony export */ op2Dup: () => (/* binding */ op2Dup),\n/* harmony export */ op2Over: () => (/* binding */ op2Over),\n/* harmony export */ op2Rot: () => (/* binding */ op2Rot),\n/* harmony export */ op2Swap: () => (/* binding */ op2Swap),\n/* harmony export */ op3Dup: () => (/* binding */ op3Dup),\n/* harmony export */ opDepth: () => (/* binding */ opDepth),\n/* harmony export */ opDrop: () => (/* binding */ opDrop),\n/* harmony export */ opDup: () => (/* binding */ opDup),\n/* harmony export */ opFromAltStack: () => (/* binding */ opFromAltStack),\n/* harmony export */ opIfDup: () => (/* binding */ opIfDup),\n/* harmony export */ opNip: () => (/* binding */ opNip),\n/* harmony export */ opOver: () => (/* binding */ opOver),\n/* harmony export */ opPick: () => (/* binding */ opPick),\n/* harmony export */ opRoll: () => (/* binding */ opRoll),\n/* harmony export */ opRot: () => (/* binding */ opRot),\n/* harmony export */ opSwap: () => (/* binding */ opSwap),\n/* harmony export */ opToAltStack: () => (/* binding */ opToAltStack),\n/* harmony export */ opTuck: () => (/* binding */ opTuck),\n/* harmony export */ stackOperations: () => (/* binding */ stackOperations)\n/* harmony export */ });\n/* harmony import */ var _combinators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./combinators */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/combinators.js\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./errors */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js\");\n/* harmony import */ var _opcodes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n\n\n\n\nconst opToAltStack = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(state, (nextState, [item]) => {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n nextState.alternateStack.push(item);\n return nextState;\n});\nconst opFromAltStack = () => (state) => {\n // eslint-disable-next-line functional/immutable-data\n const item = state.alternateStack.pop();\n if (item === undefined) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_1__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_1__.AuthenticationErrorCommon.emptyAlternateStack, state);\n }\n return (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(state, item);\n};\nconst op2Drop = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoStackItems)(state, (nextState) => nextState);\nconst op2Dup = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoStackItems)(state, (nextState, [a, b]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, a, b, a.slice(), b.slice()));\nconst op3Dup = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useThreeStackItems)(state, (nextState, [a, b, c]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, a, b, c, a.slice(), b.slice(), c.slice()));\nconst op2Over = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useFourStackItems)(state, (nextState, [a, b, c, d]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, a, b, c, d, a.slice(), b.slice()));\nconst op2Rot = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useSixStackItems)(state, (nextState, [a, b, c, d, e, f]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, c, d, e, f, a, b));\nconst op2Swap = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useFourStackItems)(state, (nextState, [a, b, c, d]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, c, d, a, b));\nconst opIfDup = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(state, (nextState, [item]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, ...((0,_types__WEBPACK_IMPORTED_MODULE_2__.stackItemIsTruthy)(item) ? [item, item.slice()] : [item])));\nconst opDepth = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(state, (0,_types__WEBPACK_IMPORTED_MODULE_2__.bigIntToScriptNumber)(BigInt(state.stack.length)));\nconst opDrop = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(state, (nextState) => nextState);\nconst opDup = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneStackItem)(state, (nextState, [item]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, item, item.slice()));\nconst opNip = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoStackItems)(state, (nextState, [, b]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, b));\nconst opOver = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoStackItems)(state, (nextState, [a, b]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, a, b, a.slice()));\nconst opPick = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(state, (nextState, depth) => {\n const item = nextState.stack[nextState.stack.length - 1 - Number(depth)];\n if (item === undefined) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_1__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_1__.AuthenticationErrorCommon.invalidStackIndex, state);\n }\n return (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, item.slice());\n}, { requireMinimalEncoding });\nconst opRoll = ({ requireMinimalEncoding, }) => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useOneScriptNumber)(state, (nextState, depth) => {\n const index = nextState.stack.length - 1 - Number(depth);\n if (index < 0 || index > nextState.stack.length - 1) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_1__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_1__.AuthenticationErrorCommon.invalidStackIndex, state);\n }\n // eslint-disable-next-line functional/immutable-data\n return (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, nextState.stack.splice(index, 1)[0]);\n}, { requireMinimalEncoding });\nconst opRot = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useThreeStackItems)(state, (nextState, [a, b, c]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, b, c, a));\nconst opSwap = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoStackItems)(state, (nextState, [a, b]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, b, a));\nconst opTuck = () => (state) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.useTwoStackItems)(state, (nextState, [a, b]) => (0,_combinators__WEBPACK_IMPORTED_MODULE_0__.pushToStack)(nextState, b.slice(), a, b));\nconst stackOperations = (flags) => ({\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_TOALTSTACK]: opToAltStack(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_FROMALTSTACK]: opFromAltStack(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_2DROP]: op2Drop(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_2DUP]: op2Dup(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_3DUP]: op3Dup(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_2OVER]: op2Over(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_2ROT]: op2Rot(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_2SWAP]: op2Swap(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_IFDUP]: opIfDup(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_DEPTH]: opDepth(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_DROP]: opDrop(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_DUP]: opDup(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_NIP]: opNip(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_OVER]: opOver(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_PICK]: opPick(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_ROLL]: opRoll(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_ROT]: opRot(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_SWAP]: opSwap(),\n [_opcodes__WEBPACK_IMPORTED_MODULE_3__.OpcodesCommon.OP_TUCK]: opTuck(),\n});\n//# sourceMappingURL=stack.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/stack.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/time.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/time.js ***! + \*******************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ opCheckLockTimeVerify: () => (/* binding */ opCheckLockTimeVerify),\n/* harmony export */ opCheckSequenceVerify: () => (/* binding */ opCheckSequenceVerify),\n/* harmony export */ readLocktime: () => (/* binding */ readLocktime),\n/* harmony export */ timeOperations: () => (/* binding */ timeOperations)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/errors.js\");\n/* harmony import */ var _opcodes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./opcodes */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/opcodes.js\");\n\n\n\nvar Bits;\n(function (Bits) {\n Bits[Bits[\"sequenceLocktimeDisableFlag\"] = 31] = \"sequenceLocktimeDisableFlag\";\n Bits[Bits[\"sequenceLocktimeTypeFlag\"] = 22] = \"sequenceLocktimeTypeFlag\";\n})(Bits || (Bits = {}));\nvar Constants;\n(function (Constants) {\n Constants[Constants[\"locktimeScriptNumberByteLength\"] = 5] = \"locktimeScriptNumberByteLength\";\n Constants[Constants[\"locktimeThreshold\"] = 500000000] = \"locktimeThreshold\";\n Constants[Constants[\"locktimeDisablingSequenceNumber\"] = 4294967295] = \"locktimeDisablingSequenceNumber\";\n Constants[Constants[\"sequenceLocktimeTransactionVersionMinimum\"] = 2] = \"sequenceLocktimeTransactionVersionMinimum\";\n // eslint-disable-next-line no-bitwise\n Constants[Constants[\"sequenceLocktimeDisableFlag\"] = 2147483648] = \"sequenceLocktimeDisableFlag\";\n // eslint-disable-next-line no-bitwise\n Constants[Constants[\"sequenceLocktimeTypeFlag\"] = 4194304] = \"sequenceLocktimeTypeFlag\";\n Constants[Constants[\"sequenceGranularity\"] = 9] = \"sequenceGranularity\";\n Constants[Constants[\"sequenceLocktimeMask\"] = 65535] = \"sequenceLocktimeMask\";\n})(Constants || (Constants = {}));\nconst readLocktime = (state, operation, flags) => {\n const item = state.stack[state.stack.length - 1];\n if (item === undefined) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.emptyStack, state);\n }\n const parsedLocktime = (0,_common__WEBPACK_IMPORTED_MODULE_1__.parseBytesAsScriptNumber)(item, {\n maximumScriptNumberByteLength: Constants.locktimeScriptNumberByteLength,\n requireMinimalEncoding: flags.requireMinimalEncoding,\n });\n if ((0,_common__WEBPACK_IMPORTED_MODULE_1__.isScriptNumberError)(parsedLocktime)) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.invalidScriptNumber, state);\n }\n const locktime = Number(parsedLocktime);\n if (locktime < 0) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.negativeLocktime, state);\n }\n return operation(state, locktime);\n};\nconst locktimeTypesAreCompatible = (locktime, requiredLocktime) => (locktime < Constants.locktimeThreshold &&\n requiredLocktime < Constants.locktimeThreshold) ||\n (locktime >= Constants.locktimeThreshold &&\n requiredLocktime >= Constants.locktimeThreshold);\nconst opCheckLockTimeVerify = (flags) => (state) => readLocktime(state, (nextState, requiredLocktime) => {\n if (!locktimeTypesAreCompatible(nextState.locktime, requiredLocktime)) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.incompatibleLocktimeType, nextState);\n }\n if (requiredLocktime > nextState.locktime) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.unsatisfiedLocktime, nextState);\n }\n if (nextState.sequenceNumber === Constants.locktimeDisablingSequenceNumber) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.locktimeDisabled, nextState);\n }\n return nextState;\n}, flags);\n// eslint-disable-next-line no-bitwise\nconst includesFlag = (value, flag) => (value & flag) !== 0;\nconst opCheckSequenceVerify = (flags) => (state) => readLocktime(state, \n// eslint-disable-next-line complexity\n(nextState, requiredSequence) => {\n const sequenceLocktimeDisabled = includesFlag(requiredSequence, Constants.sequenceLocktimeDisableFlag);\n if (sequenceLocktimeDisabled) {\n return nextState;\n }\n if (nextState.version < Constants.sequenceLocktimeTransactionVersionMinimum) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.checkSequenceUnavailable, nextState);\n }\n if (includesFlag(nextState.sequenceNumber, Constants.sequenceLocktimeDisableFlag)) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.unmatchedSequenceDisable, nextState);\n }\n if (includesFlag(requiredSequence, Constants.sequenceLocktimeTypeFlag) !==\n includesFlag(nextState.sequenceNumber, Constants.sequenceLocktimeTypeFlag)) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.incompatibleSequenceType, nextState);\n }\n if (\n // eslint-disable-next-line no-bitwise\n (requiredSequence & Constants.sequenceLocktimeMask) >\n // eslint-disable-next-line no-bitwise\n (nextState.sequenceNumber & Constants.sequenceLocktimeMask)) {\n return (0,_errors__WEBPACK_IMPORTED_MODULE_0__.applyError)(_errors__WEBPACK_IMPORTED_MODULE_0__.AuthenticationErrorCommon.unsatisfiedSequenceNumber, nextState);\n }\n return nextState;\n}, flags);\nconst timeOperations = (flags) => ({\n [_opcodes__WEBPACK_IMPORTED_MODULE_2__.OpcodesCommon.OP_CHECKLOCKTIMEVERIFY]: opCheckLockTimeVerify(flags),\n [_opcodes__WEBPACK_IMPORTED_MODULE_2__.OpcodesCommon.OP_CHECKSEQUENCEVERIFY]: opCheckSequenceVerify(flags),\n});\n//# sourceMappingURL=time.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/time.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js ***! + \********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ScriptNumberError: () => (/* binding */ ScriptNumberError),\n/* harmony export */ bigIntToScriptNumber: () => (/* binding */ bigIntToScriptNumber),\n/* harmony export */ booleanToScriptNumber: () => (/* binding */ booleanToScriptNumber),\n/* harmony export */ isScriptNumberError: () => (/* binding */ isScriptNumberError),\n/* harmony export */ parseBytesAsScriptNumber: () => (/* binding */ parseBytesAsScriptNumber),\n/* harmony export */ stackItemIsTruthy: () => (/* binding */ stackItemIsTruthy)\n/* harmony export */ });\nvar ScriptNumberError;\n(function (ScriptNumberError) {\n ScriptNumberError[\"outOfRange\"] = \"Failed to parse Script Number: overflows Script Number range.\";\n ScriptNumberError[\"requiresMinimal\"] = \"Failed to parse Script Number: the number is not minimally-encoded.\";\n})(ScriptNumberError || (ScriptNumberError = {}));\nconst isScriptNumberError = (value) => value === ScriptNumberError.outOfRange ||\n value === ScriptNumberError.requiresMinimal;\nconst normalMaximumScriptNumberByteLength = 4;\n/**\n * This method attempts to parse a \"Script Number\", a format with which numeric\n * values are represented on the stack. (The Satoshi implementation calls this\n * `CScriptNum`.)\n *\n * If `bytes` is a valid Script Number, this method returns the represented\n * number in BigInt format. If `bytes` is not valid, a `ScriptNumberError` is\n * returned.\n *\n * All common operations accepting numeric parameters or pushing numeric values\n * to the stack currently use the Script Number format. The binary format of\n * numbers wouldn't be important if they could only be operated on by arithmetic\n * operators, but since the results of these operations may become input to\n * other operations (e.g. hashing), the specific representation is consensus-\n * critical.\n *\n * Parsing of Script Numbers is limited to 4 bytes (with the exception of\n * OP_CHECKLOCKTIMEVERIFY and OP_CHECKSEQUENCEVERIFY, which read up to 5-bytes).\n * The bytes are read as a signed integer (for 32-bits: inclusive range from\n * -2^31 + 1 to 2^31 - 1) in little-endian byte order. Script Numbers must\n * further be encoded as minimally as possible (no zero-padding). See code/tests\n * for details.\n *\n * @remarks\n * Operators may push numeric results to the stack which exceed the current\n * 4-byte length limit of Script Numbers. While these stack elements would\n * otherwise be valid Script Numbers, because of the 4-byte length limit, they\n * can only be used as non-numeric values in later operations.\n *\n * Most other implementations currently parse Script Numbers into 64-bit\n * integers to operate on them (rather than integers of arbitrary size like\n * BigInt). Currently, no operators are at risk of overflowing 64-bit integers\n * given 32-bit integer inputs, but future operators may require additional\n * refactoring in those implementations.\n *\n * @param bytes - a Uint8Array from the stack\n * @param requireMinimalEncoding - if true, this method returns an error when\n * parsing non-minimally encoded Script Numbers\n * @param maximumScriptNumberByteLength - the maximum valid number of bytes\n */\n// eslint-disable-next-line complexity\nconst parseBytesAsScriptNumber = (bytes, { maximumScriptNumberByteLength = normalMaximumScriptNumberByteLength, requireMinimalEncoding = true, } = {\n maximumScriptNumberByteLength: normalMaximumScriptNumberByteLength,\n requireMinimalEncoding: true,\n}) => {\n if (bytes.length === 0) {\n return BigInt(0);\n }\n if (bytes.length > maximumScriptNumberByteLength) {\n return ScriptNumberError.outOfRange;\n }\n const mostSignificantByte = bytes[bytes.length - 1];\n const secondMostSignificantByte = bytes[bytes.length - 1 - 1];\n const allButTheSignBit = 127;\n const justTheSignBit = 128;\n if (requireMinimalEncoding &&\n // eslint-disable-next-line no-bitwise\n (mostSignificantByte & allButTheSignBit) === 0 &&\n // eslint-disable-next-line no-bitwise\n (bytes.length <= 1 || (secondMostSignificantByte & justTheSignBit) === 0)) {\n return ScriptNumberError.requiresMinimal;\n }\n const bitsPerByte = 8;\n const signFlippingByte = 0x80;\n // eslint-disable-next-line functional/no-let\n let result = BigInt(0);\n // eslint-disable-next-line functional/no-let, functional/no-loop-statement, no-plusplus\n for (let byte = 0; byte < bytes.length; byte++) {\n // eslint-disable-next-line functional/no-expression-statement, no-bitwise\n result |= BigInt(bytes[byte]) << BigInt(byte * bitsPerByte);\n }\n /* eslint-disable no-bitwise */\n const isNegative = (bytes[bytes.length - 1] & signFlippingByte) !== 0;\n return isNegative\n ? -(result &\n ~(BigInt(signFlippingByte) << BigInt(bitsPerByte * (bytes.length - 1))))\n : result;\n /* eslint-enable no-bitwise */\n};\n/**\n * Convert a BigInt into the \"Script Number\" format. See\n * `parseBytesAsScriptNumber` for more information.\n *\n * @param integer - the BigInt to encode as a Script Number\n */\n// eslint-disable-next-line complexity\nconst bigIntToScriptNumber = (integer) => {\n if (integer === BigInt(0)) {\n return new Uint8Array();\n }\n const bytes = [];\n const isNegative = integer < 0;\n const byteStates = 0xff;\n const bitsPerByte = 8;\n // eslint-disable-next-line functional/no-let\n let remaining = isNegative ? -integer : integer;\n // eslint-disable-next-line functional/no-loop-statement\n while (remaining > 0) {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data, no-bitwise\n bytes.push(Number(remaining & BigInt(byteStates)));\n // eslint-disable-next-line functional/no-expression-statement, no-bitwise\n remaining >>= BigInt(bitsPerByte);\n }\n const signFlippingByte = 0x80;\n // eslint-disable-next-line no-bitwise, functional/no-conditional-statement\n if ((bytes[bytes.length - 1] & signFlippingByte) > 0) {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n bytes.push(isNegative ? signFlippingByte : 0x00);\n // eslint-disable-next-line functional/no-conditional-statement\n }\n else if (isNegative) {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data, no-bitwise\n bytes[bytes.length - 1] |= signFlippingByte;\n }\n return new Uint8Array(bytes);\n};\n/**\n * Returns true if the provided stack item is \"truthy\" in the sense required\n * by several operations (anything but zero and \"negative zero\").\n *\n * The Satoshi implementation calls this method `CastToBool`.\n *\n * @param item - the stack item to check for truthiness\n */\nconst stackItemIsTruthy = (item) => {\n const signFlippingByte = 0x80;\n // eslint-disable-next-line functional/no-let, functional/no-loop-statement, no-plusplus\n for (let i = 0; i < item.length; i++) {\n if (item[i] !== 0) {\n if (i === item.length - 1 && item[i] === signFlippingByte) {\n return false;\n }\n return true;\n }\n }\n return false;\n};\n/**\n * Convert a boolean into Script Number format (the type used to express\n * boolean values emitted by several operations).\n *\n * @param value - the boolean value to convert\n */\nconst booleanToScriptNumber = (value) => value ? bigIntToScriptNumber(BigInt(1)) : bigIntToScriptNumber(BigInt(0));\n//# sourceMappingURL=types.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/types.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-types.js": +/*!******************************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-types.js ***! + \******************************************************************************************************/ +/***/ (() => { + +eval("//# sourceMappingURL=instruction-sets-types.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-types.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-utils.js": +/*!******************************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-utils.js ***! + \******************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ assembleBytecode: () => (/* binding */ assembleBytecode),\n/* harmony export */ assembleBytecodeBCH: () => (/* binding */ assembleBytecodeBCH),\n/* harmony export */ assembleBytecodeBTC: () => (/* binding */ assembleBytecodeBTC),\n/* harmony export */ authenticationInstructionIsMalformed: () => (/* binding */ authenticationInstructionIsMalformed),\n/* harmony export */ authenticationInstructionsAreMalformed: () => (/* binding */ authenticationInstructionsAreMalformed),\n/* harmony export */ authenticationInstructionsAreNotMalformed: () => (/* binding */ authenticationInstructionsAreNotMalformed),\n/* harmony export */ disassembleAuthenticationInstruction: () => (/* binding */ disassembleAuthenticationInstruction),\n/* harmony export */ disassembleBytecode: () => (/* binding */ disassembleBytecode),\n/* harmony export */ disassembleBytecodeBCH: () => (/* binding */ disassembleBytecodeBCH),\n/* harmony export */ disassembleBytecodeBTC: () => (/* binding */ disassembleBytecodeBTC),\n/* harmony export */ disassembleParsedAuthenticationInstruction: () => (/* binding */ disassembleParsedAuthenticationInstruction),\n/* harmony export */ disassembleParsedAuthenticationInstructionMalformed: () => (/* binding */ disassembleParsedAuthenticationInstructionMalformed),\n/* harmony export */ disassembleParsedAuthenticationInstructions: () => (/* binding */ disassembleParsedAuthenticationInstructions),\n/* harmony export */ generateBytecodeMap: () => (/* binding */ generateBytecodeMap),\n/* harmony export */ lengthBytesForPushOpcode: () => (/* binding */ lengthBytesForPushOpcode),\n/* harmony export */ parseBytecode: () => (/* binding */ parseBytecode),\n/* harmony export */ readAuthenticationInstruction: () => (/* binding */ readAuthenticationInstruction),\n/* harmony export */ serializeAuthenticationInstruction: () => (/* binding */ serializeAuthenticationInstruction),\n/* harmony export */ serializeAuthenticationInstructions: () => (/* binding */ serializeAuthenticationInstructions),\n/* harmony export */ serializeParsedAuthenticationInstruction: () => (/* binding */ serializeParsedAuthenticationInstruction),\n/* harmony export */ serializeParsedAuthenticationInstructionMalformed: () => (/* binding */ serializeParsedAuthenticationInstructionMalformed),\n/* harmony export */ serializeParsedAuthenticationInstructions: () => (/* binding */ serializeParsedAuthenticationInstructions)\n/* harmony export */ });\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/numbers.js\");\n/* harmony import */ var _template_compiler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../template/compiler */ \"./node_modules/@bitauth/libauth/build/module/lib/template/compiler.js\");\n/* harmony import */ var _bch_bch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bch/bch */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch-opcodes.js\");\n/* harmony import */ var _btc_btc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./btc/btc */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/btc/btc.js\");\n\n\n\n\n/**\n * A type-guard which checks if the provided instruction is malformed.\n * @param instruction - the instruction to check\n */\nconst authenticationInstructionIsMalformed = (instruction) => 'malformed' in instruction;\n/**\n * A type-guard which checks if the final instruction in the provided array of\n * instructions is malformed. (Only the final instruction can be malformed.)\n * @param instruction - the array of instructions to check\n */\nconst authenticationInstructionsAreMalformed = (instructions) => instructions.length > 0 &&\n authenticationInstructionIsMalformed(instructions[instructions.length - 1]);\n/**\n * A type-guard which confirms that the final instruction in the provided array\n * is not malformed. (Only the final instruction can be malformed.)\n * @param instruction - the array of instructions to check\n */\nconst authenticationInstructionsAreNotMalformed = (instructions) => !authenticationInstructionsAreMalformed(instructions);\nvar CommonPushOpcodes;\n(function (CommonPushOpcodes) {\n CommonPushOpcodes[CommonPushOpcodes[\"OP_0\"] = 0] = \"OP_0\";\n CommonPushOpcodes[CommonPushOpcodes[\"OP_PUSHDATA_1\"] = 76] = \"OP_PUSHDATA_1\";\n CommonPushOpcodes[CommonPushOpcodes[\"OP_PUSHDATA_2\"] = 77] = \"OP_PUSHDATA_2\";\n CommonPushOpcodes[CommonPushOpcodes[\"OP_PUSHDATA_4\"] = 78] = \"OP_PUSHDATA_4\";\n})(CommonPushOpcodes || (CommonPushOpcodes = {}));\nconst uint8Bytes = 1;\nconst uint16Bytes = 2;\nconst uint32Bytes = 4;\nconst readLittleEndianNumber = (script, index, length) => {\n const view = new DataView(script.buffer, index, length);\n const readAsLittleEndian = true;\n return length === uint8Bytes\n ? view.getUint8(0)\n : length === uint16Bytes\n ? view.getUint16(0, readAsLittleEndian)\n : view.getUint32(0, readAsLittleEndian);\n};\n/**\n * Returns the number of bytes used to indicate the length of the push in this\n * operation.\n * @param opcode - an opcode between 0x00 and 0x4e\n */\nconst lengthBytesForPushOpcode = (opcode) => opcode < CommonPushOpcodes.OP_PUSHDATA_1\n ? 0\n : opcode === CommonPushOpcodes.OP_PUSHDATA_1\n ? uint8Bytes\n : opcode === CommonPushOpcodes.OP_PUSHDATA_2\n ? uint16Bytes\n : uint32Bytes;\n/**\n * Parse one instruction from the provided script.\n *\n * Returns an object with an `instruction` referencing a\n * `ParsedAuthenticationInstruction`, and a `nextIndex` indicating the next\n * index from which to read. If the next index is greater than or equal to the\n * length of the script, the script has been fully parsed.\n *\n * The final `ParsedAuthenticationInstruction` from a serialized script may be\n * malformed if 1) the final operation is a push and 2) too few bytes remain for\n * the push operation to complete.\n *\n * @param script - the script from which to read the next instruction\n * @param index - the offset from which to begin reading\n */\n// eslint-disable-next-line complexity\nconst readAuthenticationInstruction = (script, index) => {\n const opcode = script[index];\n if (opcode > CommonPushOpcodes.OP_PUSHDATA_4) {\n return {\n instruction: {\n opcode: opcode,\n },\n nextIndex: index + 1,\n };\n }\n const lengthBytes = lengthBytesForPushOpcode(opcode);\n if (lengthBytes !== 0 && index + lengthBytes >= script.length) {\n const sliceStart = index + 1;\n const sliceEnd = sliceStart + lengthBytes;\n return {\n instruction: {\n expectedLengthBytes: lengthBytes,\n length: script.slice(sliceStart, sliceEnd),\n malformed: true,\n opcode: opcode,\n },\n nextIndex: sliceEnd,\n };\n }\n const dataBytes = lengthBytes === 0\n ? opcode\n : readLittleEndianNumber(script, index + 1, lengthBytes);\n const dataStart = index + 1 + lengthBytes;\n const dataEnd = dataStart + dataBytes;\n return {\n instruction: {\n data: script.slice(dataStart, dataEnd),\n ...(dataEnd > script.length\n ? {\n expectedDataBytes: dataEnd - dataStart,\n malformed: true,\n }\n : undefined),\n opcode: opcode,\n },\n nextIndex: dataEnd,\n };\n};\n/**\n * Parse authentication bytecode (`lockingBytecode` or `unlockingBytecode`)\n * into `ParsedAuthenticationInstructions`. The method\n * `authenticationInstructionsAreMalformed` can be used to check if these\n * instructions include a malformed instruction. If not, they are valid\n * `AuthenticationInstructions`.\n *\n * This implementation is common to most bitcoin forks, but the type parameter\n * can be used to strongly type the resulting instructions. For example:\n *\n * ```js\n * const instructions = parseAuthenticationBytecode(script);\n * ```\n *\n * @param script - the serialized script to parse\n */\nconst parseBytecode = (script) => {\n const instructions = [];\n // eslint-disable-next-line functional/no-let\n let i = 0;\n // eslint-disable-next-line functional/no-loop-statement\n while (i < script.length) {\n const { instruction, nextIndex } = readAuthenticationInstruction(script, i);\n // eslint-disable-next-line functional/no-expression-statement\n i = nextIndex;\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n instructions.push(instruction);\n }\n return instructions;\n};\n/**\n * OP_0 is the only single-word push. All other push instructions will\n * disassemble to multiple ASM words. (OP_1-OP_16 are handled like normal\n * operations.)\n */\nconst isMultiWordPush = (opcode) => opcode !== CommonPushOpcodes.OP_0;\nconst formatAsmPushHex = (data) => data.length > 0 ? `0x${(0,_format_format__WEBPACK_IMPORTED_MODULE_0__.binToHex)(data)}` : '';\nconst formatMissingBytesAsm = (missing) => `[missing ${missing} byte${missing === 1 ? '' : 's'}]`;\nconst hasMalformedLength = (instruction) => 'length' in instruction;\nconst isPushData = (pushOpcode) => pushOpcode >= CommonPushOpcodes.OP_PUSHDATA_1;\n/**\n * Disassemble a malformed authentication instruction into a string description.\n * @param opcodes - a mapping of possible opcodes to their string representation\n * @param instruction - the malformed instruction to disassemble\n */\nconst disassembleParsedAuthenticationInstructionMalformed = (opcodes, instruction) => `${opcodes[instruction.opcode]} ${hasMalformedLength(instruction)\n ? `${formatAsmPushHex(instruction.length)}${formatMissingBytesAsm(instruction.expectedLengthBytes - instruction.length.length)}`\n : `${isPushData(instruction.opcode)\n ? `${instruction.expectedDataBytes} `\n : ''}${formatAsmPushHex(instruction.data)}${formatMissingBytesAsm(instruction.expectedDataBytes - instruction.data.length)}`}`;\n/**\n * Disassemble a properly-formed authentication instruction into a string\n * description.\n * @param opcodes - a mapping of possible opcodes to their string representation\n * @param instruction - the instruction to disassemble\n */\nconst disassembleAuthenticationInstruction = (opcodes, instruction) => `${opcodes[instruction.opcode]}${'data' in instruction &&\n isMultiWordPush(instruction.opcode)\n ? ` ${isPushData(instruction.opcode)\n ? `${instruction.data.length} `\n : ''}${formatAsmPushHex(instruction.data)}`\n : ''}`;\n/**\n * Disassemble a single `ParsedAuthenticationInstruction` (includes potentially\n * malformed instructions) into its ASM representation.\n *\n * @param script - the instruction to disassemble\n */\nconst disassembleParsedAuthenticationInstruction = (opcodes, instruction) => authenticationInstructionIsMalformed(instruction)\n ? disassembleParsedAuthenticationInstructionMalformed(opcodes, instruction)\n : disassembleAuthenticationInstruction(opcodes, instruction);\n/**\n * Disassemble an array of `ParsedAuthenticationInstructions` (including\n * potentially malformed instructions) into its ASM representation.\n *\n * @param script - the array of instructions to disassemble\n */\nconst disassembleParsedAuthenticationInstructions = (opcodes, instructions) => instructions\n .map((instruction) => disassembleParsedAuthenticationInstruction(opcodes, instruction))\n .join(' ');\n/**\n * Disassemble authentication bytecode into a lossless ASM representation. (All\n * push operations are represented with the same opcodes used in the bytecode,\n * even when non-minimally encoded.)\n *\n * @param opcodes - the set to use when determining the name of opcodes, e.g. `OpcodesBCH`\n * @param bytecode - the authentication bytecode to disassemble\n */\nconst disassembleBytecode = (opcodes, bytecode) => disassembleParsedAuthenticationInstructions(opcodes, parseBytecode(bytecode));\n/**\n * Disassemble BCH authentication bytecode into its ASM representation.\n * @param bytecode - the authentication bytecode to disassemble\n */\nconst disassembleBytecodeBCH = (bytecode) => disassembleParsedAuthenticationInstructions(_bch_bch__WEBPACK_IMPORTED_MODULE_1__.OpcodesBCH, parseBytecode(bytecode));\n/**\n * Disassemble BTC authentication bytecode into its ASM representation.\n * @param bytecode - the authentication bytecode to disassemble\n */\nconst disassembleBytecodeBTC = (bytecode) => disassembleParsedAuthenticationInstructions(_btc_btc__WEBPACK_IMPORTED_MODULE_2__.OpcodesBTC, parseBytecode(bytecode));\n/**\n * Create an object where each key is an opcode identifier and each value is\n * the bytecode value (`Uint8Array`) it represents.\n * @param opcodes - An opcode enum, e.g. `OpcodesBCH`\n */\nconst generateBytecodeMap = (opcodes) => Object.entries(opcodes)\n .filter((entry) => typeof entry[1] === 'number')\n .reduce((identifiers, pair) => ({\n ...identifiers,\n [pair[0]]: Uint8Array.of(pair[1]),\n}), {});\n/**\n * Re-assemble a string of disassembled bytecode (see `disassembleBytecode`).\n *\n * @param opcodes - a mapping of opcodes to their respective Uint8Array\n * representation\n * @param disassembledBytecode - the disassembled bytecode to re-assemble\n */\nconst assembleBytecode = (opcodes, disassembledBytecode) => {\n const environment = {\n opcodes,\n scripts: { asm: disassembledBytecode },\n };\n return (0,_template_compiler__WEBPACK_IMPORTED_MODULE_3__.createCompilerCommonSynchronous)(environment).generateBytecode('asm', {});\n};\n/**\n * Re-assemble a string of disassembled BCH bytecode (see\n * `disassembleBytecodeBCH`).\n *\n * Note, this method performs automatic minimization of push instructions.\n *\n * @param disassembledBytecode - the disassembled BCH bytecode to re-assemble\n */\nconst assembleBytecodeBCH = (disassembledBytecode) => assembleBytecode(generateBytecodeMap(_bch_bch__WEBPACK_IMPORTED_MODULE_1__.OpcodesBCH), disassembledBytecode);\n/**\n * Re-assemble a string of disassembled BCH bytecode (see\n * `disassembleBytecodeBTC`).\n *\n * Note, this method performs automatic minimization of push instructions.\n *\n * @param disassembledBytecode - the disassembled BTC bytecode to re-assemble\n */\nconst assembleBytecodeBTC = (disassembledBytecode) => assembleBytecode(generateBytecodeMap(_btc_btc__WEBPACK_IMPORTED_MODULE_2__.OpcodesBTC), disassembledBytecode);\nconst getInstructionLengthBytes = (instruction) => {\n const opcode = instruction.opcode;\n const expectedLength = lengthBytesForPushOpcode(opcode);\n return expectedLength === uint8Bytes\n ? Uint8Array.of(instruction.data.length)\n : expectedLength === uint16Bytes\n ? (0,_format_format__WEBPACK_IMPORTED_MODULE_4__.numberToBinUint16LE)(instruction.data.length)\n : (0,_format_format__WEBPACK_IMPORTED_MODULE_4__.numberToBinUint32LE)(instruction.data.length);\n};\n/**\n * Re-serialize a valid authentication instruction.\n * @param instruction - the instruction to serialize\n */\nconst serializeAuthenticationInstruction = (instruction) => Uint8Array.from([\n instruction.opcode,\n ...('data' in instruction\n ? [\n ...(isPushData(instruction.opcode)\n ? getInstructionLengthBytes(instruction)\n : []),\n ...instruction.data,\n ]\n : []),\n]);\n/**\n * Re-serialize a malformed authentication instruction.\n * @param instruction - the malformed instruction to serialize\n */\nconst serializeParsedAuthenticationInstructionMalformed = (instruction) => {\n const opcode = instruction.opcode;\n if (hasMalformedLength(instruction)) {\n return Uint8Array.from([opcode, ...instruction.length]);\n }\n if (isPushData(opcode)) {\n return Uint8Array.from([\n opcode,\n ...(opcode === CommonPushOpcodes.OP_PUSHDATA_1\n ? Uint8Array.of(instruction.expectedDataBytes)\n : opcode === CommonPushOpcodes.OP_PUSHDATA_2\n ? (0,_format_format__WEBPACK_IMPORTED_MODULE_4__.numberToBinUint16LE)(instruction.expectedDataBytes)\n : (0,_format_format__WEBPACK_IMPORTED_MODULE_4__.numberToBinUint32LE)(instruction.expectedDataBytes)),\n ...instruction.data,\n ]);\n }\n return Uint8Array.from([opcode, ...instruction.data]);\n};\n/**\n * Re-serialize a potentially-malformed authentication instruction.\n * @param instruction - the potentially-malformed instruction to serialize\n */\nconst serializeParsedAuthenticationInstruction = (instruction) => authenticationInstructionIsMalformed(instruction)\n ? serializeParsedAuthenticationInstructionMalformed(instruction)\n : serializeAuthenticationInstruction(instruction);\n/**\n * Re-serialize an array of valid authentication instructions.\n * @param instructions - the array of valid instructions to serialize\n */\nconst serializeAuthenticationInstructions = (instructions) => (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.flattenBinArray)(instructions.map(serializeAuthenticationInstruction));\n/**\n * Re-serialize an array of potentially-malformed authentication instructions.\n * @param instructions - the array of instructions to serialize\n */\nconst serializeParsedAuthenticationInstructions = (instructions) => (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.flattenBinArray)(instructions.map(serializeParsedAuthenticationInstruction));\n//# sourceMappingURL=instruction-sets-utils.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-utils.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets.js ***! + \************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AuthenticationErrorBCH: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.AuthenticationErrorBCH),\n/* harmony export */ AuthenticationErrorCommon: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.AuthenticationErrorCommon),\n/* harmony export */ ConsensusBCH: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.ConsensusBCH),\n/* harmony export */ ConsensusCommon: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.ConsensusCommon),\n/* harmony export */ InstructionSetBCH: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.InstructionSetBCH),\n/* harmony export */ OpcodeAlternateNamesBCH: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.OpcodeAlternateNamesBCH),\n/* harmony export */ OpcodeDescriptionsBCH: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.OpcodeDescriptionsBCH),\n/* harmony export */ OpcodeDescriptionsCommon: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.OpcodeDescriptionsCommon),\n/* harmony export */ OpcodeDescriptionsUniqueBCH: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.OpcodeDescriptionsUniqueBCH),\n/* harmony export */ OpcodesBCH: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.OpcodesBCH),\n/* harmony export */ OpcodesBTC: () => (/* reexport safe */ _btc_btc__WEBPACK_IMPORTED_MODULE_0__.OpcodesBTC),\n/* harmony export */ OpcodesCommon: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.OpcodesCommon),\n/* harmony export */ PushOperationConstants: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.PushOperationConstants),\n/* harmony export */ ScriptNumberError: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.ScriptNumberError),\n/* harmony export */ SigningSerializationFlag: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.SigningSerializationFlag),\n/* harmony export */ applyError: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.applyError),\n/* harmony export */ arithmeticOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.arithmeticOperations),\n/* harmony export */ assembleBitcoinABCScript: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.assembleBitcoinABCScript),\n/* harmony export */ assembleBytecode: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.assembleBytecode),\n/* harmony export */ assembleBytecodeBCH: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.assembleBytecodeBCH),\n/* harmony export */ assembleBytecodeBTC: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.assembleBytecodeBTC),\n/* harmony export */ authenticationInstructionIsMalformed: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.authenticationInstructionIsMalformed),\n/* harmony export */ authenticationInstructionsAreMalformed: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.authenticationInstructionsAreMalformed),\n/* harmony export */ authenticationInstructionsAreNotMalformed: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.authenticationInstructionsAreNotMalformed),\n/* harmony export */ bigIntToScriptNumber: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.bigIntToScriptNumber),\n/* harmony export */ bitcoinABCOpcodes: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.bitcoinABCOpcodes),\n/* harmony export */ bitcoinCashOperations: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.bitcoinCashOperations),\n/* harmony export */ bitwiseOperation: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.bitwiseOperation),\n/* harmony export */ bitwiseOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.bitwiseOperations),\n/* harmony export */ booleanToScriptNumber: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.booleanToScriptNumber),\n/* harmony export */ checkLimitsCommon: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.checkLimitsCommon),\n/* harmony export */ cloneAuthenticationProgramStateCommon: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.cloneAuthenticationProgramStateCommon),\n/* harmony export */ cloneStack: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.cloneStack),\n/* harmony export */ combineOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.combineOperations),\n/* harmony export */ commonOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.commonOperations),\n/* harmony export */ conditionalFlowControlOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.conditionalFlowControlOperations),\n/* harmony export */ conditionallyEvaluate: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.conditionallyEvaluate),\n/* harmony export */ createAuthenticationProgramInternalStateCommon: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.createAuthenticationProgramInternalStateCommon),\n/* harmony export */ createAuthenticationProgramStateCommon: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.createAuthenticationProgramStateCommon),\n/* harmony export */ createAuthenticationProgramStateCommonEmpty: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.createAuthenticationProgramStateCommonEmpty),\n/* harmony export */ createInstructionSetBCH: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.createInstructionSetBCH),\n/* harmony export */ createTestAuthenticationProgramBCH: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.createTestAuthenticationProgramBCH),\n/* harmony export */ createTransactionContextCommon: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.createTransactionContextCommon),\n/* harmony export */ createTransactionContextCommonEmpty: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.createTransactionContextCommonEmpty),\n/* harmony export */ createTransactionContextCommonTesting: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.createTransactionContextCommonTesting),\n/* harmony export */ cryptoOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.cryptoOperations),\n/* harmony export */ decodeBitcoinSignature: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.decodeBitcoinSignature),\n/* harmony export */ disabledOperation: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.disabledOperation),\n/* harmony export */ disabledOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.disabledOperations),\n/* harmony export */ disassembleAuthenticationInstruction: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.disassembleAuthenticationInstruction),\n/* harmony export */ disassembleBytecode: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.disassembleBytecode),\n/* harmony export */ disassembleBytecodeBCH: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.disassembleBytecodeBCH),\n/* harmony export */ disassembleBytecodeBTC: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.disassembleBytecodeBTC),\n/* harmony export */ disassembleParsedAuthenticationInstruction: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.disassembleParsedAuthenticationInstruction),\n/* harmony export */ disassembleParsedAuthenticationInstructionMalformed: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.disassembleParsedAuthenticationInstructionMalformed),\n/* harmony export */ disassembleParsedAuthenticationInstructions: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.disassembleParsedAuthenticationInstructions),\n/* harmony export */ encodeDataPush: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.encodeDataPush),\n/* harmony export */ generateBytecodeMap: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.generateBytecodeMap),\n/* harmony export */ generateSigningSerializationBCH: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.generateSigningSerializationBCH),\n/* harmony export */ getFlagsForInstructionSetBCH: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.getFlagsForInstructionSetBCH),\n/* harmony export */ hashOutputs: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.hashOutputs),\n/* harmony export */ hashPrevouts: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.hashPrevouts),\n/* harmony export */ hashSequence: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.hashSequence),\n/* harmony export */ incrementOperationCount: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.incrementOperationCount),\n/* harmony export */ instantiateVirtualMachineBCH: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.instantiateVirtualMachineBCH),\n/* harmony export */ instructionSetBCHCurrentStrict: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.instructionSetBCHCurrentStrict),\n/* harmony export */ isDefinedSigningSerializationType: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.isDefinedSigningSerializationType),\n/* harmony export */ isLegacySigningSerialization: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.isLegacySigningSerialization),\n/* harmony export */ isMinimalDataPush: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.isMinimalDataPush),\n/* harmony export */ isPayToScriptHash: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.isPayToScriptHash),\n/* harmony export */ isScriptNumberError: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.isScriptNumberError),\n/* harmony export */ isValidCompressedPublicKeyEncoding: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.isValidCompressedPublicKeyEncoding),\n/* harmony export */ isValidPublicKeyEncoding: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.isValidPublicKeyEncoding),\n/* harmony export */ isValidSignatureEncodingBCHRaw: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.isValidSignatureEncodingBCHRaw),\n/* harmony export */ isValidSignatureEncodingBCHTransaction: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.isValidSignatureEncodingBCHTransaction),\n/* harmony export */ isValidSignatureEncodingDER: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.isValidSignatureEncodingDER),\n/* harmony export */ isValidUncompressedPublicKeyEncoding: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.isValidUncompressedPublicKeyEncoding),\n/* harmony export */ isWitnessProgram: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.isWitnessProgram),\n/* harmony export */ lengthBytesForPushOpcode: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.lengthBytesForPushOpcode),\n/* harmony export */ mapOverOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.mapOverOperations),\n/* harmony export */ nonOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.nonOperations),\n/* harmony export */ op0NotEqual: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.op0NotEqual),\n/* harmony export */ op1Add: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.op1Add),\n/* harmony export */ op1Sub: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.op1Sub),\n/* harmony export */ op2Drop: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.op2Drop),\n/* harmony export */ op2Dup: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.op2Dup),\n/* harmony export */ op2Over: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.op2Over),\n/* harmony export */ op2Rot: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.op2Rot),\n/* harmony export */ op2Swap: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.op2Swap),\n/* harmony export */ op3Dup: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.op3Dup),\n/* harmony export */ opAbs: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opAbs),\n/* harmony export */ opAdd: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opAdd),\n/* harmony export */ opAnd: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.opAnd),\n/* harmony export */ opBin2Num: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.opBin2Num),\n/* harmony export */ opBoolAnd: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opBoolAnd),\n/* harmony export */ opBoolOr: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opBoolOr),\n/* harmony export */ opCat: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.opCat),\n/* harmony export */ opCheckDataSig: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.opCheckDataSig),\n/* harmony export */ opCheckDataSigVerify: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.opCheckDataSigVerify),\n/* harmony export */ opCheckLockTimeVerify: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opCheckLockTimeVerify),\n/* harmony export */ opCheckMultiSig: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opCheckMultiSig),\n/* harmony export */ opCheckMultiSigVerify: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opCheckMultiSigVerify),\n/* harmony export */ opCheckSequenceVerify: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opCheckSequenceVerify),\n/* harmony export */ opCheckSig: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opCheckSig),\n/* harmony export */ opCheckSigVerify: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opCheckSigVerify),\n/* harmony export */ opCodeSeparator: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opCodeSeparator),\n/* harmony export */ opDepth: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opDepth),\n/* harmony export */ opDiv: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.opDiv),\n/* harmony export */ opDrop: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opDrop),\n/* harmony export */ opDup: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opDup),\n/* harmony export */ opElse: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opElse),\n/* harmony export */ opEndIf: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opEndIf),\n/* harmony export */ opEqual: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opEqual),\n/* harmony export */ opEqualVerify: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opEqualVerify),\n/* harmony export */ opFromAltStack: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opFromAltStack),\n/* harmony export */ opGreaterThan: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opGreaterThan),\n/* harmony export */ opGreaterThanOrEqual: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opGreaterThanOrEqual),\n/* harmony export */ opHash160: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opHash160),\n/* harmony export */ opHash256: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opHash256),\n/* harmony export */ opIf: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opIf),\n/* harmony export */ opIfDup: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opIfDup),\n/* harmony export */ opLessThan: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opLessThan),\n/* harmony export */ opLessThanOrEqual: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opLessThanOrEqual),\n/* harmony export */ opMax: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opMax),\n/* harmony export */ opMin: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opMin),\n/* harmony export */ opMod: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.opMod),\n/* harmony export */ opNegate: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opNegate),\n/* harmony export */ opNip: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opNip),\n/* harmony export */ opNop: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opNop),\n/* harmony export */ opNot: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opNot),\n/* harmony export */ opNotIf: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opNotIf),\n/* harmony export */ opNum2Bin: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.opNum2Bin),\n/* harmony export */ opNumEqual: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opNumEqual),\n/* harmony export */ opNumEqualVerify: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opNumEqualVerify),\n/* harmony export */ opNumNotEqual: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opNumNotEqual),\n/* harmony export */ opOr: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.opOr),\n/* harmony export */ opOver: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opOver),\n/* harmony export */ opPick: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opPick),\n/* harmony export */ opReturn: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opReturn),\n/* harmony export */ opReverseBytes: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.opReverseBytes),\n/* harmony export */ opRipemd160: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opRipemd160),\n/* harmony export */ opRoll: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opRoll),\n/* harmony export */ opRot: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opRot),\n/* harmony export */ opSha1: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opSha1),\n/* harmony export */ opSha256: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opSha256),\n/* harmony export */ opSize: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opSize),\n/* harmony export */ opSplit: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.opSplit),\n/* harmony export */ opSub: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opSub),\n/* harmony export */ opSwap: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opSwap),\n/* harmony export */ opToAltStack: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opToAltStack),\n/* harmony export */ opTuck: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opTuck),\n/* harmony export */ opVerify: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opVerify),\n/* harmony export */ opWithin: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.opWithin),\n/* harmony export */ opXor: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.opXor),\n/* harmony export */ padMinimallyEncodedScriptNumber: () => (/* reexport safe */ _bch_bch__WEBPACK_IMPORTED_MODULE_1__.padMinimallyEncodedScriptNumber),\n/* harmony export */ parseBytecode: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.parseBytecode),\n/* harmony export */ parseBytesAsScriptNumber: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.parseBytesAsScriptNumber),\n/* harmony export */ pushByteOpcodes: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.pushByteOpcodes),\n/* harmony export */ pushNumberOpcodes: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.pushNumberOpcodes),\n/* harmony export */ pushNumberOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.pushNumberOperations),\n/* harmony export */ pushOperation: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.pushOperation),\n/* harmony export */ pushOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.pushOperations),\n/* harmony export */ pushToStack: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.pushToStack),\n/* harmony export */ readAuthenticationInstruction: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.readAuthenticationInstruction),\n/* harmony export */ readLocktime: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.readLocktime),\n/* harmony export */ reservedOperation: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.reservedOperation),\n/* harmony export */ serializeAuthenticationInstruction: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.serializeAuthenticationInstruction),\n/* harmony export */ serializeAuthenticationInstructions: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.serializeAuthenticationInstructions),\n/* harmony export */ serializeParsedAuthenticationInstruction: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.serializeParsedAuthenticationInstruction),\n/* harmony export */ serializeParsedAuthenticationInstructionMalformed: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.serializeParsedAuthenticationInstructionMalformed),\n/* harmony export */ serializeParsedAuthenticationInstructions: () => (/* reexport safe */ _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__.serializeParsedAuthenticationInstructions),\n/* harmony export */ spliceOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.spliceOperations),\n/* harmony export */ stackItemIsTruthy: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.stackItemIsTruthy),\n/* harmony export */ stackOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.stackOperations),\n/* harmony export */ timeOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.timeOperations),\n/* harmony export */ unconditionalFlowControlOperations: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.unconditionalFlowControlOperations),\n/* harmony export */ undefinedOperation: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.undefinedOperation),\n/* harmony export */ useFourStackItems: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.useFourStackItems),\n/* harmony export */ useOneScriptNumber: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.useOneScriptNumber),\n/* harmony export */ useOneStackItem: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.useOneStackItem),\n/* harmony export */ useSixStackItems: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.useSixStackItems),\n/* harmony export */ useThreeScriptNumbers: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.useThreeScriptNumbers),\n/* harmony export */ useThreeStackItems: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.useThreeStackItems),\n/* harmony export */ useTwoScriptNumbers: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.useTwoScriptNumbers),\n/* harmony export */ useTwoStackItems: () => (/* reexport safe */ _common_common__WEBPACK_IMPORTED_MODULE_2__.useTwoStackItems)\n/* harmony export */ });\n/* harmony import */ var _btc_btc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./btc/btc */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/btc/btc.js\");\n/* harmony import */ var _bch_bch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bch/bch */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/bch/bch.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./common/common */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/common/common.js\");\n/* harmony import */ var _instruction_sets_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./instruction-sets-utils */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-utils.js\");\n/* harmony import */ var _instruction_sets_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./instruction-sets-types */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets-types.js\");\n/* harmony import */ var _instruction_sets_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_instruction_sets_types__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _instruction_sets_types__WEBPACK_IMPORTED_MODULE_4__) if([\"default\",\"OpcodesBTC\",\"AuthenticationErrorBCH\",\"ConsensusBCH\",\"InstructionSetBCH\",\"OpcodeAlternateNamesBCH\",\"OpcodeDescriptionsBCH\",\"OpcodeDescriptionsUniqueBCH\",\"OpcodesBCH\",\"assembleBitcoinABCScript\",\"bitcoinABCOpcodes\",\"bitcoinCashOperations\",\"bitwiseOperation\",\"createInstructionSetBCH\",\"createTestAuthenticationProgramBCH\",\"getFlagsForInstructionSetBCH\",\"instantiateVirtualMachineBCH\",\"instructionSetBCHCurrentStrict\",\"isPayToScriptHash\",\"isValidSignatureEncodingBCHRaw\",\"isWitnessProgram\",\"opAnd\",\"opBin2Num\",\"opCat\",\"opCheckDataSig\",\"opCheckDataSigVerify\",\"opDiv\",\"opMod\",\"opNum2Bin\",\"opOr\",\"opReverseBytes\",\"opSplit\",\"opXor\",\"padMinimallyEncodedScriptNumber\",\"AuthenticationErrorCommon\",\"ConsensusCommon\",\"OpcodeDescriptionsCommon\",\"OpcodesCommon\",\"PushOperationConstants\",\"ScriptNumberError\",\"SigningSerializationFlag\",\"applyError\",\"arithmeticOperations\",\"bigIntToScriptNumber\",\"bitwiseOperations\",\"booleanToScriptNumber\",\"checkLimitsCommon\",\"cloneAuthenticationProgramStateCommon\",\"cloneStack\",\"combineOperations\",\"commonOperations\",\"conditionalFlowControlOperations\",\"conditionallyEvaluate\",\"createAuthenticationProgramInternalStateCommon\",\"createAuthenticationProgramStateCommon\",\"createAuthenticationProgramStateCommonEmpty\",\"createTransactionContextCommon\",\"createTransactionContextCommonEmpty\",\"createTransactionContextCommonTesting\",\"cryptoOperations\",\"decodeBitcoinSignature\",\"disabledOperation\",\"disabledOperations\",\"encodeDataPush\",\"generateSigningSerializationBCH\",\"hashOutputs\",\"hashPrevouts\",\"hashSequence\",\"incrementOperationCount\",\"isDefinedSigningSerializationType\",\"isLegacySigningSerialization\",\"isMinimalDataPush\",\"isScriptNumberError\",\"isValidCompressedPublicKeyEncoding\",\"isValidPublicKeyEncoding\",\"isValidSignatureEncodingBCHTransaction\",\"isValidSignatureEncodingDER\",\"isValidUncompressedPublicKeyEncoding\",\"mapOverOperations\",\"nonOperations\",\"op0NotEqual\",\"op1Add\",\"op1Sub\",\"op2Drop\",\"op2Dup\",\"op2Over\",\"op2Rot\",\"op2Swap\",\"op3Dup\",\"opAbs\",\"opAdd\",\"opBoolAnd\",\"opBoolOr\",\"opCheckLockTimeVerify\",\"opCheckMultiSig\",\"opCheckMultiSigVerify\",\"opCheckSequenceVerify\",\"opCheckSig\",\"opCheckSigVerify\",\"opCodeSeparator\",\"opDepth\",\"opDrop\",\"opDup\",\"opElse\",\"opEndIf\",\"opEqual\",\"opEqualVerify\",\"opFromAltStack\",\"opGreaterThan\",\"opGreaterThanOrEqual\",\"opHash160\",\"opHash256\",\"opIf\",\"opIfDup\",\"opLessThan\",\"opLessThanOrEqual\",\"opMax\",\"opMin\",\"opNegate\",\"opNip\",\"opNop\",\"opNot\",\"opNotIf\",\"opNumEqual\",\"opNumEqualVerify\",\"opNumNotEqual\",\"opOver\",\"opPick\",\"opReturn\",\"opRipemd160\",\"opRoll\",\"opRot\",\"opSha1\",\"opSha256\",\"opSize\",\"opSub\",\"opSwap\",\"opToAltStack\",\"opTuck\",\"opVerify\",\"opWithin\",\"parseBytesAsScriptNumber\",\"pushByteOpcodes\",\"pushNumberOpcodes\",\"pushNumberOperations\",\"pushOperation\",\"pushOperations\",\"pushToStack\",\"readLocktime\",\"reservedOperation\",\"spliceOperations\",\"stackItemIsTruthy\",\"stackOperations\",\"timeOperations\",\"unconditionalFlowControlOperations\",\"undefinedOperation\",\"useFourStackItems\",\"useOneScriptNumber\",\"useOneStackItem\",\"useSixStackItems\",\"useThreeScriptNumbers\",\"useThreeStackItems\",\"useTwoScriptNumbers\",\"useTwoStackItems\",\"assembleBytecode\",\"assembleBytecodeBCH\",\"assembleBytecodeBTC\",\"authenticationInstructionIsMalformed\",\"authenticationInstructionsAreMalformed\",\"authenticationInstructionsAreNotMalformed\",\"disassembleAuthenticationInstruction\",\"disassembleBytecode\",\"disassembleBytecodeBCH\",\"disassembleBytecodeBTC\",\"disassembleParsedAuthenticationInstruction\",\"disassembleParsedAuthenticationInstructionMalformed\",\"disassembleParsedAuthenticationInstructions\",\"generateBytecodeMap\",\"lengthBytesForPushOpcode\",\"parseBytecode\",\"readAuthenticationInstruction\",\"serializeAuthenticationInstruction\",\"serializeAuthenticationInstructions\",\"serializeParsedAuthenticationInstruction\",\"serializeParsedAuthenticationInstructionMalformed\",\"serializeParsedAuthenticationInstructions\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _instruction_sets_types__WEBPACK_IMPORTED_MODULE_4__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n\n\n\n\n\n//# sourceMappingURL=instruction-sets.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/virtual-machine.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/virtual-machine.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createAuthenticationVirtualMachine: () => (/* binding */ createAuthenticationVirtualMachine)\n/* harmony export */ });\n/* harmony import */ var _format_format__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../format/format */ \"./node_modules/@bitauth/libauth/build/module/lib/format/hex.js\");\n\n/**\n * Create an AuthenticationVirtualMachine to evaluate authentication programs\n * constructed from operations in the `instructionSet`.\n * @param instructionSet - an `InstructionSet`\n */\nconst createAuthenticationVirtualMachine = (instructionSet) => {\n const availableOpcodes = 256;\n const operators = (0,_format_format__WEBPACK_IMPORTED_MODULE_0__.range)(availableOpcodes).map((codepoint) => instructionSet.operations[codepoint] === undefined\n ? instructionSet.undefined\n : instructionSet.operations[codepoint]);\n const getCodepoint = (state) => state.instructions[state.ip];\n const after = (state) => {\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n state.ip += 1;\n return state;\n };\n const getOperation = (state) => operators[getCodepoint(state).opcode];\n const stateStepMutate = (state) => after(getOperation(state)(state));\n const stateContinue = instructionSet.continue;\n /**\n * When we get real tail call optimization, this can be replaced\n * with recursion.\n */\n const untilComplete = (state, stepFunction) => {\n // eslint-disable-next-line functional/no-loop-statement\n while (stateContinue(state)) {\n // eslint-disable-next-line functional/no-expression-statement, no-param-reassign\n state = stepFunction(state);\n }\n return state;\n };\n const clone = (state) => instructionSet.clone(state);\n const { verify } = instructionSet;\n const stateEvaluate = (state) => untilComplete(clone(state), stateStepMutate);\n const stateDebugStep = (state) => {\n const operator = getOperation(state);\n return after(operator(clone(state)));\n };\n const stateDebug = (state) => {\n const trace = [];\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n trace.push(state);\n // eslint-disable-next-line functional/no-expression-statement\n untilComplete(state, (currentState) => {\n const nextState = stateDebugStep(currentState);\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n trace.push(nextState);\n return nextState;\n });\n return trace;\n };\n const stateStep = (state) => stateStepMutate(clone(state));\n const evaluate = (program) => instructionSet.evaluate(program, stateEvaluate);\n const debug = (program) => {\n const results = [];\n const proxyDebug = (state) => {\n var _a;\n const debugResult = stateDebug(state);\n // eslint-disable-next-line functional/no-expression-statement, functional/immutable-data\n results.push(...debugResult);\n return ((_a = debugResult[debugResult.length - 1]) !== null && _a !== void 0 ? _a : state);\n };\n const finalResult = instructionSet.evaluate(program, proxyDebug);\n return [...results, finalResult];\n };\n return {\n debug,\n evaluate,\n stateContinue,\n stateDebug,\n stateEvaluate,\n stateStep,\n stateStepMutate,\n verify,\n };\n};\n//# sourceMappingURL=virtual-machine.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/virtual-machine.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/vm-types.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/vm-types.js ***! + \***********************************************************************/ +/***/ (() => { + +eval("//# sourceMappingURL=vm-types.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/vm-types.js?"); + +/***/ }), + +/***/ "./node_modules/@bitauth/libauth/build/module/lib/vm/vm.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@bitauth/libauth/build/module/lib/vm/vm.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createAuthenticationVirtualMachine: () => (/* reexport safe */ _virtual_machine__WEBPACK_IMPORTED_MODULE_2__.createAuthenticationVirtualMachine)\n/* harmony export */ });\n/* harmony import */ var _instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instruction-sets/instruction-sets */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/instruction-sets/instruction-sets.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== \"default\") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _instruction_sets_instruction_sets__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _vm_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vm-types */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/vm-types.js\");\n/* harmony import */ var _vm_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_vm_types__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _vm_types__WEBPACK_IMPORTED_MODULE_1__) if([\"default\",\"OpcodesBTC\",\"instantiateVirtualMachineBCH\",\"ConsensusCommon\",\"OpcodesCommon\",\"checkLimitsCommon\",\"cloneAuthenticationProgramStateCommon\",\"cloneStack\",\"commonOperations\",\"createAuthenticationProgramInternalStateCommon\",\"createAuthenticationProgramStateCommon\",\"createAuthenticationProgramStateCommonEmpty\",\"createTransactionContextCommon\",\"createTransactionContextCommonEmpty\",\"createTransactionContextCommonTesting\",\"undefinedOperation\",\"assembleBytecode\",\"assembleBytecodeBCH\",\"assembleBytecodeBTC\",\"authenticationInstructionIsMalformed\",\"authenticationInstructionsAreMalformed\",\"authenticationInstructionsAreNotMalformed\",\"disassembleAuthenticationInstruction\",\"disassembleBytecode\",\"disassembleBytecodeBCH\",\"disassembleBytecodeBTC\",\"disassembleParsedAuthenticationInstruction\",\"disassembleParsedAuthenticationInstructionMalformed\",\"disassembleParsedAuthenticationInstructions\",\"generateBytecodeMap\",\"lengthBytesForPushOpcode\",\"parseBytecode\",\"readAuthenticationInstruction\",\"serializeAuthenticationInstruction\",\"serializeAuthenticationInstructions\",\"serializeParsedAuthenticationInstruction\",\"serializeParsedAuthenticationInstructionMalformed\",\"serializeParsedAuthenticationInstructions\",\"AuthenticationErrorBCH\",\"ConsensusBCH\",\"InstructionSetBCH\",\"OpcodeAlternateNamesBCH\",\"OpcodeDescriptionsBCH\",\"OpcodeDescriptionsUniqueBCH\",\"OpcodesBCH\",\"assembleBitcoinABCScript\",\"bitcoinABCOpcodes\",\"bitcoinCashOperations\",\"bitwiseOperation\",\"createInstructionSetBCH\",\"createTestAuthenticationProgramBCH\",\"getFlagsForInstructionSetBCH\",\"instructionSetBCHCurrentStrict\",\"isPayToScriptHash\",\"isValidSignatureEncodingBCHRaw\",\"isWitnessProgram\",\"opAnd\",\"opBin2Num\",\"opCat\",\"opCheckDataSig\",\"opCheckDataSigVerify\",\"opDiv\",\"opMod\",\"opNum2Bin\",\"opOr\",\"opReverseBytes\",\"opSplit\",\"opXor\",\"padMinimallyEncodedScriptNumber\",\"AuthenticationErrorCommon\",\"OpcodeDescriptionsCommon\",\"PushOperationConstants\",\"ScriptNumberError\",\"SigningSerializationFlag\",\"applyError\",\"arithmeticOperations\",\"bigIntToScriptNumber\",\"bitwiseOperations\",\"booleanToScriptNumber\",\"combineOperations\",\"conditionalFlowControlOperations\",\"conditionallyEvaluate\",\"cryptoOperations\",\"decodeBitcoinSignature\",\"disabledOperation\",\"disabledOperations\",\"encodeDataPush\",\"generateSigningSerializationBCH\",\"hashOutputs\",\"hashPrevouts\",\"hashSequence\",\"incrementOperationCount\",\"isDefinedSigningSerializationType\",\"isLegacySigningSerialization\",\"isMinimalDataPush\",\"isScriptNumberError\",\"isValidCompressedPublicKeyEncoding\",\"isValidPublicKeyEncoding\",\"isValidSignatureEncodingBCHTransaction\",\"isValidSignatureEncodingDER\",\"isValidUncompressedPublicKeyEncoding\",\"mapOverOperations\",\"nonOperations\",\"op0NotEqual\",\"op1Add\",\"op1Sub\",\"op2Drop\",\"op2Dup\",\"op2Over\",\"op2Rot\",\"op2Swap\",\"op3Dup\",\"opAbs\",\"opAdd\",\"opBoolAnd\",\"opBoolOr\",\"opCheckLockTimeVerify\",\"opCheckMultiSig\",\"opCheckMultiSigVerify\",\"opCheckSequenceVerify\",\"opCheckSig\",\"opCheckSigVerify\",\"opCodeSeparator\",\"opDepth\",\"opDrop\",\"opDup\",\"opElse\",\"opEndIf\",\"opEqual\",\"opEqualVerify\",\"opFromAltStack\",\"opGreaterThan\",\"opGreaterThanOrEqual\",\"opHash160\",\"opHash256\",\"opIf\",\"opIfDup\",\"opLessThan\",\"opLessThanOrEqual\",\"opMax\",\"opMin\",\"opNegate\",\"opNip\",\"opNop\",\"opNot\",\"opNotIf\",\"opNumEqual\",\"opNumEqualVerify\",\"opNumNotEqual\",\"opOver\",\"opPick\",\"opReturn\",\"opRipemd160\",\"opRoll\",\"opRot\",\"opSha1\",\"opSha256\",\"opSize\",\"opSub\",\"opSwap\",\"opToAltStack\",\"opTuck\",\"opVerify\",\"opWithin\",\"parseBytesAsScriptNumber\",\"pushByteOpcodes\",\"pushNumberOpcodes\",\"pushNumberOperations\",\"pushOperation\",\"pushOperations\",\"pushToStack\",\"readLocktime\",\"reservedOperation\",\"spliceOperations\",\"stackItemIsTruthy\",\"stackOperations\",\"timeOperations\",\"unconditionalFlowControlOperations\",\"useFourStackItems\",\"useOneScriptNumber\",\"useOneStackItem\",\"useSixStackItems\",\"useThreeScriptNumbers\",\"useThreeStackItems\",\"useTwoScriptNumbers\",\"useTwoStackItems\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _vm_types__WEBPACK_IMPORTED_MODULE_1__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _virtual_machine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./virtual-machine */ \"./node_modules/@bitauth/libauth/build/module/lib/vm/virtual-machine.js\");\n\n\n\n//# sourceMappingURL=vm.js.map\n\n//# sourceURL=webpack://dcp/./node_modules/@bitauth/libauth/build/module/lib/vm/vm.js?"); + +/***/ }), + +/***/ "./node_modules/aes-js/index.js": +/*!**************************************!*\ + !*** ./node_modules/aes-js/index.js ***! + \**************************************/ +/***/ (function(module) { + +eval("/*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */\n(function(root) {\n \"use strict\";\n\n function checkInt(value) {\n return (parseInt(value) === value);\n }\n\n function checkInts(arrayish) {\n if (!checkInt(arrayish.length)) { return false; }\n\n for (var i = 0; i < arrayish.length; i++) {\n if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) {\n return false;\n }\n }\n\n return true;\n }\n\n function coerceArray(arg, copy) {\n\n // ArrayBuffer view\n if (arg.buffer && arg.name === 'Uint8Array') {\n\n if (copy) {\n if (arg.slice) {\n arg = arg.slice();\n } else {\n arg = Array.prototype.slice.call(arg);\n }\n }\n\n return arg;\n }\n\n // It's an array; check it is a valid representation of a byte\n if (Array.isArray(arg)) {\n if (!checkInts(arg)) {\n throw new Error('Array contains invalid value: ' + arg);\n }\n\n return new Uint8Array(arg);\n }\n\n // Something else, but behaves like an array (maybe a Buffer? Arguments?)\n if (checkInt(arg.length) && checkInts(arg)) {\n return new Uint8Array(arg);\n }\n\n throw new Error('unsupported array-like object');\n }\n\n function createArray(length) {\n return new Uint8Array(length);\n }\n\n function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) {\n if (sourceStart != null || sourceEnd != null) {\n if (sourceArray.slice) {\n sourceArray = sourceArray.slice(sourceStart, sourceEnd);\n } else {\n sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd);\n }\n }\n targetArray.set(sourceArray, targetStart);\n }\n\n\n\n var convertUtf8 = (function() {\n function toBytes(text) {\n var result = [], i = 0;\n text = encodeURI(text);\n while (i < text.length) {\n var c = text.charCodeAt(i++);\n\n // if it is a % sign, encode the following 2 bytes as a hex value\n if (c === 37) {\n result.push(parseInt(text.substr(i, 2), 16))\n i += 2;\n\n // otherwise, just the actual byte\n } else {\n result.push(c)\n }\n }\n\n return coerceArray(result);\n }\n\n function fromBytes(bytes) {\n var result = [], i = 0;\n\n while (i < bytes.length) {\n var c = bytes[i];\n\n if (c < 128) {\n result.push(String.fromCharCode(c));\n i++;\n } else if (c > 191 && c < 224) {\n result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f)));\n i += 2;\n } else {\n result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f)));\n i += 3;\n }\n }\n\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n var convertHex = (function() {\n function toBytes(text) {\n var result = [];\n for (var i = 0; i < text.length; i += 2) {\n result.push(parseInt(text.substr(i, 2), 16));\n }\n\n return result;\n }\n\n // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html\n var Hex = '0123456789abcdef';\n\n function fromBytes(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i++) {\n var v = bytes[i];\n result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]);\n }\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n\n // Number of rounds by keysize\n var numberOfRounds = {16: 10, 24: 12, 32: 14}\n\n // Round constant words\n var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91];\n\n // S-box and Inverse S-box (S is for Substitution)\n var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f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ba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d];\n\n // Transformations for encryption\n var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a];\n var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616];\n var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16];\n var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c];\n\n // Transformations for decryption\n var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742];\n var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857];\n var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8];\n var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0];\n\n // Transformations for decryption key expansion\n var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3];\n var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697];\n var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46];\n var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d];\n\n function convertToInt32(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i += 4) {\n result.push(\n (bytes[i ] << 24) |\n (bytes[i + 1] << 16) |\n (bytes[i + 2] << 8) |\n bytes[i + 3]\n );\n }\n return result;\n }\n\n var AES = function(key) {\n if (!(this instanceof AES)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n Object.defineProperty(this, 'key', {\n value: coerceArray(key, true)\n });\n\n this._prepare();\n }\n\n\n AES.prototype._prepare = function() {\n\n var rounds = numberOfRounds[this.key.length];\n if (rounds == null) {\n throw new Error('invalid key size (must be 16, 24 or 32 bytes)');\n }\n\n // encryption round keys\n this._Ke = [];\n\n // decryption round keys\n this._Kd = [];\n\n for (var i = 0; i <= rounds; i++) {\n this._Ke.push([0, 0, 0, 0]);\n this._Kd.push([0, 0, 0, 0]);\n }\n\n var roundKeyCount = (rounds + 1) * 4;\n var KC = this.key.length / 4;\n\n // convert the key into ints\n var tk = convertToInt32(this.key);\n\n // copy values into round key arrays\n var index;\n for (var i = 0; i < KC; i++) {\n index = i >> 2;\n this._Ke[index][i % 4] = tk[i];\n this._Kd[rounds - index][i % 4] = tk[i];\n }\n\n // key expansion (fips-197 section 5.2)\n var rconpointer = 0;\n var t = KC, tt;\n while (t < roundKeyCount) {\n tt = tk[KC - 1];\n tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^\n (S[(tt >> 8) & 0xFF] << 16) ^\n (S[ tt & 0xFF] << 8) ^\n S[(tt >> 24) & 0xFF] ^\n (rcon[rconpointer] << 24));\n rconpointer += 1;\n\n // key expansion (for non-256 bit)\n if (KC != 8) {\n for (var i = 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n\n // key expansion for 256-bit keys is \"slightly different\" (fips-197)\n } else {\n for (var i = 1; i < (KC / 2); i++) {\n tk[i] ^= tk[i - 1];\n }\n tt = tk[(KC / 2) - 1];\n\n tk[KC / 2] ^= (S[ tt & 0xFF] ^\n (S[(tt >> 8) & 0xFF] << 8) ^\n (S[(tt >> 16) & 0xFF] << 16) ^\n (S[(tt >> 24) & 0xFF] << 24));\n\n for (var i = (KC / 2) + 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n }\n\n // copy values into round key arrays\n var i = 0, r, c;\n while (i < KC && t < roundKeyCount) {\n r = t >> 2;\n c = t % 4;\n this._Ke[r][c] = tk[i];\n this._Kd[rounds - r][c] = tk[i++];\n t++;\n }\n }\n\n // inverse-cipher-ify the decryption round key (fips-197 section 5.3)\n for (var r = 1; r < rounds; r++) {\n for (var c = 0; c < 4; c++) {\n tt = this._Kd[r][c];\n this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^\n U2[(tt >> 16) & 0xFF] ^\n U3[(tt >> 8) & 0xFF] ^\n U4[ tt & 0xFF]);\n }\n }\n }\n\n AES.prototype.encrypt = function(plaintext) {\n if (plaintext.length != 16) {\n throw new Error('invalid plaintext size (must be 16 bytes)');\n }\n\n var rounds = this._Ke.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(plaintext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Ke[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T1[(t[ i ] >> 24) & 0xff] ^\n T2[(t[(i + 1) % 4] >> 16) & 0xff] ^\n T3[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T4[ t[(i + 3) % 4] & 0xff] ^\n this._Ke[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Ke[rounds][i];\n result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n AES.prototype.decrypt = function(ciphertext) {\n if (ciphertext.length != 16) {\n throw new Error('invalid ciphertext size (must be 16 bytes)');\n }\n\n var rounds = this._Kd.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(ciphertext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Kd[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T5[(t[ i ] >> 24) & 0xff] ^\n T6[(t[(i + 3) % 4] >> 16) & 0xff] ^\n T7[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T8[ t[(i + 1) % 4] & 0xff] ^\n this._Kd[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Kd[rounds][i];\n result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n\n /**\n * Mode Of Operation - Electonic Codebook (ECB)\n */\n var ModeOfOperationECB = function(key) {\n if (!(this instanceof ModeOfOperationECB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Electronic Code Block\";\n this.name = \"ecb\";\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationECB.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n block = this._aes.encrypt(block);\n copyArray(block, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationECB.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n copyArray(block, plaintext, i);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Block Chaining (CBC)\n */\n var ModeOfOperationCBC = function(key, iv) {\n if (!(this instanceof ModeOfOperationCBC)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Block Chaining\";\n this.name = \"cbc\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastCipherblock = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCBC.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n\n for (var j = 0; j < 16; j++) {\n block[j] ^= this._lastCipherblock[j];\n }\n\n this._lastCipherblock = this._aes.encrypt(block);\n copyArray(this._lastCipherblock, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationCBC.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n\n for (var j = 0; j < 16; j++) {\n plaintext[i + j] = block[j] ^ this._lastCipherblock[j];\n }\n\n copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Feedback (CFB)\n */\n var ModeOfOperationCFB = function(key, iv, segmentSize) {\n if (!(this instanceof ModeOfOperationCFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Feedback\";\n this.name = \"cfb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 size)');\n }\n\n if (!segmentSize) { segmentSize = 1; }\n\n this.segmentSize = segmentSize;\n\n this._shiftRegister = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCFB.prototype.encrypt = function(plaintext) {\n if ((plaintext.length % this.segmentSize) != 0) {\n throw new Error('invalid plaintext size (must be segmentSize bytes)');\n }\n\n var encrypted = coerceArray(plaintext, true);\n\n var xorSegment;\n for (var i = 0; i < encrypted.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n for (var j = 0; j < this.segmentSize; j++) {\n encrypted[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return encrypted;\n }\n\n ModeOfOperationCFB.prototype.decrypt = function(ciphertext) {\n if ((ciphertext.length % this.segmentSize) != 0) {\n throw new Error('invalid ciphertext size (must be segmentSize bytes)');\n }\n\n var plaintext = coerceArray(ciphertext, true);\n\n var xorSegment;\n for (var i = 0; i < plaintext.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n\n for (var j = 0; j < this.segmentSize; j++) {\n plaintext[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return plaintext;\n }\n\n /**\n * Mode Of Operation - Output Feedback (OFB)\n */\n var ModeOfOperationOFB = function(key, iv) {\n if (!(this instanceof ModeOfOperationOFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Output Feedback\";\n this.name = \"ofb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastPrecipher = coerceArray(iv, true);\n this._lastPrecipherIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationOFB.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._lastPrecipherIndex === 16) {\n this._lastPrecipher = this._aes.encrypt(this._lastPrecipher);\n this._lastPrecipherIndex = 0;\n }\n encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt;\n\n\n /**\n * Counter object for CTR common mode of operation\n */\n var Counter = function(initialValue) {\n if (!(this instanceof Counter)) {\n throw Error('Counter must be instanitated with `new`');\n }\n\n // We allow 0, but anything false-ish uses the default 1\n if (initialValue !== 0 && !initialValue) { initialValue = 1; }\n\n if (typeof(initialValue) === 'number') {\n this._counter = createArray(16);\n this.setValue(initialValue);\n\n } else {\n this.setBytes(initialValue);\n }\n }\n\n Counter.prototype.setValue = function(value) {\n if (typeof(value) !== 'number' || parseInt(value) != value) {\n throw new Error('invalid counter value (must be an integer)');\n }\n\n // We cannot safely handle numbers beyond the safe range for integers\n if (value > Number.MAX_SAFE_INTEGER) {\n throw new Error('integer value out of safe range');\n }\n\n for (var index = 15; index >= 0; --index) {\n this._counter[index] = value % 256;\n value = parseInt(value / 256);\n }\n }\n\n Counter.prototype.setBytes = function(bytes) {\n bytes = coerceArray(bytes, true);\n\n if (bytes.length != 16) {\n throw new Error('invalid counter bytes size (must be 16 bytes)');\n }\n\n this._counter = bytes;\n };\n\n Counter.prototype.increment = function() {\n for (var i = 15; i >= 0; i--) {\n if (this._counter[i] === 255) {\n this._counter[i] = 0;\n } else {\n this._counter[i]++;\n break;\n }\n }\n }\n\n\n /**\n * Mode Of Operation - Counter (CTR)\n */\n var ModeOfOperationCTR = function(key, counter) {\n if (!(this instanceof ModeOfOperationCTR)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Counter\";\n this.name = \"ctr\";\n\n if (!(counter instanceof Counter)) {\n counter = new Counter(counter)\n }\n\n this._counter = counter;\n\n this._remainingCounter = null;\n this._remainingCounterIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCTR.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._remainingCounterIndex === 16) {\n this._remainingCounter = this._aes.encrypt(this._counter._counter);\n this._remainingCounterIndex = 0;\n this._counter.increment();\n }\n encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt;\n\n\n ///////////////////////\n // Padding\n\n // See:https://tools.ietf.org/html/rfc2315\n function pkcs7pad(data) {\n data = coerceArray(data, true);\n var padder = 16 - (data.length % 16);\n var result = createArray(data.length + padder);\n copyArray(data, result);\n for (var i = data.length; i < result.length; i++) {\n result[i] = padder;\n }\n return result;\n }\n\n function pkcs7strip(data) {\n data = coerceArray(data, true);\n if (data.length < 16) { throw new Error('PKCS#7 invalid length'); }\n\n var padder = data[data.length - 1];\n if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); }\n\n var length = data.length - padder;\n for (var i = 0; i < padder; i++) {\n if (data[length + i] !== padder) {\n throw new Error('PKCS#7 invalid padding byte');\n }\n }\n\n var result = createArray(length);\n copyArray(data, result, 0, 0, length);\n return result;\n }\n\n ///////////////////////\n // Exporting\n\n\n // The block cipher\n var aesjs = {\n AES: AES,\n Counter: Counter,\n\n ModeOfOperation: {\n ecb: ModeOfOperationECB,\n cbc: ModeOfOperationCBC,\n cfb: ModeOfOperationCFB,\n ofb: ModeOfOperationOFB,\n ctr: ModeOfOperationCTR\n },\n\n utils: {\n hex: convertHex,\n utf8: convertUtf8\n },\n\n padding: {\n pkcs7: {\n pad: pkcs7pad,\n strip: pkcs7strip\n }\n },\n\n _arrayTest: {\n coerceArray: coerceArray,\n createArray: createArray,\n copyArray: copyArray,\n }\n };\n\n\n // node.js\n if (true) {\n module.exports = aesjs\n\n // RequireJS/AMD\n // http://www.requirejs.org/docs/api.html\n // https://github.com/amdjs/amdjs-api/wiki/AMD\n } else {}\n\n\n})(this);\n\n\n//# sourceURL=webpack://dcp/./node_modules/aes-js/index.js?"); + +/***/ }), + +/***/ "./node_modules/ansi-styles/index.js": +/*!*******************************************!*\ + !*** ./node_modules/ansi-styles/index.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("/* module decorator */ module = __webpack_require__.nmd(module);\n\n\nconst wrapAnsi16 = (fn, offset) => (...args) => {\n\tconst code = fn(...args);\n\treturn `\\u001B[${code + offset}m`;\n};\n\nconst wrapAnsi256 = (fn, offset) => (...args) => {\n\tconst code = fn(...args);\n\treturn `\\u001B[${38 + offset};5;${code}m`;\n};\n\nconst wrapAnsi16m = (fn, offset) => (...args) => {\n\tconst rgb = fn(...args);\n\treturn `\\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;\n};\n\nconst ansi2ansi = n => n;\nconst rgb2rgb = (r, g, b) => [r, g, b];\n\nconst setLazyProperty = (object, property, get) => {\n\tObject.defineProperty(object, property, {\n\t\tget: () => {\n\t\t\tconst value = get();\n\n\t\t\tObject.defineProperty(object, property, {\n\t\t\t\tvalue,\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true\n\t\t\t});\n\n\t\t\treturn value;\n\t\t},\n\t\tenumerable: true,\n\t\tconfigurable: true\n\t});\n};\n\n/** @type {typeof import('color-convert')} */\nlet colorConvert;\nconst makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {\n\tif (colorConvert === undefined) {\n\t\tcolorConvert = __webpack_require__(/*! color-convert */ \"./node_modules/color-convert/index.js\");\n\t}\n\n\tconst offset = isBackground ? 10 : 0;\n\tconst styles = {};\n\n\tfor (const [sourceSpace, suite] of Object.entries(colorConvert)) {\n\t\tconst name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace;\n\t\tif (sourceSpace === targetSpace) {\n\t\t\tstyles[name] = wrap(identity, offset);\n\t\t} else if (typeof suite === 'object') {\n\t\t\tstyles[name] = wrap(suite[targetSpace], offset);\n\t\t}\n\t}\n\n\treturn styles;\n};\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\tconst styles = {\n\t\tmodifier: {\n\t\t\treset: [0, 0],\n\t\t\t// 21 isn't widely supported and 22 does the same thing\n\t\t\tbold: [1, 22],\n\t\t\tdim: [2, 22],\n\t\t\titalic: [3, 23],\n\t\t\tunderline: [4, 24],\n\t\t\tinverse: [7, 27],\n\t\t\thidden: [8, 28],\n\t\t\tstrikethrough: [9, 29]\n\t\t},\n\t\tcolor: {\n\t\t\tblack: [30, 39],\n\t\t\tred: [31, 39],\n\t\t\tgreen: [32, 39],\n\t\t\tyellow: [33, 39],\n\t\t\tblue: [34, 39],\n\t\t\tmagenta: [35, 39],\n\t\t\tcyan: [36, 39],\n\t\t\twhite: [37, 39],\n\n\t\t\t// Bright color\n\t\t\tblackBright: [90, 39],\n\t\t\tredBright: [91, 39],\n\t\t\tgreenBright: [92, 39],\n\t\t\tyellowBright: [93, 39],\n\t\t\tblueBright: [94, 39],\n\t\t\tmagentaBright: [95, 39],\n\t\t\tcyanBright: [96, 39],\n\t\t\twhiteBright: [97, 39]\n\t\t},\n\t\tbgColor: {\n\t\t\tbgBlack: [40, 49],\n\t\t\tbgRed: [41, 49],\n\t\t\tbgGreen: [42, 49],\n\t\t\tbgYellow: [43, 49],\n\t\t\tbgBlue: [44, 49],\n\t\t\tbgMagenta: [45, 49],\n\t\t\tbgCyan: [46, 49],\n\t\t\tbgWhite: [47, 49],\n\n\t\t\t// Bright color\n\t\t\tbgBlackBright: [100, 49],\n\t\t\tbgRedBright: [101, 49],\n\t\t\tbgGreenBright: [102, 49],\n\t\t\tbgYellowBright: [103, 49],\n\t\t\tbgBlueBright: [104, 49],\n\t\t\tbgMagentaBright: [105, 49],\n\t\t\tbgCyanBright: [106, 49],\n\t\t\tbgWhiteBright: [107, 49]\n\t\t}\n\t};\n\n\t// Alias bright black as gray (and grey)\n\tstyles.color.gray = styles.color.blackBright;\n\tstyles.bgColor.bgGray = styles.bgColor.bgBlackBright;\n\tstyles.color.grey = styles.color.blackBright;\n\tstyles.bgColor.bgGrey = styles.bgColor.bgBlackBright;\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tsetLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false));\n\tsetLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false));\n\tsetLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false));\n\tsetLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true));\n\tsetLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true));\n\tsetLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true));\n\n\treturn styles;\n}\n\n// Make the export immutable\nObject.defineProperty(module, 'exports', {\n\tenumerable: true,\n\tget: assembleStyles\n});\n\n\n//# sourceURL=webpack://dcp/./node_modules/ansi-styles/index.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1.js": +/*!******************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("\n\nconst asn1 = exports;\n\nasn1.bignum = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\n\nasn1.define = (__webpack_require__(/*! ./asn1/api */ \"./node_modules/asn1.js/lib/asn1/api.js\").define);\nasn1.base = __webpack_require__(/*! ./asn1/base */ \"./node_modules/asn1.js/lib/asn1/base/index.js\");\nasn1.constants = __webpack_require__(/*! ./asn1/constants */ \"./node_modules/asn1.js/lib/asn1/constants/index.js\");\nasn1.decoders = __webpack_require__(/*! ./asn1/decoders */ \"./node_modules/asn1.js/lib/asn1/decoders/index.js\");\nasn1.encoders = __webpack_require__(/*! ./asn1/encoders */ \"./node_modules/asn1.js/lib/asn1/encoders/index.js\");\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1/api.js": +/*!**********************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1/api.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("\n\nconst encoders = __webpack_require__(/*! ./encoders */ \"./node_modules/asn1.js/lib/asn1/encoders/index.js\");\nconst decoders = __webpack_require__(/*! ./decoders */ \"./node_modules/asn1.js/lib/asn1/decoders/index.js\");\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nconst api = exports;\n\napi.define = function define(name, body) {\n return new Entity(name, body);\n};\n\nfunction Entity(name, body) {\n this.name = name;\n this.body = body;\n\n this.decoders = {};\n this.encoders = {};\n}\n\nEntity.prototype._createNamed = function createNamed(Base) {\n const name = this.name;\n\n function Generated(entity) {\n this._initNamed(entity, name);\n }\n inherits(Generated, Base);\n Generated.prototype._initNamed = function _initNamed(entity, name) {\n Base.call(this, entity, name);\n };\n\n return new Generated(this);\n};\n\nEntity.prototype._getDecoder = function _getDecoder(enc) {\n enc = enc || 'der';\n // Lazily create decoder\n if (!this.decoders.hasOwnProperty(enc))\n this.decoders[enc] = this._createNamed(decoders[enc]);\n return this.decoders[enc];\n};\n\nEntity.prototype.decode = function decode(data, enc, options) {\n return this._getDecoder(enc).decode(data, options);\n};\n\nEntity.prototype._getEncoder = function _getEncoder(enc) {\n enc = enc || 'der';\n // Lazily create encoder\n if (!this.encoders.hasOwnProperty(enc))\n this.encoders[enc] = this._createNamed(encoders[enc]);\n return this.encoders[enc];\n};\n\nEntity.prototype.encode = function encode(data, enc, /* internal */ reporter) {\n return this._getEncoder(enc).encode(data, reporter);\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1/api.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1/base/buffer.js": +/*!******************************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1/base/buffer.js ***! + \******************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nconst Reporter = (__webpack_require__(/*! ../base/reporter */ \"./node_modules/asn1.js/lib/asn1/base/reporter.js\").Reporter);\nconst Buffer = (__webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer);\n\nfunction DecoderBuffer(base, options) {\n Reporter.call(this, options);\n if (!Buffer.isBuffer(base)) {\n this.error('Input not Buffer');\n return;\n }\n\n this.base = base;\n this.offset = 0;\n this.length = base.length;\n}\ninherits(DecoderBuffer, Reporter);\nexports.DecoderBuffer = DecoderBuffer;\n\nDecoderBuffer.isDecoderBuffer = function isDecoderBuffer(data) {\n if (data instanceof DecoderBuffer) {\n return true;\n }\n\n // Or accept compatible API\n const isCompatible = typeof data === 'object' &&\n Buffer.isBuffer(data.base) &&\n data.constructor.name === 'DecoderBuffer' &&\n typeof data.offset === 'number' &&\n typeof data.length === 'number' &&\n typeof data.save === 'function' &&\n typeof data.restore === 'function' &&\n typeof data.isEmpty === 'function' &&\n typeof data.readUInt8 === 'function' &&\n typeof data.skip === 'function' &&\n typeof data.raw === 'function';\n\n return isCompatible;\n};\n\nDecoderBuffer.prototype.save = function save() {\n return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };\n};\n\nDecoderBuffer.prototype.restore = function restore(save) {\n // Return skipped data\n const res = new DecoderBuffer(this.base);\n res.offset = save.offset;\n res.length = this.offset;\n\n this.offset = save.offset;\n Reporter.prototype.restore.call(this, save.reporter);\n\n return res;\n};\n\nDecoderBuffer.prototype.isEmpty = function isEmpty() {\n return this.offset === this.length;\n};\n\nDecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {\n if (this.offset + 1 <= this.length)\n return this.base.readUInt8(this.offset++, true);\n else\n return this.error(fail || 'DecoderBuffer overrun');\n};\n\nDecoderBuffer.prototype.skip = function skip(bytes, fail) {\n if (!(this.offset + bytes <= this.length))\n return this.error(fail || 'DecoderBuffer overrun');\n\n const res = new DecoderBuffer(this.base);\n\n // Share reporter state\n res._reporterState = this._reporterState;\n\n res.offset = this.offset;\n res.length = this.offset + bytes;\n this.offset += bytes;\n return res;\n};\n\nDecoderBuffer.prototype.raw = function raw(save) {\n return this.base.slice(save ? save.offset : this.offset, this.length);\n};\n\nfunction EncoderBuffer(value, reporter) {\n if (Array.isArray(value)) {\n this.length = 0;\n this.value = value.map(function(item) {\n if (!EncoderBuffer.isEncoderBuffer(item))\n item = new EncoderBuffer(item, reporter);\n this.length += item.length;\n return item;\n }, this);\n } else if (typeof value === 'number') {\n if (!(0 <= value && value <= 0xff))\n return reporter.error('non-byte EncoderBuffer value');\n this.value = value;\n this.length = 1;\n } else if (typeof value === 'string') {\n this.value = value;\n this.length = Buffer.byteLength(value);\n } else if (Buffer.isBuffer(value)) {\n this.value = value;\n this.length = value.length;\n } else {\n return reporter.error('Unsupported type: ' + typeof value);\n }\n}\nexports.EncoderBuffer = EncoderBuffer;\n\nEncoderBuffer.isEncoderBuffer = function isEncoderBuffer(data) {\n if (data instanceof EncoderBuffer) {\n return true;\n }\n\n // Or accept compatible API\n const isCompatible = typeof data === 'object' &&\n data.constructor.name === 'EncoderBuffer' &&\n typeof data.length === 'number' &&\n typeof data.join === 'function';\n\n return isCompatible;\n};\n\nEncoderBuffer.prototype.join = function join(out, offset) {\n if (!out)\n out = Buffer.alloc(this.length);\n if (!offset)\n offset = 0;\n\n if (this.length === 0)\n return out;\n\n if (Array.isArray(this.value)) {\n this.value.forEach(function(item) {\n item.join(out, offset);\n offset += item.length;\n });\n } else {\n if (typeof this.value === 'number')\n out[offset] = this.value;\n else if (typeof this.value === 'string')\n out.write(this.value, offset);\n else if (Buffer.isBuffer(this.value))\n this.value.copy(out, offset);\n offset += this.length;\n }\n\n return out;\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1/base/buffer.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1/base/index.js": +/*!*****************************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1/base/index.js ***! + \*****************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("\n\nconst base = exports;\n\nbase.Reporter = (__webpack_require__(/*! ./reporter */ \"./node_modules/asn1.js/lib/asn1/base/reporter.js\").Reporter);\nbase.DecoderBuffer = (__webpack_require__(/*! ./buffer */ \"./node_modules/asn1.js/lib/asn1/base/buffer.js\").DecoderBuffer);\nbase.EncoderBuffer = (__webpack_require__(/*! ./buffer */ \"./node_modules/asn1.js/lib/asn1/base/buffer.js\").EncoderBuffer);\nbase.Node = __webpack_require__(/*! ./node */ \"./node_modules/asn1.js/lib/asn1/base/node.js\");\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1/base/index.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1/base/node.js": +/*!****************************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1/base/node.js ***! + \****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nconst Reporter = (__webpack_require__(/*! ../base/reporter */ \"./node_modules/asn1.js/lib/asn1/base/reporter.js\").Reporter);\nconst EncoderBuffer = (__webpack_require__(/*! ../base/buffer */ \"./node_modules/asn1.js/lib/asn1/base/buffer.js\").EncoderBuffer);\nconst DecoderBuffer = (__webpack_require__(/*! ../base/buffer */ \"./node_modules/asn1.js/lib/asn1/base/buffer.js\").DecoderBuffer);\nconst assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\n// Supported tags\nconst tags = [\n 'seq', 'seqof', 'set', 'setof', 'objid', 'bool',\n 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',\n 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',\n 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'\n];\n\n// Public methods list\nconst methods = [\n 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',\n 'any', 'contains'\n].concat(tags);\n\n// Overrided methods list\nconst overrided = [\n '_peekTag', '_decodeTag', '_use',\n '_decodeStr', '_decodeObjid', '_decodeTime',\n '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',\n\n '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',\n '_encodeNull', '_encodeInt', '_encodeBool'\n];\n\nfunction Node(enc, parent, name) {\n const state = {};\n this._baseState = state;\n\n state.name = name;\n state.enc = enc;\n\n state.parent = parent || null;\n state.children = null;\n\n // State\n state.tag = null;\n state.args = null;\n state.reverseArgs = null;\n state.choice = null;\n state.optional = false;\n state.any = false;\n state.obj = false;\n state.use = null;\n state.useDecoder = null;\n state.key = null;\n state['default'] = null;\n state.explicit = null;\n state.implicit = null;\n state.contains = null;\n\n // Should create new instance on each method\n if (!state.parent) {\n state.children = [];\n this._wrap();\n }\n}\nmodule.exports = Node;\n\nconst stateProps = [\n 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',\n 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',\n 'implicit', 'contains'\n];\n\nNode.prototype.clone = function clone() {\n const state = this._baseState;\n const cstate = {};\n stateProps.forEach(function(prop) {\n cstate[prop] = state[prop];\n });\n const res = new this.constructor(cstate.parent);\n res._baseState = cstate;\n return res;\n};\n\nNode.prototype._wrap = function wrap() {\n const state = this._baseState;\n methods.forEach(function(method) {\n this[method] = function _wrappedMethod() {\n const clone = new this.constructor(this);\n state.children.push(clone);\n return clone[method].apply(clone, arguments);\n };\n }, this);\n};\n\nNode.prototype._init = function init(body) {\n const state = this._baseState;\n\n assert(state.parent === null);\n body.call(this);\n\n // Filter children\n state.children = state.children.filter(function(child) {\n return child._baseState.parent === this;\n }, this);\n assert.equal(state.children.length, 1, 'Root node can have only one child');\n};\n\nNode.prototype._useArgs = function useArgs(args) {\n const state = this._baseState;\n\n // Filter children and args\n const children = args.filter(function(arg) {\n return arg instanceof this.constructor;\n }, this);\n args = args.filter(function(arg) {\n return !(arg instanceof this.constructor);\n }, this);\n\n if (children.length !== 0) {\n assert(state.children === null);\n state.children = children;\n\n // Replace parent to maintain backward link\n children.forEach(function(child) {\n child._baseState.parent = this;\n }, this);\n }\n if (args.length !== 0) {\n assert(state.args === null);\n state.args = args;\n state.reverseArgs = args.map(function(arg) {\n if (typeof arg !== 'object' || arg.constructor !== Object)\n return arg;\n\n const res = {};\n Object.keys(arg).forEach(function(key) {\n if (key == (key | 0))\n key |= 0;\n const value = arg[key];\n res[value] = key;\n });\n return res;\n });\n }\n};\n\n//\n// Overrided methods\n//\n\noverrided.forEach(function(method) {\n Node.prototype[method] = function _overrided() {\n const state = this._baseState;\n throw new Error(method + ' not implemented for encoding: ' + state.enc);\n };\n});\n\n//\n// Public methods\n//\n\ntags.forEach(function(tag) {\n Node.prototype[tag] = function _tagMethod() {\n const state = this._baseState;\n const args = Array.prototype.slice.call(arguments);\n\n assert(state.tag === null);\n state.tag = tag;\n\n this._useArgs(args);\n\n return this;\n };\n});\n\nNode.prototype.use = function use(item) {\n assert(item);\n const state = this._baseState;\n\n assert(state.use === null);\n state.use = item;\n\n return this;\n};\n\nNode.prototype.optional = function optional() {\n const state = this._baseState;\n\n state.optional = true;\n\n return this;\n};\n\nNode.prototype.def = function def(val) {\n const state = this._baseState;\n\n assert(state['default'] === null);\n state['default'] = val;\n state.optional = true;\n\n return this;\n};\n\nNode.prototype.explicit = function explicit(num) {\n const state = this._baseState;\n\n assert(state.explicit === null && state.implicit === null);\n state.explicit = num;\n\n return this;\n};\n\nNode.prototype.implicit = function implicit(num) {\n const state = this._baseState;\n\n assert(state.explicit === null && state.implicit === null);\n state.implicit = num;\n\n return this;\n};\n\nNode.prototype.obj = function obj() {\n const state = this._baseState;\n const args = Array.prototype.slice.call(arguments);\n\n state.obj = true;\n\n if (args.length !== 0)\n this._useArgs(args);\n\n return this;\n};\n\nNode.prototype.key = function key(newKey) {\n const state = this._baseState;\n\n assert(state.key === null);\n state.key = newKey;\n\n return this;\n};\n\nNode.prototype.any = function any() {\n const state = this._baseState;\n\n state.any = true;\n\n return this;\n};\n\nNode.prototype.choice = function choice(obj) {\n const state = this._baseState;\n\n assert(state.choice === null);\n state.choice = obj;\n this._useArgs(Object.keys(obj).map(function(key) {\n return obj[key];\n }));\n\n return this;\n};\n\nNode.prototype.contains = function contains(item) {\n const state = this._baseState;\n\n assert(state.use === null);\n state.contains = item;\n\n return this;\n};\n\n//\n// Decoding\n//\n\nNode.prototype._decode = function decode(input, options) {\n const state = this._baseState;\n\n // Decode root node\n if (state.parent === null)\n return input.wrapResult(state.children[0]._decode(input, options));\n\n let result = state['default'];\n let present = true;\n\n let prevKey = null;\n if (state.key !== null)\n prevKey = input.enterKey(state.key);\n\n // Check if tag is there\n if (state.optional) {\n let tag = null;\n if (state.explicit !== null)\n tag = state.explicit;\n else if (state.implicit !== null)\n tag = state.implicit;\n else if (state.tag !== null)\n tag = state.tag;\n\n if (tag === null && !state.any) {\n // Trial and Error\n const save = input.save();\n try {\n if (state.choice === null)\n this._decodeGeneric(state.tag, input, options);\n else\n this._decodeChoice(input, options);\n present = true;\n } catch (e) {\n present = false;\n }\n input.restore(save);\n } else {\n present = this._peekTag(input, tag, state.any);\n\n if (input.isError(present))\n return present;\n }\n }\n\n // Push object on stack\n let prevObj;\n if (state.obj && present)\n prevObj = input.enterObject();\n\n if (present) {\n // Unwrap explicit values\n if (state.explicit !== null) {\n const explicit = this._decodeTag(input, state.explicit);\n if (input.isError(explicit))\n return explicit;\n input = explicit;\n }\n\n const start = input.offset;\n\n // Unwrap implicit and normal values\n if (state.use === null && state.choice === null) {\n let save;\n if (state.any)\n save = input.save();\n const body = this._decodeTag(\n input,\n state.implicit !== null ? state.implicit : state.tag,\n state.any\n );\n if (input.isError(body))\n return body;\n\n if (state.any)\n result = input.raw(save);\n else\n input = body;\n }\n\n if (options && options.track && state.tag !== null)\n options.track(input.path(), start, input.length, 'tagged');\n\n if (options && options.track && state.tag !== null)\n options.track(input.path(), input.offset, input.length, 'content');\n\n // Select proper method for tag\n if (state.any) {\n // no-op\n } else if (state.choice === null) {\n result = this._decodeGeneric(state.tag, input, options);\n } else {\n result = this._decodeChoice(input, options);\n }\n\n if (input.isError(result))\n return result;\n\n // Decode children\n if (!state.any && state.choice === null && state.children !== null) {\n state.children.forEach(function decodeChildren(child) {\n // NOTE: We are ignoring errors here, to let parser continue with other\n // parts of encoded data\n child._decode(input, options);\n });\n }\n\n // Decode contained/encoded by schema, only in bit or octet strings\n if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {\n const data = new DecoderBuffer(result);\n result = this._getUse(state.contains, input._reporterState.obj)\n ._decode(data, options);\n }\n }\n\n // Pop object\n if (state.obj && present)\n result = input.leaveObject(prevObj);\n\n // Set key\n if (state.key !== null && (result !== null || present === true))\n input.leaveKey(prevKey, state.key, result);\n else if (prevKey !== null)\n input.exitKey(prevKey);\n\n return result;\n};\n\nNode.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {\n const state = this._baseState;\n\n if (tag === 'seq' || tag === 'set')\n return null;\n if (tag === 'seqof' || tag === 'setof')\n return this._decodeList(input, tag, state.args[0], options);\n else if (/str$/.test(tag))\n return this._decodeStr(input, tag, options);\n else if (tag === 'objid' && state.args)\n return this._decodeObjid(input, state.args[0], state.args[1], options);\n else if (tag === 'objid')\n return this._decodeObjid(input, null, null, options);\n else if (tag === 'gentime' || tag === 'utctime')\n return this._decodeTime(input, tag, options);\n else if (tag === 'null_')\n return this._decodeNull(input, options);\n else if (tag === 'bool')\n return this._decodeBool(input, options);\n else if (tag === 'objDesc')\n return this._decodeStr(input, tag, options);\n else if (tag === 'int' || tag === 'enum')\n return this._decodeInt(input, state.args && state.args[0], options);\n\n if (state.use !== null) {\n return this._getUse(state.use, input._reporterState.obj)\n ._decode(input, options);\n } else {\n return input.error('unknown tag: ' + tag);\n }\n};\n\nNode.prototype._getUse = function _getUse(entity, obj) {\n\n const state = this._baseState;\n // Create altered use decoder if implicit is set\n state.useDecoder = this._use(entity, obj);\n assert(state.useDecoder._baseState.parent === null);\n state.useDecoder = state.useDecoder._baseState.children[0];\n if (state.implicit !== state.useDecoder._baseState.implicit) {\n state.useDecoder = state.useDecoder.clone();\n state.useDecoder._baseState.implicit = state.implicit;\n }\n return state.useDecoder;\n};\n\nNode.prototype._decodeChoice = function decodeChoice(input, options) {\n const state = this._baseState;\n let result = null;\n let match = false;\n\n Object.keys(state.choice).some(function(key) {\n const save = input.save();\n const node = state.choice[key];\n try {\n const value = node._decode(input, options);\n if (input.isError(value))\n return false;\n\n result = { type: key, value: value };\n match = true;\n } catch (e) {\n input.restore(save);\n return false;\n }\n return true;\n }, this);\n\n if (!match)\n return input.error('Choice not matched');\n\n return result;\n};\n\n//\n// Encoding\n//\n\nNode.prototype._createEncoderBuffer = function createEncoderBuffer(data) {\n return new EncoderBuffer(data, this.reporter);\n};\n\nNode.prototype._encode = function encode(data, reporter, parent) {\n const state = this._baseState;\n if (state['default'] !== null && state['default'] === data)\n return;\n\n const result = this._encodeValue(data, reporter, parent);\n if (result === undefined)\n return;\n\n if (this._skipDefault(result, reporter, parent))\n return;\n\n return result;\n};\n\nNode.prototype._encodeValue = function encode(data, reporter, parent) {\n const state = this._baseState;\n\n // Decode root node\n if (state.parent === null)\n return state.children[0]._encode(data, reporter || new Reporter());\n\n let result = null;\n\n // Set reporter to share it with a child class\n this.reporter = reporter;\n\n // Check if data is there\n if (state.optional && data === undefined) {\n if (state['default'] !== null)\n data = state['default'];\n else\n return;\n }\n\n // Encode children first\n let content = null;\n let primitive = false;\n if (state.any) {\n // Anything that was given is translated to buffer\n result = this._createEncoderBuffer(data);\n } else if (state.choice) {\n result = this._encodeChoice(data, reporter);\n } else if (state.contains) {\n content = this._getUse(state.contains, parent)._encode(data, reporter);\n primitive = true;\n } else if (state.children) {\n content = state.children.map(function(child) {\n if (child._baseState.tag === 'null_')\n return child._encode(null, reporter, data);\n\n if (child._baseState.key === null)\n return reporter.error('Child should have a key');\n const prevKey = reporter.enterKey(child._baseState.key);\n\n if (typeof data !== 'object')\n return reporter.error('Child expected, but input is not object');\n\n const res = child._encode(data[child._baseState.key], reporter, data);\n reporter.leaveKey(prevKey);\n\n return res;\n }, this).filter(function(child) {\n return child;\n });\n content = this._createEncoderBuffer(content);\n } else {\n if (state.tag === 'seqof' || state.tag === 'setof') {\n // TODO(indutny): this should be thrown on DSL level\n if (!(state.args && state.args.length === 1))\n return reporter.error('Too many args for : ' + state.tag);\n\n if (!Array.isArray(data))\n return reporter.error('seqof/setof, but data is not Array');\n\n const child = this.clone();\n child._baseState.implicit = null;\n content = this._createEncoderBuffer(data.map(function(item) {\n const state = this._baseState;\n\n return this._getUse(state.args[0], data)._encode(item, reporter);\n }, child));\n } else if (state.use !== null) {\n result = this._getUse(state.use, parent)._encode(data, reporter);\n } else {\n content = this._encodePrimitive(state.tag, data);\n primitive = true;\n }\n }\n\n // Encode data itself\n if (!state.any && state.choice === null) {\n const tag = state.implicit !== null ? state.implicit : state.tag;\n const cls = state.implicit === null ? 'universal' : 'context';\n\n if (tag === null) {\n if (state.use === null)\n reporter.error('Tag could be omitted only for .use()');\n } else {\n if (state.use === null)\n result = this._encodeComposite(tag, primitive, cls, content);\n }\n }\n\n // Wrap in explicit\n if (state.explicit !== null)\n result = this._encodeComposite(state.explicit, false, 'context', result);\n\n return result;\n};\n\nNode.prototype._encodeChoice = function encodeChoice(data, reporter) {\n const state = this._baseState;\n\n const node = state.choice[data.type];\n if (!node) {\n assert(\n false,\n data.type + ' not found in ' +\n JSON.stringify(Object.keys(state.choice)));\n }\n return node._encode(data.value, reporter);\n};\n\nNode.prototype._encodePrimitive = function encodePrimitive(tag, data) {\n const state = this._baseState;\n\n if (/str$/.test(tag))\n return this._encodeStr(data, tag);\n else if (tag === 'objid' && state.args)\n return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);\n else if (tag === 'objid')\n return this._encodeObjid(data, null, null);\n else if (tag === 'gentime' || tag === 'utctime')\n return this._encodeTime(data, tag);\n else if (tag === 'null_')\n return this._encodeNull();\n else if (tag === 'int' || tag === 'enum')\n return this._encodeInt(data, state.args && state.reverseArgs[0]);\n else if (tag === 'bool')\n return this._encodeBool(data);\n else if (tag === 'objDesc')\n return this._encodeStr(data, tag);\n else\n throw new Error('Unsupported tag: ' + tag);\n};\n\nNode.prototype._isNumstr = function isNumstr(str) {\n return /^[0-9 ]*$/.test(str);\n};\n\nNode.prototype._isPrintstr = function isPrintstr(str) {\n return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str);\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1/base/node.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1/base/reporter.js": +/*!********************************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1/base/reporter.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nfunction Reporter(options) {\n this._reporterState = {\n obj: null,\n path: [],\n options: options || {},\n errors: []\n };\n}\nexports.Reporter = Reporter;\n\nReporter.prototype.isError = function isError(obj) {\n return obj instanceof ReporterError;\n};\n\nReporter.prototype.save = function save() {\n const state = this._reporterState;\n\n return { obj: state.obj, pathLen: state.path.length };\n};\n\nReporter.prototype.restore = function restore(data) {\n const state = this._reporterState;\n\n state.obj = data.obj;\n state.path = state.path.slice(0, data.pathLen);\n};\n\nReporter.prototype.enterKey = function enterKey(key) {\n return this._reporterState.path.push(key);\n};\n\nReporter.prototype.exitKey = function exitKey(index) {\n const state = this._reporterState;\n\n state.path = state.path.slice(0, index - 1);\n};\n\nReporter.prototype.leaveKey = function leaveKey(index, key, value) {\n const state = this._reporterState;\n\n this.exitKey(index);\n if (state.obj !== null)\n state.obj[key] = value;\n};\n\nReporter.prototype.path = function path() {\n return this._reporterState.path.join('/');\n};\n\nReporter.prototype.enterObject = function enterObject() {\n const state = this._reporterState;\n\n const prev = state.obj;\n state.obj = {};\n return prev;\n};\n\nReporter.prototype.leaveObject = function leaveObject(prev) {\n const state = this._reporterState;\n\n const now = state.obj;\n state.obj = prev;\n return now;\n};\n\nReporter.prototype.error = function error(msg) {\n let err;\n const state = this._reporterState;\n\n const inherited = msg instanceof ReporterError;\n if (inherited) {\n err = msg;\n } else {\n err = new ReporterError(state.path.map(function(elem) {\n return '[' + JSON.stringify(elem) + ']';\n }).join(''), msg.message || msg, msg.stack);\n }\n\n if (!state.options.partial)\n throw err;\n\n if (!inherited)\n state.errors.push(err);\n\n return err;\n};\n\nReporter.prototype.wrapResult = function wrapResult(result) {\n const state = this._reporterState;\n if (!state.options.partial)\n return result;\n\n return {\n result: this.isError(result) ? null : result,\n errors: state.errors\n };\n};\n\nfunction ReporterError(path, msg) {\n this.path = path;\n this.rethrow(msg);\n}\ninherits(ReporterError, Error);\n\nReporterError.prototype.rethrow = function rethrow(msg) {\n this.message = msg + ' at: ' + (this.path || '(shallow)');\n if (Error.captureStackTrace)\n Error.captureStackTrace(this, ReporterError);\n\n if (!this.stack) {\n try {\n // IE only adds stack when thrown\n throw new Error(this.message);\n } catch (e) {\n this.stack = e.stack;\n }\n }\n return this;\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1/base/reporter.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1/constants/der.js": +/*!********************************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1/constants/der.js ***! + \********************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +eval("\n\n// Helper\nfunction reverse(map) {\n const res = {};\n\n Object.keys(map).forEach(function(key) {\n // Convert key to integer if it is stringified\n if ((key | 0) == key)\n key = key | 0;\n\n const value = map[key];\n res[value] = key;\n });\n\n return res;\n}\n\nexports.tagClass = {\n 0: 'universal',\n 1: 'application',\n 2: 'context',\n 3: 'private'\n};\nexports.tagClassByName = reverse(exports.tagClass);\n\nexports.tag = {\n 0x00: 'end',\n 0x01: 'bool',\n 0x02: 'int',\n 0x03: 'bitstr',\n 0x04: 'octstr',\n 0x05: 'null_',\n 0x06: 'objid',\n 0x07: 'objDesc',\n 0x08: 'external',\n 0x09: 'real',\n 0x0a: 'enum',\n 0x0b: 'embed',\n 0x0c: 'utf8str',\n 0x0d: 'relativeOid',\n 0x10: 'seq',\n 0x11: 'set',\n 0x12: 'numstr',\n 0x13: 'printstr',\n 0x14: 't61str',\n 0x15: 'videostr',\n 0x16: 'ia5str',\n 0x17: 'utctime',\n 0x18: 'gentime',\n 0x19: 'graphstr',\n 0x1a: 'iso646str',\n 0x1b: 'genstr',\n 0x1c: 'unistr',\n 0x1d: 'charstr',\n 0x1e: 'bmpstr'\n};\nexports.tagByName = reverse(exports.tag);\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1/constants/der.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1/constants/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1/constants/index.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("\n\nconst constants = exports;\n\n// Helper\nconstants._reverse = function reverse(map) {\n const res = {};\n\n Object.keys(map).forEach(function(key) {\n // Convert key to integer if it is stringified\n if ((key | 0) == key)\n key = key | 0;\n\n const value = map[key];\n res[value] = key;\n });\n\n return res;\n};\n\nconstants.der = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/constants/der.js\");\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1/constants/index.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1/decoders/der.js": +/*!*******************************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1/decoders/der.js ***! + \*******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nconst bignum = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\nconst DecoderBuffer = (__webpack_require__(/*! ../base/buffer */ \"./node_modules/asn1.js/lib/asn1/base/buffer.js\").DecoderBuffer);\nconst Node = __webpack_require__(/*! ../base/node */ \"./node_modules/asn1.js/lib/asn1/base/node.js\");\n\n// Import DER constants\nconst der = __webpack_require__(/*! ../constants/der */ \"./node_modules/asn1.js/lib/asn1/constants/der.js\");\n\nfunction DERDecoder(entity) {\n this.enc = 'der';\n this.name = entity.name;\n this.entity = entity;\n\n // Construct base tree\n this.tree = new DERNode();\n this.tree._init(entity.body);\n}\nmodule.exports = DERDecoder;\n\nDERDecoder.prototype.decode = function decode(data, options) {\n if (!DecoderBuffer.isDecoderBuffer(data)) {\n data = new DecoderBuffer(data, options);\n }\n\n return this.tree._decode(data, options);\n};\n\n// Tree methods\n\nfunction DERNode(parent) {\n Node.call(this, 'der', parent);\n}\ninherits(DERNode, Node);\n\nDERNode.prototype._peekTag = function peekTag(buffer, tag, any) {\n if (buffer.isEmpty())\n return false;\n\n const state = buffer.save();\n const decodedTag = derDecodeTag(buffer, 'Failed to peek tag: \"' + tag + '\"');\n if (buffer.isError(decodedTag))\n return decodedTag;\n\n buffer.restore(state);\n\n return decodedTag.tag === tag || decodedTag.tagStr === tag ||\n (decodedTag.tagStr + 'of') === tag || any;\n};\n\nDERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {\n const decodedTag = derDecodeTag(buffer,\n 'Failed to decode tag of \"' + tag + '\"');\n if (buffer.isError(decodedTag))\n return decodedTag;\n\n let len = derDecodeLen(buffer,\n decodedTag.primitive,\n 'Failed to get length of \"' + tag + '\"');\n\n // Failure\n if (buffer.isError(len))\n return len;\n\n if (!any &&\n decodedTag.tag !== tag &&\n decodedTag.tagStr !== tag &&\n decodedTag.tagStr + 'of' !== tag) {\n return buffer.error('Failed to match tag: \"' + tag + '\"');\n }\n\n if (decodedTag.primitive || len !== null)\n return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n\n // Indefinite length... find END tag\n const state = buffer.save();\n const res = this._skipUntilEnd(\n buffer,\n 'Failed to skip indefinite length body: \"' + this.tag + '\"');\n if (buffer.isError(res))\n return res;\n\n len = buffer.offset - state.offset;\n buffer.restore(state);\n return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n};\n\nDERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {\n for (;;) {\n const tag = derDecodeTag(buffer, fail);\n if (buffer.isError(tag))\n return tag;\n const len = derDecodeLen(buffer, tag.primitive, fail);\n if (buffer.isError(len))\n return len;\n\n let res;\n if (tag.primitive || len !== null)\n res = buffer.skip(len);\n else\n res = this._skipUntilEnd(buffer, fail);\n\n // Failure\n if (buffer.isError(res))\n return res;\n\n if (tag.tagStr === 'end')\n break;\n }\n};\n\nDERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,\n options) {\n const result = [];\n while (!buffer.isEmpty()) {\n const possibleEnd = this._peekTag(buffer, 'end');\n if (buffer.isError(possibleEnd))\n return possibleEnd;\n\n const res = decoder.decode(buffer, 'der', options);\n if (buffer.isError(res) && possibleEnd)\n break;\n result.push(res);\n }\n return result;\n};\n\nDERNode.prototype._decodeStr = function decodeStr(buffer, tag) {\n if (tag === 'bitstr') {\n const unused = buffer.readUInt8();\n if (buffer.isError(unused))\n return unused;\n return { unused: unused, data: buffer.raw() };\n } else if (tag === 'bmpstr') {\n const raw = buffer.raw();\n if (raw.length % 2 === 1)\n return buffer.error('Decoding of string type: bmpstr length mismatch');\n\n let str = '';\n for (let i = 0; i < raw.length / 2; i++) {\n str += String.fromCharCode(raw.readUInt16BE(i * 2));\n }\n return str;\n } else if (tag === 'numstr') {\n const numstr = buffer.raw().toString('ascii');\n if (!this._isNumstr(numstr)) {\n return buffer.error('Decoding of string type: ' +\n 'numstr unsupported characters');\n }\n return numstr;\n } else if (tag === 'octstr') {\n return buffer.raw();\n } else if (tag === 'objDesc') {\n return buffer.raw();\n } else if (tag === 'printstr') {\n const printstr = buffer.raw().toString('ascii');\n if (!this._isPrintstr(printstr)) {\n return buffer.error('Decoding of string type: ' +\n 'printstr unsupported characters');\n }\n return printstr;\n } else if (/str$/.test(tag)) {\n return buffer.raw().toString();\n } else {\n return buffer.error('Decoding of string type: ' + tag + ' unsupported');\n }\n};\n\nDERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {\n let result;\n const identifiers = [];\n let ident = 0;\n let subident = 0;\n while (!buffer.isEmpty()) {\n subident = buffer.readUInt8();\n ident <<= 7;\n ident |= subident & 0x7f;\n if ((subident & 0x80) === 0) {\n identifiers.push(ident);\n ident = 0;\n }\n }\n if (subident & 0x80)\n identifiers.push(ident);\n\n const first = (identifiers[0] / 40) | 0;\n const second = identifiers[0] % 40;\n\n if (relative)\n result = identifiers;\n else\n result = [first, second].concat(identifiers.slice(1));\n\n if (values) {\n let tmp = values[result.join(' ')];\n if (tmp === undefined)\n tmp = values[result.join('.')];\n if (tmp !== undefined)\n result = tmp;\n }\n\n return result;\n};\n\nDERNode.prototype._decodeTime = function decodeTime(buffer, tag) {\n const str = buffer.raw().toString();\n\n let year;\n let mon;\n let day;\n let hour;\n let min;\n let sec;\n if (tag === 'gentime') {\n year = str.slice(0, 4) | 0;\n mon = str.slice(4, 6) | 0;\n day = str.slice(6, 8) | 0;\n hour = str.slice(8, 10) | 0;\n min = str.slice(10, 12) | 0;\n sec = str.slice(12, 14) | 0;\n } else if (tag === 'utctime') {\n year = str.slice(0, 2) | 0;\n mon = str.slice(2, 4) | 0;\n day = str.slice(4, 6) | 0;\n hour = str.slice(6, 8) | 0;\n min = str.slice(8, 10) | 0;\n sec = str.slice(10, 12) | 0;\n if (year < 70)\n year = 2000 + year;\n else\n year = 1900 + year;\n } else {\n return buffer.error('Decoding ' + tag + ' time is not supported yet');\n }\n\n return Date.UTC(year, mon - 1, day, hour, min, sec, 0);\n};\n\nDERNode.prototype._decodeNull = function decodeNull() {\n return null;\n};\n\nDERNode.prototype._decodeBool = function decodeBool(buffer) {\n const res = buffer.readUInt8();\n if (buffer.isError(res))\n return res;\n else\n return res !== 0;\n};\n\nDERNode.prototype._decodeInt = function decodeInt(buffer, values) {\n // Bigint, return as it is (assume big endian)\n const raw = buffer.raw();\n let res = new bignum(raw);\n\n if (values)\n res = values[res.toString(10)] || res;\n\n return res;\n};\n\nDERNode.prototype._use = function use(entity, obj) {\n if (typeof entity === 'function')\n entity = entity(obj);\n return entity._getDecoder('der').tree;\n};\n\n// Utility methods\n\nfunction derDecodeTag(buf, fail) {\n let tag = buf.readUInt8(fail);\n if (buf.isError(tag))\n return tag;\n\n const cls = der.tagClass[tag >> 6];\n const primitive = (tag & 0x20) === 0;\n\n // Multi-octet tag - load\n if ((tag & 0x1f) === 0x1f) {\n let oct = tag;\n tag = 0;\n while ((oct & 0x80) === 0x80) {\n oct = buf.readUInt8(fail);\n if (buf.isError(oct))\n return oct;\n\n tag <<= 7;\n tag |= oct & 0x7f;\n }\n } else {\n tag &= 0x1f;\n }\n const tagStr = der.tag[tag];\n\n return {\n cls: cls,\n primitive: primitive,\n tag: tag,\n tagStr: tagStr\n };\n}\n\nfunction derDecodeLen(buf, primitive, fail) {\n let len = buf.readUInt8(fail);\n if (buf.isError(len))\n return len;\n\n // Indefinite form\n if (!primitive && len === 0x80)\n return null;\n\n // Definite form\n if ((len & 0x80) === 0) {\n // Short form\n return len;\n }\n\n // Long form\n const num = len & 0x7f;\n if (num > 4)\n return buf.error('length octect is too long');\n\n len = 0;\n for (let i = 0; i < num; i++) {\n len <<= 8;\n const j = buf.readUInt8(fail);\n if (buf.isError(j))\n return j;\n len |= j;\n }\n\n return len;\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1/decoders/der.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1/decoders/index.js": +/*!*********************************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1/decoders/index.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("\n\nconst decoders = exports;\n\ndecoders.der = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/decoders/der.js\");\ndecoders.pem = __webpack_require__(/*! ./pem */ \"./node_modules/asn1.js/lib/asn1/decoders/pem.js\");\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1/decoders/index.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1/decoders/pem.js": +/*!*******************************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1/decoders/pem.js ***! + \*******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nconst Buffer = (__webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer);\n\nconst DERDecoder = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/decoders/der.js\");\n\nfunction PEMDecoder(entity) {\n DERDecoder.call(this, entity);\n this.enc = 'pem';\n}\ninherits(PEMDecoder, DERDecoder);\nmodule.exports = PEMDecoder;\n\nPEMDecoder.prototype.decode = function decode(data, options) {\n const lines = data.toString().split(/[\\r\\n]+/g);\n\n const label = options.label.toUpperCase();\n\n const re = /^-----(BEGIN|END) ([^-]+)-----$/;\n let start = -1;\n let end = -1;\n for (let i = 0; i < lines.length; i++) {\n const match = lines[i].match(re);\n if (match === null)\n continue;\n\n if (match[2] !== label)\n continue;\n\n if (start === -1) {\n if (match[1] !== 'BEGIN')\n break;\n start = i;\n } else {\n if (match[1] !== 'END')\n break;\n end = i;\n break;\n }\n }\n if (start === -1 || end === -1)\n throw new Error('PEM section not found for: ' + label);\n\n const base64 = lines.slice(start + 1, end).join('');\n // Remove excessive symbols\n base64.replace(/[^a-z0-9+/=]+/gi, '');\n\n const input = Buffer.from(base64, 'base64');\n return DERDecoder.prototype.decode.call(this, input, options);\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1/decoders/pem.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1/encoders/der.js": +/*!*******************************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1/encoders/der.js ***! + \*******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nconst Buffer = (__webpack_require__(/*! safer-buffer */ \"./node_modules/safer-buffer/safer.js\").Buffer);\nconst Node = __webpack_require__(/*! ../base/node */ \"./node_modules/asn1.js/lib/asn1/base/node.js\");\n\n// Import DER constants\nconst der = __webpack_require__(/*! ../constants/der */ \"./node_modules/asn1.js/lib/asn1/constants/der.js\");\n\nfunction DEREncoder(entity) {\n this.enc = 'der';\n this.name = entity.name;\n this.entity = entity;\n\n // Construct base tree\n this.tree = new DERNode();\n this.tree._init(entity.body);\n}\nmodule.exports = DEREncoder;\n\nDEREncoder.prototype.encode = function encode(data, reporter) {\n return this.tree._encode(data, reporter).join();\n};\n\n// Tree methods\n\nfunction DERNode(parent) {\n Node.call(this, 'der', parent);\n}\ninherits(DERNode, Node);\n\nDERNode.prototype._encodeComposite = function encodeComposite(tag,\n primitive,\n cls,\n content) {\n const encodedTag = encodeTag(tag, primitive, cls, this.reporter);\n\n // Short form\n if (content.length < 0x80) {\n const header = Buffer.alloc(2);\n header[0] = encodedTag;\n header[1] = content.length;\n return this._createEncoderBuffer([ header, content ]);\n }\n\n // Long form\n // Count octets required to store length\n let lenOctets = 1;\n for (let i = content.length; i >= 0x100; i >>= 8)\n lenOctets++;\n\n const header = Buffer.alloc(1 + 1 + lenOctets);\n header[0] = encodedTag;\n header[1] = 0x80 | lenOctets;\n\n for (let i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)\n header[i] = j & 0xff;\n\n return this._createEncoderBuffer([ header, content ]);\n};\n\nDERNode.prototype._encodeStr = function encodeStr(str, tag) {\n if (tag === 'bitstr') {\n return this._createEncoderBuffer([ str.unused | 0, str.data ]);\n } else if (tag === 'bmpstr') {\n const buf = Buffer.alloc(str.length * 2);\n for (let i = 0; i < str.length; i++) {\n buf.writeUInt16BE(str.charCodeAt(i), i * 2);\n }\n return this._createEncoderBuffer(buf);\n } else if (tag === 'numstr') {\n if (!this._isNumstr(str)) {\n return this.reporter.error('Encoding of string type: numstr supports ' +\n 'only digits and space');\n }\n return this._createEncoderBuffer(str);\n } else if (tag === 'printstr') {\n if (!this._isPrintstr(str)) {\n return this.reporter.error('Encoding of string type: printstr supports ' +\n 'only latin upper and lower case letters, ' +\n 'digits, space, apostrophe, left and rigth ' +\n 'parenthesis, plus sign, comma, hyphen, ' +\n 'dot, slash, colon, equal sign, ' +\n 'question mark');\n }\n return this._createEncoderBuffer(str);\n } else if (/str$/.test(tag)) {\n return this._createEncoderBuffer(str);\n } else if (tag === 'objDesc') {\n return this._createEncoderBuffer(str);\n } else {\n return this.reporter.error('Encoding of string type: ' + tag +\n ' unsupported');\n }\n};\n\nDERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {\n if (typeof id === 'string') {\n if (!values)\n return this.reporter.error('string objid given, but no values map found');\n if (!values.hasOwnProperty(id))\n return this.reporter.error('objid not found in values map');\n id = values[id].split(/[\\s.]+/g);\n for (let i = 0; i < id.length; i++)\n id[i] |= 0;\n } else if (Array.isArray(id)) {\n id = id.slice();\n for (let i = 0; i < id.length; i++)\n id[i] |= 0;\n }\n\n if (!Array.isArray(id)) {\n return this.reporter.error('objid() should be either array or string, ' +\n 'got: ' + JSON.stringify(id));\n }\n\n if (!relative) {\n if (id[1] >= 40)\n return this.reporter.error('Second objid identifier OOB');\n id.splice(0, 2, id[0] * 40 + id[1]);\n }\n\n // Count number of octets\n let size = 0;\n for (let i = 0; i < id.length; i++) {\n let ident = id[i];\n for (size++; ident >= 0x80; ident >>= 7)\n size++;\n }\n\n const objid = Buffer.alloc(size);\n let offset = objid.length - 1;\n for (let i = id.length - 1; i >= 0; i--) {\n let ident = id[i];\n objid[offset--] = ident & 0x7f;\n while ((ident >>= 7) > 0)\n objid[offset--] = 0x80 | (ident & 0x7f);\n }\n\n return this._createEncoderBuffer(objid);\n};\n\nfunction two(num) {\n if (num < 10)\n return '0' + num;\n else\n return num;\n}\n\nDERNode.prototype._encodeTime = function encodeTime(time, tag) {\n let str;\n const date = new Date(time);\n\n if (tag === 'gentime') {\n str = [\n two(date.getUTCFullYear()),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n 'Z'\n ].join('');\n } else if (tag === 'utctime') {\n str = [\n two(date.getUTCFullYear() % 100),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n 'Z'\n ].join('');\n } else {\n this.reporter.error('Encoding ' + tag + ' time is not supported yet');\n }\n\n return this._encodeStr(str, 'octstr');\n};\n\nDERNode.prototype._encodeNull = function encodeNull() {\n return this._createEncoderBuffer('');\n};\n\nDERNode.prototype._encodeInt = function encodeInt(num, values) {\n if (typeof num === 'string') {\n if (!values)\n return this.reporter.error('String int or enum given, but no values map');\n if (!values.hasOwnProperty(num)) {\n return this.reporter.error('Values map doesn\\'t contain: ' +\n JSON.stringify(num));\n }\n num = values[num];\n }\n\n // Bignum, assume big endian\n if (typeof num !== 'number' && !Buffer.isBuffer(num)) {\n const numArray = num.toArray();\n if (!num.sign && numArray[0] & 0x80) {\n numArray.unshift(0);\n }\n num = Buffer.from(numArray);\n }\n\n if (Buffer.isBuffer(num)) {\n let size = num.length;\n if (num.length === 0)\n size++;\n\n const out = Buffer.alloc(size);\n num.copy(out);\n if (num.length === 0)\n out[0] = 0;\n return this._createEncoderBuffer(out);\n }\n\n if (num < 0x80)\n return this._createEncoderBuffer(num);\n\n if (num < 0x100)\n return this._createEncoderBuffer([0, num]);\n\n let size = 1;\n for (let i = num; i >= 0x100; i >>= 8)\n size++;\n\n const out = new Array(size);\n for (let i = out.length - 1; i >= 0; i--) {\n out[i] = num & 0xff;\n num >>= 8;\n }\n if(out[0] & 0x80) {\n out.unshift(0);\n }\n\n return this._createEncoderBuffer(Buffer.from(out));\n};\n\nDERNode.prototype._encodeBool = function encodeBool(value) {\n return this._createEncoderBuffer(value ? 0xff : 0);\n};\n\nDERNode.prototype._use = function use(entity, obj) {\n if (typeof entity === 'function')\n entity = entity(obj);\n return entity._getEncoder('der').tree;\n};\n\nDERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {\n const state = this._baseState;\n let i;\n if (state['default'] === null)\n return false;\n\n const data = dataBuffer.join();\n if (state.defaultBuffer === undefined)\n state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();\n\n if (data.length !== state.defaultBuffer.length)\n return false;\n\n for (i=0; i < data.length; i++)\n if (data[i] !== state.defaultBuffer[i])\n return false;\n\n return true;\n};\n\n// Utility methods\n\nfunction encodeTag(tag, primitive, cls, reporter) {\n let res;\n\n if (tag === 'seqof')\n tag = 'seq';\n else if (tag === 'setof')\n tag = 'set';\n\n if (der.tagByName.hasOwnProperty(tag))\n res = der.tagByName[tag];\n else if (typeof tag === 'number' && (tag | 0) === tag)\n res = tag;\n else\n return reporter.error('Unknown tag: ' + tag);\n\n if (res >= 0x1f)\n return reporter.error('Multi-octet tag encoding unsupported');\n\n if (!primitive)\n res |= 0x20;\n\n res |= (der.tagClassByName[cls || 'universal'] << 6);\n\n return res;\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1/encoders/der.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1/encoders/index.js": +/*!*********************************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1/encoders/index.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("\n\nconst encoders = exports;\n\nencoders.der = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/encoders/der.js\");\nencoders.pem = __webpack_require__(/*! ./pem */ \"./node_modules/asn1.js/lib/asn1/encoders/pem.js\");\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1/encoders/index.js?"); + +/***/ }), + +/***/ "./node_modules/asn1.js/lib/asn1/encoders/pem.js": +/*!*******************************************************!*\ + !*** ./node_modules/asn1.js/lib/asn1/encoders/pem.js ***! + \*******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nconst inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nconst DEREncoder = __webpack_require__(/*! ./der */ \"./node_modules/asn1.js/lib/asn1/encoders/der.js\");\n\nfunction PEMEncoder(entity) {\n DEREncoder.call(this, entity);\n this.enc = 'pem';\n}\ninherits(PEMEncoder, DEREncoder);\nmodule.exports = PEMEncoder;\n\nPEMEncoder.prototype.encode = function encode(data, options) {\n const buf = DEREncoder.prototype.encode.call(this, data);\n\n const p = buf.toString('base64');\n const out = [ '-----BEGIN ' + options.label + '-----' ];\n for (let i = 0; i < p.length; i += 64)\n out.push(p.slice(i, i + 64));\n out.push('-----END ' + options.label + '-----');\n return out.join('\\n');\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/asn1.js/lib/asn1/encoders/pem.js?"); + +/***/ }), + +/***/ "./node_modules/assert/build/assert.js": +/*!*********************************************!*\ + !*** ./node_modules/assert/build/assert.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("/* provided dependency */ var process = __webpack_require__(/*! ./node_modules/process/browser.js */ \"./node_modules/process/browser.js\");\n// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar _require = __webpack_require__(/*! ./internal/errors */ \"./node_modules/assert/build/internal/errors.js\"),\n _require$codes = _require.codes,\n ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE,\n ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;\n\nvar AssertionError = __webpack_require__(/*! ./internal/assert/assertion_error */ \"./node_modules/assert/build/internal/assert/assertion_error.js\");\n\nvar _require2 = __webpack_require__(/*! util/ */ \"./node_modules/util/util.js\"),\n inspect = _require2.inspect;\n\nvar _require$types = (__webpack_require__(/*! util/ */ \"./node_modules/util/util.js\").types),\n isPromise = _require$types.isPromise,\n isRegExp = _require$types.isRegExp;\n\nvar objectAssign = Object.assign ? Object.assign : (__webpack_require__(/*! es6-object-assign */ \"./node_modules/es6-object-assign/index.js\").assign);\nvar objectIs = Object.is ? Object.is : __webpack_require__(/*! object-is */ \"./node_modules/object-is/index.js\");\nvar errorCache = new Map();\nvar isDeepEqual;\nvar isDeepStrictEqual;\nvar parseExpressionAt;\nvar findNodeAround;\nvar decoder;\n\nfunction lazyLoadComparison() {\n var comparison = __webpack_require__(/*! ./internal/util/comparisons */ \"./node_modules/assert/build/internal/util/comparisons.js\");\n\n isDeepEqual = comparison.isDeepEqual;\n isDeepStrictEqual = comparison.isDeepStrictEqual;\n} // Escape control characters but not \\n and \\t to keep the line breaks and\n// indentation intact.\n// eslint-disable-next-line no-control-regex\n\n\nvar escapeSequencesRegExp = /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/g;\nvar meta = [\"\\\\u0000\", \"\\\\u0001\", \"\\\\u0002\", \"\\\\u0003\", \"\\\\u0004\", \"\\\\u0005\", \"\\\\u0006\", \"\\\\u0007\", '\\\\b', '', '', \"\\\\u000b\", '\\\\f', '', \"\\\\u000e\", \"\\\\u000f\", \"\\\\u0010\", \"\\\\u0011\", \"\\\\u0012\", \"\\\\u0013\", \"\\\\u0014\", \"\\\\u0015\", \"\\\\u0016\", \"\\\\u0017\", \"\\\\u0018\", \"\\\\u0019\", \"\\\\u001a\", \"\\\\u001b\", \"\\\\u001c\", \"\\\\u001d\", \"\\\\u001e\", \"\\\\u001f\"];\n\nvar escapeFn = function escapeFn(str) {\n return meta[str.charCodeAt(0)];\n};\n\nvar warned = false; // The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\nvar NO_EXCEPTION_SENTINEL = {}; // All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction innerFail(obj) {\n if (obj.message instanceof Error) throw obj.message;\n throw new AssertionError(obj);\n}\n\nfunction fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length;\n var internalMessage;\n\n if (argsLen === 0) {\n internalMessage = 'Failed';\n } else if (argsLen === 1) {\n message = actual;\n actual = undefined;\n } else {\n if (warned === false) {\n warned = true;\n var warn = process.emitWarning ? process.emitWarning : console.warn.bind(console);\n warn('assert.fail() with more than one argument is deprecated. ' + 'Please use assert.strictEqual() instead or only pass a message.', 'DeprecationWarning', 'DEP0094');\n }\n\n if (argsLen === 2) operator = '!=';\n }\n\n if (message instanceof Error) throw message;\n var errArgs = {\n actual: actual,\n expected: expected,\n operator: operator === undefined ? 'fail' : operator,\n stackStartFn: stackStartFn || fail\n };\n\n if (message !== undefined) {\n errArgs.message = message;\n }\n\n var err = new AssertionError(errArgs);\n\n if (internalMessage) {\n err.message = internalMessage;\n err.generatedMessage = true;\n }\n\n throw err;\n}\n\nassert.fail = fail; // The AssertionError is defined in internal/error.\n\nassert.AssertionError = AssertionError;\n\nfunction innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = false;\n\n if (argLen === 0) {\n generatedMessage = true;\n message = 'No value argument passed to `assert.ok()`';\n } else if (message instanceof Error) {\n throw message;\n }\n\n var err = new AssertionError({\n actual: value,\n expected: true,\n message: message,\n operator: '==',\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n} // Pure assertion tests whether a value is truthy, as determined\n// by !!value.\n\n\nfunction ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n innerOk.apply(void 0, [ok, args.length].concat(args));\n}\n\nassert.ok = ok; // The equality assertion tests shallow, coercive equality with ==.\n\n/* eslint-disable no-restricted-properties */\n\nassert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n } // eslint-disable-next-line eqeqeq\n\n\n if (actual != expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '==',\n stackStartFn: equal\n });\n }\n}; // The non-equality assertion tests for whether two objects are not\n// equal with !=.\n\n\nassert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n } // eslint-disable-next-line eqeqeq\n\n\n if (actual == expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '!=',\n stackStartFn: notEqual\n });\n }\n}; // The equivalence assertion tests a deep equality relation.\n\n\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n\n if (!isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepEqual',\n stackStartFn: deepEqual\n });\n }\n}; // The non-equivalence assertion tests for any deep inequality.\n\n\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n\n if (isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepEqual',\n stackStartFn: notDeepEqual\n });\n }\n};\n/* eslint-enable */\n\n\nassert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n\n if (!isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepStrictEqual',\n stackStartFn: deepStrictEqual\n });\n }\n};\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\n\nfunction notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n\n if (isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepStrictEqual',\n stackStartFn: notDeepStrictEqual\n });\n }\n}\n\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (!objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'strictEqual',\n stackStartFn: strictEqual\n });\n }\n};\n\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notStrictEqual',\n stackStartFn: notStrictEqual\n });\n }\n};\n\nvar Comparison = function Comparison(obj, keys, actual) {\n var _this = this;\n\n _classCallCheck(this, Comparison);\n\n keys.forEach(function (key) {\n if (key in obj) {\n if (actual !== undefined && typeof actual[key] === 'string' && isRegExp(obj[key]) && obj[key].test(actual[key])) {\n _this[key] = actual[key];\n } else {\n _this[key] = obj[key];\n }\n }\n });\n};\n\nfunction compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) {\n if (!message) {\n // Create placeholder objects to create a nice output.\n var a = new Comparison(actual, keys);\n var b = new Comparison(expected, keys, actual);\n var err = new AssertionError({\n actual: a,\n expected: b,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.actual = actual;\n err.expected = expected;\n err.operator = fn.name;\n throw err;\n }\n\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n}\n\nfunction expectedException(actual, expected, msg, fn) {\n if (typeof expected !== 'function') {\n if (isRegExp(expected)) return expected.test(actual); // assert.doesNotThrow does not accept objects.\n\n if (arguments.length === 2) {\n throw new ERR_INVALID_ARG_TYPE('expected', ['Function', 'RegExp'], expected);\n } // Handle primitives properly.\n\n\n if (_typeof(actual) !== 'object' || actual === null) {\n var err = new AssertionError({\n actual: actual,\n expected: expected,\n message: msg,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.operator = fn.name;\n throw err;\n }\n\n var keys = Object.keys(expected); // Special handle errors to make sure the name and the message are compared\n // as well.\n\n if (expected instanceof Error) {\n keys.push('name', 'message');\n } else if (keys.length === 0) {\n throw new ERR_INVALID_ARG_VALUE('error', expected, 'may not be an empty object');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n keys.forEach(function (key) {\n if (typeof actual[key] === 'string' && isRegExp(expected[key]) && expected[key].test(actual[key])) {\n return;\n }\n\n compareExceptionKey(actual, expected, key, msg, keys, fn);\n });\n return true;\n } // Guard instanceof against arrow functions as they don't have a prototype.\n\n\n if (expected.prototype !== undefined && actual instanceof expected) {\n return true;\n }\n\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n\n return expected.call({}, actual) === true;\n}\n\nfunction getActual(fn) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', 'Function', fn);\n }\n\n try {\n fn();\n } catch (e) {\n return e;\n }\n\n return NO_EXCEPTION_SENTINEL;\n}\n\nfunction checkIsPromise(obj) {\n // Accept native ES6 promises and promises that are implemented in a similar\n // way. Do not accept thenables that use a function as `obj` and that have no\n // `catch` handler.\n // TODO: thenables are checked up until they have the correct methods,\n // but according to documentation, the `then` method should receive\n // the `fulfill` and `reject` arguments as well or it may be never resolved.\n return isPromise(obj) || obj !== null && _typeof(obj) === 'object' && typeof obj.then === 'function' && typeof obj.catch === 'function';\n}\n\nfunction waitForActual(promiseFn) {\n return Promise.resolve().then(function () {\n var resultPromise;\n\n if (typeof promiseFn === 'function') {\n // Return a rejected promise if `promiseFn` throws synchronously.\n resultPromise = promiseFn(); // Fail in case no promise is returned.\n\n if (!checkIsPromise(resultPromise)) {\n throw new ERR_INVALID_RETURN_VALUE('instance of Promise', 'promiseFn', resultPromise);\n }\n } else if (checkIsPromise(promiseFn)) {\n resultPromise = promiseFn;\n } else {\n throw new ERR_INVALID_ARG_TYPE('promiseFn', ['Function', 'Promise'], promiseFn);\n }\n\n return Promise.resolve().then(function () {\n return resultPromise;\n }).then(function () {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function (e) {\n return e;\n });\n });\n}\n\nfunction expectsError(stackStartFn, actual, error, message) {\n if (typeof error === 'string') {\n if (arguments.length === 4) {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n\n if (_typeof(actual) === 'object' && actual !== null) {\n if (actual.message === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error message \\\"\".concat(actual.message, \"\\\" is identical to the message.\"));\n }\n } else if (actual === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error \\\"\".concat(actual, \"\\\" is identical to the message.\"));\n }\n\n message = error;\n error = undefined;\n } else if (error != null && _typeof(error) !== 'object' && typeof error !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = '';\n\n if (error && error.name) {\n details += \" (\".concat(error.name, \")\");\n }\n\n details += message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'rejects' ? 'rejection' : 'exception';\n innerFail({\n actual: undefined,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn: stackStartFn\n });\n }\n\n if (error && !expectedException(actual, error, message, stackStartFn)) {\n throw actual;\n }\n}\n\nfunction expectsNoError(stackStartFn, actual, error, message) {\n if (actual === NO_EXCEPTION_SENTINEL) return;\n\n if (typeof error === 'string') {\n message = error;\n error = undefined;\n }\n\n if (!error || expectedException(actual, error)) {\n var details = message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'doesNotReject' ? 'rejection' : 'exception';\n innerFail({\n actual: actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, \"\\n\") + \"Actual message: \\\"\".concat(actual && actual.message, \"\\\"\"),\n stackStartFn: stackStartFn\n });\n }\n\n throw actual;\n}\n\nassert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n};\n\nassert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n\n return waitForActual(promiseFn).then(function (result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n};\n\nassert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n};\n\nassert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {\n args[_key5 - 1] = arguments[_key5];\n }\n\n return waitForActual(fn).then(function (result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n};\n\nassert.ifError = function ifError(err) {\n if (err !== null && err !== undefined) {\n var message = 'ifError got unwanted exception: ';\n\n if (_typeof(err) === 'object' && typeof err.message === 'string') {\n if (err.message.length === 0 && err.constructor) {\n message += err.constructor.name;\n } else {\n message += err.message;\n }\n } else {\n message += inspect(err);\n }\n\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: 'ifError',\n message: message,\n stackStartFn: ifError\n }); // Make sure we actually have a stack trace!\n\n var origStack = err.stack;\n\n if (typeof origStack === 'string') {\n // This will remove any duplicated frames from the error frames taken\n // from within `ifError` and add the original error frames to the newly\n // created ones.\n var tmp2 = origStack.split('\\n');\n tmp2.shift(); // Filter all frames existing in err.stack.\n\n var tmp1 = newErr.stack.split('\\n');\n\n for (var i = 0; i < tmp2.length; i++) {\n // Find the first occurrence of the frame.\n var pos = tmp1.indexOf(tmp2[i]);\n\n if (pos !== -1) {\n // Only keep new frames.\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n\n newErr.stack = \"\".concat(tmp1.join('\\n'), \"\\n\").concat(tmp2.join('\\n'));\n }\n\n throw newErr;\n }\n}; // Expose a strict only variant of assert\n\n\nfunction strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n innerOk.apply(void 0, [strict, args.length].concat(args));\n}\n\nassert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n});\nassert.strict.strict = assert.strict;\n\n//# sourceURL=webpack://dcp/./node_modules/assert/build/assert.js?"); + +/***/ }), + +/***/ "./node_modules/assert/build/internal/assert/assertion_error.js": +/*!**********************************************************************!*\ + !*** ./node_modules/assert/build/internal/assert/assertion_error.js ***! + \**********************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("/* provided dependency */ var process = __webpack_require__(/*! ./node_modules/process/browser.js */ \"./node_modules/process/browser.js\");\n// Currently in sync with Node.js lib/internal/assert/assertion_error.js\n// https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c\n\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar _require = __webpack_require__(/*! util/ */ \"./node_modules/util/util.js\"),\n inspect = _require.inspect;\n\nvar _require2 = __webpack_require__(/*! ../errors */ \"./node_modules/assert/build/internal/errors.js\"),\n ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE; // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n\n\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n\n return str.substring(this_len - search.length, this_len) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\n\n\nfunction repeat(str, count) {\n count = Math.floor(count);\n if (str.length == 0 || count == 0) return '';\n var maxCount = str.length * count;\n count = Math.floor(Math.log(count) / Math.log(2));\n\n while (count) {\n str += str;\n count--;\n }\n\n str += str.substring(0, maxCount - str.length);\n return str;\n}\n\nvar blue = '';\nvar green = '';\nvar red = '';\nvar white = '';\nvar kReadableOperator = {\n deepStrictEqual: 'Expected values to be strictly deep-equal:',\n strictEqual: 'Expected values to be strictly equal:',\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: 'Expected values to be loosely deep-equal:',\n equal: 'Expected values to be loosely equal:',\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: 'Values identical but not reference-equal:'\n}; // Comparing short primitives should just show === / !== instead of using the\n// diff.\n\nvar kMaxShortLength = 10;\n\nfunction copyError(source) {\n var keys = Object.keys(source);\n var target = Object.create(Object.getPrototypeOf(source));\n keys.forEach(function (key) {\n target[key] = source[key];\n });\n Object.defineProperty(target, 'message', {\n value: source.message\n });\n return target;\n}\n\nfunction inspectValue(val) {\n // The util.inspect default values could be changed. This makes sure the\n // error messages contain the necessary information nevertheless.\n return inspect(val, {\n compact: false,\n customInspect: false,\n depth: 1000,\n maxArrayLength: Infinity,\n // Assert compares only enumerable properties (with a few exceptions).\n showHidden: false,\n // Having a long line as error is better than wrapping the line for\n // comparison for now.\n // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we\n // have meta information about the inspected properties (i.e., know where\n // in what line the property starts and ends).\n breakLength: Infinity,\n // Assert does not detect proxies currently.\n showProxy: false,\n sorted: true,\n // Inspect getters as we also check them when comparing entries.\n getters: true\n });\n}\n\nfunction createErrDiff(actual, expected, operator) {\n var other = '';\n var res = '';\n var lastPos = 0;\n var end = '';\n var skipped = false;\n var actualInspected = inspectValue(actual);\n var actualLines = actualInspected.split('\\n');\n var expectedLines = inspectValue(expected).split('\\n');\n var i = 0;\n var indicator = ''; // In case both values are objects explicitly mark them as not reference equal\n // for the `strictEqual` operator.\n\n if (operator === 'strictEqual' && _typeof(actual) === 'object' && _typeof(expected) === 'object' && actual !== null && expected !== null) {\n operator = 'strictEqualObject';\n } // If \"actual\" and \"expected\" fit on a single line and they are not strictly\n // equal, check further special handling.\n\n\n if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length; // If the character length of \"actual\" and \"expected\" together is less than\n // kMaxShortLength and if neither is an object and at least one of them is\n // not `zero`, use the strict equal comparison to visualize the output.\n\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== 'object' || actual === null) && (_typeof(expected) !== 'object' || expected === null) && (actual !== 0 || expected !== 0)) {\n // -0 === +0\n return \"\".concat(kReadableOperator[operator], \"\\n\\n\") + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], \"\\n\");\n }\n } else if (operator !== 'strictEqualObject') {\n // If the stderr is a tty and the input length is lower than the current\n // columns per line, add a mismatch indicator below the output. If it is\n // not a tty, use a default value of 80 characters.\n var maxLength = process.stderr && process.stderr.isTTY ? process.stderr.columns : 80;\n\n if (inputLength < maxLength) {\n while (actualLines[0][i] === expectedLines[0][i]) {\n i++;\n } // Ignore the first characters.\n\n\n if (i > 2) {\n // Add position indicator for the first mismatch in case it is a\n // single line and the input length is less than the column length.\n indicator = \"\\n \".concat(repeat(' ', i), \"^\");\n i = 0;\n }\n }\n }\n } // Remove all ending lines that match (this optimizes the output for\n // readability by reducing the number of total changed lines).\n\n\n var a = actualLines[actualLines.length - 1];\n var b = expectedLines[expectedLines.length - 1];\n\n while (a === b) {\n if (i++ < 2) {\n end = \"\\n \".concat(a).concat(end);\n } else {\n other = a;\n }\n\n actualLines.pop();\n expectedLines.pop();\n if (actualLines.length === 0 || expectedLines.length === 0) break;\n a = actualLines[actualLines.length - 1];\n b = expectedLines[expectedLines.length - 1];\n }\n\n var maxLines = Math.max(actualLines.length, expectedLines.length); // Strict equal with identical objects that are not identical by reference.\n // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() })\n\n if (maxLines === 0) {\n // We have to get the result again. The lines were all removed before.\n var _actualLines = actualInspected.split('\\n'); // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n\n\n if (_actualLines.length > 30) {\n _actualLines[26] = \"\".concat(blue, \"...\").concat(white);\n\n while (_actualLines.length > 27) {\n _actualLines.pop();\n }\n }\n\n return \"\".concat(kReadableOperator.notIdentical, \"\\n\\n\").concat(_actualLines.join('\\n'), \"\\n\");\n }\n\n if (i > 3) {\n end = \"\\n\".concat(blue, \"...\").concat(white).concat(end);\n skipped = true;\n }\n\n if (other !== '') {\n end = \"\\n \".concat(other).concat(end);\n other = '';\n }\n\n var printedLines = 0;\n var msg = kReadableOperator[operator] + \"\\n\".concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white);\n var skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n\n for (i = 0; i < maxLines; i++) {\n // Only extra expected lines exist\n var cur = i - lastPos;\n\n if (actualLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(expectedLines[i - 2]);\n printedLines++;\n }\n\n res += \"\\n \".concat(expectedLines[i - 1]);\n printedLines++;\n } // Mark the current line as the last diverging one.\n\n\n lastPos = i; // Add the expected line to the cache.\n\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]);\n printedLines++; // Only extra actual lines exist\n } else if (expectedLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n } // Mark the current line as the last diverging one.\n\n\n lastPos = i; // Add the actual line to the result.\n\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLines[i]);\n printedLines++; // Lines diverge\n } else {\n var expectedLine = expectedLines[i];\n var actualLine = actualLines[i]; // If the lines diverge, specifically check for lines that only diverge by\n // a trailing comma. In that case it is actually identical and we should\n // mark it as such.\n\n var divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, ',') || actualLine.slice(0, -1) !== expectedLine); // If the expected line has a trailing comma but is otherwise identical,\n // add a comma at the end of the actual line. Otherwise the output could\n // look weird as in:\n //\n // [\n // 1 // No comma at the end!\n // + 2\n // ]\n //\n\n if (divergingLines && endsWith(expectedLine, ',') && expectedLine.slice(0, -1) === actualLine) {\n divergingLines = false;\n actualLine += ',';\n }\n\n if (divergingLines) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n } // Mark the current line as the last diverging one.\n\n\n lastPos = i; // Add the actual line to the result and cache the expected diverging\n // line so consecutive diverging lines show up as +++--- and not +-+-+-.\n\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLine);\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLine);\n printedLines += 2; // Lines are identical\n } else {\n // Add all cached information to the result before adding other things\n // and reset the cache.\n res += other;\n other = ''; // If the last diverging line is exactly one line above or if it is the\n // very first line, add the line to the result.\n\n if (cur === 1 || i === 0) {\n res += \"\\n \".concat(actualLine);\n printedLines++;\n }\n }\n } // Inspected object to big (Show ~20 rows max)\n\n\n if (printedLines > 20 && i < maxLines - 2) {\n return \"\".concat(msg).concat(skippedMsg, \"\\n\").concat(res, \"\\n\").concat(blue, \"...\").concat(white).concat(other, \"\\n\") + \"\".concat(blue, \"...\").concat(white);\n }\n }\n\n return \"\".concat(msg).concat(skipped ? skippedMsg : '', \"\\n\").concat(res).concat(other).concat(end).concat(indicator);\n}\n\nvar AssertionError =\n/*#__PURE__*/\nfunction (_Error) {\n _inherits(AssertionError, _Error);\n\n function AssertionError(options) {\n var _this;\n\n _classCallCheck(this, AssertionError);\n\n if (_typeof(options) !== 'object' || options === null) {\n throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);\n }\n\n var message = options.message,\n operator = options.operator,\n stackStartFn = options.stackStartFn;\n var actual = options.actual,\n expected = options.expected;\n var limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n\n if (message != null) {\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, String(message)));\n } else {\n if (process.stderr && process.stderr.isTTY) {\n // Reset on each call to make sure we handle dynamically set environment\n // variables correct.\n if (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1) {\n blue = \"\\x1B[34m\";\n green = \"\\x1B[32m\";\n white = \"\\x1B[39m\";\n red = \"\\x1B[31m\";\n } else {\n blue = '';\n green = '';\n white = '';\n red = '';\n }\n } // Prevent the error stack from being visible by duplicating the error\n // in a very close way to the original in case both sides are actually\n // instances of Error.\n\n\n if (_typeof(actual) === 'object' && actual !== null && _typeof(expected) === 'object' && expected !== null && 'stack' in actual && actual instanceof Error && 'stack' in expected && expected instanceof Error) {\n actual = copyError(actual);\n expected = copyError(expected);\n }\n\n if (operator === 'deepStrictEqual' || operator === 'strictEqual') {\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, createErrDiff(actual, expected, operator)));\n } else if (operator === 'notDeepStrictEqual' || operator === 'notStrictEqual') {\n // In case the objects are equal but the operator requires unequal, show\n // the first object and say A equals B\n var base = kReadableOperator[operator];\n var res = inspectValue(actual).split('\\n'); // In case \"actual\" is an object, it should not be reference equal.\n\n if (operator === 'notStrictEqual' && _typeof(actual) === 'object' && actual !== null) {\n base = kReadableOperator.notStrictEqualObject;\n } // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n\n\n if (res.length > 30) {\n res[26] = \"\".concat(blue, \"...\").concat(white);\n\n while (res.length > 27) {\n res.pop();\n }\n } // Only print a single input.\n\n\n if (res.length === 1) {\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, \"\".concat(base, \" \").concat(res[0])));\n } else {\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, \"\".concat(base, \"\\n\\n\").concat(res.join('\\n'), \"\\n\")));\n }\n } else {\n var _res = inspectValue(actual);\n\n var other = '';\n var knownOperators = kReadableOperator[operator];\n\n if (operator === 'notDeepEqual' || operator === 'notEqual') {\n _res = \"\".concat(kReadableOperator[operator], \"\\n\\n\").concat(_res);\n\n if (_res.length > 1024) {\n _res = \"\".concat(_res.slice(0, 1021), \"...\");\n }\n } else {\n other = \"\".concat(inspectValue(expected));\n\n if (_res.length > 512) {\n _res = \"\".concat(_res.slice(0, 509), \"...\");\n }\n\n if (other.length > 512) {\n other = \"\".concat(other.slice(0, 509), \"...\");\n }\n\n if (operator === 'deepEqual' || operator === 'equal') {\n _res = \"\".concat(knownOperators, \"\\n\\n\").concat(_res, \"\\n\\nshould equal\\n\\n\");\n } else {\n other = \" \".concat(operator, \" \").concat(other);\n }\n }\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, \"\".concat(_res).concat(other)));\n }\n }\n\n Error.stackTraceLimit = limit;\n _this.generatedMessage = !message;\n Object.defineProperty(_assertThisInitialized(_this), 'name', {\n value: 'AssertionError [ERR_ASSERTION]',\n enumerable: false,\n writable: true,\n configurable: true\n });\n _this.code = 'ERR_ASSERTION';\n _this.actual = actual;\n _this.expected = expected;\n _this.operator = operator;\n\n if (Error.captureStackTrace) {\n // eslint-disable-next-line no-restricted-syntax\n Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn);\n } // Create error message including the error code in the name.\n\n\n _this.stack; // Reset the name.\n\n _this.name = 'AssertionError';\n return _possibleConstructorReturn(_this);\n }\n\n _createClass(AssertionError, [{\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n }, {\n key: inspect.custom,\n value: function value(recurseTimes, ctx) {\n // This limits the `actual` and `expected` property default inspection to\n // the minimum depth. Otherwise those values would be too verbose compared\n // to the actual error message which contains a combined view of these two\n // input values.\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: false,\n depth: 0\n }));\n }\n }]);\n\n return AssertionError;\n}(_wrapNativeSuper(Error));\n\nmodule.exports = AssertionError;\n\n//# sourceURL=webpack://dcp/./node_modules/assert/build/internal/assert/assertion_error.js?"); + +/***/ }), + +/***/ "./node_modules/assert/build/internal/errors.js": +/*!******************************************************!*\ + !*** ./node_modules/assert/build/internal/errors.js ***! + \******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("// Currently in sync with Node.js lib/internal/errors.js\n// https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f\n\n/* eslint node-core/documented-errors: \"error\" */\n\n/* eslint node-core/alphabetize-errors: \"error\" */\n\n/* eslint node-core/prefer-util-format-errors: \"error\" */\n // The whole point behind this internal module is to allow Node.js to no\n// longer be forced to treat every error message change as a semver-major\n// change. The NodeError classes here all expose a `code` property whose\n// value statically and permanently identifies the error. While the error\n// message may change, the code should not.\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar codes = {}; // Lazy loaded\n\nvar assert;\nvar util;\n\nfunction createErrorType(code, message, Base) {\n if (!Base) {\n Base = Error;\n }\n\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === 'string') {\n return message;\n } else {\n return message(arg1, arg2, arg3);\n }\n }\n\n var NodeError =\n /*#__PURE__*/\n function (_Base) {\n _inherits(NodeError, _Base);\n\n function NodeError(arg1, arg2, arg3) {\n var _this;\n\n _classCallCheck(this, NodeError);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError).call(this, getMessage(arg1, arg2, arg3)));\n _this.code = code;\n return _this;\n }\n\n return NodeError;\n }(Base);\n\n codes[code] = NodeError;\n} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\n\n\nfunction oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function (i) {\n return String(i);\n });\n\n if (len > 2) {\n return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(', '), \", or \") + expected[len - 1];\n } else if (len === 2) {\n return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n } else {\n return \"of \".concat(thing, \" \").concat(expected[0]);\n }\n } else {\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\n\n\nfunction startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n\n\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n\n return str.substring(this_len - search.length, this_len) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\n\n\nfunction includes(str, search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n\n if (start + search.length > str.length) {\n return false;\n } else {\n return str.indexOf(search, start) !== -1;\n }\n}\n\ncreateErrorType('ERR_AMBIGUOUS_ARGUMENT', 'The \"%s\" argument is ambiguous. %s', TypeError);\ncreateErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {\n if (assert === undefined) assert = __webpack_require__(/*! ../assert */ \"./node_modules/assert/build/assert.js\");\n assert(typeof name === 'string', \"'name' must be a string\"); // determiner: 'must be' or 'must not be'\n\n var determiner;\n\n if (typeof expected === 'string' && startsWith(expected, 'not ')) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n } else {\n determiner = 'must be';\n }\n\n var msg;\n\n if (endsWith(name, ' argument')) {\n // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } else {\n var type = includes(name, '.') ? 'property' : 'argument';\n msg = \"The \\\"\".concat(name, \"\\\" \").concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } // TODO(BridgeAR): Improve the output by showing `null` and similar.\n\n\n msg += \". Received type \".concat(_typeof(actual));\n return msg;\n}, TypeError);\ncreateErrorType('ERR_INVALID_ARG_VALUE', function (name, value) {\n var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'is invalid';\n if (util === undefined) util = __webpack_require__(/*! util/ */ \"./node_modules/util/util.js\");\n var inspected = util.inspect(value);\n\n if (inspected.length > 128) {\n inspected = \"\".concat(inspected.slice(0, 128), \"...\");\n }\n\n return \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n}, TypeError, RangeError);\ncreateErrorType('ERR_INVALID_RETURN_VALUE', function (input, name, value) {\n var type;\n\n if (value && value.constructor && value.constructor.name) {\n type = \"instance of \".concat(value.constructor.name);\n } else {\n type = \"type \".concat(_typeof(value));\n }\n\n return \"Expected \".concat(input, \" to be returned from the \\\"\").concat(name, \"\\\"\") + \" function but got \".concat(type, \".\");\n}, TypeError);\ncreateErrorType('ERR_MISSING_ARGS', function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (assert === undefined) assert = __webpack_require__(/*! ../assert */ \"./node_modules/assert/build/assert.js\");\n assert(args.length > 0, 'At least one arg needs to be specified');\n var msg = 'The ';\n var len = args.length;\n args = args.map(function (a) {\n return \"\\\"\".concat(a, \"\\\"\");\n });\n\n switch (len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n\n default:\n msg += args.slice(0, len - 1).join(', ');\n msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n\n return \"\".concat(msg, \" must be specified\");\n}, TypeError);\nmodule.exports.codes = codes;\n\n//# sourceURL=webpack://dcp/./node_modules/assert/build/internal/errors.js?"); + +/***/ }), + +/***/ "./node_modules/assert/build/internal/util/comparisons.js": +/*!****************************************************************!*\ + !*** ./node_modules/assert/build/internal/util/comparisons.js ***! + \****************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("// Currently in sync with Node.js lib/internal/util/comparisons.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar regexFlagsSupported = /a/g.flags !== undefined;\n\nvar arrayFromSet = function arrayFromSet(set) {\n var array = [];\n set.forEach(function (value) {\n return array.push(value);\n });\n return array;\n};\n\nvar arrayFromMap = function arrayFromMap(map) {\n var array = [];\n map.forEach(function (value, key) {\n return array.push([key, value]);\n });\n return array;\n};\n\nvar objectIs = Object.is ? Object.is : __webpack_require__(/*! object-is */ \"./node_modules/object-is/index.js\");\nvar objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function () {\n return [];\n};\nvar numberIsNaN = Number.isNaN ? Number.isNaN : __webpack_require__(/*! is-nan */ \"./node_modules/is-nan/index.js\");\n\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\n\nvar hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);\nvar propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable);\nvar objectToString = uncurryThis(Object.prototype.toString);\n\nvar _require$types = (__webpack_require__(/*! util/ */ \"./node_modules/util/util.js\").types),\n isAnyArrayBuffer = _require$types.isAnyArrayBuffer,\n isArrayBufferView = _require$types.isArrayBufferView,\n isDate = _require$types.isDate,\n isMap = _require$types.isMap,\n isRegExp = _require$types.isRegExp,\n isSet = _require$types.isSet,\n isNativeError = _require$types.isNativeError,\n isBoxedPrimitive = _require$types.isBoxedPrimitive,\n isNumberObject = _require$types.isNumberObject,\n isStringObject = _require$types.isStringObject,\n isBooleanObject = _require$types.isBooleanObject,\n isBigIntObject = _require$types.isBigIntObject,\n isSymbolObject = _require$types.isSymbolObject,\n isFloat32Array = _require$types.isFloat32Array,\n isFloat64Array = _require$types.isFloat64Array;\n\nfunction isNonIndex(key) {\n if (key.length === 0 || key.length > 10) return true;\n\n for (var i = 0; i < key.length; i++) {\n var code = key.charCodeAt(i);\n if (code < 48 || code > 57) return true;\n } // The maximum size for an array is 2 ** 32 -1.\n\n\n return key.length === 10 && key >= Math.pow(2, 32);\n}\n\nfunction getOwnNonIndexProperties(value) {\n return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));\n} // Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n\n if (y < x) {\n return 1;\n }\n\n return 0;\n}\n\nvar ONLY_ENUMERABLE = undefined;\nvar kStrict = true;\nvar kLoose = false;\nvar kNoIterator = 0;\nvar kIsArray = 1;\nvar kIsSet = 2;\nvar kIsMap = 3; // Check if they have the same source and flags\n\nfunction areSimilarRegExps(a, b) {\n return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);\n}\n\nfunction areSimilarFloatArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n for (var offset = 0; offset < a.byteLength; offset++) {\n if (a[offset] !== b[offset]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction areSimilarTypedArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n return compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;\n}\n\nfunction areEqualArrayBuffers(buf1, buf2) {\n return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;\n}\n\nfunction isEqualBoxedPrimitive(val1, val2) {\n if (isNumberObject(val1)) {\n return isNumberObject(val2) && objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));\n }\n\n if (isStringObject(val1)) {\n return isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);\n }\n\n if (isBooleanObject(val1)) {\n return isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);\n }\n\n if (isBigIntObject(val1)) {\n return isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);\n }\n\n return isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);\n} // Notes: Type tags are historical [[Class]] properties that can be set by\n// FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS\n// and retrieved using Object.prototype.toString.call(obj) in JS\n// See https://tc39.github.io/ecma262/#sec-object.prototype.tostring\n// for a list of tags pre-defined in the spec.\n// There are some unspecified tags in the wild too (e.g. typed array tags).\n// Since tags can be altered, they only serve fast failures\n//\n// Typed arrays and buffers are checked by comparing the content in their\n// underlying ArrayBuffer. This optimization requires that it's\n// reasonable to interpret their underlying memory in the same way,\n// which is checked by comparing their type tags.\n// (e.g. a Uint8Array and a Uint16Array with the same memory content\n// could still be different because they will be interpreted differently).\n//\n// For strict comparison, objects should have\n// a) The same built-in type tags\n// b) The same prototypes.\n\n\nfunction innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? objectIs(val1, val2) : true;\n } // Check more closely if val1 and val2 are equal.\n\n\n if (strict) {\n if (_typeof(val1) !== 'object') {\n return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2);\n }\n\n if (_typeof(val2) !== 'object' || val1 === null || val2 === null) {\n return false;\n }\n\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) {\n return false;\n }\n } else {\n if (val1 === null || _typeof(val1) !== 'object') {\n if (val2 === null || _typeof(val2) !== 'object') {\n // eslint-disable-next-line eqeqeq\n return val1 == val2;\n }\n\n return false;\n }\n\n if (val2 === null || _typeof(val2) !== 'object') {\n return false;\n }\n }\n\n var val1Tag = objectToString(val1);\n var val2Tag = objectToString(val2);\n\n if (val1Tag !== val2Tag) {\n return false;\n }\n\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) {\n return false;\n }\n\n var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsArray, keys1);\n } // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n\n\n if (val1Tag === '[object Object]') {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) {\n return false;\n }\n }\n\n if (isDate(val1)) {\n if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) {\n return false;\n }\n } else if (isRegExp(val1)) {\n if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) {\n return false;\n }\n } else if (isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) {\n return false;\n }\n } else if (isArrayBufferView(val1)) {\n if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {\n if (!areSimilarFloatArrays(val1, val2)) {\n return false;\n }\n } else if (!areSimilarTypedArrays(val1, val2)) {\n return false;\n } // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n\n\n var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n\n var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (_keys.length !== _keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);\n } else if (isSet(val1)) {\n if (!isSet(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsSet);\n } else if (isMap(val1)) {\n if (!isMap(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsMap);\n } else if (isAnyArrayBuffer(val1)) {\n if (!areEqualArrayBuffers(val1, val2)) {\n return false;\n }\n } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator);\n}\n\nfunction getEnumerables(val, keys) {\n return keys.filter(function (k) {\n return propertyIsEnumerable(val, k);\n });\n}\n\nfunction keyCheck(val1, val2, strict, memos, iterationType, aKeys) {\n // For all remaining Object pairs, including Array, objects and Maps,\n // equivalence is determined by having:\n // a) The same number of owned enumerable properties\n // b) The same set of keys/indexes (although not necessarily the same order)\n // c) Equivalent values for every corresponding key/index\n // d) For Sets and Maps, equal contents\n // Note: this accounts for both named and indexed properties on Arrays.\n if (arguments.length === 5) {\n aKeys = Object.keys(val1);\n var bKeys = Object.keys(val2); // The pair must have the same number of owned properties.\n\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n } // Cheap key test\n\n\n var i = 0;\n\n for (; i < aKeys.length; i++) {\n if (!hasOwnProperty(val2, aKeys[i])) {\n return false;\n }\n }\n\n if (strict && arguments.length === 5) {\n var symbolKeysA = objectGetOwnPropertySymbols(val1);\n\n if (symbolKeysA.length !== 0) {\n var count = 0;\n\n for (i = 0; i < symbolKeysA.length; i++) {\n var key = symbolKeysA[i];\n\n if (propertyIsEnumerable(val1, key)) {\n if (!propertyIsEnumerable(val2, key)) {\n return false;\n }\n\n aKeys.push(key);\n count++;\n } else if (propertyIsEnumerable(val2, key)) {\n return false;\n }\n }\n\n var symbolKeysB = objectGetOwnPropertySymbols(val2);\n\n if (symbolKeysA.length !== symbolKeysB.length && getEnumerables(val2, symbolKeysB).length !== count) {\n return false;\n }\n } else {\n var _symbolKeysB = objectGetOwnPropertySymbols(val2);\n\n if (_symbolKeysB.length !== 0 && getEnumerables(val2, _symbolKeysB).length !== 0) {\n return false;\n }\n }\n }\n\n if (aKeys.length === 0 && (iterationType === kNoIterator || iterationType === kIsArray && val1.length === 0 || val1.size === 0)) {\n return true;\n } // Use memos to handle cycles.\n\n\n if (memos === undefined) {\n memos = {\n val1: new Map(),\n val2: new Map(),\n position: 0\n };\n } else {\n // We prevent up to two map.has(x) calls by directly retrieving the value\n // and checking for undefined. The map can only contain numbers, so it is\n // safe to check for undefined only.\n var val2MemoA = memos.val1.get(val1);\n\n if (val2MemoA !== undefined) {\n var val2MemoB = memos.val2.get(val2);\n\n if (val2MemoB !== undefined) {\n return val2MemoA === val2MemoB;\n }\n }\n\n memos.position++;\n }\n\n memos.val1.set(val1, memos.position);\n memos.val2.set(val2, memos.position);\n var areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType);\n memos.val1.delete(val1);\n memos.val2.delete(val2);\n return areEq;\n}\n\nfunction setHasEqualElement(set, val1, strict, memo) {\n // Go looking.\n var setValues = arrayFromSet(set);\n\n for (var i = 0; i < setValues.length; i++) {\n var val2 = setValues[i];\n\n if (innerDeepEqual(val1, val2, strict, memo)) {\n // Remove the matching element to make sure we do not check that again.\n set.delete(val2);\n return true;\n }\n }\n\n return false;\n} // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using\n// Sadly it is not possible to detect corresponding values properly in case the\n// type is a string, number, bigint or boolean. The reason is that those values\n// can match lots of different string values (e.g., 1n == '+00001').\n\n\nfunction findLooseMatchingPrimitives(prim) {\n switch (_typeof(prim)) {\n case 'undefined':\n return null;\n\n case 'object':\n // Only pass in null as object!\n return undefined;\n\n case 'symbol':\n return false;\n\n case 'string':\n prim = +prim;\n // Loose equal entries exist only if the string is possible to convert to\n // a regular number and not NaN.\n // Fall through\n\n case 'number':\n if (numberIsNaN(prim)) {\n return false;\n }\n\n }\n\n return true;\n}\n\nfunction setMightHaveLoosePrim(a, b, prim) {\n var altValue = findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n return b.has(altValue) && !a.has(altValue);\n}\n\nfunction mapMightHaveLoosePrim(a, b, prim, item, memo) {\n var altValue = findLooseMatchingPrimitives(prim);\n\n if (altValue != null) {\n return altValue;\n }\n\n var curB = b.get(altValue);\n\n if (curB === undefined && !b.has(altValue) || !innerDeepEqual(item, curB, false, memo)) {\n return false;\n }\n\n return !a.has(altValue) && innerDeepEqual(item, curB, false, memo);\n}\n\nfunction setEquiv(a, b, strict, memo) {\n // This is a lazily initiated Set of entries which have to be compared\n // pairwise.\n var set = null;\n var aValues = arrayFromSet(a);\n\n for (var i = 0; i < aValues.length; i++) {\n var val = aValues[i]; // Note: Checking for the objects first improves the performance for object\n // heavy sets but it is a minor slow down for primitives. As they are fast\n // to check this improves the worst case scenario instead.\n\n if (_typeof(val) === 'object' && val !== null) {\n if (set === null) {\n set = new Set();\n } // If the specified value doesn't exist in the second set its an not null\n // object (or non strict only: a not matching primitive) we'll need to go\n // hunting for something thats deep-(strict-)equal to it. To make this\n // O(n log n) complexity we have to copy these values in a new set first.\n\n\n set.add(val);\n } else if (!b.has(val)) {\n if (strict) return false; // Fast path to detect missing string, symbol, undefined and null values.\n\n if (!setMightHaveLoosePrim(a, b, val)) {\n return false;\n }\n\n if (set === null) {\n set = new Set();\n }\n\n set.add(val);\n }\n }\n\n if (set !== null) {\n var bValues = arrayFromSet(b);\n\n for (var _i = 0; _i < bValues.length; _i++) {\n var _val = bValues[_i]; // We have to check if a primitive value is already\n // matching and only if it's not, go hunting for it.\n\n if (_typeof(_val) === 'object' && _val !== null) {\n if (!setHasEqualElement(set, _val, strict, memo)) return false;\n } else if (!strict && !a.has(_val) && !setHasEqualElement(set, _val, strict, memo)) {\n return false;\n }\n }\n\n return set.size === 0;\n }\n\n return true;\n}\n\nfunction mapHasEqualEntry(set, map, key1, item1, strict, memo) {\n // To be able to handle cases like:\n // Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']])\n // ... we need to consider *all* matching keys, not just the first we find.\n var setValues = arrayFromSet(set);\n\n for (var i = 0; i < setValues.length; i++) {\n var key2 = setValues[i];\n\n if (innerDeepEqual(key1, key2, strict, memo) && innerDeepEqual(item1, map.get(key2), strict, memo)) {\n set.delete(key2);\n return true;\n }\n }\n\n return false;\n}\n\nfunction mapEquiv(a, b, strict, memo) {\n var set = null;\n var aEntries = arrayFromMap(a);\n\n for (var i = 0; i < aEntries.length; i++) {\n var _aEntries$i = _slicedToArray(aEntries[i], 2),\n key = _aEntries$i[0],\n item1 = _aEntries$i[1];\n\n if (_typeof(key) === 'object' && key !== null) {\n if (set === null) {\n set = new Set();\n }\n\n set.add(key);\n } else {\n // By directly retrieving the value we prevent another b.has(key) check in\n // almost all possible cases.\n var item2 = b.get(key);\n\n if (item2 === undefined && !b.has(key) || !innerDeepEqual(item1, item2, strict, memo)) {\n if (strict) return false; // Fast path to detect missing string, symbol, undefined and null\n // keys.\n\n if (!mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;\n\n if (set === null) {\n set = new Set();\n }\n\n set.add(key);\n }\n }\n }\n\n if (set !== null) {\n var bEntries = arrayFromMap(b);\n\n for (var _i2 = 0; _i2 < bEntries.length; _i2++) {\n var _bEntries$_i = _slicedToArray(bEntries[_i2], 2),\n key = _bEntries$_i[0],\n item = _bEntries$_i[1];\n\n if (_typeof(key) === 'object' && key !== null) {\n if (!mapHasEqualEntry(set, a, key, item, strict, memo)) return false;\n } else if (!strict && (!a.has(key) || !innerDeepEqual(a.get(key), item, false, memo)) && !mapHasEqualEntry(set, a, key, item, false, memo)) {\n return false;\n }\n }\n\n return set.size === 0;\n }\n\n return true;\n}\n\nfunction objEquiv(a, b, strict, keys, memos, iterationType) {\n // Sets and maps don't have their entries accessible via normal object\n // properties.\n var i = 0;\n\n if (iterationType === kIsSet) {\n if (!setEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsMap) {\n if (!mapEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsArray) {\n for (; i < a.length; i++) {\n if (hasOwnProperty(a, i)) {\n if (!hasOwnProperty(b, i) || !innerDeepEqual(a[i], b[i], strict, memos)) {\n return false;\n }\n } else if (hasOwnProperty(b, i)) {\n return false;\n } else {\n // Array is sparse.\n var keysA = Object.keys(a);\n\n for (; i < keysA.length; i++) {\n var key = keysA[i];\n\n if (!hasOwnProperty(b, key) || !innerDeepEqual(a[key], b[key], strict, memos)) {\n return false;\n }\n }\n\n if (keysA.length !== Object.keys(b).length) {\n return false;\n }\n\n return true;\n }\n }\n } // The pair must have equivalent values for every corresponding key.\n // Possibly expensive deep test:\n\n\n for (i = 0; i < keys.length; i++) {\n var _key = keys[i];\n\n if (!innerDeepEqual(a[_key], b[_key], strict, memos)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction isDeepEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kLoose);\n}\n\nfunction isDeepStrictEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kStrict);\n}\n\nmodule.exports = {\n isDeepEqual: isDeepEqual,\n isDeepStrictEqual: isDeepStrictEqual\n};\n\n//# sourceURL=webpack://dcp/./node_modules/assert/build/internal/util/comparisons.js?"); + +/***/ }), + +/***/ "./node_modules/atob/browser-atob.js": +/*!*******************************************!*\ + !*** ./node_modules/atob/browser-atob.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("/* module decorator */ module = __webpack_require__.nmd(module);\n/* provided dependency */ var Buffer = __webpack_require__(/*! ./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js */ \"./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js\")[\"Buffer\"];\n(function (w) {\n \"use strict\";\n\n function findBest(atobNative) {\n // normal window\n if ('function' === typeof atobNative) { return atobNative; }\n\n\n // browserify (web worker)\n if ('function' === typeof Buffer) {\n return function atobBrowserify(a) {\n //!! Deliberately using an API that's deprecated in node.js because\n //!! this file is for browsers and we expect them to cope with it.\n //!! Discussion: github.com/node-browser-compat/atob/pull/9\n return new Buffer(a, 'base64').toString('binary');\n };\n }\n\n // ios web worker with base64js\n if ('object' === typeof w.base64js) {\n // bufferToBinaryString\n // https://git.coolaj86.com/coolaj86/unibabel.js/blob/master/index.js#L50\n return function atobWebWorker_iOS(a) {\n var buf = w.base64js.b64ToByteArray(a);\n return Array.prototype.map.call(buf, function (ch) {\n return String.fromCharCode(ch);\n }).join('');\n };\n }\n\n\t\treturn function () {\n\t\t\t// ios web worker without base64js\n\t\t\tthrow new Error(\"You're probably in an old browser or an iOS webworker.\" +\n\t\t\t\t\" It might help to include beatgammit's base64-js.\");\n };\n }\n\n var atobBest = findBest(w.atob);\n w.atob = atobBest;\n\n if (( true) && module && module.exports) {\n module.exports = atobBest;\n }\n}(window));\n\n\n//# sourceURL=webpack://dcp/./node_modules/atob/browser-atob.js?"); + +/***/ }), + +/***/ "./node_modules/base-x/src/index.js": +/*!******************************************!*\ + !*** ./node_modules/base-x/src/index.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\n// @ts-ignore\nvar _Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\nfunction base (ALPHABET) {\n if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n var BASE_MAP = new Uint8Array(256)\n for (var j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255\n }\n for (var i = 0; i < ALPHABET.length; i++) {\n var x = ALPHABET.charAt(i)\n var xc = x.charCodeAt(0)\n if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n BASE_MAP[xc] = i\n }\n var BASE = ALPHABET.length\n var LEADER = ALPHABET.charAt(0)\n var FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up\n var iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up\n function encode (source) {\n if (Array.isArray(source) || source instanceof Uint8Array) { source = _Buffer.from(source) }\n if (!_Buffer.isBuffer(source)) { throw new TypeError('Expected Buffer') }\n if (source.length === 0) { return '' }\n // Skip & count leading zeroes.\n var zeroes = 0\n var length = 0\n var pbegin = 0\n var pend = source.length\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++\n zeroes++\n }\n // Allocate enough space in big-endian base58 representation.\n var size = ((pend - pbegin) * iFACTOR + 1) >>> 0\n var b58 = new Uint8Array(size)\n // Process the bytes.\n while (pbegin !== pend) {\n var carry = source[pbegin]\n // Apply \"b58 = b58 * 256 + ch\".\n var i = 0\n for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n carry += (256 * b58[it1]) >>> 0\n b58[it1] = (carry % BASE) >>> 0\n carry = (carry / BASE) >>> 0\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i\n pbegin++\n }\n // Skip leading zeroes in base58 result.\n var it2 = size - length\n while (it2 !== size && b58[it2] === 0) {\n it2++\n }\n // Translate the result into a string.\n var str = LEADER.repeat(zeroes)\n for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }\n return str\n }\n function decodeUnsafe (source) {\n if (typeof source !== 'string') { throw new TypeError('Expected String') }\n if (source.length === 0) { return _Buffer.alloc(0) }\n var psz = 0\n // Skip and count leading '1's.\n var zeroes = 0\n var length = 0\n while (source[psz] === LEADER) {\n zeroes++\n psz++\n }\n // Allocate enough space in big-endian base256 representation.\n var size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.\n var b256 = new Uint8Array(size)\n // Process the characters.\n while (source[psz]) {\n // Decode character\n var carry = BASE_MAP[source.charCodeAt(psz)]\n // Invalid character\n if (carry === 255) { return }\n var i = 0\n for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n carry += (BASE * b256[it3]) >>> 0\n b256[it3] = (carry % 256) >>> 0\n carry = (carry / 256) >>> 0\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i\n psz++\n }\n // Skip leading zeroes in b256.\n var it4 = size - length\n while (it4 !== size && b256[it4] === 0) {\n it4++\n }\n var vch = _Buffer.allocUnsafe(zeroes + (size - it4))\n vch.fill(0x00, 0, zeroes)\n var j = zeroes\n while (it4 !== size) {\n vch[j++] = b256[it4++]\n }\n return vch\n }\n function decode (string) {\n var buffer = decodeUnsafe(string)\n if (buffer) { return buffer }\n throw new Error('Non-base' + BASE + ' character')\n }\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}\nmodule.exports = base\n\n\n//# sourceURL=webpack://dcp/./node_modules/base-x/src/index.js?"); + +/***/ }), + +/***/ "./node_modules/base64-js/index.js": +/*!*****************************************!*\ + !*** ./node_modules/base64-js/index.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +eval("\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/base64-js/index.js?"); + +/***/ }), + +/***/ "./node_modules/bignumber.js/bignumber.js": +/*!************************************************!*\ + !*** ./node_modules/bignumber.js/bignumber.js ***! + \************************************************/ +/***/ (function(module, exports, __webpack_require__) { + +eval("var __WEBPACK_AMD_DEFINE_RESULT__;;(function (globalObject) {\r\n 'use strict';\r\n\r\n/*\r\n * bignumber.js v9.0.1\r\n * A JavaScript library for arbitrary-precision arithmetic.\r\n * https://github.com/MikeMcl/bignumber.js\r\n * Copyright (c) 2020 Michael Mclaughlin \r\n * MIT Licensed.\r\n *\r\n * BigNumber.prototype methods | BigNumber methods\r\n * |\r\n * absoluteValue abs | clone\r\n * comparedTo | config set\r\n * decimalPlaces dp | DECIMAL_PLACES\r\n * dividedBy div | ROUNDING_MODE\r\n * dividedToIntegerBy idiv | EXPONENTIAL_AT\r\n * exponentiatedBy pow | RANGE\r\n * integerValue | CRYPTO\r\n * isEqualTo eq | MODULO_MODE\r\n * isFinite | POW_PRECISION\r\n * isGreaterThan gt | FORMAT\r\n * isGreaterThanOrEqualTo gte | ALPHABET\r\n * isInteger | isBigNumber\r\n * isLessThan lt | maximum max\r\n * isLessThanOrEqualTo lte | minimum min\r\n * isNaN | random\r\n * isNegative | sum\r\n * isPositive |\r\n * isZero |\r\n * minus |\r\n * modulo mod |\r\n * multipliedBy times |\r\n * negated |\r\n * plus |\r\n * precision sd |\r\n * shiftedBy |\r\n * squareRoot sqrt |\r\n * toExponential |\r\n * toFixed |\r\n * toFormat |\r\n * toFraction |\r\n * toJSON |\r\n * toNumber |\r\n * toPrecision |\r\n * toString |\r\n * valueOf |\r\n *\r\n */\r\n\r\n\r\n var BigNumber,\r\n isNumeric = /^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,\r\n mathceil = Math.ceil,\r\n mathfloor = Math.floor,\r\n\r\n bignumberError = '[BigNumber Error] ',\r\n tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ',\r\n\r\n BASE = 1e14,\r\n LOG_BASE = 14,\r\n MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1\r\n // MAX_INT32 = 0x7fffffff, // 2^31 - 1\r\n POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],\r\n SQRT_BASE = 1e7,\r\n\r\n // EDITABLE\r\n // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and\r\n // the arguments to toExponential, toFixed, toFormat, and toPrecision.\r\n MAX = 1E9; // 0 to MAX_INT32\r\n\r\n\r\n /*\r\n * Create and return a BigNumber constructor.\r\n */\r\n function clone(configObject) {\r\n var div, convertBase, parseNumeric,\r\n P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null },\r\n ONE = new BigNumber(1),\r\n\r\n\r\n //----------------------------- EDITABLE CONFIG DEFAULTS -------------------------------\r\n\r\n\r\n // The default values below must be integers within the inclusive ranges stated.\r\n // The values can also be changed at run-time using BigNumber.set.\r\n\r\n // The maximum number of decimal places for operations involving division.\r\n DECIMAL_PLACES = 20, // 0 to MAX\r\n\r\n // The rounding mode used when rounding to the above decimal places, and when using\r\n // toExponential, toFixed, toFormat and toPrecision, and round (default value).\r\n // UP 0 Away from zero.\r\n // DOWN 1 Towards zero.\r\n // CEIL 2 Towards +Infinity.\r\n // FLOOR 3 Towards -Infinity.\r\n // HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n ROUNDING_MODE = 4, // 0 to 8\r\n\r\n // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]\r\n\r\n // The exponent value at and beneath which toString returns exponential notation.\r\n // Number type: -7\r\n TO_EXP_NEG = -7, // 0 to -MAX\r\n\r\n // The exponent value at and above which toString returns exponential notation.\r\n // Number type: 21\r\n TO_EXP_POS = 21, // 0 to MAX\r\n\r\n // RANGE : [MIN_EXP, MAX_EXP]\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // Number type: -324 (5e-324)\r\n MIN_EXP = -1e7, // -1 to -MAX\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // Number type: 308 (1.7976931348623157e+308)\r\n // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.\r\n MAX_EXP = 1e7, // 1 to MAX\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n CRYPTO = false, // true or false\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend.\r\n // This modulo mode is commonly known as 'truncated division' and is\r\n // equivalent to (a % n) in JavaScript.\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)).\r\n // The remainder is always positive.\r\n //\r\n // The truncated division, floored division, Euclidian division and IEEE 754 remainder\r\n // modes are commonly used for the modulus operation.\r\n // Although the other rounding modes can also be used, they may not give useful results.\r\n MODULO_MODE = 1, // 0 to 9\r\n\r\n // The maximum number of significant digits of the result of the exponentiatedBy operation.\r\n // If POW_PRECISION is 0, there will be unlimited significant digits.\r\n POW_PRECISION = 0, // 0 to MAX\r\n\r\n // The format specification used by the BigNumber.prototype.toFormat method.\r\n FORMAT = {\r\n prefix: '',\r\n groupSize: 3,\r\n secondaryGroupSize: 0,\r\n groupSeparator: ',',\r\n decimalSeparator: '.',\r\n fractionGroupSize: 0,\r\n fractionGroupSeparator: '\\xA0', // non-breaking space\r\n suffix: ''\r\n },\r\n\r\n // The alphabet used for base conversion. It must be at least 2 characters long, with no '+',\r\n // '-', '.', whitespace, or repeated character.\r\n // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'\r\n ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz';\r\n\r\n\r\n //------------------------------------------------------------------------------------------\r\n\r\n\r\n // CONSTRUCTOR\r\n\r\n\r\n /*\r\n * The BigNumber constructor and exported function.\r\n * Create and return a new instance of a BigNumber object.\r\n *\r\n * v {number|string|BigNumber} A numeric value.\r\n * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive.\r\n */\r\n function BigNumber(v, b) {\r\n var alphabet, c, caseChanged, e, i, isNum, len, str,\r\n x = this;\r\n\r\n // Enable constructor call without `new`.\r\n if (!(x instanceof BigNumber)) return new BigNumber(v, b);\r\n\r\n if (b == null) {\r\n\r\n if (v && v._isBigNumber === true) {\r\n x.s = v.s;\r\n\r\n if (!v.c || v.e > MAX_EXP) {\r\n x.c = x.e = null;\r\n } else if (v.e < MIN_EXP) {\r\n x.c = [x.e = 0];\r\n } else {\r\n x.e = v.e;\r\n x.c = v.c.slice();\r\n }\r\n\r\n return;\r\n }\r\n\r\n if ((isNum = typeof v == 'number') && v * 0 == 0) {\r\n\r\n // Use `1 / n` to handle minus zero also.\r\n x.s = 1 / v < 0 ? (v = -v, -1) : 1;\r\n\r\n // Fast path for integers, where n < 2147483648 (2**31).\r\n if (v === ~~v) {\r\n for (e = 0, i = v; i >= 10; i /= 10, e++);\r\n\r\n if (e > MAX_EXP) {\r\n x.c = x.e = null;\r\n } else {\r\n x.e = e;\r\n x.c = [v];\r\n }\r\n\r\n return;\r\n }\r\n\r\n str = String(v);\r\n } else {\r\n\r\n if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);\r\n\r\n x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;\r\n }\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n } else {\r\n\r\n // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n intCheck(b, 2, ALPHABET.length, 'Base');\r\n\r\n // Allow exponential notation to be used with base 10 argument, while\r\n // also rounding to DECIMAL_PLACES as with other bases.\r\n if (b == 10) {\r\n x = new BigNumber(v);\r\n return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);\r\n }\r\n\r\n str = String(v);\r\n\r\n if (isNum = typeof v == 'number') {\r\n\r\n // Avoid potential interpretation of Infinity and NaN as base 44+ values.\r\n if (v * 0 != 0) return parseNumeric(x, str, isNum, b);\r\n\r\n x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;\r\n\r\n // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n if (BigNumber.DEBUG && str.replace(/^0\\.0*|\\./, '').length > 15) {\r\n throw Error\r\n (tooManyDigits + v);\r\n }\r\n } else {\r\n x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;\r\n }\r\n\r\n alphabet = ALPHABET.slice(0, b);\r\n e = i = 0;\r\n\r\n // Check that str is a valid base b number.\r\n // Don't use RegExp, so alphabet can contain special characters.\r\n for (len = str.length; i < len; i++) {\r\n if (alphabet.indexOf(c = str.charAt(i)) < 0) {\r\n if (c == '.') {\r\n\r\n // If '.' is not the first character and it has not be found before.\r\n if (i > e) {\r\n e = len;\r\n continue;\r\n }\r\n } else if (!caseChanged) {\r\n\r\n // Allow e.g. hexadecimal 'FF' as well as 'ff'.\r\n if (str == str.toUpperCase() && (str = str.toLowerCase()) ||\r\n str == str.toLowerCase() && (str = str.toUpperCase())) {\r\n caseChanged = true;\r\n i = -1;\r\n e = 0;\r\n continue;\r\n }\r\n }\r\n\r\n return parseNumeric(x, String(v), isNum, b);\r\n }\r\n }\r\n\r\n // Prevent later check for length on converted number.\r\n isNum = false;\r\n str = convertBase(str, b, 10, x.s);\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n else e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(--len) === 48;);\r\n\r\n if (str = str.slice(i, ++len)) {\r\n len -= i;\r\n\r\n // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n if (isNum && BigNumber.DEBUG &&\r\n len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {\r\n throw Error\r\n (tooManyDigits + (x.s * v));\r\n }\r\n\r\n // Overflow?\r\n if ((e = e - i - 1) > MAX_EXP) {\r\n\r\n // Infinity.\r\n x.c = x.e = null;\r\n\r\n // Underflow?\r\n } else if (e < MIN_EXP) {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n } else {\r\n x.e = e;\r\n x.c = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first element of the coefficient array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE; // i < 1\r\n\r\n if (i < len) {\r\n if (i) x.c.push(+str.slice(0, i));\r\n\r\n for (len -= LOG_BASE; i < len;) {\r\n x.c.push(+str.slice(i, i += LOG_BASE));\r\n }\r\n\r\n i = LOG_BASE - (str = str.slice(i)).length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--; str += '0');\r\n x.c.push(+str);\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.c = [x.e = 0];\r\n }\r\n }\r\n\r\n\r\n // CONSTRUCTOR PROPERTIES\r\n\r\n\r\n BigNumber.clone = clone;\r\n\r\n BigNumber.ROUND_UP = 0;\r\n BigNumber.ROUND_DOWN = 1;\r\n BigNumber.ROUND_CEIL = 2;\r\n BigNumber.ROUND_FLOOR = 3;\r\n BigNumber.ROUND_HALF_UP = 4;\r\n BigNumber.ROUND_HALF_DOWN = 5;\r\n BigNumber.ROUND_HALF_EVEN = 6;\r\n BigNumber.ROUND_HALF_CEIL = 7;\r\n BigNumber.ROUND_HALF_FLOOR = 8;\r\n BigNumber.EUCLID = 9;\r\n\r\n\r\n /*\r\n * Configure infrequently-changing library-wide settings.\r\n *\r\n * Accept an object with the following optional properties (if the value of a property is\r\n * a number, it must be an integer within the inclusive range stated):\r\n *\r\n * DECIMAL_PLACES {number} 0 to MAX\r\n * ROUNDING_MODE {number} 0 to 8\r\n * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX]\r\n * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX]\r\n * CRYPTO {boolean} true or false\r\n * MODULO_MODE {number} 0 to 9\r\n * POW_PRECISION {number} 0 to MAX\r\n * ALPHABET {string} A string of two or more unique characters which does\r\n * not contain '.'.\r\n * FORMAT {object} An object with some of the following properties:\r\n * prefix {string}\r\n * groupSize {number}\r\n * secondaryGroupSize {number}\r\n * groupSeparator {string}\r\n * decimalSeparator {string}\r\n * fractionGroupSize {number}\r\n * fractionGroupSeparator {string}\r\n * suffix {string}\r\n *\r\n * (The values assigned to the above FORMAT object properties are not checked for validity.)\r\n *\r\n * E.g.\r\n * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })\r\n *\r\n * Ignore properties/parameters set to null or undefined, except for ALPHABET.\r\n *\r\n * Return an object with the properties current values.\r\n */\r\n BigNumber.config = BigNumber.set = function (obj) {\r\n var p, v;\r\n\r\n if (obj != null) {\r\n\r\n if (typeof obj == 'object') {\r\n\r\n // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.\r\n // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) {\r\n v = obj[p];\r\n intCheck(v, 0, MAX, p);\r\n DECIMAL_PLACES = v;\r\n }\r\n\r\n // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.\r\n // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) {\r\n v = obj[p];\r\n intCheck(v, 0, 8, p);\r\n ROUNDING_MODE = v;\r\n }\r\n\r\n // EXPONENTIAL_AT {number|number[]}\r\n // Integer, -MAX to MAX inclusive or\r\n // [integer -MAX to 0 inclusive, 0 to MAX inclusive].\r\n // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) {\r\n v = obj[p];\r\n if (v && v.pop) {\r\n intCheck(v[0], -MAX, 0, p);\r\n intCheck(v[1], 0, MAX, p);\r\n TO_EXP_NEG = v[0];\r\n TO_EXP_POS = v[1];\r\n } else {\r\n intCheck(v, -MAX, MAX, p);\r\n TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);\r\n }\r\n }\r\n\r\n // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or\r\n // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].\r\n // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}'\r\n if (obj.hasOwnProperty(p = 'RANGE')) {\r\n v = obj[p];\r\n if (v && v.pop) {\r\n intCheck(v[0], -MAX, -1, p);\r\n intCheck(v[1], 1, MAX, p);\r\n MIN_EXP = v[0];\r\n MAX_EXP = v[1];\r\n } else {\r\n intCheck(v, -MAX, MAX, p);\r\n if (v) {\r\n MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' cannot be zero: ' + v);\r\n }\r\n }\r\n }\r\n\r\n // CRYPTO {boolean} true or false.\r\n // '[BigNumber Error] CRYPTO not true or false: {v}'\r\n // '[BigNumber Error] crypto unavailable'\r\n if (obj.hasOwnProperty(p = 'CRYPTO')) {\r\n v = obj[p];\r\n if (v === !!v) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n CRYPTO = v;\r\n } else {\r\n CRYPTO = !v;\r\n throw Error\r\n (bignumberError + 'crypto unavailable');\r\n }\r\n } else {\r\n CRYPTO = v;\r\n }\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' not true or false: ' + v);\r\n }\r\n }\r\n\r\n // MODULO_MODE {number} Integer, 0 to 9 inclusive.\r\n // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'MODULO_MODE')) {\r\n v = obj[p];\r\n intCheck(v, 0, 9, p);\r\n MODULO_MODE = v;\r\n }\r\n\r\n // POW_PRECISION {number} Integer, 0 to MAX inclusive.\r\n // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}'\r\n if (obj.hasOwnProperty(p = 'POW_PRECISION')) {\r\n v = obj[p];\r\n intCheck(v, 0, MAX, p);\r\n POW_PRECISION = v;\r\n }\r\n\r\n // FORMAT {object}\r\n // '[BigNumber Error] FORMAT not an object: {v}'\r\n if (obj.hasOwnProperty(p = 'FORMAT')) {\r\n v = obj[p];\r\n if (typeof v == 'object') FORMAT = v;\r\n else throw Error\r\n (bignumberError + p + ' not an object: ' + v);\r\n }\r\n\r\n // ALPHABET {string}\r\n // '[BigNumber Error] ALPHABET invalid: {v}'\r\n if (obj.hasOwnProperty(p = 'ALPHABET')) {\r\n v = obj[p];\r\n\r\n // Disallow if less than two characters,\r\n // or if it contains '+', '-', '.', whitespace, or a repeated character.\r\n if (typeof v == 'string' && !/^.?$|[+\\-.\\s]|(.).*\\1/.test(v)) {\r\n ALPHABET = v;\r\n } else {\r\n throw Error\r\n (bignumberError + p + ' invalid: ' + v);\r\n }\r\n }\r\n\r\n } else {\r\n\r\n // '[BigNumber Error] Object expected: {v}'\r\n throw Error\r\n (bignumberError + 'Object expected: ' + obj);\r\n }\r\n }\r\n\r\n return {\r\n DECIMAL_PLACES: DECIMAL_PLACES,\r\n ROUNDING_MODE: ROUNDING_MODE,\r\n EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],\r\n RANGE: [MIN_EXP, MAX_EXP],\r\n CRYPTO: CRYPTO,\r\n MODULO_MODE: MODULO_MODE,\r\n POW_PRECISION: POW_PRECISION,\r\n FORMAT: FORMAT,\r\n ALPHABET: ALPHABET\r\n };\r\n };\r\n\r\n\r\n /*\r\n * Return true if v is a BigNumber instance, otherwise return false.\r\n *\r\n * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed.\r\n *\r\n * v {any}\r\n *\r\n * '[BigNumber Error] Invalid BigNumber: {v}'\r\n */\r\n BigNumber.isBigNumber = function (v) {\r\n if (!v || v._isBigNumber !== true) return false;\r\n if (!BigNumber.DEBUG) return true;\r\n\r\n var i, n,\r\n c = v.c,\r\n e = v.e,\r\n s = v.s;\r\n\r\n out: if ({}.toString.call(c) == '[object Array]') {\r\n\r\n if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {\r\n\r\n // If the first element is zero, the BigNumber value must be zero.\r\n if (c[0] === 0) {\r\n if (e === 0 && c.length === 1) return true;\r\n break out;\r\n }\r\n\r\n // Calculate number of digits that c[0] should have, based on the exponent.\r\n i = (e + 1) % LOG_BASE;\r\n if (i < 1) i += LOG_BASE;\r\n\r\n // Calculate number of digits of c[0].\r\n //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) {\r\n if (String(c[0]).length == i) {\r\n\r\n for (i = 0; i < c.length; i++) {\r\n n = c[i];\r\n if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;\r\n }\r\n\r\n // Last element cannot be zero, unless it is the only element.\r\n if (n !== 0) return true;\r\n }\r\n }\r\n\r\n // Infinity/NaN\r\n } else if (c === null && e === null && (s === null || s === 1 || s === -1)) {\r\n return true;\r\n }\r\n\r\n throw Error\r\n (bignumberError + 'Invalid BigNumber: ' + v);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.maximum = BigNumber.max = function () {\r\n return maxOrMin(arguments, P.lt);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.minimum = BigNumber.min = function () {\r\n return maxOrMin(arguments, P.gt);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,\r\n * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing\r\n * zeros are produced).\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}'\r\n * '[BigNumber Error] crypto unavailable'\r\n */\r\n BigNumber.random = (function () {\r\n var pow2_53 = 0x20000000000000;\r\n\r\n // Return a 53 bit integer n, where 0 <= n < 9007199254740992.\r\n // Check if Math.random() produces more than 32 bits of randomness.\r\n // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.\r\n // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.\r\n var random53bitInt = (Math.random() * pow2_53) & 0x1fffff\r\n ? function () { return mathfloor(Math.random() * pow2_53); }\r\n : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +\r\n (Math.random() * 0x800000 | 0); };\r\n\r\n return function (dp) {\r\n var a, b, e, k, v,\r\n i = 0,\r\n c = [],\r\n rand = new BigNumber(ONE);\r\n\r\n if (dp == null) dp = DECIMAL_PLACES;\r\n else intCheck(dp, 0, MAX);\r\n\r\n k = mathceil(dp / LOG_BASE);\r\n\r\n if (CRYPTO) {\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n if (crypto.getRandomValues) {\r\n\r\n a = crypto.getRandomValues(new Uint32Array(k *= 2));\r\n\r\n for (; i < k;) {\r\n\r\n // 53 bits:\r\n // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)\r\n // 11111 11111111 11111111 11111111 11100000 00000000 00000000\r\n // ((Math.pow(2, 32) - 1) >>> 11).toString(2)\r\n // 11111 11111111 11111111\r\n // 0x20000 is 2^21.\r\n v = a[i] * 0x20000 + (a[i + 1] >>> 11);\r\n\r\n // Rejection sampling:\r\n // 0 <= v < 9007199254740992\r\n // Probability that v >= 9e15, is\r\n // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251\r\n if (v >= 9e15) {\r\n b = crypto.getRandomValues(new Uint32Array(2));\r\n a[i] = b[0];\r\n a[i + 1] = b[1];\r\n } else {\r\n\r\n // 0 <= v <= 8999999999999999\r\n // 0 <= (v % 1e14) <= 99999999999999\r\n c.push(v % 1e14);\r\n i += 2;\r\n }\r\n }\r\n i = k / 2;\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n a = crypto.randomBytes(k *= 7);\r\n\r\n for (; i < k;) {\r\n\r\n // 0x1000000000000 is 2^48, 0x10000000000 is 2^40\r\n // 0x100000000 is 2^32, 0x1000000 is 2^24\r\n // 11111 11111111 11111111 11111111 11111111 11111111 11111111\r\n // 0 <= v < 9007199254740992\r\n v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) +\r\n (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) +\r\n (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];\r\n\r\n if (v >= 9e15) {\r\n crypto.randomBytes(7).copy(a, i);\r\n } else {\r\n\r\n // 0 <= (v % 1e14) <= 99999999999999\r\n c.push(v % 1e14);\r\n i += 7;\r\n }\r\n }\r\n i = k / 7;\r\n } else {\r\n CRYPTO = false;\r\n throw Error\r\n (bignumberError + 'crypto unavailable');\r\n }\r\n }\r\n\r\n // Use Math.random.\r\n if (!CRYPTO) {\r\n\r\n for (; i < k;) {\r\n v = random53bitInt();\r\n if (v < 9e15) c[i++] = v % 1e14;\r\n }\r\n }\r\n\r\n k = c[--i];\r\n dp %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to dp.\r\n if (k && dp) {\r\n v = POWS_TEN[LOG_BASE - dp];\r\n c[i] = mathfloor(k / v) * v;\r\n }\r\n\r\n // Remove trailing elements which are zero.\r\n for (; c[i] === 0; c.pop(), i--);\r\n\r\n // Zero?\r\n if (i < 0) {\r\n c = [e = 0];\r\n } else {\r\n\r\n // Remove leading elements which are zero and adjust exponent accordingly.\r\n for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE);\r\n\r\n // Count the digits of the first element of c to determine leading zeros, and...\r\n for (i = 1, v = c[0]; v >= 10; v /= 10, i++);\r\n\r\n // adjust the exponent accordingly.\r\n if (i < LOG_BASE) e -= LOG_BASE - i;\r\n }\r\n\r\n rand.e = e;\r\n rand.c = c;\r\n return rand;\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a BigNumber whose value is the sum of the arguments.\r\n *\r\n * arguments {number|string|BigNumber}\r\n */\r\n BigNumber.sum = function () {\r\n var i = 1,\r\n args = arguments,\r\n sum = new BigNumber(args[0]);\r\n for (; i < args.length;) sum = sum.plus(args[i++]);\r\n return sum;\r\n };\r\n\r\n\r\n // PRIVATE FUNCTIONS\r\n\r\n\r\n // Called by BigNumber and BigNumber.prototype.toString.\r\n convertBase = (function () {\r\n var decimal = '0123456789';\r\n\r\n /*\r\n * Convert string of baseIn to an array of numbers of baseOut.\r\n * Eg. toBaseOut('255', 10, 16) returns [15, 15].\r\n * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5].\r\n */\r\n function toBaseOut(str, baseIn, baseOut, alphabet) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n len = str.length;\r\n\r\n for (; i < len;) {\r\n for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r\n\r\n arr[0] += alphabet.indexOf(str.charAt(i++));\r\n\r\n for (j = 0; j < arr.length; j++) {\r\n\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] == null) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n }\r\n\r\n // Convert a numeric string of baseIn to a numeric string of baseOut.\r\n // If the caller is toString, we are converting from base 10 to baseOut.\r\n // If the caller is BigNumber, we are converting from baseIn to base 10.\r\n return function (str, baseIn, baseOut, sign, callerIsToString) {\r\n var alphabet, d, e, k, r, x, xc, y,\r\n i = str.indexOf('.'),\r\n dp = DECIMAL_PLACES,\r\n rm = ROUNDING_MODE;\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n k = POW_PRECISION;\r\n\r\n // Unlimited precision.\r\n POW_PRECISION = 0;\r\n str = str.replace('.', '');\r\n y = new BigNumber(baseIn);\r\n x = y.pow(str.length - i);\r\n POW_PRECISION = k;\r\n\r\n // Convert str as if an integer, then restore the fraction part by dividing the\r\n // result by its base raised to a power.\r\n\r\n y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'),\r\n 10, baseOut, decimal);\r\n y.e = y.c.length;\r\n }\r\n\r\n // Convert the number as integer.\r\n\r\n xc = toBaseOut(str, baseIn, baseOut, callerIsToString\r\n ? (alphabet = ALPHABET, decimal)\r\n : (alphabet = decimal, ALPHABET));\r\n\r\n // xc now represents str as an integer and converted to baseOut. e is the exponent.\r\n e = k = xc.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xc[--k] == 0; xc.pop());\r\n\r\n // Zero?\r\n if (!xc[0]) return alphabet.charAt(0);\r\n\r\n // Does str represent an integer? If so, no need for the division.\r\n if (i < 0) {\r\n --e;\r\n } else {\r\n x.c = xc;\r\n x.e = e;\r\n\r\n // The sign is needed for correct rounding.\r\n x.s = sign;\r\n x = div(x, y, dp, rm, baseOut);\r\n xc = x.c;\r\n r = x.r;\r\n e = x.e;\r\n }\r\n\r\n // xc now represents str converted to baseOut.\r\n\r\n // THe index of the rounding digit.\r\n d = e + dp + 1;\r\n\r\n // The rounding digit: the digit to the right of the digit that may be rounded up.\r\n i = xc[d];\r\n\r\n // Look at the rounding digits and mode to determine whether to round up.\r\n\r\n k = baseOut / 2;\r\n r = r || d < 0 || xc[d + 1] != null;\r\n\r\n r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n // If the index of the rounding digit is not greater than zero, or xc represents\r\n // zero, then the result of the base conversion is zero or, if rounding up, a value\r\n // such as 0.00001.\r\n if (d < 1 || !xc[0]) {\r\n\r\n // 1^-dp or 0\r\n str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);\r\n } else {\r\n\r\n // Truncate xc to the required number of decimal places.\r\n xc.length = d;\r\n\r\n // Round up?\r\n if (r) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (--baseOut; ++xc[--d] > baseOut;) {\r\n xc[d] = 0;\r\n\r\n if (!d) {\r\n ++e;\r\n xc = [1].concat(xc);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (k = xc.length; !xc[--k];);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++]));\r\n\r\n // Add leading zeros, decimal point and trailing zeros as required.\r\n str = toFixedPoint(str, e, alphabet.charAt(0));\r\n }\r\n\r\n // The caller will add the sign.\r\n return str;\r\n };\r\n })();\r\n\r\n\r\n // Perform division in the specified base. Called by div and convertBase.\r\n div = (function () {\r\n\r\n // Assume non-zero x and k.\r\n function multiply(x, k, base) {\r\n var m, temp, xlo, xhi,\r\n carry = 0,\r\n i = x.length,\r\n klo = k % SQRT_BASE,\r\n khi = k / SQRT_BASE | 0;\r\n\r\n for (x = x.slice(); i--;) {\r\n xlo = x[i] % SQRT_BASE;\r\n xhi = x[i] / SQRT_BASE | 0;\r\n m = khi * xlo + xhi * klo;\r\n temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry;\r\n carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;\r\n x[i] = temp % base;\r\n }\r\n\r\n if (carry) x = [carry].concat(x);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, cmp;\r\n\r\n if (aL != bL) {\r\n cmp = aL > bL ? 1 : -1;\r\n } else {\r\n\r\n for (i = cmp = 0; i < aL; i++) {\r\n\r\n if (a[i] != b[i]) {\r\n cmp = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return cmp;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1; a.splice(0, 1));\r\n }\r\n\r\n // x: dividend, y: divisor.\r\n return function (x, y, dp, rm, base) {\r\n var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,\r\n yL, yz,\r\n s = x.s == y.s ? 1 : -1,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xc || !xc[0] || !yc || !yc[0]) {\r\n\r\n return new BigNumber(\r\n\r\n // Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN :\r\n\r\n // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.\r\n xc && xc[0] == 0 || !yc ? s * 0 : s / 0\r\n );\r\n }\r\n\r\n q = new BigNumber(s);\r\n qc = q.c = [];\r\n e = x.e - y.e;\r\n s = dp + e + 1;\r\n\r\n if (!base) {\r\n base = BASE;\r\n e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);\r\n s = s / LOG_BASE | 0;\r\n }\r\n\r\n // Result exponent may be one less then the current value of e.\r\n // The coefficients of the BigNumbers from convertBase may have trailing zeros.\r\n for (i = 0; yc[i] == (xc[i] || 0); i++);\r\n\r\n if (yc[i] > (xc[i] || 0)) e--;\r\n\r\n if (s < 0) {\r\n qc.push(1);\r\n more = true;\r\n } else {\r\n xL = xc.length;\r\n yL = yc.length;\r\n i = 0;\r\n s += 2;\r\n\r\n // Normalise xc and yc so highest order digit of yc is >= base / 2.\r\n\r\n n = mathfloor(base / (yc[0] + 1));\r\n\r\n // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1.\r\n // if (n > 1 || n++ == 1 && yc[0] < base / 2) {\r\n if (n > 1) {\r\n yc = multiply(yc, n, base);\r\n xc = multiply(xc, n, base);\r\n yL = yc.length;\r\n xL = xc.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xc.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL; rem[remL++] = 0);\r\n yz = yc.slice();\r\n yz = [0].concat(yz);\r\n yc0 = yc[0];\r\n if (yc[1] >= base / 2) yc0++;\r\n // Not necessary, but to prevent trial digit n > base, when using base 3.\r\n // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15;\r\n\r\n do {\r\n n = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yc, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, n.\r\n\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // n is how many times the divisor goes into the current remainder.\r\n n = mathfloor(rem0 / yc0);\r\n\r\n // Algorithm:\r\n // product = divisor multiplied by trial digit (n).\r\n // Compare product and remainder.\r\n // If product is greater than remainder:\r\n // Subtract divisor from product, decrement trial digit.\r\n // Subtract product from remainder.\r\n // If product was less than remainder at the last compare:\r\n // Compare new remainder and divisor.\r\n // If remainder is greater than divisor:\r\n // Subtract divisor from remainder, increment trial digit.\r\n\r\n if (n > 1) {\r\n\r\n // n may be > base only when base is 3.\r\n if (n >= base) n = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiply(yc, n, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n // If product > remainder then trial digit n too high.\r\n // n is 1 too high about 5% of the time, and is not known to have\r\n // ever been more than 1 too high.\r\n while (compare(prod, rem, prodL, remL) == 1) {\r\n n--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yc, prodL, base);\r\n prodL = prod.length;\r\n cmp = 1;\r\n }\r\n } else {\r\n\r\n // n is 0 or 1, cmp is -1.\r\n // If n is 0, there is no need to compare yc and rem again below,\r\n // so change cmp to 1 to avoid it.\r\n // If n is 1, leave cmp as -1, so yc and rem are compared again.\r\n if (n == 0) {\r\n\r\n // divisor < remainder, so n must be at least 1.\r\n cmp = n = 1;\r\n }\r\n\r\n // product = divisor\r\n prod = yc.slice();\r\n prodL = prod.length;\r\n }\r\n\r\n if (prodL < remL) prod = [0].concat(prod);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n remL = rem.length;\r\n\r\n // If product was < remainder.\r\n if (cmp == -1) {\r\n\r\n // Compare divisor and new remainder.\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n // Trial digit n too low.\r\n // n is 1 too low about 5% of the time, and very rarely 2 too low.\r\n while (compare(yc, rem, yL, remL) < 1) {\r\n n++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yc, remL, base);\r\n remL = rem.length;\r\n }\r\n }\r\n } else if (cmp === 0) {\r\n n++;\r\n rem = [0];\r\n } // else cmp === 1 and n will be 0\r\n\r\n // Add the next digit, n, to the result array.\r\n qc[i++] = n;\r\n\r\n // Update the remainder.\r\n if (rem[0]) {\r\n rem[remL++] = xc[xi] || 0;\r\n } else {\r\n rem = [xc[xi]];\r\n remL = 1;\r\n }\r\n } while ((xi++ < xL || rem[0] != null) && s--);\r\n\r\n more = rem[0] != null;\r\n\r\n // Leading zero?\r\n if (!qc[0]) qc.splice(0, 1);\r\n }\r\n\r\n if (base == BASE) {\r\n\r\n // To calculate q.e, first get the number of digits of qc[0].\r\n for (i = 1, s = qc[0]; s >= 10; s /= 10, i++);\r\n\r\n round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);\r\n\r\n // Caller is convertBase.\r\n } else {\r\n q.e = e;\r\n q.r = +more;\r\n }\r\n\r\n return q;\r\n };\r\n })();\r\n\r\n\r\n /*\r\n * Return a string representing the value of BigNumber n in fixed-point or exponential\r\n * notation rounded to the specified decimal places or significant digits.\r\n *\r\n * n: a BigNumber.\r\n * i: the index of the last digit required (i.e. the digit that may be rounded up).\r\n * rm: the rounding mode.\r\n * id: 1 (toExponential) or 2 (toPrecision).\r\n */\r\n function format(n, i, rm, id) {\r\n var c0, e, ne, len, str;\r\n\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n if (!n.c) return n.toString();\r\n\r\n c0 = n.c[0];\r\n ne = n.e;\r\n\r\n if (i == null) {\r\n str = coeffToString(n.c);\r\n str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS)\r\n ? toExponential(str, ne)\r\n : toFixedPoint(str, ne, '0');\r\n } else {\r\n n = round(new BigNumber(n), i, rm);\r\n\r\n // n.e may have changed if the value was rounded up.\r\n e = n.e;\r\n\r\n str = coeffToString(n.c);\r\n len = str.length;\r\n\r\n // toPrecision returns exponential notation if the number of significant digits\r\n // specified is less than the number of digits necessary to represent the integer\r\n // part of the value in fixed-point notation.\r\n\r\n // Exponential notation.\r\n if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {\r\n\r\n // Append zeros?\r\n for (; len < i; str += '0', len++);\r\n str = toExponential(str, e);\r\n\r\n // Fixed-point notation.\r\n } else {\r\n i -= ne;\r\n str = toFixedPoint(str, e, '0');\r\n\r\n // Append zeros?\r\n if (e + 1 > len) {\r\n if (--i > 0) for (str += '.'; i--; str += '0');\r\n } else {\r\n i += e - len;\r\n if (i > 0) {\r\n if (e + 1 == len) str += '.';\r\n for (; i--; str += '0');\r\n }\r\n }\r\n }\r\n }\r\n\r\n return n.s < 0 && c0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // Handle BigNumber.max and BigNumber.min.\r\n function maxOrMin(args, method) {\r\n var n,\r\n i = 1,\r\n m = new BigNumber(args[0]);\r\n\r\n for (; i < args.length; i++) {\r\n n = new BigNumber(args[i]);\r\n\r\n // If any number is NaN, return NaN.\r\n if (!n.s) {\r\n m = n;\r\n break;\r\n } else if (method.call(m, n)) {\r\n m = n;\r\n }\r\n }\r\n\r\n return m;\r\n }\r\n\r\n\r\n /*\r\n * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.\r\n * Called by minus, plus and times.\r\n */\r\n function normalise(n, c, e) {\r\n var i = 1,\r\n j = c.length;\r\n\r\n // Remove trailing zeros.\r\n for (; !c[--j]; c.pop());\r\n\r\n // Calculate the base 10 exponent. First get the number of digits of c[0].\r\n for (j = c[0]; j >= 10; j /= 10, i++);\r\n\r\n // Overflow?\r\n if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {\r\n\r\n // Infinity.\r\n n.c = n.e = null;\r\n\r\n // Underflow?\r\n } else if (e < MIN_EXP) {\r\n\r\n // Zero.\r\n n.c = [n.e = 0];\r\n } else {\r\n n.e = e;\r\n n.c = c;\r\n }\r\n\r\n return n;\r\n }\r\n\r\n\r\n // Handle values that fail the validity test in BigNumber.\r\n parseNumeric = (function () {\r\n var basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i,\r\n dotAfter = /^([^.]+)\\.$/,\r\n dotBefore = /^\\.([^.]+)$/,\r\n isInfinityOrNaN = /^-?(Infinity|NaN)$/,\r\n whitespaceOrPlus = /^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g;\r\n\r\n return function (x, str, isNum, b) {\r\n var base,\r\n s = isNum ? str : str.replace(whitespaceOrPlus, '');\r\n\r\n // No exception on ±Infinity or NaN.\r\n if (isInfinityOrNaN.test(s)) {\r\n x.s = isNaN(s) ? null : s < 0 ? -1 : 1;\r\n } else {\r\n if (!isNum) {\r\n\r\n // basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i\r\n s = s.replace(basePrefix, function (m, p1, p2) {\r\n base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8;\r\n return !b || b == base ? p1 : m;\r\n });\r\n\r\n if (b) {\r\n base = b;\r\n\r\n // E.g. '1.' to '1', '.1' to '0.1'\r\n s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1');\r\n }\r\n\r\n if (str != s) return new BigNumber(s, base);\r\n }\r\n\r\n // '[BigNumber Error] Not a number: {n}'\r\n // '[BigNumber Error] Not a base {b} number: {n}'\r\n if (BigNumber.DEBUG) {\r\n throw Error\r\n (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str);\r\n }\r\n\r\n // NaN\r\n x.s = null;\r\n }\r\n\r\n x.c = x.e = null;\r\n }\r\n })();\r\n\r\n\r\n /*\r\n * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.\r\n * If r is truthy, it is known that there are more digits after the rounding digit.\r\n */\r\n function round(x, sd, rm, r) {\r\n var d, i, j, k, n, ni, rd,\r\n xc = x.c,\r\n pows10 = POWS_TEN;\r\n\r\n // if x is not Infinity or NaN...\r\n if (xc) {\r\n\r\n // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // n is a base 1e14 number, the value of the element of array x.c containing rd.\r\n // ni is the index of n within x.c.\r\n // d is the number of digits of n.\r\n // i is the index of rd within n including leading zeros.\r\n // j is the actual index of rd within n (if < 0, rd is a leading zero).\r\n out: {\r\n\r\n // Get the number of digits of the first element of xc.\r\n for (d = 1, k = xc[0]; k >= 10; k /= 10, d++);\r\n i = sd - d;\r\n\r\n // If the rounding digit is in the first element of xc...\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n n = xc[ni = 0];\r\n\r\n // Get the rounding digit at index j of n.\r\n rd = n / pows10[d - j - 1] % 10 | 0;\r\n } else {\r\n ni = mathceil((i + 1) / LOG_BASE);\r\n\r\n if (ni >= xc.length) {\r\n\r\n if (r) {\r\n\r\n // Needed by sqrt.\r\n for (; xc.length <= ni; xc.push(0));\r\n n = rd = 0;\r\n d = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n n = k = xc[ni];\r\n\r\n // Get the number of digits of n.\r\n for (d = 1; k >= 10; k /= 10, d++);\r\n\r\n // Get the index of rd within n.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within n, adjusted for leading zeros.\r\n // The number of leading zeros of n is given by LOG_BASE - d.\r\n j = i - LOG_BASE + d;\r\n\r\n // Get the rounding digit at index j of n.\r\n rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0;\r\n }\r\n }\r\n\r\n r = r || sd < 0 ||\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n // The expression n % pows10[d - j - 1] returns all digits of n to the right\r\n // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.\r\n xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);\r\n\r\n r = rm < 4\r\n ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xc[0]) {\r\n xc.length = 0;\r\n\r\n if (r) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xc[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xc.length = ni;\r\n k = 1;\r\n ni--;\r\n } else {\r\n xc.length = ni + 1;\r\n k = pows10[LOG_BASE - i];\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of n.\r\n xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;\r\n }\r\n\r\n // Round up?\r\n if (r) {\r\n\r\n for (; ;) {\r\n\r\n // If the digit to be rounded up is in the first element of xc...\r\n if (ni == 0) {\r\n\r\n // i will be the length of xc[0] before k is added.\r\n for (i = 1, j = xc[0]; j >= 10; j /= 10, i++);\r\n j = xc[0] += k;\r\n for (k = 1; j >= 10; j /= 10, k++);\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xc[0] == BASE) xc[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xc[ni] += k;\r\n if (xc[ni] != BASE) break;\r\n xc[ni--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xc.length; xc[--i] === 0; xc.pop());\r\n }\r\n\r\n // Overflow? Infinity.\r\n if (x.e > MAX_EXP) {\r\n x.c = x.e = null;\r\n\r\n // Underflow? Zero.\r\n } else if (x.e < MIN_EXP) {\r\n x.c = [x.e = 0];\r\n }\r\n }\r\n\r\n return x;\r\n }\r\n\r\n\r\n function valueOf(n) {\r\n var str,\r\n e = n.e;\r\n\r\n if (e === null) return n.toString();\r\n\r\n str = coeffToString(n.c);\r\n\r\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n ? toExponential(str, e)\r\n : toFixedPoint(str, e, '0');\r\n\r\n return n.s < 0 ? '-' + str : str;\r\n }\r\n\r\n\r\n // PROTOTYPE/INSTANCE METHODS\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the absolute value of this BigNumber.\r\n */\r\n P.absoluteValue = P.abs = function () {\r\n var x = new BigNumber(this);\r\n if (x.s < 0) x.s = 1;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * Return\r\n * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n * -1 if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n * 0 if they have the same value,\r\n * or null if the value of either is NaN.\r\n */\r\n P.comparedTo = function (y, b) {\r\n return compare(this, new BigNumber(y, b));\r\n };\r\n\r\n\r\n /*\r\n * If dp is undefined or null or true or false, return the number of decimal places of the\r\n * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n *\r\n * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this\r\n * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or\r\n * ROUNDING_MODE if rm is omitted.\r\n *\r\n * [dp] {number} Decimal places: integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.decimalPlaces = P.dp = function (dp, rm) {\r\n var c, n, v,\r\n x = this;\r\n\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n return round(new BigNumber(x), dp + x.e + 1, rm);\r\n }\r\n\r\n if (!(c = x.c)) return null;\r\n n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last number.\r\n if (v = c[v]) for (; v % 10 == 0; v /= 10, n--);\r\n if (n < 0) n = 0;\r\n\r\n return n;\r\n };\r\n\r\n\r\n /*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber divided by the value of\r\n * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n */\r\n P.dividedBy = P.div = function (y, b) {\r\n return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the integer part of dividing the value of this\r\n * BigNumber by the value of BigNumber(y, b).\r\n */\r\n P.dividedToIntegerBy = P.idiv = function (y, b) {\r\n return div(this, new BigNumber(y, b), 0, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a BigNumber whose value is the value of this BigNumber exponentiated by n.\r\n *\r\n * If m is present, return the result modulo m.\r\n * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.\r\n * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE.\r\n *\r\n * The modular power operation works efficiently when x, n, and m are integers, otherwise it\r\n * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0.\r\n *\r\n * n {number|string|BigNumber} The exponent. An integer.\r\n * [m] {number|string|BigNumber} The modulus.\r\n *\r\n * '[BigNumber Error] Exponent not an integer: {n}'\r\n */\r\n P.exponentiatedBy = P.pow = function (n, m) {\r\n var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y,\r\n x = this;\r\n\r\n n = new BigNumber(n);\r\n\r\n // Allow NaN and ±Infinity, but not other non-integers.\r\n if (n.c && !n.isInteger()) {\r\n throw Error\r\n (bignumberError + 'Exponent not an integer: ' + valueOf(n));\r\n }\r\n\r\n if (m != null) m = new BigNumber(m);\r\n\r\n // Exponent of MAX_SAFE_INTEGER is 15.\r\n nIsBig = n.e > 14;\r\n\r\n // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0.\r\n if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {\r\n\r\n // The sign of the result of pow when x is negative depends on the evenness of n.\r\n // If +n overflows to ±Infinity, the evenness of n would be not be known.\r\n y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? 2 - isOdd(n) : +valueOf(n)));\r\n return m ? y.mod(m) : y;\r\n }\r\n\r\n nIsNeg = n.s < 0;\r\n\r\n if (m) {\r\n\r\n // x % m returns NaN if abs(m) is zero, or m is NaN.\r\n if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN);\r\n\r\n isModExp = !nIsNeg && x.isInteger() && m.isInteger();\r\n\r\n if (isModExp) x = x.mod(m);\r\n\r\n // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15.\r\n // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15.\r\n } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0\r\n // [1, 240000000]\r\n ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7\r\n // [80000000000000] [99999750000000]\r\n : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {\r\n\r\n // If x is negative and n is odd, k = -0, else k = 0.\r\n k = x.s < 0 && isOdd(n) ? -0 : 0;\r\n\r\n // If x >= 1, k = ±Infinity.\r\n if (x.e > -1) k = 1 / k;\r\n\r\n // If n is negative return ±0, else return ±Infinity.\r\n return new BigNumber(nIsNeg ? 1 / k : k);\r\n\r\n } else if (POW_PRECISION) {\r\n\r\n // Truncating each coefficient array to a length of k after each multiplication\r\n // equates to truncating significant digits to POW_PRECISION + [28, 41],\r\n // i.e. there will be a minimum of 28 guard digits retained.\r\n k = mathceil(POW_PRECISION / LOG_BASE + 2);\r\n }\r\n\r\n if (nIsBig) {\r\n half = new BigNumber(0.5);\r\n if (nIsNeg) n.s = 1;\r\n nIsOdd = isOdd(n);\r\n } else {\r\n i = Math.abs(+valueOf(n));\r\n nIsOdd = i % 2;\r\n }\r\n\r\n y = new BigNumber(ONE);\r\n\r\n // Performs 54 loop iterations for n of 9007199254740991.\r\n for (; ;) {\r\n\r\n if (nIsOdd) {\r\n y = y.times(x);\r\n if (!y.c) break;\r\n\r\n if (k) {\r\n if (y.c.length > k) y.c.length = k;\r\n } else if (isModExp) {\r\n y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m));\r\n }\r\n }\r\n\r\n if (i) {\r\n i = mathfloor(i / 2);\r\n if (i === 0) break;\r\n nIsOdd = i % 2;\r\n } else {\r\n n = n.times(half);\r\n round(n, n.e + 1, 1);\r\n\r\n if (n.e > 14) {\r\n nIsOdd = isOdd(n);\r\n } else {\r\n i = +valueOf(n);\r\n if (i === 0) break;\r\n nIsOdd = i % 2;\r\n }\r\n }\r\n\r\n x = x.times(x);\r\n\r\n if (k) {\r\n if (x.c && x.c.length > k) x.c.length = k;\r\n } else if (isModExp) {\r\n x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m));\r\n }\r\n }\r\n\r\n if (isModExp) return y;\r\n if (nIsNeg) y = ONE.div(y);\r\n\r\n return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer\r\n * using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n *\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}'\r\n */\r\n P.integerValue = function (rm) {\r\n var n = new BigNumber(this);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n return round(n, n.e + 1, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isEqualTo = P.eq = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is a finite number, otherwise return false.\r\n */\r\n P.isFinite = function () {\r\n return !!this.c;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isGreaterThan = P.gt = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is greater than or equal to the value of\r\n * BigNumber(y, b), otherwise return false.\r\n */\r\n P.isGreaterThanOrEqualTo = P.gte = function (y, b) {\r\n return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0;\r\n\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is an integer, otherwise return false.\r\n */\r\n P.isInteger = function () {\r\n return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n * otherwise return false.\r\n */\r\n P.isLessThan = P.lt = function (y, b) {\r\n return compare(this, new BigNumber(y, b)) < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is less than or equal to the value of\r\n * BigNumber(y, b), otherwise return false.\r\n */\r\n P.isLessThanOrEqualTo = P.lte = function (y, b) {\r\n return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is NaN, otherwise return false.\r\n */\r\n P.isNaN = function () {\r\n return !this.s;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is negative, otherwise return false.\r\n */\r\n P.isNegative = function () {\r\n return this.s < 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is positive, otherwise return false.\r\n */\r\n P.isPositive = function () {\r\n return this.s > 0;\r\n };\r\n\r\n\r\n /*\r\n * Return true if the value of this BigNumber is 0 or -0, otherwise return false.\r\n */\r\n P.isZero = function () {\r\n return !!this.c && this.c[0] == 0;\r\n };\r\n\r\n\r\n /*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber minus the value of\r\n * BigNumber(y, b).\r\n */\r\n P.minus = function (y, b) {\r\n var i, j, t, xLTy,\r\n x = this,\r\n a = x.s;\r\n\r\n y = new BigNumber(y, b);\r\n b = y.s;\r\n\r\n // Either NaN?\r\n if (!a || !b) return new BigNumber(NaN);\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.plus(y);\r\n }\r\n\r\n var xe = x.e / LOG_BASE,\r\n ye = y.e / LOG_BASE,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n if (!xe || !ye) {\r\n\r\n // Either Infinity?\r\n if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN);\r\n\r\n // Either zero?\r\n if (!xc[0] || !yc[0]) {\r\n\r\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x :\r\n\r\n // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity\r\n ROUNDING_MODE == 3 ? -0 : 0);\r\n }\r\n }\r\n\r\n xe = bitFloor(xe);\r\n ye = bitFloor(ye);\r\n xc = xc.slice();\r\n\r\n // Determine which is the bigger number.\r\n if (a = xe - ye) {\r\n\r\n if (xLTy = a < 0) {\r\n a = -a;\r\n t = xc;\r\n } else {\r\n ye = xe;\r\n t = yc;\r\n }\r\n\r\n t.reverse();\r\n\r\n // Prepend zeros to equalise exponents.\r\n for (b = a; b--; t.push(0));\r\n t.reverse();\r\n } else {\r\n\r\n // Exponents equal. Check digit by digit.\r\n j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;\r\n\r\n for (a = b = 0; b < j; b++) {\r\n\r\n if (xc[b] != yc[b]) {\r\n xLTy = xc[b] < yc[b];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // x < y? Point xc to the array of the bigger number.\r\n if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s;\r\n\r\n b = (j = yc.length) - (i = xc.length);\r\n\r\n // Append zeros to xc if shorter.\r\n // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.\r\n if (b > 0) for (; b--; xc[i++] = 0);\r\n b = BASE - 1;\r\n\r\n // Subtract yc from xc.\r\n for (; j > a;) {\r\n\r\n if (xc[--j] < yc[j]) {\r\n for (i = j; i && !xc[--i]; xc[i] = b);\r\n --xc[i];\r\n xc[j] += BASE;\r\n }\r\n\r\n xc[j] -= yc[j];\r\n }\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xc[0] == 0; xc.splice(0, 1), --ye);\r\n\r\n // Zero?\r\n if (!xc[0]) {\r\n\r\n // Following IEEE 754 (2008) 6.3,\r\n // n - n = +0 but n - n = -0 when rounding towards -Infinity.\r\n y.s = ROUNDING_MODE == 3 ? -1 : 1;\r\n y.c = [y.e = 0];\r\n return y;\r\n }\r\n\r\n // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity\r\n // for finite x and y.\r\n return normalise(y, xc, ye);\r\n };\r\n\r\n\r\n /*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber modulo the value of\r\n * BigNumber(y, b). The result depends on the value of MODULO_MODE.\r\n */\r\n P.modulo = P.mod = function (y, b) {\r\n var q, s,\r\n x = this;\r\n\r\n y = new BigNumber(y, b);\r\n\r\n // Return NaN if x is Infinity or NaN, or y is NaN or zero.\r\n if (!x.c || !y.s || y.c && !y.c[0]) {\r\n return new BigNumber(NaN);\r\n\r\n // Return x if y is Infinity or x is zero.\r\n } else if (!y.c || x.c && !x.c[0]) {\r\n return new BigNumber(x);\r\n }\r\n\r\n if (MODULO_MODE == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // r = x - qy where 0 <= r < abs(y)\r\n s = y.s;\r\n y.s = 1;\r\n q = div(x, y, 0, 3);\r\n y.s = s;\r\n q.s *= s;\r\n } else {\r\n q = div(x, y, 0, MODULO_MODE);\r\n }\r\n\r\n y = x.minus(q.times(y));\r\n\r\n // To match JavaScript %, ensure sign of zero is sign of dividend.\r\n if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;\r\n\r\n return y;\r\n };\r\n\r\n\r\n /*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value\r\n * of BigNumber(y, b).\r\n */\r\n P.multipliedBy = P.times = function (y, b) {\r\n var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,\r\n base, sqrtBase,\r\n x = this,\r\n xc = x.c,\r\n yc = (y = new BigNumber(y, b)).c;\r\n\r\n // Either NaN, ±Infinity or ±0?\r\n if (!xc || !yc || !xc[0] || !yc[0]) {\r\n\r\n // Return NaN if either is NaN, or one is 0 and the other is Infinity.\r\n if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {\r\n y.c = y.e = y.s = null;\r\n } else {\r\n y.s *= x.s;\r\n\r\n // Return ±Infinity if either is ±Infinity.\r\n if (!xc || !yc) {\r\n y.c = y.e = null;\r\n\r\n // Return ±0 if either is ±0.\r\n } else {\r\n y.c = [0];\r\n y.e = 0;\r\n }\r\n }\r\n\r\n return y;\r\n }\r\n\r\n e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);\r\n y.s *= x.s;\r\n xcL = xc.length;\r\n ycL = yc.length;\r\n\r\n // Ensure xc points to longer array and xcL to its length.\r\n if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i;\r\n\r\n // Initialise the result array with zeros.\r\n for (i = xcL + ycL, zc = []; i--; zc.push(0));\r\n\r\n base = BASE;\r\n sqrtBase = SQRT_BASE;\r\n\r\n for (i = ycL; --i >= 0;) {\r\n c = 0;\r\n ylo = yc[i] % sqrtBase;\r\n yhi = yc[i] / sqrtBase | 0;\r\n\r\n for (k = xcL, j = i + k; j > i;) {\r\n xlo = xc[--k] % sqrtBase;\r\n xhi = xc[k] / sqrtBase | 0;\r\n m = yhi * xlo + xhi * ylo;\r\n xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c;\r\n c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;\r\n zc[j--] = xlo % base;\r\n }\r\n\r\n zc[j] = c;\r\n }\r\n\r\n if (c) {\r\n ++e;\r\n } else {\r\n zc.splice(0, 1);\r\n }\r\n\r\n return normalise(y, zc, e);\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber negated,\r\n * i.e. multiplied by -1.\r\n */\r\n P.negated = function () {\r\n var x = new BigNumber(this);\r\n x.s = -x.s || null;\r\n return x;\r\n };\r\n\r\n\r\n /*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new BigNumber whose value is the value of this BigNumber plus the value of\r\n * BigNumber(y, b).\r\n */\r\n P.plus = function (y, b) {\r\n var t,\r\n x = this,\r\n a = x.s;\r\n\r\n y = new BigNumber(y, b);\r\n b = y.s;\r\n\r\n // Either NaN?\r\n if (!a || !b) return new BigNumber(NaN);\r\n\r\n // Signs differ?\r\n if (a != b) {\r\n y.s = -b;\r\n return x.minus(y);\r\n }\r\n\r\n var xe = x.e / LOG_BASE,\r\n ye = y.e / LOG_BASE,\r\n xc = x.c,\r\n yc = y.c;\r\n\r\n if (!xe || !ye) {\r\n\r\n // Return ±Infinity if either ±Infinity.\r\n if (!xc || !yc) return new BigNumber(a / 0);\r\n\r\n // Either zero?\r\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0);\r\n }\r\n\r\n xe = bitFloor(xe);\r\n ye = bitFloor(ye);\r\n xc = xc.slice();\r\n\r\n // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.\r\n if (a = xe - ye) {\r\n if (a > 0) {\r\n ye = xe;\r\n t = yc;\r\n } else {\r\n a = -a;\r\n t = xc;\r\n }\r\n\r\n t.reverse();\r\n for (; a--; t.push(0));\r\n t.reverse();\r\n }\r\n\r\n a = xc.length;\r\n b = yc.length;\r\n\r\n // Point xc to the longer array, and b to the shorter length.\r\n if (a - b < 0) t = yc, yc = xc, xc = t, b = a;\r\n\r\n // Only start adding at yc.length - 1 as the further digits of xc can be ignored.\r\n for (a = 0; b;) {\r\n a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;\r\n xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;\r\n }\r\n\r\n if (a) {\r\n xc = [a].concat(xc);\r\n ++ye;\r\n }\r\n\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n // ye = MAX_EXP + 1 possible\r\n return normalise(y, xc, ye);\r\n };\r\n\r\n\r\n /*\r\n * If sd is undefined or null or true or false, return the number of significant digits of\r\n * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n * If sd is true include integer-part trailing zeros in the count.\r\n *\r\n * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this\r\n * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or\r\n * ROUNDING_MODE if rm is omitted.\r\n *\r\n * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive.\r\n * boolean: whether to count integer-part trailing zeros: true or false.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n */\r\n P.precision = P.sd = function (sd, rm) {\r\n var c, n, v,\r\n x = this;\r\n\r\n if (sd != null && sd !== !!sd) {\r\n intCheck(sd, 1, MAX);\r\n if (rm == null) rm = ROUNDING_MODE;\r\n else intCheck(rm, 0, 8);\r\n\r\n return round(new BigNumber(x), sd, rm);\r\n }\r\n\r\n if (!(c = x.c)) return null;\r\n v = c.length - 1;\r\n n = v * LOG_BASE + 1;\r\n\r\n if (v = c[v]) {\r\n\r\n // Subtract the number of trailing zeros of the last element.\r\n for (; v % 10 == 0; v /= 10, n--);\r\n\r\n // Add the number of digits of the first element.\r\n for (v = c[0]; v >= 10; v /= 10, n++);\r\n }\r\n\r\n if (sd && x.e + 1 > n) n = x.e + 1;\r\n\r\n return n;\r\n };\r\n\r\n\r\n /*\r\n * Return a new BigNumber whose value is the value of this BigNumber shifted by k places\r\n * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.\r\n *\r\n * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}'\r\n */\r\n P.shiftedBy = function (k) {\r\n intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);\r\n return this.times('1e' + k);\r\n };\r\n\r\n\r\n /*\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n * Return a new BigNumber whose value is the square root of the value of this BigNumber,\r\n * rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n */\r\n P.squareRoot = P.sqrt = function () {\r\n var m, n, r, rep, t,\r\n x = this,\r\n c = x.c,\r\n s = x.s,\r\n e = x.e,\r\n dp = DECIMAL_PLACES + 4,\r\n half = new BigNumber('0.5');\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !c || !c[0]) {\r\n return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);\r\n }\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+valueOf(x));\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = coeffToString(c);\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(+n);\r\n e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new BigNumber(n);\r\n } else {\r\n r = new BigNumber(s + '');\r\n }\r\n\r\n // Check for zero.\r\n // r could be zero if MIN_EXP is changed after the this value was created.\r\n // This would cause a division by zero (x/t) and hence Infinity below, which would cause\r\n // coeffToString to throw.\r\n if (r.c[0]) {\r\n e = r.e;\r\n s = e + dp;\r\n if (s < 3) s = 0;\r\n\r\n // Newton-Raphson iteration.\r\n for (; ;) {\r\n t = r;\r\n r = half.times(t.plus(div(x, t, dp, 1)));\r\n\r\n if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {\r\n\r\n // The exponent of r may here be one less than the final result exponent,\r\n // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits\r\n // are indexed correctly.\r\n if (r.e < e) --s;\r\n n = n.slice(s - 3, s + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits\r\n // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the\r\n // iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the\r\n // exact result as the nines may infinitely repeat.\r\n if (!rep) {\r\n round(t, t.e + DECIMAL_PLACES + 2, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n dp += 4;\r\n s += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact\r\n // result. If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n round(r, r.e + DECIMAL_PLACES + 2, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in exponential notation and\r\n * rounded using ROUNDING_MODE to dp fixed decimal places.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.toExponential = function (dp, rm) {\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n dp++;\r\n }\r\n return format(this, dp, rm, 1);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in fixed-point notation rounding\r\n * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n *\r\n * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',\r\n * but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n */\r\n P.toFixed = function (dp, rm) {\r\n if (dp != null) {\r\n intCheck(dp, 0, MAX);\r\n dp = dp + this.e + 1;\r\n }\r\n return format(this, dp, rm);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in fixed-point notation rounded\r\n * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties\r\n * of the format or FORMAT object (see BigNumber.set).\r\n *\r\n * The formatting object may contain some or all of the properties shown below.\r\n *\r\n * FORMAT = {\r\n * prefix: '',\r\n * groupSize: 3,\r\n * secondaryGroupSize: 0,\r\n * groupSeparator: ',',\r\n * decimalSeparator: '.',\r\n * fractionGroupSize: 0,\r\n * fractionGroupSeparator: '\\xA0', // non-breaking space\r\n * suffix: ''\r\n * };\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n * [format] {object} Formatting options. See FORMAT pbject above.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n * '[BigNumber Error] Argument not an object: {format}'\r\n */\r\n P.toFormat = function (dp, rm, format) {\r\n var str,\r\n x = this;\r\n\r\n if (format == null) {\r\n if (dp != null && rm && typeof rm == 'object') {\r\n format = rm;\r\n rm = null;\r\n } else if (dp && typeof dp == 'object') {\r\n format = dp;\r\n dp = rm = null;\r\n } else {\r\n format = FORMAT;\r\n }\r\n } else if (typeof format != 'object') {\r\n throw Error\r\n (bignumberError + 'Argument not an object: ' + format);\r\n }\r\n\r\n str = x.toFixed(dp, rm);\r\n\r\n if (x.c) {\r\n var i,\r\n arr = str.split('.'),\r\n g1 = +format.groupSize,\r\n g2 = +format.secondaryGroupSize,\r\n groupSeparator = format.groupSeparator || '',\r\n intPart = arr[0],\r\n fractionPart = arr[1],\r\n isNeg = x.s < 0,\r\n intDigits = isNeg ? intPart.slice(1) : intPart,\r\n len = intDigits.length;\r\n\r\n if (g2) i = g1, g1 = g2, g2 = i, len -= i;\r\n\r\n if (g1 > 0 && len > 0) {\r\n i = len % g1 || g1;\r\n intPart = intDigits.substr(0, i);\r\n for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);\r\n if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);\r\n if (isNeg) intPart = '-' + intPart;\r\n }\r\n\r\n str = fractionPart\r\n ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize)\r\n ? fractionPart.replace(new RegExp('\\\\d{' + g2 + '}\\\\B', 'g'),\r\n '$&' + (format.fractionGroupSeparator || ''))\r\n : fractionPart)\r\n : intPart;\r\n }\r\n\r\n return (format.prefix || '') + str + (format.suffix || '');\r\n };\r\n\r\n\r\n /*\r\n * Return an array of two BigNumbers representing the value of this BigNumber as a simple\r\n * fraction with an integer numerator and an integer denominator.\r\n * The denominator will be a positive non-zero value less than or equal to the specified\r\n * maximum denominator. If a maximum denominator is not specified, the denominator will be\r\n * the lowest value necessary to represent the number exactly.\r\n *\r\n * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator.\r\n *\r\n * '[BigNumber Error] Argument {not an integer|out of range} : {md}'\r\n */\r\n P.toFraction = function (md) {\r\n var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s,\r\n x = this,\r\n xc = x.c;\r\n\r\n if (md != null) {\r\n n = new BigNumber(md);\r\n\r\n // Throw if md is less than one or is not an integer, unless it is Infinity.\r\n if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {\r\n throw Error\r\n (bignumberError + 'Argument ' +\r\n (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n));\r\n }\r\n }\r\n\r\n if (!xc) return new BigNumber(x);\r\n\r\n d = new BigNumber(ONE);\r\n n1 = d0 = new BigNumber(ONE);\r\n d1 = n0 = new BigNumber(ONE);\r\n s = coeffToString(xc);\r\n\r\n // Determine initial denominator.\r\n // d is a power of 10 and the minimum max denominator that specifies the value exactly.\r\n e = d.e = s.length - x.e - 1;\r\n d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];\r\n md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n;\r\n\r\n exp = MAX_EXP;\r\n MAX_EXP = 1 / 0;\r\n n = new BigNumber(s);\r\n\r\n // n0 = d1 = 0\r\n n0.c[0] = 0;\r\n\r\n for (; ;) {\r\n q = div(n, d, 0, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.comparedTo(md) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n n1 = n0.plus(q.times(d2 = n1));\r\n n0 = d2;\r\n d = n.minus(q.times(d2 = d));\r\n n = d2;\r\n }\r\n\r\n d2 = div(md.minus(d0), d1, 0, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n e = e * 2;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1\r\n r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(\r\n div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];\r\n\r\n MAX_EXP = exp;\r\n\r\n return r;\r\n };\r\n\r\n\r\n /*\r\n * Return the value of this BigNumber converted to a number primitive.\r\n */\r\n P.toNumber = function () {\r\n return +valueOf(this);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber rounded to sd significant digits\r\n * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits\r\n * necessary to represent the integer part of the value in fixed-point notation, then use\r\n * exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n */\r\n P.toPrecision = function (sd, rm) {\r\n if (sd != null) intCheck(sd, 1, MAX);\r\n return format(this, sd, rm, 2);\r\n };\r\n\r\n\r\n /*\r\n * Return a string representing the value of this BigNumber in base b, or base 10 if b is\r\n * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and\r\n * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent\r\n * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than\r\n * TO_EXP_NEG, return exponential notation.\r\n *\r\n * [b] {number} Integer, 2 to ALPHABET.length inclusive.\r\n *\r\n * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n */\r\n P.toString = function (b) {\r\n var str,\r\n n = this,\r\n s = n.s,\r\n e = n.e;\r\n\r\n // Infinity or NaN?\r\n if (e === null) {\r\n if (s) {\r\n str = 'Infinity';\r\n if (s < 0) str = '-' + str;\r\n } else {\r\n str = 'NaN';\r\n }\r\n } else {\r\n if (b == null) {\r\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n ? toExponential(coeffToString(n.c), e)\r\n : toFixedPoint(coeffToString(n.c), e, '0');\r\n } else if (b === 10) {\r\n n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);\r\n str = toFixedPoint(coeffToString(n.c), n.e, '0');\r\n } else {\r\n intCheck(b, 2, ALPHABET.length, 'Base');\r\n str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true);\r\n }\r\n\r\n if (s < 0 && n.c[0]) str = '-' + str;\r\n }\r\n\r\n return str;\r\n };\r\n\r\n\r\n /*\r\n * Return as toString, but do not accept a base argument, and include the minus sign for\r\n * negative zero.\r\n */\r\n P.valueOf = P.toJSON = function () {\r\n return valueOf(this);\r\n };\r\n\r\n\r\n P._isBigNumber = true;\r\n\r\n if (configObject != null) BigNumber.set(configObject);\r\n\r\n return BigNumber;\r\n }\r\n\r\n\r\n // PRIVATE HELPER FUNCTIONS\r\n\r\n // These functions don't need access to variables,\r\n // e.g. DECIMAL_PLACES, in the scope of the `clone` function above.\r\n\r\n\r\n function bitFloor(n) {\r\n var i = n | 0;\r\n return n > 0 || n === i ? i : i - 1;\r\n }\r\n\r\n\r\n // Return a coefficient array as a string of base 10 digits.\r\n function coeffToString(a) {\r\n var s, z,\r\n i = 1,\r\n j = a.length,\r\n r = a[0] + '';\r\n\r\n for (; i < j;) {\r\n s = a[i++] + '';\r\n z = LOG_BASE - s.length;\r\n for (; z--; s = '0' + s);\r\n r += s;\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (j = r.length; r.charCodeAt(--j) === 48;);\r\n\r\n return r.slice(0, j + 1 || 1);\r\n }\r\n\r\n\r\n // Compare the value of BigNumbers x and y.\r\n function compare(x, y) {\r\n var a, b,\r\n xc = x.c,\r\n yc = y.c,\r\n i = x.s,\r\n j = y.s,\r\n k = x.e,\r\n l = y.e;\r\n\r\n // Either NaN?\r\n if (!i || !j) return null;\r\n\r\n a = xc && !xc[0];\r\n b = yc && !yc[0];\r\n\r\n // Either zero?\r\n if (a || b) return a ? b ? 0 : -j : i;\r\n\r\n // Signs differ?\r\n if (i != j) return i;\r\n\r\n a = i < 0;\r\n b = k == l;\r\n\r\n // Either Infinity?\r\n if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;\r\n\r\n // Compare exponents.\r\n if (!b) return k > l ^ a ? 1 : -1;\r\n\r\n j = (k = xc.length) < (l = yc.length) ? k : l;\r\n\r\n // Compare digit by digit.\r\n for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;\r\n\r\n // Compare lengths.\r\n return k == l ? 0 : k > l ^ a ? 1 : -1;\r\n }\r\n\r\n\r\n /*\r\n * Check that n is a primitive number, an integer, and in range, otherwise throw.\r\n */\r\n function intCheck(n, min, max, name) {\r\n if (n < min || n > max || n !== mathfloor(n)) {\r\n throw Error\r\n (bignumberError + (name || 'Argument') + (typeof n == 'number'\r\n ? n < min || n > max ? ' out of range: ' : ' not an integer: '\r\n : ' not a primitive number: ') + String(n));\r\n }\r\n }\r\n\r\n\r\n // Assumes finite n.\r\n function isOdd(n) {\r\n var k = n.c.length - 1;\r\n return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;\r\n }\r\n\r\n\r\n function toExponential(str, e) {\r\n return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) +\r\n (e < 0 ? 'e' : 'e+') + e;\r\n }\r\n\r\n\r\n function toFixedPoint(str, e, z) {\r\n var len, zs;\r\n\r\n // Negative exponent?\r\n if (e < 0) {\r\n\r\n // Prepend zeros.\r\n for (zs = z + '.'; ++e; zs += z);\r\n str = zs + str;\r\n\r\n // Positive exponent\r\n } else {\r\n len = str.length;\r\n\r\n // Append zeros.\r\n if (++e > len) {\r\n for (zs = z, e -= len; --e; zs += z);\r\n str += zs;\r\n } else if (e < len) {\r\n str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n return str;\r\n }\r\n\r\n\r\n // EXPORT\r\n\r\n\r\n BigNumber = clone();\r\n BigNumber['default'] = BigNumber.BigNumber = BigNumber;\r\n\r\n // AMD.\r\n if (true) {\r\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return BigNumber; }).call(exports, __webpack_require__, exports, module),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n\r\n // Node.js and other environments that support module.exports.\r\n } else {}\r\n})(this);\r\n\n\n//# sourceURL=webpack://dcp/./node_modules/bignumber.js/bignumber.js?"); + +/***/ }), + +/***/ "./node_modules/bn.js/lib/bn.js": +/*!**************************************!*\ + !*** ./node_modules/bn.js/lib/bn.js ***! + \**************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +eval("/* module decorator */ module = __webpack_require__.nmd(module);\n(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = (__webpack_require__(/*! buffer */ \"?8131\").Buffer);\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})( false || module, this);\n\n\n//# sourceURL=webpack://dcp/./node_modules/bn.js/lib/bn.js?"); + +/***/ }), + +/***/ "./node_modules/brorand/index.js": +/*!***************************************!*\ + !*** ./node_modules/brorand/index.js ***! + \***************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var r;\n\nmodule.exports = function rand(len) {\n if (!r)\n r = new Rand(null);\n\n return r.generate(len);\n};\n\nfunction Rand(rand) {\n this.rand = rand;\n}\nmodule.exports.Rand = Rand;\n\nRand.prototype.generate = function generate(len) {\n return this._rand(len);\n};\n\n// Emulate crypto API using randy\nRand.prototype._rand = function _rand(n) {\n if (this.rand.getBytes)\n return this.rand.getBytes(n);\n\n var res = new Uint8Array(n);\n for (var i = 0; i < res.length; i++)\n res[i] = this.rand.getByte();\n return res;\n};\n\nif (typeof self === 'object') {\n if (self.crypto && self.crypto.getRandomValues) {\n // Modern browsers\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.crypto.getRandomValues(arr);\n return arr;\n };\n } else if (self.msCrypto && self.msCrypto.getRandomValues) {\n // IE\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.msCrypto.getRandomValues(arr);\n return arr;\n };\n\n // Safari's WebWorkers do not have `crypto`\n } else if (typeof window === 'object') {\n // Old junk\n Rand.prototype._rand = function() {\n throw new Error('Not implemented yet');\n };\n }\n} else {\n // Node.js or Web worker with no crypto support\n try {\n var crypto = __webpack_require__(/*! crypto */ \"?3fc0\");\n if (typeof crypto.randomBytes !== 'function')\n throw new Error('Not supported');\n\n Rand.prototype._rand = function _rand(n) {\n return crypto.randomBytes(n);\n };\n } catch (e) {\n }\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/brorand/index.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/aes.js": +/*!********************************************!*\ + !*** ./node_modules/browserify-aes/aes.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("// based on the aes implimentation in triple sec\n// https://github.com/keybase/triplesec\n// which is in turn based on the one from crypto-js\n// https://code.google.com/p/crypto-js/\n\nvar Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\n\nfunction asUInt32Array (buf) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n\n var len = (buf.length / 4) | 0\n var out = new Array(len)\n\n for (var i = 0; i < len; i++) {\n out[i] = buf.readUInt32BE(i * 4)\n }\n\n return out\n}\n\nfunction scrubVec (v) {\n for (var i = 0; i < v.length; v++) {\n v[i] = 0\n }\n}\n\nfunction cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) {\n var SUB_MIX0 = SUB_MIX[0]\n var SUB_MIX1 = SUB_MIX[1]\n var SUB_MIX2 = SUB_MIX[2]\n var SUB_MIX3 = SUB_MIX[3]\n\n var s0 = M[0] ^ keySchedule[0]\n var s1 = M[1] ^ keySchedule[1]\n var s2 = M[2] ^ keySchedule[2]\n var s3 = M[3] ^ keySchedule[3]\n var t0, t1, t2, t3\n var ksRow = 4\n\n for (var round = 1; round < nRounds; round++) {\n t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++]\n t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++]\n t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++]\n t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++]\n s0 = t0\n s1 = t1\n s2 = t2\n s3 = t3\n }\n\n t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]\n t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]\n t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]\n t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]\n t0 = t0 >>> 0\n t1 = t1 >>> 0\n t2 = t2 >>> 0\n t3 = t3 >>> 0\n\n return [t0, t1, t2, t3]\n}\n\n// AES constants\nvar RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]\nvar G = (function () {\n // Compute double table\n var d = new Array(256)\n for (var j = 0; j < 256; j++) {\n if (j < 128) {\n d[j] = j << 1\n } else {\n d[j] = (j << 1) ^ 0x11b\n }\n }\n\n var SBOX = []\n var INV_SBOX = []\n var SUB_MIX = [[], [], [], []]\n var INV_SUB_MIX = [[], [], [], []]\n\n // Walk GF(2^8)\n var x = 0\n var xi = 0\n for (var i = 0; i < 256; ++i) {\n // Compute sbox\n var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4)\n sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63\n SBOX[x] = sx\n INV_SBOX[sx] = x\n\n // Compute multiplication\n var x2 = d[x]\n var x4 = d[x2]\n var x8 = d[x4]\n\n // Compute sub bytes, mix columns tables\n var t = (d[sx] * 0x101) ^ (sx * 0x1010100)\n SUB_MIX[0][x] = (t << 24) | (t >>> 8)\n SUB_MIX[1][x] = (t << 16) | (t >>> 16)\n SUB_MIX[2][x] = (t << 8) | (t >>> 24)\n SUB_MIX[3][x] = t\n\n // Compute inv sub bytes, inv mix columns tables\n t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100)\n INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8)\n INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16)\n INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24)\n INV_SUB_MIX[3][sx] = t\n\n if (x === 0) {\n x = xi = 1\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]]\n xi ^= d[d[xi]]\n }\n }\n\n return {\n SBOX: SBOX,\n INV_SBOX: INV_SBOX,\n SUB_MIX: SUB_MIX,\n INV_SUB_MIX: INV_SUB_MIX\n }\n})()\n\nfunction AES (key) {\n this._key = asUInt32Array(key)\n this._reset()\n}\n\nAES.blockSize = 4 * 4\nAES.keySize = 256 / 8\nAES.prototype.blockSize = AES.blockSize\nAES.prototype.keySize = AES.keySize\nAES.prototype._reset = function () {\n var keyWords = this._key\n var keySize = keyWords.length\n var nRounds = keySize + 6\n var ksRows = (nRounds + 1) * 4\n\n var keySchedule = []\n for (var k = 0; k < keySize; k++) {\n keySchedule[k] = keyWords[k]\n }\n\n for (k = keySize; k < ksRows; k++) {\n var t = keySchedule[k - 1]\n\n if (k % keySize === 0) {\n t = (t << 8) | (t >>> 24)\n t =\n (G.SBOX[t >>> 24] << 24) |\n (G.SBOX[(t >>> 16) & 0xff] << 16) |\n (G.SBOX[(t >>> 8) & 0xff] << 8) |\n (G.SBOX[t & 0xff])\n\n t ^= RCON[(k / keySize) | 0] << 24\n } else if (keySize > 6 && k % keySize === 4) {\n t =\n (G.SBOX[t >>> 24] << 24) |\n (G.SBOX[(t >>> 16) & 0xff] << 16) |\n (G.SBOX[(t >>> 8) & 0xff] << 8) |\n (G.SBOX[t & 0xff])\n }\n\n keySchedule[k] = keySchedule[k - keySize] ^ t\n }\n\n var invKeySchedule = []\n for (var ik = 0; ik < ksRows; ik++) {\n var ksR = ksRows - ik\n var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)]\n\n if (ik < 4 || ksR <= 4) {\n invKeySchedule[ik] = tt\n } else {\n invKeySchedule[ik] =\n G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^\n G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^\n G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^\n G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]]\n }\n }\n\n this._nRounds = nRounds\n this._keySchedule = keySchedule\n this._invKeySchedule = invKeySchedule\n}\n\nAES.prototype.encryptBlockRaw = function (M) {\n M = asUInt32Array(M)\n return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds)\n}\n\nAES.prototype.encryptBlock = function (M) {\n var out = this.encryptBlockRaw(M)\n var buf = Buffer.allocUnsafe(16)\n buf.writeUInt32BE(out[0], 0)\n buf.writeUInt32BE(out[1], 4)\n buf.writeUInt32BE(out[2], 8)\n buf.writeUInt32BE(out[3], 12)\n return buf\n}\n\nAES.prototype.decryptBlock = function (M) {\n M = asUInt32Array(M)\n\n // swap\n var m1 = M[1]\n M[1] = M[3]\n M[3] = m1\n\n var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds)\n var buf = Buffer.allocUnsafe(16)\n buf.writeUInt32BE(out[0], 0)\n buf.writeUInt32BE(out[3], 4)\n buf.writeUInt32BE(out[2], 8)\n buf.writeUInt32BE(out[1], 12)\n return buf\n}\n\nAES.prototype.scrub = function () {\n scrubVec(this._keySchedule)\n scrubVec(this._invKeySchedule)\n scrubVec(this._key)\n}\n\nmodule.exports.AES = AES\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/aes.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/authCipher.js": +/*!***************************************************!*\ + !*** ./node_modules/browserify-aes/authCipher.js ***! + \***************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var aes = __webpack_require__(/*! ./aes */ \"./node_modules/browserify-aes/aes.js\")\nvar Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\nvar Transform = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\")\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar GHASH = __webpack_require__(/*! ./ghash */ \"./node_modules/browserify-aes/ghash.js\")\nvar xor = __webpack_require__(/*! buffer-xor */ \"./node_modules/buffer-xor/index.js\")\nvar incr32 = __webpack_require__(/*! ./incr32 */ \"./node_modules/browserify-aes/incr32.js\")\n\nfunction xorTest (a, b) {\n var out = 0\n if (a.length !== b.length) out++\n\n var len = Math.min(a.length, b.length)\n for (var i = 0; i < len; ++i) {\n out += (a[i] ^ b[i])\n }\n\n return out\n}\n\nfunction calcIv (self, iv, ck) {\n if (iv.length === 12) {\n self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])])\n return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])])\n }\n var ghash = new GHASH(ck)\n var len = iv.length\n var toPad = len % 16\n ghash.update(iv)\n if (toPad) {\n toPad = 16 - toPad\n ghash.update(Buffer.alloc(toPad, 0))\n }\n ghash.update(Buffer.alloc(8, 0))\n var ivBits = len * 8\n var tail = Buffer.alloc(8)\n tail.writeUIntBE(ivBits, 0, 8)\n ghash.update(tail)\n self._finID = ghash.state\n var out = Buffer.from(self._finID)\n incr32(out)\n return out\n}\nfunction StreamCipher (mode, key, iv, decrypt) {\n Transform.call(this)\n\n var h = Buffer.alloc(4, 0)\n\n this._cipher = new aes.AES(key)\n var ck = this._cipher.encryptBlock(h)\n this._ghash = new GHASH(ck)\n iv = calcIv(this, iv, ck)\n\n this._prev = Buffer.from(iv)\n this._cache = Buffer.allocUnsafe(0)\n this._secCache = Buffer.allocUnsafe(0)\n this._decrypt = decrypt\n this._alen = 0\n this._len = 0\n this._mode = mode\n\n this._authTag = null\n this._called = false\n}\n\ninherits(StreamCipher, Transform)\n\nStreamCipher.prototype._update = function (chunk) {\n if (!this._called && this._alen) {\n var rump = 16 - (this._alen % 16)\n if (rump < 16) {\n rump = Buffer.alloc(rump, 0)\n this._ghash.update(rump)\n }\n }\n\n this._called = true\n var out = this._mode.encrypt(this, chunk)\n if (this._decrypt) {\n this._ghash.update(chunk)\n } else {\n this._ghash.update(out)\n }\n this._len += chunk.length\n return out\n}\n\nStreamCipher.prototype._final = function () {\n if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data')\n\n var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID))\n if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data')\n\n this._authTag = tag\n this._cipher.scrub()\n}\n\nStreamCipher.prototype.getAuthTag = function getAuthTag () {\n if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state')\n\n return this._authTag\n}\n\nStreamCipher.prototype.setAuthTag = function setAuthTag (tag) {\n if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state')\n\n this._authTag = tag\n}\n\nStreamCipher.prototype.setAAD = function setAAD (buf) {\n if (this._called) throw new Error('Attempting to set AAD in unsupported state')\n\n this._ghash.update(buf)\n this._alen += buf.length\n}\n\nmodule.exports = StreamCipher\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/authCipher.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/browser.js": +/*!************************************************!*\ + !*** ./node_modules/browserify-aes/browser.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +eval("var ciphers = __webpack_require__(/*! ./encrypter */ \"./node_modules/browserify-aes/encrypter.js\")\nvar deciphers = __webpack_require__(/*! ./decrypter */ \"./node_modules/browserify-aes/decrypter.js\")\nvar modes = __webpack_require__(/*! ./modes/list.json */ \"./node_modules/browserify-aes/modes/list.json\")\n\nfunction getCiphers () {\n return Object.keys(modes)\n}\n\nexports.createCipher = exports.Cipher = ciphers.createCipher\nexports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv\nexports.createDecipher = exports.Decipher = deciphers.createDecipher\nexports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv\nexports.listCiphers = exports.getCiphers = getCiphers\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/browser.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/decrypter.js": +/*!**************************************************!*\ + !*** ./node_modules/browserify-aes/decrypter.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +eval("var AuthCipher = __webpack_require__(/*! ./authCipher */ \"./node_modules/browserify-aes/authCipher.js\")\nvar Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\nvar MODES = __webpack_require__(/*! ./modes */ \"./node_modules/browserify-aes/modes/index.js\")\nvar StreamCipher = __webpack_require__(/*! ./streamCipher */ \"./node_modules/browserify-aes/streamCipher.js\")\nvar Transform = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\")\nvar aes = __webpack_require__(/*! ./aes */ \"./node_modules/browserify-aes/aes.js\")\nvar ebtk = __webpack_require__(/*! evp_bytestokey */ \"./node_modules/evp_bytestokey/index.js\")\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\n\nfunction Decipher (mode, key, iv) {\n Transform.call(this)\n\n this._cache = new Splitter()\n this._last = void 0\n this._cipher = new aes.AES(key)\n this._prev = Buffer.from(iv)\n this._mode = mode\n this._autopadding = true\n}\n\ninherits(Decipher, Transform)\n\nDecipher.prototype._update = function (data) {\n this._cache.add(data)\n var chunk\n var thing\n var out = []\n while ((chunk = this._cache.get(this._autopadding))) {\n thing = this._mode.decrypt(this, chunk)\n out.push(thing)\n }\n return Buffer.concat(out)\n}\n\nDecipher.prototype._final = function () {\n var chunk = this._cache.flush()\n if (this._autopadding) {\n return unpad(this._mode.decrypt(this, chunk))\n } else if (chunk) {\n throw new Error('data not multiple of block length')\n }\n}\n\nDecipher.prototype.setAutoPadding = function (setTo) {\n this._autopadding = !!setTo\n return this\n}\n\nfunction Splitter () {\n this.cache = Buffer.allocUnsafe(0)\n}\n\nSplitter.prototype.add = function (data) {\n this.cache = Buffer.concat([this.cache, data])\n}\n\nSplitter.prototype.get = function (autoPadding) {\n var out\n if (autoPadding) {\n if (this.cache.length > 16) {\n out = this.cache.slice(0, 16)\n this.cache = this.cache.slice(16)\n return out\n }\n } else {\n if (this.cache.length >= 16) {\n out = this.cache.slice(0, 16)\n this.cache = this.cache.slice(16)\n return out\n }\n }\n\n return null\n}\n\nSplitter.prototype.flush = function () {\n if (this.cache.length) return this.cache\n}\n\nfunction unpad (last) {\n var padded = last[15]\n if (padded < 1 || padded > 16) {\n throw new Error('unable to decrypt data')\n }\n var i = -1\n while (++i < padded) {\n if (last[(i + (16 - padded))] !== padded) {\n throw new Error('unable to decrypt data')\n }\n }\n if (padded === 16) return\n\n return last.slice(0, 16 - padded)\n}\n\nfunction createDecipheriv (suite, password, iv) {\n var config = MODES[suite.toLowerCase()]\n if (!config) throw new TypeError('invalid suite type')\n\n if (typeof iv === 'string') iv = Buffer.from(iv)\n if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)\n\n if (typeof password === 'string') password = Buffer.from(password)\n if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)\n\n if (config.type === 'stream') {\n return new StreamCipher(config.module, password, iv, true)\n } else if (config.type === 'auth') {\n return new AuthCipher(config.module, password, iv, true)\n }\n\n return new Decipher(config.module, password, iv)\n}\n\nfunction createDecipher (suite, password) {\n var config = MODES[suite.toLowerCase()]\n if (!config) throw new TypeError('invalid suite type')\n\n var keys = ebtk(password, false, config.key, config.iv)\n return createDecipheriv(suite, keys.key, keys.iv)\n}\n\nexports.createDecipher = createDecipher\nexports.createDecipheriv = createDecipheriv\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/decrypter.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/encrypter.js": +/*!**************************************************!*\ + !*** ./node_modules/browserify-aes/encrypter.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +eval("var MODES = __webpack_require__(/*! ./modes */ \"./node_modules/browserify-aes/modes/index.js\")\nvar AuthCipher = __webpack_require__(/*! ./authCipher */ \"./node_modules/browserify-aes/authCipher.js\")\nvar Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\nvar StreamCipher = __webpack_require__(/*! ./streamCipher */ \"./node_modules/browserify-aes/streamCipher.js\")\nvar Transform = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\")\nvar aes = __webpack_require__(/*! ./aes */ \"./node_modules/browserify-aes/aes.js\")\nvar ebtk = __webpack_require__(/*! evp_bytestokey */ \"./node_modules/evp_bytestokey/index.js\")\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\n\nfunction Cipher (mode, key, iv) {\n Transform.call(this)\n\n this._cache = new Splitter()\n this._cipher = new aes.AES(key)\n this._prev = Buffer.from(iv)\n this._mode = mode\n this._autopadding = true\n}\n\ninherits(Cipher, Transform)\n\nCipher.prototype._update = function (data) {\n this._cache.add(data)\n var chunk\n var thing\n var out = []\n\n while ((chunk = this._cache.get())) {\n thing = this._mode.encrypt(this, chunk)\n out.push(thing)\n }\n\n return Buffer.concat(out)\n}\n\nvar PADDING = Buffer.alloc(16, 0x10)\n\nCipher.prototype._final = function () {\n var chunk = this._cache.flush()\n if (this._autopadding) {\n chunk = this._mode.encrypt(this, chunk)\n this._cipher.scrub()\n return chunk\n }\n\n if (!chunk.equals(PADDING)) {\n this._cipher.scrub()\n throw new Error('data not multiple of block length')\n }\n}\n\nCipher.prototype.setAutoPadding = function (setTo) {\n this._autopadding = !!setTo\n return this\n}\n\nfunction Splitter () {\n this.cache = Buffer.allocUnsafe(0)\n}\n\nSplitter.prototype.add = function (data) {\n this.cache = Buffer.concat([this.cache, data])\n}\n\nSplitter.prototype.get = function () {\n if (this.cache.length > 15) {\n var out = this.cache.slice(0, 16)\n this.cache = this.cache.slice(16)\n return out\n }\n return null\n}\n\nSplitter.prototype.flush = function () {\n var len = 16 - this.cache.length\n var padBuff = Buffer.allocUnsafe(len)\n\n var i = -1\n while (++i < len) {\n padBuff.writeUInt8(len, i)\n }\n\n return Buffer.concat([this.cache, padBuff])\n}\n\nfunction createCipheriv (suite, password, iv) {\n var config = MODES[suite.toLowerCase()]\n if (!config) throw new TypeError('invalid suite type')\n\n if (typeof password === 'string') password = Buffer.from(password)\n if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)\n\n if (typeof iv === 'string') iv = Buffer.from(iv)\n if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)\n\n if (config.type === 'stream') {\n return new StreamCipher(config.module, password, iv)\n } else if (config.type === 'auth') {\n return new AuthCipher(config.module, password, iv)\n }\n\n return new Cipher(config.module, password, iv)\n}\n\nfunction createCipher (suite, password) {\n var config = MODES[suite.toLowerCase()]\n if (!config) throw new TypeError('invalid suite type')\n\n var keys = ebtk(password, false, config.key, config.iv)\n return createCipheriv(suite, keys.key, keys.iv)\n}\n\nexports.createCipheriv = createCipheriv\nexports.createCipher = createCipher\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/encrypter.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/ghash.js": +/*!**********************************************!*\ + !*** ./node_modules/browserify-aes/ghash.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\nvar ZEROES = Buffer.alloc(16, 0)\n\nfunction toArray (buf) {\n return [\n buf.readUInt32BE(0),\n buf.readUInt32BE(4),\n buf.readUInt32BE(8),\n buf.readUInt32BE(12)\n ]\n}\n\nfunction fromArray (out) {\n var buf = Buffer.allocUnsafe(16)\n buf.writeUInt32BE(out[0] >>> 0, 0)\n buf.writeUInt32BE(out[1] >>> 0, 4)\n buf.writeUInt32BE(out[2] >>> 0, 8)\n buf.writeUInt32BE(out[3] >>> 0, 12)\n return buf\n}\n\nfunction GHASH (key) {\n this.h = key\n this.state = Buffer.alloc(16, 0)\n this.cache = Buffer.allocUnsafe(0)\n}\n\n// from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html\n// by Juho Vähä-Herttua\nGHASH.prototype.ghash = function (block) {\n var i = -1\n while (++i < block.length) {\n this.state[i] ^= block[i]\n }\n this._multiply()\n}\n\nGHASH.prototype._multiply = function () {\n var Vi = toArray(this.h)\n var Zi = [0, 0, 0, 0]\n var j, xi, lsbVi\n var i = -1\n while (++i < 128) {\n xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0\n if (xi) {\n // Z_i+1 = Z_i ^ V_i\n Zi[0] ^= Vi[0]\n Zi[1] ^= Vi[1]\n Zi[2] ^= Vi[2]\n Zi[3] ^= Vi[3]\n }\n\n // Store the value of LSB(V_i)\n lsbVi = (Vi[3] & 1) !== 0\n\n // V_i+1 = V_i >> 1\n for (j = 3; j > 0; j--) {\n Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31)\n }\n Vi[0] = Vi[0] >>> 1\n\n // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R\n if (lsbVi) {\n Vi[0] = Vi[0] ^ (0xe1 << 24)\n }\n }\n this.state = fromArray(Zi)\n}\n\nGHASH.prototype.update = function (buf) {\n this.cache = Buffer.concat([this.cache, buf])\n var chunk\n while (this.cache.length >= 16) {\n chunk = this.cache.slice(0, 16)\n this.cache = this.cache.slice(16)\n this.ghash(chunk)\n }\n}\n\nGHASH.prototype.final = function (abl, bl) {\n if (this.cache.length) {\n this.ghash(Buffer.concat([this.cache, ZEROES], 16))\n }\n\n this.ghash(fromArray([0, abl, 0, bl]))\n return this.state\n}\n\nmodule.exports = GHASH\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/ghash.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/incr32.js": +/*!***********************************************!*\ + !*** ./node_modules/browserify-aes/incr32.js ***! + \***********************************************/ +/***/ ((module) => { + +eval("function incr32 (iv) {\n var len = iv.length\n var item\n while (len--) {\n item = iv.readUInt8(len)\n if (item === 255) {\n iv.writeUInt8(0, len)\n } else {\n item++\n iv.writeUInt8(item, len)\n break\n }\n }\n}\nmodule.exports = incr32\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/incr32.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/modes/cbc.js": +/*!**************************************************!*\ + !*** ./node_modules/browserify-aes/modes/cbc.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +eval("var xor = __webpack_require__(/*! buffer-xor */ \"./node_modules/buffer-xor/index.js\")\n\nexports.encrypt = function (self, block) {\n var data = xor(block, self._prev)\n\n self._prev = self._cipher.encryptBlock(data)\n return self._prev\n}\n\nexports.decrypt = function (self, block) {\n var pad = self._prev\n\n self._prev = block\n var out = self._cipher.decryptBlock(block)\n\n return xor(out, pad)\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/modes/cbc.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/modes/cfb.js": +/*!**************************************************!*\ + !*** ./node_modules/browserify-aes/modes/cfb.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +eval("var Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\nvar xor = __webpack_require__(/*! buffer-xor */ \"./node_modules/buffer-xor/index.js\")\n\nfunction encryptStart (self, data, decrypt) {\n var len = data.length\n var out = xor(data, self._cache)\n self._cache = self._cache.slice(len)\n self._prev = Buffer.concat([self._prev, decrypt ? data : out])\n return out\n}\n\nexports.encrypt = function (self, data, decrypt) {\n var out = Buffer.allocUnsafe(0)\n var len\n\n while (data.length) {\n if (self._cache.length === 0) {\n self._cache = self._cipher.encryptBlock(self._prev)\n self._prev = Buffer.allocUnsafe(0)\n }\n\n if (self._cache.length <= data.length) {\n len = self._cache.length\n out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)])\n data = data.slice(len)\n } else {\n out = Buffer.concat([out, encryptStart(self, data, decrypt)])\n break\n }\n }\n\n return out\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/modes/cfb.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/modes/cfb1.js": +/*!***************************************************!*\ + !*** ./node_modules/browserify-aes/modes/cfb1.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +eval("var Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\n\nfunction encryptByte (self, byteParam, decrypt) {\n var pad\n var i = -1\n var len = 8\n var out = 0\n var bit, value\n while (++i < len) {\n pad = self._cipher.encryptBlock(self._prev)\n bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0\n value = pad[0] ^ bit\n out += ((value & 0x80) >> (i % 8))\n self._prev = shiftIn(self._prev, decrypt ? bit : value)\n }\n return out\n}\n\nfunction shiftIn (buffer, value) {\n var len = buffer.length\n var i = -1\n var out = Buffer.allocUnsafe(buffer.length)\n buffer = Buffer.concat([buffer, Buffer.from([value])])\n\n while (++i < len) {\n out[i] = buffer[i] << 1 | buffer[i + 1] >> (7)\n }\n\n return out\n}\n\nexports.encrypt = function (self, chunk, decrypt) {\n var len = chunk.length\n var out = Buffer.allocUnsafe(len)\n var i = -1\n\n while (++i < len) {\n out[i] = encryptByte(self, chunk[i], decrypt)\n }\n\n return out\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/modes/cfb1.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/modes/cfb8.js": +/*!***************************************************!*\ + !*** ./node_modules/browserify-aes/modes/cfb8.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +eval("var Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\n\nfunction encryptByte (self, byteParam, decrypt) {\n var pad = self._cipher.encryptBlock(self._prev)\n var out = pad[0] ^ byteParam\n\n self._prev = Buffer.concat([\n self._prev.slice(1),\n Buffer.from([decrypt ? byteParam : out])\n ])\n\n return out\n}\n\nexports.encrypt = function (self, chunk, decrypt) {\n var len = chunk.length\n var out = Buffer.allocUnsafe(len)\n var i = -1\n\n while (++i < len) {\n out[i] = encryptByte(self, chunk[i], decrypt)\n }\n\n return out\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/modes/cfb8.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/modes/ctr.js": +/*!**************************************************!*\ + !*** ./node_modules/browserify-aes/modes/ctr.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +eval("var xor = __webpack_require__(/*! buffer-xor */ \"./node_modules/buffer-xor/index.js\")\nvar Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\nvar incr32 = __webpack_require__(/*! ../incr32 */ \"./node_modules/browserify-aes/incr32.js\")\n\nfunction getBlock (self) {\n var out = self._cipher.encryptBlockRaw(self._prev)\n incr32(self._prev)\n return out\n}\n\nvar blockSize = 16\nexports.encrypt = function (self, chunk) {\n var chunkNum = Math.ceil(chunk.length / blockSize)\n var start = self._cache.length\n self._cache = Buffer.concat([\n self._cache,\n Buffer.allocUnsafe(chunkNum * blockSize)\n ])\n for (var i = 0; i < chunkNum; i++) {\n var out = getBlock(self)\n var offset = start + i * blockSize\n self._cache.writeUInt32BE(out[0], offset + 0)\n self._cache.writeUInt32BE(out[1], offset + 4)\n self._cache.writeUInt32BE(out[2], offset + 8)\n self._cache.writeUInt32BE(out[3], offset + 12)\n }\n var pad = self._cache.slice(0, chunk.length)\n self._cache = self._cache.slice(chunk.length)\n return xor(chunk, pad)\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/modes/ctr.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/modes/ecb.js": +/*!**************************************************!*\ + !*** ./node_modules/browserify-aes/modes/ecb.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +eval("exports.encrypt = function (self, block) {\n return self._cipher.encryptBlock(block)\n}\n\nexports.decrypt = function (self, block) {\n return self._cipher.decryptBlock(block)\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/modes/ecb.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/modes/index.js": +/*!****************************************************!*\ + !*** ./node_modules/browserify-aes/modes/index.js ***! + \****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var modeModules = {\n ECB: __webpack_require__(/*! ./ecb */ \"./node_modules/browserify-aes/modes/ecb.js\"),\n CBC: __webpack_require__(/*! ./cbc */ \"./node_modules/browserify-aes/modes/cbc.js\"),\n CFB: __webpack_require__(/*! ./cfb */ \"./node_modules/browserify-aes/modes/cfb.js\"),\n CFB8: __webpack_require__(/*! ./cfb8 */ \"./node_modules/browserify-aes/modes/cfb8.js\"),\n CFB1: __webpack_require__(/*! ./cfb1 */ \"./node_modules/browserify-aes/modes/cfb1.js\"),\n OFB: __webpack_require__(/*! ./ofb */ \"./node_modules/browserify-aes/modes/ofb.js\"),\n CTR: __webpack_require__(/*! ./ctr */ \"./node_modules/browserify-aes/modes/ctr.js\"),\n GCM: __webpack_require__(/*! ./ctr */ \"./node_modules/browserify-aes/modes/ctr.js\")\n}\n\nvar modes = __webpack_require__(/*! ./list.json */ \"./node_modules/browserify-aes/modes/list.json\")\n\nfor (var key in modes) {\n modes[key].module = modeModules[modes[key].mode]\n}\n\nmodule.exports = modes\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/modes/index.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/modes/ofb.js": +/*!**************************************************!*\ + !*** ./node_modules/browserify-aes/modes/ofb.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +eval("/* provided dependency */ var Buffer = __webpack_require__(/*! ./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js */ \"./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js\")[\"Buffer\"];\nvar xor = __webpack_require__(/*! buffer-xor */ \"./node_modules/buffer-xor/index.js\")\n\nfunction getBlock (self) {\n self._prev = self._cipher.encryptBlock(self._prev)\n return self._prev\n}\n\nexports.encrypt = function (self, chunk) {\n while (self._cache.length < chunk.length) {\n self._cache = Buffer.concat([self._cache, getBlock(self)])\n }\n\n var pad = self._cache.slice(0, chunk.length)\n self._cache = self._cache.slice(chunk.length)\n return xor(chunk, pad)\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/modes/ofb.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-aes/streamCipher.js": +/*!*****************************************************!*\ + !*** ./node_modules/browserify-aes/streamCipher.js ***! + \*****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var aes = __webpack_require__(/*! ./aes */ \"./node_modules/browserify-aes/aes.js\")\nvar Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\nvar Transform = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\")\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\n\nfunction StreamCipher (mode, key, iv, decrypt) {\n Transform.call(this)\n\n this._cipher = new aes.AES(key)\n this._prev = Buffer.from(iv)\n this._cache = Buffer.allocUnsafe(0)\n this._secCache = Buffer.allocUnsafe(0)\n this._decrypt = decrypt\n this._mode = mode\n}\n\ninherits(StreamCipher, Transform)\n\nStreamCipher.prototype._update = function (chunk) {\n return this._mode.encrypt(this, chunk, this._decrypt)\n}\n\nStreamCipher.prototype._final = function () {\n this._cipher.scrub()\n}\n\nmodule.exports = StreamCipher\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-aes/streamCipher.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-cipher/browser.js": +/*!***************************************************!*\ + !*** ./node_modules/browserify-cipher/browser.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +eval("var DES = __webpack_require__(/*! browserify-des */ \"./node_modules/browserify-des/index.js\")\nvar aes = __webpack_require__(/*! browserify-aes/browser */ \"./node_modules/browserify-aes/browser.js\")\nvar aesModes = __webpack_require__(/*! browserify-aes/modes */ \"./node_modules/browserify-aes/modes/index.js\")\nvar desModes = __webpack_require__(/*! browserify-des/modes */ \"./node_modules/browserify-des/modes.js\")\nvar ebtk = __webpack_require__(/*! evp_bytestokey */ \"./node_modules/evp_bytestokey/index.js\")\n\nfunction createCipher (suite, password) {\n suite = suite.toLowerCase()\n\n var keyLen, ivLen\n if (aesModes[suite]) {\n keyLen = aesModes[suite].key\n ivLen = aesModes[suite].iv\n } else if (desModes[suite]) {\n keyLen = desModes[suite].key * 8\n ivLen = desModes[suite].iv\n } else {\n throw new TypeError('invalid suite type')\n }\n\n var keys = ebtk(password, false, keyLen, ivLen)\n return createCipheriv(suite, keys.key, keys.iv)\n}\n\nfunction createDecipher (suite, password) {\n suite = suite.toLowerCase()\n\n var keyLen, ivLen\n if (aesModes[suite]) {\n keyLen = aesModes[suite].key\n ivLen = aesModes[suite].iv\n } else if (desModes[suite]) {\n keyLen = desModes[suite].key * 8\n ivLen = desModes[suite].iv\n } else {\n throw new TypeError('invalid suite type')\n }\n\n var keys = ebtk(password, false, keyLen, ivLen)\n return createDecipheriv(suite, keys.key, keys.iv)\n}\n\nfunction createCipheriv (suite, key, iv) {\n suite = suite.toLowerCase()\n if (aesModes[suite]) return aes.createCipheriv(suite, key, iv)\n if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite })\n\n throw new TypeError('invalid suite type')\n}\n\nfunction createDecipheriv (suite, key, iv) {\n suite = suite.toLowerCase()\n if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv)\n if (desModes[suite]) return new DES({ key: key, iv: iv, mode: suite, decrypt: true })\n\n throw new TypeError('invalid suite type')\n}\n\nfunction getCiphers () {\n return Object.keys(desModes).concat(aes.getCiphers())\n}\n\nexports.createCipher = exports.Cipher = createCipher\nexports.createCipheriv = exports.Cipheriv = createCipheriv\nexports.createDecipher = exports.Decipher = createDecipher\nexports.createDecipheriv = exports.Decipheriv = createDecipheriv\nexports.listCiphers = exports.getCiphers = getCiphers\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-cipher/browser.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-des/index.js": +/*!**********************************************!*\ + !*** ./node_modules/browserify-des/index.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var CipherBase = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\")\nvar des = __webpack_require__(/*! des.js */ \"./node_modules/des.js/lib/des.js\")\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\n\nvar modes = {\n 'des-ede3-cbc': des.CBC.instantiate(des.EDE),\n 'des-ede3': des.EDE,\n 'des-ede-cbc': des.CBC.instantiate(des.EDE),\n 'des-ede': des.EDE,\n 'des-cbc': des.CBC.instantiate(des.DES),\n 'des-ecb': des.DES\n}\nmodes.des = modes['des-cbc']\nmodes.des3 = modes['des-ede3-cbc']\nmodule.exports = DES\ninherits(DES, CipherBase)\nfunction DES (opts) {\n CipherBase.call(this)\n var modeName = opts.mode.toLowerCase()\n var mode = modes[modeName]\n var type\n if (opts.decrypt) {\n type = 'decrypt'\n } else {\n type = 'encrypt'\n }\n var key = opts.key\n if (!Buffer.isBuffer(key)) {\n key = Buffer.from(key)\n }\n if (modeName === 'des-ede' || modeName === 'des-ede-cbc') {\n key = Buffer.concat([key, key.slice(0, 8)])\n }\n var iv = opts.iv\n if (!Buffer.isBuffer(iv)) {\n iv = Buffer.from(iv)\n }\n this._des = mode.create({\n key: key,\n iv: iv,\n type: type\n })\n}\nDES.prototype._update = function (data) {\n return Buffer.from(this._des.update(data))\n}\nDES.prototype._final = function () {\n return Buffer.from(this._des.final())\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-des/index.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-des/modes.js": +/*!**********************************************!*\ + !*** ./node_modules/browserify-des/modes.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, exports) => { + +eval("exports[\"des-ecb\"] = {\n key: 8,\n iv: 0\n}\nexports[\"des-cbc\"] = exports.des = {\n key: 8,\n iv: 8\n}\nexports[\"des-ede3-cbc\"] = exports.des3 = {\n key: 24,\n iv: 8\n}\nexports[\"des-ede3\"] = {\n key: 24,\n iv: 0\n}\nexports[\"des-ede-cbc\"] = {\n key: 16,\n iv: 8\n}\nexports[\"des-ede\"] = {\n key: 16,\n iv: 0\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-des/modes.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-rsa/index.js": +/*!**********************************************!*\ + !*** ./node_modules/browserify-rsa/index.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("/* provided dependency */ var Buffer = __webpack_require__(/*! ./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js */ \"./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js\")[\"Buffer\"];\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\")\nvar randomBytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\")\n\nfunction blind (priv) {\n var r = getr(priv)\n var blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed()\n return { blinder: blinder, unblinder: r.invm(priv.modulus) }\n}\n\nfunction getr (priv) {\n var len = priv.modulus.byteLength()\n var r\n do {\n r = new BN(randomBytes(len))\n } while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2))\n return r\n}\n\nfunction crt (msg, priv) {\n var blinds = blind(priv)\n var len = priv.modulus.byteLength()\n var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus)\n var c1 = blinded.toRed(BN.mont(priv.prime1))\n var c2 = blinded.toRed(BN.mont(priv.prime2))\n var qinv = priv.coefficient\n var p = priv.prime1\n var q = priv.prime2\n var m1 = c1.redPow(priv.exponent1).fromRed()\n var m2 = c2.redPow(priv.exponent2).fromRed()\n var h = m1.isub(m2).imul(qinv).umod(p).imul(q)\n return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, 'be', len)\n}\ncrt.getr = getr\n\nmodule.exports = crt\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-rsa/index.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-sign/algos.js": +/*!***********************************************!*\ + !*** ./node_modules/browserify-sign/algos.js ***! + \***********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nmodule.exports = __webpack_require__(/*! ./browser/algorithms.json */ \"./node_modules/browserify-sign/browser/algorithms.json\");\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-sign/algos.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-sign/browser/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/browserify-sign/browser/index.js ***! + \*******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nvar Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer);\nvar createHash = __webpack_require__(/*! create-hash */ \"./node_modules/create-hash/browser.js\");\nvar stream = __webpack_require__(/*! readable-stream */ \"./node_modules/readable-stream/readable-browser.js\");\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\nvar sign = __webpack_require__(/*! ./sign */ \"./node_modules/browserify-sign/browser/sign.js\");\nvar verify = __webpack_require__(/*! ./verify */ \"./node_modules/browserify-sign/browser/verify.js\");\n\nvar algorithms = __webpack_require__(/*! ./algorithms.json */ \"./node_modules/browserify-sign/browser/algorithms.json\");\nObject.keys(algorithms).forEach(function (key) {\n algorithms[key].id = Buffer.from(algorithms[key].id, 'hex');\n algorithms[key.toLowerCase()] = algorithms[key];\n});\n\nfunction Sign(algorithm) {\n stream.Writable.call(this);\n\n var data = algorithms[algorithm];\n if (!data) { throw new Error('Unknown message digest'); }\n\n this._hashType = data.hash;\n this._hash = createHash(data.hash);\n this._tag = data.id;\n this._signType = data.sign;\n}\ninherits(Sign, stream.Writable);\n\nSign.prototype._write = function _write(data, _, done) {\n this._hash.update(data);\n done();\n};\n\nSign.prototype.update = function update(data, enc) {\n this._hash.update(typeof data === 'string' ? Buffer.from(data, enc) : data);\n\n return this;\n};\n\nSign.prototype.sign = function signMethod(key, enc) {\n this.end();\n var hash = this._hash.digest();\n var sig = sign(hash, key, this._hashType, this._signType, this._tag);\n\n return enc ? sig.toString(enc) : sig;\n};\n\nfunction Verify(algorithm) {\n stream.Writable.call(this);\n\n var data = algorithms[algorithm];\n if (!data) { throw new Error('Unknown message digest'); }\n\n this._hash = createHash(data.hash);\n this._tag = data.id;\n this._signType = data.sign;\n}\ninherits(Verify, stream.Writable);\n\nVerify.prototype._write = function _write(data, _, done) {\n this._hash.update(data);\n done();\n};\n\nVerify.prototype.update = function update(data, enc) {\n this._hash.update(typeof data === 'string' ? Buffer.from(data, enc) : data);\n\n return this;\n};\n\nVerify.prototype.verify = function verifyMethod(key, sig, enc) {\n var sigBuffer = typeof sig === 'string' ? Buffer.from(sig, enc) : sig;\n\n this.end();\n var hash = this._hash.digest();\n return verify(sigBuffer, hash, key, this._signType, this._tag);\n};\n\nfunction createSign(algorithm) {\n return new Sign(algorithm);\n}\n\nfunction createVerify(algorithm) {\n return new Verify(algorithm);\n}\n\nmodule.exports = {\n Sign: createSign,\n Verify: createVerify,\n createSign: createSign,\n createVerify: createVerify\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-sign/browser/index.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-sign/browser/sign.js": +/*!******************************************************!*\ + !*** ./node_modules/browserify-sign/browser/sign.js ***! + \******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\n// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js\nvar Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer);\nvar createHmac = __webpack_require__(/*! create-hmac */ \"./node_modules/create-hmac/browser.js\");\nvar crt = __webpack_require__(/*! browserify-rsa */ \"./node_modules/browserify-rsa/index.js\");\nvar EC = (__webpack_require__(/*! elliptic */ \"./node_modules/elliptic/lib/elliptic.js\").ec);\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\nvar parseKeys = __webpack_require__(/*! parse-asn1 */ \"./node_modules/parse-asn1/index.js\");\nvar curves = __webpack_require__(/*! ./curves.json */ \"./node_modules/browserify-sign/browser/curves.json\");\n\nvar RSA_PKCS1_PADDING = 1;\n\nfunction sign(hash, key, hashType, signType, tag) {\n var priv = parseKeys(key);\n if (priv.curve) {\n // rsa keys can be interpreted as ecdsa ones in openssl\n if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') { throw new Error('wrong private key type'); }\n return ecSign(hash, priv);\n } else if (priv.type === 'dsa') {\n if (signType !== 'dsa') { throw new Error('wrong private key type'); }\n return dsaSign(hash, priv, hashType);\n }\n if (signType !== 'rsa' && signType !== 'ecdsa/rsa') { throw new Error('wrong private key type'); }\n if (key.padding !== undefined && key.padding !== RSA_PKCS1_PADDING) { throw new Error('illegal or unsupported padding mode'); }\n\n hash = Buffer.concat([tag, hash]);\n var len = priv.modulus.byteLength();\n var pad = [0, 1];\n while (hash.length + pad.length + 1 < len) { pad.push(0xff); }\n pad.push(0x00);\n var i = -1;\n while (++i < hash.length) { pad.push(hash[i]); }\n\n var out = crt(pad, priv);\n return out;\n}\n\nfunction ecSign(hash, priv) {\n var curveId = curves[priv.curve.join('.')];\n if (!curveId) { throw new Error('unknown curve ' + priv.curve.join('.')); }\n\n var curve = new EC(curveId);\n var key = curve.keyFromPrivate(priv.privateKey);\n var out = key.sign(hash);\n\n return Buffer.from(out.toDER());\n}\n\nfunction dsaSign(hash, priv, algo) {\n var x = priv.params.priv_key;\n var p = priv.params.p;\n var q = priv.params.q;\n var g = priv.params.g;\n var r = new BN(0);\n var k;\n var H = bits2int(hash, q).mod(q);\n var s = false;\n var kv = getKey(x, q, hash, algo);\n while (s === false) {\n k = makeKey(q, kv, algo);\n r = makeR(g, k, p, q);\n s = k.invm(q).imul(H.add(x.mul(r))).mod(q);\n if (s.cmpn(0) === 0) {\n s = false;\n r = new BN(0);\n }\n }\n return toDER(r, s);\n}\n\nfunction toDER(r, s) {\n r = r.toArray();\n s = s.toArray();\n\n // Pad values\n if (r[0] & 0x80) { r = [0].concat(r); }\n if (s[0] & 0x80) { s = [0].concat(s); }\n\n var total = r.length + s.length + 4;\n var res = [\n 0x30, total, 0x02, r.length\n ];\n res = res.concat(r, [0x02, s.length], s);\n return Buffer.from(res);\n}\n\nfunction getKey(x, q, hash, algo) {\n x = Buffer.from(x.toArray());\n if (x.length < q.byteLength()) {\n var zeros = Buffer.alloc(q.byteLength() - x.length);\n x = Buffer.concat([zeros, x]);\n }\n var hlen = hash.length;\n var hbits = bits2octets(hash, q);\n var v = Buffer.alloc(hlen);\n v.fill(1);\n var k = Buffer.alloc(hlen);\n k = createHmac(algo, k).update(v).update(Buffer.from([0])).update(x).update(hbits).digest();\n v = createHmac(algo, k).update(v).digest();\n k = createHmac(algo, k).update(v).update(Buffer.from([1])).update(x).update(hbits).digest();\n v = createHmac(algo, k).update(v).digest();\n return { k: k, v: v };\n}\n\nfunction bits2int(obits, q) {\n var bits = new BN(obits);\n var shift = (obits.length << 3) - q.bitLength();\n if (shift > 0) { bits.ishrn(shift); }\n return bits;\n}\n\nfunction bits2octets(bits, q) {\n bits = bits2int(bits, q);\n bits = bits.mod(q);\n var out = Buffer.from(bits.toArray());\n if (out.length < q.byteLength()) {\n var zeros = Buffer.alloc(q.byteLength() - out.length);\n out = Buffer.concat([zeros, out]);\n }\n return out;\n}\n\nfunction makeKey(q, kv, algo) {\n var t;\n var k;\n\n do {\n t = Buffer.alloc(0);\n\n while (t.length * 8 < q.bitLength()) {\n kv.v = createHmac(algo, kv.k).update(kv.v).digest();\n t = Buffer.concat([t, kv.v]);\n }\n\n k = bits2int(t, q);\n kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer.from([0])).digest();\n kv.v = createHmac(algo, kv.k).update(kv.v).digest();\n } while (k.cmp(q) !== -1);\n\n return k;\n}\n\nfunction makeR(g, k, p, q) {\n return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q);\n}\n\nmodule.exports = sign;\nmodule.exports.getKey = getKey;\nmodule.exports.makeKey = makeKey;\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-sign/browser/sign.js?"); + +/***/ }), + +/***/ "./node_modules/browserify-sign/browser/verify.js": +/*!********************************************************!*\ + !*** ./node_modules/browserify-sign/browser/verify.js ***! + \********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\n// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js\nvar Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer);\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\nvar EC = (__webpack_require__(/*! elliptic */ \"./node_modules/elliptic/lib/elliptic.js\").ec);\nvar parseKeys = __webpack_require__(/*! parse-asn1 */ \"./node_modules/parse-asn1/index.js\");\nvar curves = __webpack_require__(/*! ./curves.json */ \"./node_modules/browserify-sign/browser/curves.json\");\n\nfunction verify(sig, hash, key, signType, tag) {\n var pub = parseKeys(key);\n if (pub.type === 'ec') {\n // rsa keys can be interpreted as ecdsa ones in openssl\n if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') { throw new Error('wrong public key type'); }\n return ecVerify(sig, hash, pub);\n } else if (pub.type === 'dsa') {\n if (signType !== 'dsa') { throw new Error('wrong public key type'); }\n return dsaVerify(sig, hash, pub);\n }\n if (signType !== 'rsa' && signType !== 'ecdsa/rsa') { throw new Error('wrong public key type'); }\n\n hash = Buffer.concat([tag, hash]);\n var len = pub.modulus.byteLength();\n var pad = [1];\n var padNum = 0;\n while (hash.length + pad.length + 2 < len) {\n pad.push(0xff);\n padNum += 1;\n }\n pad.push(0x00);\n var i = -1;\n while (++i < hash.length) {\n pad.push(hash[i]);\n }\n pad = Buffer.from(pad);\n var red = BN.mont(pub.modulus);\n sig = new BN(sig).toRed(red);\n\n sig = sig.redPow(new BN(pub.publicExponent));\n sig = Buffer.from(sig.fromRed().toArray());\n var out = padNum < 8 ? 1 : 0;\n len = Math.min(sig.length, pad.length);\n if (sig.length !== pad.length) { out = 1; }\n\n i = -1;\n while (++i < len) { out |= sig[i] ^ pad[i]; }\n return out === 0;\n}\n\nfunction ecVerify(sig, hash, pub) {\n var curveId = curves[pub.data.algorithm.curve.join('.')];\n if (!curveId) { throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.')); }\n\n var curve = new EC(curveId);\n var pubkey = pub.data.subjectPrivateKey.data;\n\n return curve.verify(hash, sig, pubkey);\n}\n\nfunction dsaVerify(sig, hash, pub) {\n var p = pub.data.p;\n var q = pub.data.q;\n var g = pub.data.g;\n var y = pub.data.pub_key;\n var unpacked = parseKeys.signature.decode(sig, 'der');\n var s = unpacked.s;\n var r = unpacked.r;\n checkValue(s, q);\n checkValue(r, q);\n var montp = BN.mont(p);\n var w = s.invm(q);\n var v = g.toRed(montp)\n .redPow(new BN(hash).mul(w).mod(q))\n .fromRed()\n .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed())\n .mod(p)\n .mod(q);\n return v.cmp(r) === 0;\n}\n\nfunction checkValue(b, q) {\n if (b.cmpn(0) <= 0) { throw new Error('invalid sig'); }\n if (b.cmp(q) >= 0) { throw new Error('invalid sig'); }\n}\n\nmodule.exports = verify;\n\n\n//# sourceURL=webpack://dcp/./node_modules/browserify-sign/browser/verify.js?"); + +/***/ }), + +/***/ "./node_modules/bs58/index.js": +/*!************************************!*\ + !*** ./node_modules/bs58/index.js ***! + \************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var basex = __webpack_require__(/*! base-x */ \"./node_modules/base-x/src/index.js\")\nvar ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n\nmodule.exports = basex(ALPHABET)\n\n\n//# sourceURL=webpack://dcp/./node_modules/bs58/index.js?"); + +/***/ }), + +/***/ "./node_modules/bs58check/base.js": +/*!****************************************!*\ + !*** ./node_modules/bs58check/base.js ***! + \****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nvar base58 = __webpack_require__(/*! bs58 */ \"./node_modules/bs58/index.js\")\nvar Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\n\nmodule.exports = function (checksumFn) {\n // Encode a buffer as a base58-check encoded string\n function encode (payload) {\n var checksum = checksumFn(payload)\n\n return base58.encode(Buffer.concat([\n payload,\n checksum\n ], payload.length + 4))\n }\n\n function decodeRaw (buffer) {\n var payload = buffer.slice(0, -4)\n var checksum = buffer.slice(-4)\n var newChecksum = checksumFn(payload)\n\n if (checksum[0] ^ newChecksum[0] |\n checksum[1] ^ newChecksum[1] |\n checksum[2] ^ newChecksum[2] |\n checksum[3] ^ newChecksum[3]) return\n\n return payload\n }\n\n // Decode a base58-check encoded string to a buffer, no result if checksum is wrong\n function decodeUnsafe (string) {\n var buffer = base58.decodeUnsafe(string)\n if (!buffer) return\n\n return decodeRaw(buffer)\n }\n\n function decode (string) {\n var buffer = base58.decode(string)\n var payload = decodeRaw(buffer, checksumFn)\n if (!payload) throw new Error('Invalid checksum')\n return payload\n }\n\n return {\n encode: encode,\n decode: decode,\n decodeUnsafe: decodeUnsafe\n }\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/bs58check/base.js?"); + +/***/ }), + +/***/ "./node_modules/bs58check/index.js": +/*!*****************************************!*\ + !*** ./node_modules/bs58check/index.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nvar createHash = __webpack_require__(/*! create-hash */ \"./node_modules/create-hash/browser.js\")\nvar bs58checkBase = __webpack_require__(/*! ./base */ \"./node_modules/bs58check/base.js\")\n\n// SHA256(SHA256(buffer))\nfunction sha256x2 (buffer) {\n var tmp = createHash('sha256').update(buffer).digest()\n return createHash('sha256').update(tmp).digest()\n}\n\nmodule.exports = bs58checkBase(sha256x2)\n\n\n//# sourceURL=webpack://dcp/./node_modules/bs58check/index.js?"); + +/***/ }), + +/***/ "./node_modules/btoa/index.js": +/*!************************************!*\ + !*** ./node_modules/btoa/index.js ***! + \************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("/* provided dependency */ var Buffer = __webpack_require__(/*! ./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js */ \"./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js\")[\"Buffer\"];\n(function () {\n \"use strict\";\n\n function btoa(str) {\n var buffer;\n\n if (str instanceof Buffer) {\n buffer = str;\n } else {\n buffer = Buffer.from(str.toString(), 'binary');\n }\n\n return buffer.toString('base64');\n }\n\n module.exports = btoa;\n}());\n\n\n//# sourceURL=webpack://dcp/./node_modules/btoa/index.js?"); + +/***/ }), + +/***/ "./node_modules/buffer-xor/index.js": +/*!******************************************!*\ + !*** ./node_modules/buffer-xor/index.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("/* provided dependency */ var Buffer = __webpack_require__(/*! ./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js */ \"./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js\")[\"Buffer\"];\nmodule.exports = function xor (a, b) {\n var length = Math.min(a.length, b.length)\n var buffer = new Buffer(length)\n\n for (var i = 0; i < length; ++i) {\n buffer[i] = a[i] ^ b[i]\n }\n\n return buffer\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/buffer-xor/index.js?"); + +/***/ }), + +/***/ "./node_modules/buffer/index.js": +/*!**************************************!*\ + !*** ./node_modules/buffer/index.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nvar base64 = __webpack_require__(/*! base64-js */ \"./node_modules/base64-js/index.js\")\nvar ieee754 = __webpack_require__(/*! ieee754 */ \"./node_modules/ieee754/index.js\")\nvar customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n var arr = new Uint8Array(1)\n var proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n var buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n var valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n var b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(\n value[Symbol.toPrimitive]('string'), encodingOrOffset, length\n )\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n var length = byteLength(string, encoding) | 0\n var buf = createBuffer(length)\n\n var actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n var buf = createBuffer(length)\n for (var i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n var copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n var buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n var buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n Buffer.from(buf).copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n var len = string.length\n var mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n var strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (var i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n var len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nvar hexSliceLookupTable = (function () {\n var alphabet = '0123456789abcdef'\n var table = new Array(256)\n for (var i = 0; i < 16; ++i) {\n var i16 = i * 16\n for (var j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n\n//# sourceURL=webpack://dcp/./node_modules/buffer/index.js?"); + +/***/ }), + +/***/ "./node_modules/call-bind/callBound.js": +/*!*********************************************!*\ + !*** ./node_modules/call-bind/callBound.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nvar GetIntrinsic = __webpack_require__(/*! get-intrinsic */ \"./node_modules/get-intrinsic/index.js\");\n\nvar callBind = __webpack_require__(/*! ./ */ \"./node_modules/call-bind/index.js\");\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/call-bind/callBound.js?"); + +/***/ }), + +/***/ "./node_modules/call-bind/index.js": +/*!*****************************************!*\ + !*** ./node_modules/call-bind/index.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nvar bind = __webpack_require__(/*! function-bind */ \"./node_modules/function-bind/index.js\");\nvar GetIntrinsic = __webpack_require__(/*! get-intrinsic */ \"./node_modules/get-intrinsic/index.js\");\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/call-bind/index.js?"); + +/***/ }), + +/***/ "./node_modules/chalk/source/index.js": +/*!********************************************!*\ + !*** ./node_modules/chalk/source/index.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\nconst ansiStyles = __webpack_require__(/*! ansi-styles */ \"./node_modules/ansi-styles/index.js\");\nconst {stdout: stdoutColor, stderr: stderrColor} = __webpack_require__(/*! supports-color */ \"./node_modules/supports-color/browser.js\");\nconst {\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex\n} = __webpack_require__(/*! ./util */ \"./node_modules/chalk/source/util.js\");\n\nconst {isArray} = Array;\n\n// `supportsColor.level` → `ansiStyles.color[name]` mapping\nconst levelMapping = [\n\t'ansi',\n\t'ansi',\n\t'ansi256',\n\t'ansi16m'\n];\n\nconst styles = Object.create(null);\n\nconst applyOptions = (object, options = {}) => {\n\tif (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {\n\t\tthrow new Error('The `level` option should be an integer from 0 to 3');\n\t}\n\n\t// Detect level if not set manually\n\tconst colorLevel = stdoutColor ? stdoutColor.level : 0;\n\tobject.level = options.level === undefined ? colorLevel : options.level;\n};\n\nclass ChalkClass {\n\tconstructor(options) {\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn chalkFactory(options);\n\t}\n}\n\nconst chalkFactory = options => {\n\tconst chalk = {};\n\tapplyOptions(chalk, options);\n\n\tchalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);\n\n\tObject.setPrototypeOf(chalk, Chalk.prototype);\n\tObject.setPrototypeOf(chalk.template, chalk);\n\n\tchalk.template.constructor = () => {\n\t\tthrow new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.');\n\t};\n\n\tchalk.template.Instance = ChalkClass;\n\n\treturn chalk.template;\n};\n\nfunction Chalk(options) {\n\treturn chalkFactory(options);\n}\n\nfor (const [styleName, style] of Object.entries(ansiStyles)) {\n\tstyles[styleName] = {\n\t\tget() {\n\t\t\tconst builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);\n\t\t\tObject.defineProperty(this, styleName, {value: builder});\n\t\t\treturn builder;\n\t\t}\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\tconst builder = createBuilder(this, this._styler, true);\n\t\tObject.defineProperty(this, 'visible', {value: builder});\n\t\treturn builder;\n\t}\n};\n\nconst usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256'];\n\nfor (const model of usedModels) {\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);\n\t\t\t\treturn createBuilder(this, styler, this._isEmpty);\n\t\t\t};\n\t\t}\n\t};\n}\n\nfor (const model of usedModels) {\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);\n\t\t\t\treturn createBuilder(this, styler, this._isEmpty);\n\t\t\t};\n\t\t}\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, {\n\t...styles,\n\tlevel: {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn this._generator.level;\n\t\t},\n\t\tset(level) {\n\t\t\tthis._generator.level = level;\n\t\t}\n\t}\n});\n\nconst createStyler = (open, close, parent) => {\n\tlet openAll;\n\tlet closeAll;\n\tif (parent === undefined) {\n\t\topenAll = open;\n\t\tcloseAll = close;\n\t} else {\n\t\topenAll = parent.openAll + open;\n\t\tcloseAll = close + parent.closeAll;\n\t}\n\n\treturn {\n\t\topen,\n\t\tclose,\n\t\topenAll,\n\t\tcloseAll,\n\t\tparent\n\t};\n};\n\nconst createBuilder = (self, _styler, _isEmpty) => {\n\tconst builder = (...arguments_) => {\n\t\tif (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {\n\t\t\t// Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}`\n\t\t\treturn applyStyle(builder, chalkTag(builder, ...arguments_));\n\t\t}\n\n\t\t// Single argument is hot path, implicit coercion is faster than anything\n\t\t// eslint-disable-next-line no-implicit-coercion\n\t\treturn applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));\n\t};\n\n\t// We alter the prototype because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tObject.setPrototypeOf(builder, proto);\n\n\tbuilder._generator = self;\n\tbuilder._styler = _styler;\n\tbuilder._isEmpty = _isEmpty;\n\n\treturn builder;\n};\n\nconst applyStyle = (self, string) => {\n\tif (self.level <= 0 || !string) {\n\t\treturn self._isEmpty ? '' : string;\n\t}\n\n\tlet styler = self._styler;\n\n\tif (styler === undefined) {\n\t\treturn string;\n\t}\n\n\tconst {openAll, closeAll} = styler;\n\tif (string.indexOf('\\u001B') !== -1) {\n\t\twhile (styler !== undefined) {\n\t\t\t// Replace any instances already present with a re-opening code\n\t\t\t// otherwise only the part of the string until said closing code\n\t\t\t// will be colored, and the rest will simply be 'plain'.\n\t\t\tstring = stringReplaceAll(string, styler.close, styler.open);\n\n\t\t\tstyler = styler.parent;\n\t\t}\n\t}\n\n\t// We can move both next actions out of loop, because remaining actions in loop won't have\n\t// any/visible effect on parts we add here. Close the styling before a linebreak and reopen\n\t// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92\n\tconst lfIndex = string.indexOf('\\n');\n\tif (lfIndex !== -1) {\n\t\tstring = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);\n\t}\n\n\treturn openAll + string + closeAll;\n};\n\nlet template;\nconst chalkTag = (chalk, ...strings) => {\n\tconst [firstString] = strings;\n\n\tif (!isArray(firstString) || !isArray(firstString.raw)) {\n\t\t// If chalk() was called by itself or with a string,\n\t\t// return the string itself as a string.\n\t\treturn strings.join(' ');\n\t}\n\n\tconst arguments_ = strings.slice(1);\n\tconst parts = [firstString.raw[0]];\n\n\tfor (let i = 1; i < firstString.length; i++) {\n\t\tparts.push(\n\t\t\tString(arguments_[i - 1]).replace(/[{}\\\\]/g, '\\\\$&'),\n\t\t\tString(firstString.raw[i])\n\t\t);\n\t}\n\n\tif (template === undefined) {\n\t\ttemplate = __webpack_require__(/*! ./templates */ \"./node_modules/chalk/source/templates.js\");\n\t}\n\n\treturn template(chalk, parts.join(''));\n};\n\nObject.defineProperties(Chalk.prototype, styles);\n\nconst chalk = Chalk(); // eslint-disable-line new-cap\nchalk.supportsColor = stdoutColor;\nchalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap\nchalk.stderr.supportsColor = stderrColor;\n\nmodule.exports = chalk;\n\n\n//# sourceURL=webpack://dcp/./node_modules/chalk/source/index.js?"); + +/***/ }), + +/***/ "./node_modules/chalk/source/templates.js": +/*!************************************************!*\ + !*** ./node_modules/chalk/source/templates.js ***! + \************************************************/ +/***/ ((module) => { + +"use strict"; +eval("\nconst TEMPLATE_REGEX = /(?:\\\\(u(?:[a-f\\d]{4}|\\{[a-f\\d]{1,6}\\})|x[a-f\\d]{2}|.))|(?:\\{(~)?(\\w+(?:\\([^)]*\\))?(?:\\.\\w+(?:\\([^)]*\\))?)*)(?:[ \\t]|(?=\\r?\\n)))|(\\})|((?:.|[\\r\\n\\f])+?)/gi;\nconst STYLE_REGEX = /(?:^|\\.)(\\w+)(?:\\(([^)]*)\\))?/g;\nconst STRING_REGEX = /^(['\"])((?:\\\\.|(?!\\1)[^\\\\])*)\\1$/;\nconst ESCAPE_REGEX = /\\\\(u(?:[a-f\\d]{4}|{[a-f\\d]{1,6}})|x[a-f\\d]{2}|.)|([^\\\\])/gi;\n\nconst ESCAPES = new Map([\n\t['n', '\\n'],\n\t['r', '\\r'],\n\t['t', '\\t'],\n\t['b', '\\b'],\n\t['f', '\\f'],\n\t['v', '\\v'],\n\t['0', '\\0'],\n\t['\\\\', '\\\\'],\n\t['e', '\\u001B'],\n\t['a', '\\u0007']\n]);\n\nfunction unescape(c) {\n\tconst u = c[0] === 'u';\n\tconst bracket = c[1] === '{';\n\n\tif ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) {\n\t\treturn String.fromCharCode(parseInt(c.slice(1), 16));\n\t}\n\n\tif (u && bracket) {\n\t\treturn String.fromCodePoint(parseInt(c.slice(2, -1), 16));\n\t}\n\n\treturn ESCAPES.get(c) || c;\n}\n\nfunction parseArguments(name, arguments_) {\n\tconst results = [];\n\tconst chunks = arguments_.trim().split(/\\s*,\\s*/g);\n\tlet matches;\n\n\tfor (const chunk of chunks) {\n\t\tconst number = Number(chunk);\n\t\tif (!Number.isNaN(number)) {\n\t\t\tresults.push(number);\n\t\t} else if ((matches = chunk.match(STRING_REGEX))) {\n\t\t\tresults.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));\n\t\t} else {\n\t\t\tthrow new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);\n\t\t}\n\t}\n\n\treturn results;\n}\n\nfunction parseStyle(style) {\n\tSTYLE_REGEX.lastIndex = 0;\n\n\tconst results = [];\n\tlet matches;\n\n\twhile ((matches = STYLE_REGEX.exec(style)) !== null) {\n\t\tconst name = matches[1];\n\n\t\tif (matches[2]) {\n\t\t\tconst args = parseArguments(name, matches[2]);\n\t\t\tresults.push([name].concat(args));\n\t\t} else {\n\t\t\tresults.push([name]);\n\t\t}\n\t}\n\n\treturn results;\n}\n\nfunction buildStyle(chalk, styles) {\n\tconst enabled = {};\n\n\tfor (const layer of styles) {\n\t\tfor (const style of layer.styles) {\n\t\t\tenabled[style[0]] = layer.inverse ? null : style.slice(1);\n\t\t}\n\t}\n\n\tlet current = chalk;\n\tfor (const [styleName, styles] of Object.entries(enabled)) {\n\t\tif (!Array.isArray(styles)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!(styleName in current)) {\n\t\t\tthrow new Error(`Unknown Chalk style: ${styleName}`);\n\t\t}\n\n\t\tcurrent = styles.length > 0 ? current[styleName](...styles) : current[styleName];\n\t}\n\n\treturn current;\n}\n\nmodule.exports = (chalk, temporary) => {\n\tconst styles = [];\n\tconst chunks = [];\n\tlet chunk = [];\n\n\t// eslint-disable-next-line max-params\n\ttemporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {\n\t\tif (escapeCharacter) {\n\t\t\tchunk.push(unescape(escapeCharacter));\n\t\t} else if (style) {\n\t\t\tconst string = chunk.join('');\n\t\t\tchunk = [];\n\t\t\tchunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));\n\t\t\tstyles.push({inverse, styles: parseStyle(style)});\n\t\t} else if (close) {\n\t\t\tif (styles.length === 0) {\n\t\t\t\tthrow new Error('Found extraneous } in Chalk template literal');\n\t\t\t}\n\n\t\t\tchunks.push(buildStyle(chalk, styles)(chunk.join('')));\n\t\t\tchunk = [];\n\t\t\tstyles.pop();\n\t\t} else {\n\t\t\tchunk.push(character);\n\t\t}\n\t});\n\n\tchunks.push(chunk.join(''));\n\n\tif (styles.length > 0) {\n\t\tconst errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\\`}\\`)`;\n\t\tthrow new Error(errMessage);\n\t}\n\n\treturn chunks.join('');\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/chalk/source/templates.js?"); + +/***/ }), + +/***/ "./node_modules/chalk/source/util.js": +/*!*******************************************!*\ + !*** ./node_modules/chalk/source/util.js ***! + \*******************************************/ +/***/ ((module) => { + +"use strict"; +eval("\n\nconst stringReplaceAll = (string, substring, replacer) => {\n\tlet index = string.indexOf(substring);\n\tif (index === -1) {\n\t\treturn string;\n\t}\n\n\tconst substringLength = substring.length;\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\treturnValue += string.substr(endIndex, index - endIndex) + substring + replacer;\n\t\tendIndex = index + substringLength;\n\t\tindex = string.indexOf(substring, endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.substr(endIndex);\n\treturn returnValue;\n};\n\nconst stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\tconst gotCR = string[index - 1] === '\\r';\n\t\treturnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\\r\\n' : '\\n') + postfix;\n\t\tendIndex = index + 1;\n\t\tindex = string.indexOf('\\n', endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.substr(endIndex);\n\treturn returnValue;\n};\n\nmodule.exports = {\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/chalk/source/util.js?"); + +/***/ }), + +/***/ "./node_modules/cipher-base/index.js": +/*!*******************************************!*\ + !*** ./node_modules/cipher-base/index.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\nvar Transform = (__webpack_require__(/*! stream */ \"./node_modules/stream-browserify/index.js\").Transform)\nvar StringDecoder = (__webpack_require__(/*! string_decoder */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder)\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\n\nfunction CipherBase (hashMode) {\n Transform.call(this)\n this.hashMode = typeof hashMode === 'string'\n if (this.hashMode) {\n this[hashMode] = this._finalOrDigest\n } else {\n this.final = this._finalOrDigest\n }\n if (this._final) {\n this.__final = this._final\n this._final = null\n }\n this._decoder = null\n this._encoding = null\n}\ninherits(CipherBase, Transform)\n\nCipherBase.prototype.update = function (data, inputEnc, outputEnc) {\n if (typeof data === 'string') {\n data = Buffer.from(data, inputEnc)\n }\n\n var outData = this._update(data)\n if (this.hashMode) return this\n\n if (outputEnc) {\n outData = this._toString(outData, outputEnc)\n }\n\n return outData\n}\n\nCipherBase.prototype.setAutoPadding = function () {}\nCipherBase.prototype.getAuthTag = function () {\n throw new Error('trying to get auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAuthTag = function () {\n throw new Error('trying to set auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAAD = function () {\n throw new Error('trying to set aad in unsupported state')\n}\n\nCipherBase.prototype._transform = function (data, _, next) {\n var err\n try {\n if (this.hashMode) {\n this._update(data)\n } else {\n this.push(this._update(data))\n }\n } catch (e) {\n err = e\n } finally {\n next(err)\n }\n}\nCipherBase.prototype._flush = function (done) {\n var err\n try {\n this.push(this.__final())\n } catch (e) {\n err = e\n }\n\n done(err)\n}\nCipherBase.prototype._finalOrDigest = function (outputEnc) {\n var outData = this.__final() || Buffer.alloc(0)\n if (outputEnc) {\n outData = this._toString(outData, outputEnc, true)\n }\n return outData\n}\n\nCipherBase.prototype._toString = function (value, enc, fin) {\n if (!this._decoder) {\n this._decoder = new StringDecoder(enc)\n this._encoding = enc\n }\n\n if (this._encoding !== enc) throw new Error('can\\'t switch encodings')\n\n var out = this._decoder.write(value)\n if (fin) {\n out += this._decoder.end()\n }\n\n return out\n}\n\nmodule.exports = CipherBase\n\n\n//# sourceURL=webpack://dcp/./node_modules/cipher-base/index.js?"); + +/***/ }), + +/***/ "./node_modules/clone/clone.js": +/*!*************************************!*\ + !*** ./node_modules/clone/clone.js ***! + \*************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("/* provided dependency */ var Buffer = __webpack_require__(/*! ./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js */ \"./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js\")[\"Buffer\"];\nvar clone = (function() {\n'use strict';\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n*/\nfunction clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n};\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n};\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n};\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n};\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n};\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif ( true && module.exports) {\n module.exports = clone;\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/clone/clone.js?"); + +/***/ }), + +/***/ "./node_modules/color-convert/conversions.js": +/*!***************************************************!*\ + !*** ./node_modules/color-convert/conversions.js ***! + \***************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("/* MIT license */\n/* eslint-disable no-mixed-operators */\nconst cssKeywords = __webpack_require__(/*! color-name */ \"./node_modules/color-name/index.js\");\n\n// NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\nconst reverseKeywords = {};\nfor (const key of Object.keys(cssKeywords)) {\n\treverseKeywords[cssKeywords[key]] = key;\n}\n\nconst convert = {\n\trgb: {channels: 3, labels: 'rgb'},\n\thsl: {channels: 3, labels: 'hsl'},\n\thsv: {channels: 3, labels: 'hsv'},\n\thwb: {channels: 3, labels: 'hwb'},\n\tcmyk: {channels: 4, labels: 'cmyk'},\n\txyz: {channels: 3, labels: 'xyz'},\n\tlab: {channels: 3, labels: 'lab'},\n\tlch: {channels: 3, labels: 'lch'},\n\thex: {channels: 1, labels: ['hex']},\n\tkeyword: {channels: 1, labels: ['keyword']},\n\tansi16: {channels: 1, labels: ['ansi16']},\n\tansi256: {channels: 1, labels: ['ansi256']},\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\n\tgray: {channels: 1, labels: ['gray']}\n};\n\nmodule.exports = convert;\n\n// Hide .channels and .labels properties\nfor (const model of Object.keys(convert)) {\n\tif (!('channels' in convert[model])) {\n\t\tthrow new Error('missing channels property: ' + model);\n\t}\n\n\tif (!('labels' in convert[model])) {\n\t\tthrow new Error('missing channel labels property: ' + model);\n\t}\n\n\tif (convert[model].labels.length !== convert[model].channels) {\n\t\tthrow new Error('channel and label counts mismatch: ' + model);\n\t}\n\n\tconst {channels, labels} = convert[model];\n\tdelete convert[model].channels;\n\tdelete convert[model].labels;\n\tObject.defineProperty(convert[model], 'channels', {value: channels});\n\tObject.defineProperty(convert[model], 'labels', {value: labels});\n}\n\nconvert.rgb.hsl = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst min = Math.min(r, g, b);\n\tconst max = Math.max(r, g, b);\n\tconst delta = max - min;\n\tlet h;\n\tlet s;\n\n\tif (max === min) {\n\t\th = 0;\n\t} else if (r === max) {\n\t\th = (g - b) / delta;\n\t} else if (g === max) {\n\t\th = 2 + (b - r) / delta;\n\t} else if (b === max) {\n\t\th = 4 + (r - g) / delta;\n\t}\n\n\th = Math.min(h * 60, 360);\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst l = (min + max) / 2;\n\n\tif (max === min) {\n\t\ts = 0;\n\t} else if (l <= 0.5) {\n\t\ts = delta / (max + min);\n\t} else {\n\t\ts = delta / (2 - max - min);\n\t}\n\n\treturn [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n\tlet rdif;\n\tlet gdif;\n\tlet bdif;\n\tlet h;\n\tlet s;\n\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst v = Math.max(r, g, b);\n\tconst diff = v - Math.min(r, g, b);\n\tconst diffc = function (c) {\n\t\treturn (v - c) / 6 / diff + 1 / 2;\n\t};\n\n\tif (diff === 0) {\n\t\th = 0;\n\t\ts = 0;\n\t} else {\n\t\ts = diff / v;\n\t\trdif = diffc(r);\n\t\tgdif = diffc(g);\n\t\tbdif = diffc(b);\n\n\t\tif (r === v) {\n\t\t\th = bdif - gdif;\n\t\t} else if (g === v) {\n\t\t\th = (1 / 3) + rdif - bdif;\n\t\t} else if (b === v) {\n\t\t\th = (2 / 3) + gdif - rdif;\n\t\t}\n\n\t\tif (h < 0) {\n\t\t\th += 1;\n\t\t} else if (h > 1) {\n\t\t\th -= 1;\n\t\t}\n\t}\n\n\treturn [\n\t\th * 360,\n\t\ts * 100,\n\t\tv * 100\n\t];\n};\n\nconvert.rgb.hwb = function (rgb) {\n\tconst r = rgb[0];\n\tconst g = rgb[1];\n\tlet b = rgb[2];\n\tconst h = convert.rgb.hsl(rgb)[0];\n\tconst w = 1 / 255 * Math.min(r, Math.min(g, b));\n\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n\n\treturn [h, w * 100, b * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\n\tconst k = Math.min(1 - r, 1 - g, 1 - b);\n\tconst c = (1 - r - k) / (1 - k) || 0;\n\tconst m = (1 - g - k) / (1 - k) || 0;\n\tconst y = (1 - b - k) / (1 - k) || 0;\n\n\treturn [c * 100, m * 100, y * 100, k * 100];\n};\n\nfunction comparativeDistance(x, y) {\n\t/*\n\t\tSee https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n\t*/\n\treturn (\n\t\t((x[0] - y[0]) ** 2) +\n\t\t((x[1] - y[1]) ** 2) +\n\t\t((x[2] - y[2]) ** 2)\n\t);\n}\n\nconvert.rgb.keyword = function (rgb) {\n\tconst reversed = reverseKeywords[rgb];\n\tif (reversed) {\n\t\treturn reversed;\n\t}\n\n\tlet currentClosestDistance = Infinity;\n\tlet currentClosestKeyword;\n\n\tfor (const keyword of Object.keys(cssKeywords)) {\n\t\tconst value = cssKeywords[keyword];\n\n\t\t// Compute comparative distance\n\t\tconst distance = comparativeDistance(rgb, value);\n\n\t\t// Check if its less, if so set as closest\n\t\tif (distance < currentClosestDistance) {\n\t\t\tcurrentClosestDistance = distance;\n\t\t\tcurrentClosestKeyword = keyword;\n\t\t}\n\t}\n\n\treturn currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n\treturn cssKeywords[keyword];\n};\n\nconvert.rgb.xyz = function (rgb) {\n\tlet r = rgb[0] / 255;\n\tlet g = rgb[1] / 255;\n\tlet b = rgb[2] / 255;\n\n\t// Assume sRGB\n\tr = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);\n\n\tconst x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n\tconst y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n\tconst z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n\tconst xyz = convert.rgb.xyz(rgb);\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n\tconst h = hsl[0] / 360;\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\tlet t2;\n\tlet t3;\n\tlet val;\n\n\tif (s === 0) {\n\t\tval = l * 255;\n\t\treturn [val, val, val];\n\t}\n\n\tif (l < 0.5) {\n\t\tt2 = l * (1 + s);\n\t} else {\n\t\tt2 = l + s - l * s;\n\t}\n\n\tconst t1 = 2 * l - t2;\n\n\tconst rgb = [0, 0, 0];\n\tfor (let i = 0; i < 3; i++) {\n\t\tt3 = h + 1 / 3 * -(i - 1);\n\t\tif (t3 < 0) {\n\t\t\tt3++;\n\t\t}\n\n\t\tif (t3 > 1) {\n\t\t\tt3--;\n\t\t}\n\n\t\tif (6 * t3 < 1) {\n\t\t\tval = t1 + (t2 - t1) * 6 * t3;\n\t\t} else if (2 * t3 < 1) {\n\t\t\tval = t2;\n\t\t} else if (3 * t3 < 2) {\n\t\t\tval = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n\t\t} else {\n\t\t\tval = t1;\n\t\t}\n\n\t\trgb[i] = val * 255;\n\t}\n\n\treturn rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n\tconst h = hsl[0];\n\tlet s = hsl[1] / 100;\n\tlet l = hsl[2] / 100;\n\tlet smin = s;\n\tconst lmin = Math.max(l, 0.01);\n\n\tl *= 2;\n\ts *= (l <= 1) ? l : 2 - l;\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\n\tconst v = (l + s) / 2;\n\tconst sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\n\n\treturn [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n\tconst h = hsv[0] / 60;\n\tconst s = hsv[1] / 100;\n\tlet v = hsv[2] / 100;\n\tconst hi = Math.floor(h) % 6;\n\n\tconst f = h - Math.floor(h);\n\tconst p = 255 * v * (1 - s);\n\tconst q = 255 * v * (1 - (s * f));\n\tconst t = 255 * v * (1 - (s * (1 - f)));\n\tv *= 255;\n\n\tswitch (hi) {\n\t\tcase 0:\n\t\t\treturn [v, t, p];\n\t\tcase 1:\n\t\t\treturn [q, v, p];\n\t\tcase 2:\n\t\t\treturn [p, v, t];\n\t\tcase 3:\n\t\t\treturn [p, q, v];\n\t\tcase 4:\n\t\t\treturn [t, p, v];\n\t\tcase 5:\n\t\t\treturn [v, p, q];\n\t}\n};\n\nconvert.hsv.hsl = function (hsv) {\n\tconst h = hsv[0];\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\tconst vmin = Math.max(v, 0.01);\n\tlet sl;\n\tlet l;\n\n\tl = (2 - s) * v;\n\tconst lmin = (2 - s) * vmin;\n\tsl = s * vmin;\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\n\tsl = sl || 0;\n\tl /= 2;\n\n\treturn [h, sl * 100, l * 100];\n};\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nconvert.hwb.rgb = function (hwb) {\n\tconst h = hwb[0] / 360;\n\tlet wh = hwb[1] / 100;\n\tlet bl = hwb[2] / 100;\n\tconst ratio = wh + bl;\n\tlet f;\n\n\t// Wh + bl cant be > 1\n\tif (ratio > 1) {\n\t\twh /= ratio;\n\t\tbl /= ratio;\n\t}\n\n\tconst i = Math.floor(6 * h);\n\tconst v = 1 - bl;\n\tf = 6 * h - i;\n\n\tif ((i & 0x01) !== 0) {\n\t\tf = 1 - f;\n\t}\n\n\tconst n = wh + f * (v - wh); // Linear interpolation\n\n\tlet r;\n\tlet g;\n\tlet b;\n\t/* eslint-disable max-statements-per-line,no-multi-spaces */\n\tswitch (i) {\n\t\tdefault:\n\t\tcase 6:\n\t\tcase 0: r = v; g = n; b = wh; break;\n\t\tcase 1: r = n; g = v; b = wh; break;\n\t\tcase 2: r = wh; g = v; b = n; break;\n\t\tcase 3: r = wh; g = n; b = v; break;\n\t\tcase 4: r = n; g = wh; b = v; break;\n\t\tcase 5: r = v; g = wh; b = n; break;\n\t}\n\t/* eslint-enable max-statements-per-line,no-multi-spaces */\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n\tconst c = cmyk[0] / 100;\n\tconst m = cmyk[1] / 100;\n\tconst y = cmyk[2] / 100;\n\tconst k = cmyk[3] / 100;\n\n\tconst r = 1 - Math.min(1, c * (1 - k) + k);\n\tconst g = 1 - Math.min(1, m * (1 - k) + k);\n\tconst b = 1 - Math.min(1, y * (1 - k) + k);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n\tconst x = xyz[0] / 100;\n\tconst y = xyz[1] / 100;\n\tconst z = xyz[2] / 100;\n\tlet r;\n\tlet g;\n\tlet b;\n\n\tr = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n\tg = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n\tb = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n\t// Assume sRGB\n\tr = r > 0.0031308\n\t\t? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)\n\t\t: r * 12.92;\n\n\tg = g > 0.0031308\n\t\t? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)\n\t\t: g * 12.92;\n\n\tb = b > 0.0031308\n\t\t? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)\n\t\t: b * 12.92;\n\n\tr = Math.min(Math.max(0, r), 1);\n\tg = Math.min(Math.max(0, g), 1);\n\tb = Math.min(Math.max(0, b), 1);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.lab.xyz = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet x;\n\tlet y;\n\tlet z;\n\n\ty = (l + 16) / 116;\n\tx = a / 500 + y;\n\tz = y - b / 200;\n\n\tconst y2 = y ** 3;\n\tconst x2 = x ** 3;\n\tconst z2 = z ** 3;\n\ty = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;\n\tx = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;\n\tz = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;\n\n\tx *= 95.047;\n\ty *= 100;\n\tz *= 108.883;\n\n\treturn [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet h;\n\n\tconst hr = Math.atan2(b, a);\n\th = hr * 360 / 2 / Math.PI;\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst c = Math.sqrt(a * a + b * b);\n\n\treturn [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n\tconst l = lch[0];\n\tconst c = lch[1];\n\tconst h = lch[2];\n\n\tconst hr = h / 360 * 2 * Math.PI;\n\tconst a = c * Math.cos(hr);\n\tconst b = c * Math.sin(hr);\n\n\treturn [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args, saturation = null) {\n\tconst [r, g, b] = args;\n\tlet value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization\n\n\tvalue = Math.round(value / 50);\n\n\tif (value === 0) {\n\t\treturn 30;\n\t}\n\n\tlet ansi = 30\n\t\t+ ((Math.round(b / 255) << 2)\n\t\t| (Math.round(g / 255) << 1)\n\t\t| Math.round(r / 255));\n\n\tif (value === 2) {\n\t\tansi += 60;\n\t}\n\n\treturn ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n\t// Optimization here; we already know the value and don't need to get\n\t// it converted for us.\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n\tconst r = args[0];\n\tconst g = args[1];\n\tconst b = args[2];\n\n\t// We use the extended greyscale palette here, with the exception of\n\t// black and white. normal palette only has 4 greyscale shades.\n\tif (r === g && g === b) {\n\t\tif (r < 8) {\n\t\t\treturn 16;\n\t\t}\n\n\t\tif (r > 248) {\n\t\t\treturn 231;\n\t\t}\n\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\n\t}\n\n\tconst ansi = 16\n\t\t+ (36 * Math.round(r / 255 * 5))\n\t\t+ (6 * Math.round(g / 255 * 5))\n\t\t+ Math.round(b / 255 * 5);\n\n\treturn ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n\tlet color = args % 10;\n\n\t// Handle greyscale\n\tif (color === 0 || color === 7) {\n\t\tif (args > 50) {\n\t\t\tcolor += 3.5;\n\t\t}\n\n\t\tcolor = color / 10.5 * 255;\n\n\t\treturn [color, color, color];\n\t}\n\n\tconst mult = (~~(args > 50) + 1) * 0.5;\n\tconst r = ((color & 1) * mult) * 255;\n\tconst g = (((color >> 1) & 1) * mult) * 255;\n\tconst b = (((color >> 2) & 1) * mult) * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n\t// Handle greyscale\n\tif (args >= 232) {\n\t\tconst c = (args - 232) * 10 + 8;\n\t\treturn [c, c, c];\n\t}\n\n\targs -= 16;\n\n\tlet rem;\n\tconst r = Math.floor(args / 36) / 5 * 255;\n\tconst g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n\tconst b = (rem % 6) / 5 * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n\tconst integer = ((Math.round(args[0]) & 0xFF) << 16)\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\n\t\t+ (Math.round(args[2]) & 0xFF);\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n\tconst match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n\tif (!match) {\n\t\treturn [0, 0, 0];\n\t}\n\n\tlet colorString = match[0];\n\n\tif (match[0].length === 3) {\n\t\tcolorString = colorString.split('').map(char => {\n\t\t\treturn char + char;\n\t\t}).join('');\n\t}\n\n\tconst integer = parseInt(colorString, 16);\n\tconst r = (integer >> 16) & 0xFF;\n\tconst g = (integer >> 8) & 0xFF;\n\tconst b = integer & 0xFF;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst max = Math.max(Math.max(r, g), b);\n\tconst min = Math.min(Math.min(r, g), b);\n\tconst chroma = (max - min);\n\tlet grayscale;\n\tlet hue;\n\n\tif (chroma < 1) {\n\t\tgrayscale = min / (1 - chroma);\n\t} else {\n\t\tgrayscale = 0;\n\t}\n\n\tif (chroma <= 0) {\n\t\thue = 0;\n\t} else\n\tif (max === r) {\n\t\thue = ((g - b) / chroma) % 6;\n\t} else\n\tif (max === g) {\n\t\thue = 2 + (b - r) / chroma;\n\t} else {\n\t\thue = 4 + (r - g) / chroma;\n\t}\n\n\thue /= 6;\n\thue %= 1;\n\n\treturn [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\n\tconst c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));\n\n\tlet f = 0;\n\tif (c < 1.0) {\n\t\tf = (l - 0.5 * c) / (1.0 - c);\n\t}\n\n\treturn [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\n\tconst c = s * v;\n\tlet f = 0;\n\n\tif (c < 1.0) {\n\t\tf = (v - c) / (1 - c);\n\t}\n\n\treturn [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n\tconst h = hcg[0] / 360;\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tif (c === 0.0) {\n\t\treturn [g * 255, g * 255, g * 255];\n\t}\n\n\tconst pure = [0, 0, 0];\n\tconst hi = (h % 1) * 6;\n\tconst v = hi % 1;\n\tconst w = 1 - v;\n\tlet mg = 0;\n\n\t/* eslint-disable max-statements-per-line */\n\tswitch (Math.floor(hi)) {\n\t\tcase 0:\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\n\t\tcase 1:\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\n\t\tcase 2:\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\n\t\tcase 3:\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\n\t\tcase 4:\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\n\t\tdefault:\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\n\t}\n\t/* eslint-enable max-statements-per-line */\n\n\tmg = (1.0 - c) * g;\n\n\treturn [\n\t\t(c * pure[0] + mg) * 255,\n\t\t(c * pure[1] + mg) * 255,\n\t\t(c * pure[2] + mg) * 255\n\t];\n};\n\nconvert.hcg.hsv = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst v = c + g * (1.0 - c);\n\tlet f = 0;\n\n\tif (v > 0.0) {\n\t\tf = c / v;\n\t}\n\n\treturn [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst l = g * (1.0 - c) + 0.5 * c;\n\tlet s = 0;\n\n\tif (l > 0.0 && l < 0.5) {\n\t\ts = c / (2 * l);\n\t} else\n\tif (l >= 0.5 && l < 1.0) {\n\t\ts = c / (2 * (1 - l));\n\t}\n\n\treturn [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\tconst v = c + g * (1.0 - c);\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n\tconst w = hwb[1] / 100;\n\tconst b = hwb[2] / 100;\n\tconst v = 1 - b;\n\tconst c = v - w;\n\tlet g = 0;\n\n\tif (c < 1) {\n\t\tg = (v - c) / (1 - c);\n\t}\n\n\treturn [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n\treturn [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n\treturn [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];\n};\n\nconvert.gray.rgb = function (args) {\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = function (args) {\n\treturn [0, 0, args[0]];\n};\n\nconvert.gray.hsv = convert.gray.hsl;\n\nconvert.gray.hwb = function (gray) {\n\treturn [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n\treturn [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n\treturn [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n\tconst val = Math.round(gray[0] / 100 * 255) & 0xFF;\n\tconst integer = (val << 16) + (val << 8) + val;\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n\tconst val = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\treturn [val / 255 * 100];\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/color-convert/conversions.js?"); + +/***/ }), + +/***/ "./node_modules/color-convert/index.js": +/*!*********************************************!*\ + !*** ./node_modules/color-convert/index.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("const conversions = __webpack_require__(/*! ./conversions */ \"./node_modules/color-convert/conversions.js\");\nconst route = __webpack_require__(/*! ./route */ \"./node_modules/color-convert/route.js\");\n\nconst convert = {};\n\nconst models = Object.keys(conversions);\n\nfunction wrapRaw(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\treturn fn(args);\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfunction wrapRounded(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\tconst result = fn(args);\n\n\t\t// We're assuming the result is an array here.\n\t\t// see notice in conversions.js; don't use box types\n\t\t// in conversion functions.\n\t\tif (typeof result === 'object') {\n\t\t\tfor (let len = result.length, i = 0; i < len; i++) {\n\t\t\t\tresult[i] = Math.round(result[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nmodels.forEach(fromModel => {\n\tconvert[fromModel] = {};\n\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\n\n\tconst routes = route(fromModel);\n\tconst routeModels = Object.keys(routes);\n\n\trouteModels.forEach(toModel => {\n\t\tconst fn = routes[toModel];\n\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\n\t});\n});\n\nmodule.exports = convert;\n\n\n//# sourceURL=webpack://dcp/./node_modules/color-convert/index.js?"); + +/***/ }), + +/***/ "./node_modules/color-convert/route.js": +/*!*********************************************!*\ + !*** ./node_modules/color-convert/route.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("const conversions = __webpack_require__(/*! ./conversions */ \"./node_modules/color-convert/conversions.js\");\n\n/*\n\tThis function routes a model to all other models.\n\n\tall functions that are routed have a property `.conversion` attached\n\tto the returned synthetic function. This property is an array\n\tof strings, each with the steps in between the 'from' and 'to'\n\tcolor models (inclusive).\n\n\tconversions that are not possible simply are not included.\n*/\n\nfunction buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}\n\n// https://en.wikipedia.org/wiki/Breadth-first_search\nfunction deriveBFS(fromModel) {\n\tconst graph = buildGraph();\n\tconst queue = [fromModel]; // Unshift -> queue -> pop\n\n\tgraph[fromModel].distance = 0;\n\n\twhile (queue.length) {\n\t\tconst current = queue.pop();\n\t\tconst adjacents = Object.keys(conversions[current]);\n\n\t\tfor (let len = adjacents.length, i = 0; i < len; i++) {\n\t\t\tconst adjacent = adjacents[i];\n\t\t\tconst node = graph[adjacent];\n\n\t\t\tif (node.distance === -1) {\n\t\t\t\tnode.distance = graph[current].distance + 1;\n\t\t\t\tnode.parent = current;\n\t\t\t\tqueue.unshift(adjacent);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn graph;\n}\n\nfunction link(from, to) {\n\treturn function (args) {\n\t\treturn to(from(args));\n\t};\n}\n\nfunction wrapConversion(toModel, graph) {\n\tconst path = [graph[toModel].parent, toModel];\n\tlet fn = conversions[graph[toModel].parent][toModel];\n\n\tlet cur = graph[toModel].parent;\n\twhile (graph[cur].parent) {\n\t\tpath.unshift(graph[cur].parent);\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\n\t\tcur = graph[cur].parent;\n\t}\n\n\tfn.conversion = path;\n\treturn fn;\n}\n\nmodule.exports = function (fromModel) {\n\tconst graph = deriveBFS(fromModel);\n\tconst conversion = {};\n\n\tconst models = Object.keys(graph);\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tconst toModel = models[i];\n\t\tconst node = graph[toModel];\n\n\t\tif (node.parent === null) {\n\t\t\t// No possible conversion, or this node is the source model.\n\t\t\tcontinue;\n\t\t}\n\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\n\t}\n\n\treturn conversion;\n};\n\n\n\n//# sourceURL=webpack://dcp/./node_modules/color-convert/route.js?"); + +/***/ }), + +/***/ "./node_modules/color-name/index.js": +/*!******************************************!*\ + !*** ./node_modules/color-name/index.js ***! + \******************************************/ +/***/ ((module) => { + +"use strict"; +eval("\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n\n\n//# sourceURL=webpack://dcp/./node_modules/color-name/index.js?"); + +/***/ }), + +/***/ "./node_modules/create-ecdh/browser.js": +/*!*********************************************!*\ + !*** ./node_modules/create-ecdh/browser.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("/* provided dependency */ var Buffer = __webpack_require__(/*! ./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js */ \"./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js\")[\"Buffer\"];\nvar elliptic = __webpack_require__(/*! elliptic */ \"./node_modules/elliptic/lib/elliptic.js\")\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\")\n\nmodule.exports = function createECDH (curve) {\n return new ECDH(curve)\n}\n\nvar aliases = {\n secp256k1: {\n name: 'secp256k1',\n byteLength: 32\n },\n secp224r1: {\n name: 'p224',\n byteLength: 28\n },\n prime256v1: {\n name: 'p256',\n byteLength: 32\n },\n prime192v1: {\n name: 'p192',\n byteLength: 24\n },\n ed25519: {\n name: 'ed25519',\n byteLength: 32\n },\n secp384r1: {\n name: 'p384',\n byteLength: 48\n },\n secp521r1: {\n name: 'p521',\n byteLength: 66\n }\n}\n\naliases.p224 = aliases.secp224r1\naliases.p256 = aliases.secp256r1 = aliases.prime256v1\naliases.p192 = aliases.secp192r1 = aliases.prime192v1\naliases.p384 = aliases.secp384r1\naliases.p521 = aliases.secp521r1\n\nfunction ECDH (curve) {\n this.curveType = aliases[curve]\n if (!this.curveType) {\n this.curveType = {\n name: curve\n }\n }\n this.curve = new elliptic.ec(this.curveType.name) // eslint-disable-line new-cap\n this.keys = void 0\n}\n\nECDH.prototype.generateKeys = function (enc, format) {\n this.keys = this.curve.genKeyPair()\n return this.getPublicKey(enc, format)\n}\n\nECDH.prototype.computeSecret = function (other, inenc, enc) {\n inenc = inenc || 'utf8'\n if (!Buffer.isBuffer(other)) {\n other = new Buffer(other, inenc)\n }\n var otherPub = this.curve.keyFromPublic(other).getPublic()\n var out = otherPub.mul(this.keys.getPrivate()).getX()\n return formatReturnValue(out, enc, this.curveType.byteLength)\n}\n\nECDH.prototype.getPublicKey = function (enc, format) {\n var key = this.keys.getPublic(format === 'compressed', true)\n if (format === 'hybrid') {\n if (key[key.length - 1] % 2) {\n key[0] = 7\n } else {\n key[0] = 6\n }\n }\n return formatReturnValue(key, enc)\n}\n\nECDH.prototype.getPrivateKey = function (enc) {\n return formatReturnValue(this.keys.getPrivate(), enc)\n}\n\nECDH.prototype.setPublicKey = function (pub, enc) {\n enc = enc || 'utf8'\n if (!Buffer.isBuffer(pub)) {\n pub = new Buffer(pub, enc)\n }\n this.keys._importPublic(pub)\n return this\n}\n\nECDH.prototype.setPrivateKey = function (priv, enc) {\n enc = enc || 'utf8'\n if (!Buffer.isBuffer(priv)) {\n priv = new Buffer(priv, enc)\n }\n\n var _priv = new BN(priv)\n _priv = _priv.toString(16)\n this.keys = this.curve.genKeyPair()\n this.keys._importPrivate(_priv)\n return this\n}\n\nfunction formatReturnValue (bn, enc, len) {\n if (!Array.isArray(bn)) {\n bn = bn.toArray()\n }\n var buf = new Buffer(bn)\n if (len && buf.length < len) {\n var zeros = new Buffer(len - buf.length)\n zeros.fill(0)\n buf = Buffer.concat([zeros, buf])\n }\n if (!enc) {\n return buf\n } else {\n return buf.toString(enc)\n }\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/create-ecdh/browser.js?"); + +/***/ }), + +/***/ "./node_modules/create-hash/browser.js": +/*!*********************************************!*\ + !*** ./node_modules/create-hash/browser.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar MD5 = __webpack_require__(/*! md5.js */ \"./node_modules/md5.js/index.js\")\nvar RIPEMD160 = __webpack_require__(/*! ripemd160 */ \"./node_modules/ripemd160/index.js\")\nvar sha = __webpack_require__(/*! sha.js */ \"./node_modules/sha.js/index.js\")\nvar Base = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\")\n\nfunction Hash (hash) {\n Base.call(this, 'digest')\n\n this._hash = hash\n}\n\ninherits(Hash, Base)\n\nHash.prototype._update = function (data) {\n this._hash.update(data)\n}\n\nHash.prototype._final = function () {\n return this._hash.digest()\n}\n\nmodule.exports = function createHash (alg) {\n alg = alg.toLowerCase()\n if (alg === 'md5') return new MD5()\n if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160()\n\n return new Hash(sha(alg))\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/create-hash/browser.js?"); + +/***/ }), + +/***/ "./node_modules/create-hash/md5.js": +/*!*****************************************!*\ + !*** ./node_modules/create-hash/md5.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var MD5 = __webpack_require__(/*! md5.js */ \"./node_modules/md5.js/index.js\")\n\nmodule.exports = function (buffer) {\n return new MD5().update(buffer).digest()\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/create-hash/md5.js?"); + +/***/ }), + +/***/ "./node_modules/create-hmac/browser.js": +/*!*********************************************!*\ + !*** ./node_modules/create-hmac/browser.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar Legacy = __webpack_require__(/*! ./legacy */ \"./node_modules/create-hmac/legacy.js\")\nvar Base = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\")\nvar Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\nvar md5 = __webpack_require__(/*! create-hash/md5 */ \"./node_modules/create-hash/md5.js\")\nvar RIPEMD160 = __webpack_require__(/*! ripemd160 */ \"./node_modules/ripemd160/index.js\")\n\nvar sha = __webpack_require__(/*! sha.js */ \"./node_modules/sha.js/index.js\")\n\nvar ZEROS = Buffer.alloc(128)\n\nfunction Hmac (alg, key) {\n Base.call(this, 'digest')\n if (typeof key === 'string') {\n key = Buffer.from(key)\n }\n\n var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64\n\n this._alg = alg\n this._key = key\n if (key.length > blocksize) {\n var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)\n key = hash.update(key).digest()\n } else if (key.length < blocksize) {\n key = Buffer.concat([key, ZEROS], blocksize)\n }\n\n var ipad = this._ipad = Buffer.allocUnsafe(blocksize)\n var opad = this._opad = Buffer.allocUnsafe(blocksize)\n\n for (var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)\n this._hash.update(ipad)\n}\n\ninherits(Hmac, Base)\n\nHmac.prototype._update = function (data) {\n this._hash.update(data)\n}\n\nHmac.prototype._final = function () {\n var h = this._hash.digest()\n var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg)\n return hash.update(this._opad).update(h).digest()\n}\n\nmodule.exports = function createHmac (alg, key) {\n alg = alg.toLowerCase()\n if (alg === 'rmd160' || alg === 'ripemd160') {\n return new Hmac('rmd160', key)\n }\n if (alg === 'md5') {\n return new Legacy(md5, key)\n }\n return new Hmac(alg, key)\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/create-hmac/browser.js?"); + +/***/ }), + +/***/ "./node_modules/create-hmac/legacy.js": +/*!********************************************!*\ + !*** ./node_modules/create-hmac/legacy.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\")\nvar Buffer = (__webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer)\n\nvar Base = __webpack_require__(/*! cipher-base */ \"./node_modules/cipher-base/index.js\")\n\nvar ZEROS = Buffer.alloc(128)\nvar blocksize = 64\n\nfunction Hmac (alg, key) {\n Base.call(this, 'digest')\n if (typeof key === 'string') {\n key = Buffer.from(key)\n }\n\n this._alg = alg\n this._key = key\n\n if (key.length > blocksize) {\n key = alg(key)\n } else if (key.length < blocksize) {\n key = Buffer.concat([key, ZEROS], blocksize)\n }\n\n var ipad = this._ipad = Buffer.allocUnsafe(blocksize)\n var opad = this._opad = Buffer.allocUnsafe(blocksize)\n\n for (var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n\n this._hash = [ipad]\n}\n\ninherits(Hmac, Base)\n\nHmac.prototype._update = function (data) {\n this._hash.push(data)\n}\n\nHmac.prototype._final = function () {\n var h = this._alg(Buffer.concat(this._hash))\n return this._alg(Buffer.concat([this._opad, h]))\n}\nmodule.exports = Hmac\n\n\n//# sourceURL=webpack://dcp/./node_modules/create-hmac/legacy.js?"); + +/***/ }), + +/***/ "./node_modules/crypto-browserify/index.js": +/*!*************************************************!*\ + !*** ./node_modules/crypto-browserify/index.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("\n\nexports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\")\nexports.createHash = exports.Hash = __webpack_require__(/*! create-hash */ \"./node_modules/create-hash/browser.js\")\nexports.createHmac = exports.Hmac = __webpack_require__(/*! create-hmac */ \"./node_modules/create-hmac/browser.js\")\n\nvar algos = __webpack_require__(/*! browserify-sign/algos */ \"./node_modules/browserify-sign/algos.js\")\nvar algoKeys = Object.keys(algos)\nvar hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys)\nexports.getHashes = function () {\n return hashes\n}\n\nvar p = __webpack_require__(/*! pbkdf2 */ \"./node_modules/pbkdf2/browser.js\")\nexports.pbkdf2 = p.pbkdf2\nexports.pbkdf2Sync = p.pbkdf2Sync\n\nvar aes = __webpack_require__(/*! browserify-cipher */ \"./node_modules/browserify-cipher/browser.js\")\n\nexports.Cipher = aes.Cipher\nexports.createCipher = aes.createCipher\nexports.Cipheriv = aes.Cipheriv\nexports.createCipheriv = aes.createCipheriv\nexports.Decipher = aes.Decipher\nexports.createDecipher = aes.createDecipher\nexports.Decipheriv = aes.Decipheriv\nexports.createDecipheriv = aes.createDecipheriv\nexports.getCiphers = aes.getCiphers\nexports.listCiphers = aes.listCiphers\n\nvar dh = __webpack_require__(/*! diffie-hellman */ \"./node_modules/diffie-hellman/browser.js\")\n\nexports.DiffieHellmanGroup = dh.DiffieHellmanGroup\nexports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup\nexports.getDiffieHellman = dh.getDiffieHellman\nexports.createDiffieHellman = dh.createDiffieHellman\nexports.DiffieHellman = dh.DiffieHellman\n\nvar sign = __webpack_require__(/*! browserify-sign */ \"./node_modules/browserify-sign/browser/index.js\")\n\nexports.createSign = sign.createSign\nexports.Sign = sign.Sign\nexports.createVerify = sign.createVerify\nexports.Verify = sign.Verify\n\nexports.createECDH = __webpack_require__(/*! create-ecdh */ \"./node_modules/create-ecdh/browser.js\")\n\nvar publicEncrypt = __webpack_require__(/*! public-encrypt */ \"./node_modules/public-encrypt/browser.js\")\n\nexports.publicEncrypt = publicEncrypt.publicEncrypt\nexports.privateEncrypt = publicEncrypt.privateEncrypt\nexports.publicDecrypt = publicEncrypt.publicDecrypt\nexports.privateDecrypt = publicEncrypt.privateDecrypt\n\n// the least I can do is make error messages for the rest of the node.js/crypto api.\n// ;[\n// 'createCredentials'\n// ].forEach(function (name) {\n// exports[name] = function () {\n// throw new Error([\n// 'sorry, ' + name + ' is not implemented yet',\n// 'we accept pull requests',\n// 'https://github.com/crypto-browserify/crypto-browserify'\n// ].join('\\n'))\n// }\n// })\n\nvar rf = __webpack_require__(/*! randomfill */ \"./node_modules/randomfill/browser.js\")\n\nexports.randomFill = rf.randomFill\nexports.randomFillSync = rf.randomFillSync\n\nexports.createCredentials = function () {\n throw new Error([\n 'sorry, createCredentials is not implemented yet',\n 'we accept pull requests',\n 'https://github.com/crypto-browserify/crypto-browserify'\n ].join('\\n'))\n}\n\nexports.constants = {\n 'DH_CHECK_P_NOT_SAFE_PRIME': 2,\n 'DH_CHECK_P_NOT_PRIME': 1,\n 'DH_UNABLE_TO_CHECK_GENERATOR': 4,\n 'DH_NOT_SUITABLE_GENERATOR': 8,\n 'NPN_ENABLED': 1,\n 'ALPN_ENABLED': 1,\n 'RSA_PKCS1_PADDING': 1,\n 'RSA_SSLV23_PADDING': 2,\n 'RSA_NO_PADDING': 3,\n 'RSA_PKCS1_OAEP_PADDING': 4,\n 'RSA_X931_PADDING': 5,\n 'RSA_PKCS1_PSS_PADDING': 6,\n 'POINT_CONVERSION_COMPRESSED': 2,\n 'POINT_CONVERSION_UNCOMPRESSED': 4,\n 'POINT_CONVERSION_HYBRID': 6\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/crypto-browserify/index.js?"); + +/***/ }), + +/***/ "./node_modules/debug/src/browser.js": +/*!*******************************************!*\ + !*** ./node_modules/debug/src/browser.js ***! + \*******************************************/ +/***/ ((module, exports, __webpack_require__) => { + +eval("/* provided dependency */ var process = __webpack_require__(/*! ./node_modules/process/browser.js */ \"./node_modules/process/browser.js\");\n/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"./node_modules/debug/src/common.js\")(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/debug/src/browser.js?"); + +/***/ }), + +/***/ "./node_modules/debug/src/common.js": +/*!******************************************!*\ + !*** ./node_modules/debug/src/common.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n\n\n//# sourceURL=webpack://dcp/./node_modules/debug/src/common.js?"); + +/***/ }), + +/***/ "./node_modules/deepmerge/dist/cjs.js": +/*!********************************************!*\ + !*** ./node_modules/deepmerge/dist/cjs.js ***! + \********************************************/ +/***/ ((module) => { + +"use strict"; +eval("\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n\n\n//# sourceURL=webpack://dcp/./node_modules/deepmerge/dist/cjs.js?"); + +/***/ }), + +/***/ "./node_modules/defaults/index.js": +/*!****************************************!*\ + !*** ./node_modules/defaults/index.js ***! + \****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var clone = __webpack_require__(/*! clone */ \"./node_modules/clone/clone.js\");\n\nmodule.exports = function(options, defaults) {\n options = options || {};\n\n Object.keys(defaults).forEach(function(key) {\n if (typeof options[key] === 'undefined') {\n options[key] = clone(defaults[key]);\n }\n });\n\n return options;\n};\n\n//# sourceURL=webpack://dcp/./node_modules/defaults/index.js?"); + +/***/ }), + +/***/ "./node_modules/define-properties/index.js": +/*!*************************************************!*\ + !*** ./node_modules/define-properties/index.js ***! + \*************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nvar keys = __webpack_require__(/*! object-keys */ \"./node_modules/object-keys/index.js\");\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar origDefineProperty = Object.defineProperty;\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar hasPropertyDescriptors = __webpack_require__(/*! has-property-descriptors */ \"./node_modules/has-property-descriptors/index.js\")();\n\nvar supportsDescriptors = origDefineProperty && hasPropertyDescriptors;\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object) {\n\t\tif (predicate === true) {\n\t\t\tif (object[name] === value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (!isFunction(predicate) || !predicate()) {\n\t\t\treturn;\n\t\t}\n\t}\n\tif (supportsDescriptors) {\n\t\torigDefineProperty(object, name, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: value,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\tobject[name] = value; // eslint-disable-line no-param-reassign\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n\n\n//# sourceURL=webpack://dcp/./node_modules/define-properties/index.js?"); + +/***/ }), + +/***/ "./node_modules/des.js/lib/des.js": +/*!****************************************!*\ + !*** ./node_modules/des.js/lib/des.js ***! + \****************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("\n\nexports.utils = __webpack_require__(/*! ./des/utils */ \"./node_modules/des.js/lib/des/utils.js\");\nexports.Cipher = __webpack_require__(/*! ./des/cipher */ \"./node_modules/des.js/lib/des/cipher.js\");\nexports.DES = __webpack_require__(/*! ./des/des */ \"./node_modules/des.js/lib/des/des.js\");\nexports.CBC = __webpack_require__(/*! ./des/cbc */ \"./node_modules/des.js/lib/des/cbc.js\");\nexports.EDE = __webpack_require__(/*! ./des/ede */ \"./node_modules/des.js/lib/des/ede.js\");\n\n\n//# sourceURL=webpack://dcp/./node_modules/des.js/lib/des.js?"); + +/***/ }), + +/***/ "./node_modules/des.js/lib/des/cbc.js": +/*!********************************************!*\ + !*** ./node_modules/des.js/lib/des/cbc.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval("\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar proto = {};\n\nfunction CBCState(iv) {\n assert.equal(iv.length, 8, 'Invalid IV length');\n\n this.iv = new Array(8);\n for (var i = 0; i < this.iv.length; i++)\n this.iv[i] = iv[i];\n}\n\nfunction instantiate(Base) {\n function CBC(options) {\n Base.call(this, options);\n this._cbcInit();\n }\n inherits(CBC, Base);\n\n var keys = Object.keys(proto);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n CBC.prototype[key] = proto[key];\n }\n\n CBC.create = function create(options) {\n return new CBC(options);\n };\n\n return CBC;\n}\n\nexports.instantiate = instantiate;\n\nproto._cbcInit = function _cbcInit() {\n var state = new CBCState(this.options.iv);\n this._cbcState = state;\n};\n\nproto._update = function _update(inp, inOff, out, outOff) {\n var state = this._cbcState;\n var superProto = this.constructor.super_.prototype;\n\n var iv = state.iv;\n if (this.type === 'encrypt') {\n for (var i = 0; i < this.blockSize; i++)\n iv[i] ^= inp[inOff + i];\n\n superProto._update.call(this, iv, 0, out, outOff);\n\n for (var i = 0; i < this.blockSize; i++)\n iv[i] = out[outOff + i];\n } else {\n superProto._update.call(this, inp, inOff, out, outOff);\n\n for (var i = 0; i < this.blockSize; i++)\n out[outOff + i] ^= iv[i];\n\n for (var i = 0; i < this.blockSize; i++)\n iv[i] = inp[inOff + i];\n }\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/des.js/lib/des/cbc.js?"); + +/***/ }), + +/***/ "./node_modules/des.js/lib/des/cipher.js": +/*!***********************************************!*\ + !*** ./node_modules/des.js/lib/des/cipher.js ***! + \***********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\n\nfunction Cipher(options) {\n this.options = options;\n\n this.type = this.options.type;\n this.blockSize = 8;\n this._init();\n\n this.buffer = new Array(this.blockSize);\n this.bufferOff = 0;\n this.padding = options.padding !== false\n}\nmodule.exports = Cipher;\n\nCipher.prototype._init = function _init() {\n // Might be overrided\n};\n\nCipher.prototype.update = function update(data) {\n if (data.length === 0)\n return [];\n\n if (this.type === 'decrypt')\n return this._updateDecrypt(data);\n else\n return this._updateEncrypt(data);\n};\n\nCipher.prototype._buffer = function _buffer(data, off) {\n // Append data to buffer\n var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);\n for (var i = 0; i < min; i++)\n this.buffer[this.bufferOff + i] = data[off + i];\n this.bufferOff += min;\n\n // Shift next\n return min;\n};\n\nCipher.prototype._flushBuffer = function _flushBuffer(out, off) {\n this._update(this.buffer, 0, out, off);\n this.bufferOff = 0;\n return this.blockSize;\n};\n\nCipher.prototype._updateEncrypt = function _updateEncrypt(data) {\n var inputOff = 0;\n var outputOff = 0;\n\n var count = ((this.bufferOff + data.length) / this.blockSize) | 0;\n var out = new Array(count * this.blockSize);\n\n if (this.bufferOff !== 0) {\n inputOff += this._buffer(data, inputOff);\n\n if (this.bufferOff === this.buffer.length)\n outputOff += this._flushBuffer(out, outputOff);\n }\n\n // Write blocks\n var max = data.length - ((data.length - inputOff) % this.blockSize);\n for (; inputOff < max; inputOff += this.blockSize) {\n this._update(data, inputOff, out, outputOff);\n outputOff += this.blockSize;\n }\n\n // Queue rest\n for (; inputOff < data.length; inputOff++, this.bufferOff++)\n this.buffer[this.bufferOff] = data[inputOff];\n\n return out;\n};\n\nCipher.prototype._updateDecrypt = function _updateDecrypt(data) {\n var inputOff = 0;\n var outputOff = 0;\n\n var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;\n var out = new Array(count * this.blockSize);\n\n // TODO(indutny): optimize it, this is far from optimal\n for (; count > 0; count--) {\n inputOff += this._buffer(data, inputOff);\n outputOff += this._flushBuffer(out, outputOff);\n }\n\n // Buffer rest of the input\n inputOff += this._buffer(data, inputOff);\n\n return out;\n};\n\nCipher.prototype.final = function final(buffer) {\n var first;\n if (buffer)\n first = this.update(buffer);\n\n var last;\n if (this.type === 'encrypt')\n last = this._finalEncrypt();\n else\n last = this._finalDecrypt();\n\n if (first)\n return first.concat(last);\n else\n return last;\n};\n\nCipher.prototype._pad = function _pad(buffer, off) {\n if (off === 0)\n return false;\n\n while (off < buffer.length)\n buffer[off++] = 0;\n\n return true;\n};\n\nCipher.prototype._finalEncrypt = function _finalEncrypt() {\n if (!this._pad(this.buffer, this.bufferOff))\n return [];\n\n var out = new Array(this.blockSize);\n this._update(this.buffer, 0, out, 0);\n return out;\n};\n\nCipher.prototype._unpad = function _unpad(buffer) {\n return buffer;\n};\n\nCipher.prototype._finalDecrypt = function _finalDecrypt() {\n assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt');\n var out = new Array(this.blockSize);\n this._flushBuffer(out, 0);\n\n return this._unpad(out);\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/des.js/lib/des/cipher.js?"); + +/***/ }), + +/***/ "./node_modules/des.js/lib/des/des.js": +/*!********************************************!*\ + !*** ./node_modules/des.js/lib/des/des.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar utils = __webpack_require__(/*! ./utils */ \"./node_modules/des.js/lib/des/utils.js\");\nvar Cipher = __webpack_require__(/*! ./cipher */ \"./node_modules/des.js/lib/des/cipher.js\");\n\nfunction DESState() {\n this.tmp = new Array(2);\n this.keys = null;\n}\n\nfunction DES(options) {\n Cipher.call(this, options);\n\n var state = new DESState();\n this._desState = state;\n\n this.deriveKeys(state, options.key);\n}\ninherits(DES, Cipher);\nmodule.exports = DES;\n\nDES.create = function create(options) {\n return new DES(options);\n};\n\nvar shiftTable = [\n 1, 1, 2, 2, 2, 2, 2, 2,\n 1, 2, 2, 2, 2, 2, 2, 1\n];\n\nDES.prototype.deriveKeys = function deriveKeys(state, key) {\n state.keys = new Array(16 * 2);\n\n assert.equal(key.length, this.blockSize, 'Invalid key length');\n\n var kL = utils.readUInt32BE(key, 0);\n var kR = utils.readUInt32BE(key, 4);\n\n utils.pc1(kL, kR, state.tmp, 0);\n kL = state.tmp[0];\n kR = state.tmp[1];\n for (var i = 0; i < state.keys.length; i += 2) {\n var shift = shiftTable[i >>> 1];\n kL = utils.r28shl(kL, shift);\n kR = utils.r28shl(kR, shift);\n utils.pc2(kL, kR, state.keys, i);\n }\n};\n\nDES.prototype._update = function _update(inp, inOff, out, outOff) {\n var state = this._desState;\n\n var l = utils.readUInt32BE(inp, inOff);\n var r = utils.readUInt32BE(inp, inOff + 4);\n\n // Initial Permutation\n utils.ip(l, r, state.tmp, 0);\n l = state.tmp[0];\n r = state.tmp[1];\n\n if (this.type === 'encrypt')\n this._encrypt(state, l, r, state.tmp, 0);\n else\n this._decrypt(state, l, r, state.tmp, 0);\n\n l = state.tmp[0];\n r = state.tmp[1];\n\n utils.writeUInt32BE(out, l, outOff);\n utils.writeUInt32BE(out, r, outOff + 4);\n};\n\nDES.prototype._pad = function _pad(buffer, off) {\n if (this.padding === false) {\n return false;\n }\n\n var value = buffer.length - off;\n for (var i = off; i < buffer.length; i++)\n buffer[i] = value;\n\n return true;\n};\n\nDES.prototype._unpad = function _unpad(buffer) {\n if (this.padding === false) {\n return buffer;\n }\n\n var pad = buffer[buffer.length - 1];\n for (var i = buffer.length - pad; i < buffer.length; i++)\n assert.equal(buffer[i], pad);\n\n return buffer.slice(0, buffer.length - pad);\n};\n\nDES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {\n var l = lStart;\n var r = rStart;\n\n // Apply f() x16 times\n for (var i = 0; i < state.keys.length; i += 2) {\n var keyL = state.keys[i];\n var keyR = state.keys[i + 1];\n\n // f(r, k)\n utils.expand(r, state.tmp, 0);\n\n keyL ^= state.tmp[0];\n keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR);\n var f = utils.permute(s);\n\n var t = r;\n r = (l ^ f) >>> 0;\n l = t;\n }\n\n // Reverse Initial Permutation\n utils.rip(r, l, out, off);\n};\n\nDES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {\n var l = rStart;\n var r = lStart;\n\n // Apply f() x16 times\n for (var i = state.keys.length - 2; i >= 0; i -= 2) {\n var keyL = state.keys[i];\n var keyR = state.keys[i + 1];\n\n // f(r, k)\n utils.expand(l, state.tmp, 0);\n\n keyL ^= state.tmp[0];\n keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR);\n var f = utils.permute(s);\n\n var t = l;\n l = (r ^ f) >>> 0;\n r = t;\n }\n\n // Reverse Initial Permutation\n utils.rip(l, r, out, off);\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/des.js/lib/des/des.js?"); + +/***/ }), + +/***/ "./node_modules/des.js/lib/des/ede.js": +/*!********************************************!*\ + !*** ./node_modules/des.js/lib/des/ede.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval("\n\nvar assert = __webpack_require__(/*! minimalistic-assert */ \"./node_modules/minimalistic-assert/index.js\");\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\nvar Cipher = __webpack_require__(/*! ./cipher */ \"./node_modules/des.js/lib/des/cipher.js\");\nvar DES = __webpack_require__(/*! ./des */ \"./node_modules/des.js/lib/des/des.js\");\n\nfunction EDEState(type, key) {\n assert.equal(key.length, 24, 'Invalid key length');\n\n var k1 = key.slice(0, 8);\n var k2 = key.slice(8, 16);\n var k3 = key.slice(16, 24);\n\n if (type === 'encrypt') {\n this.ciphers = [\n DES.create({ type: 'encrypt', key: k1 }),\n DES.create({ type: 'decrypt', key: k2 }),\n DES.create({ type: 'encrypt', key: k3 })\n ];\n } else {\n this.ciphers = [\n DES.create({ type: 'decrypt', key: k3 }),\n DES.create({ type: 'encrypt', key: k2 }),\n DES.create({ type: 'decrypt', key: k1 })\n ];\n }\n}\n\nfunction EDE(options) {\n Cipher.call(this, options);\n\n var state = new EDEState(this.type, this.options.key);\n this._edeState = state;\n}\ninherits(EDE, Cipher);\n\nmodule.exports = EDE;\n\nEDE.create = function create(options) {\n return new EDE(options);\n};\n\nEDE.prototype._update = function _update(inp, inOff, out, outOff) {\n var state = this._edeState;\n\n state.ciphers[0]._update(inp, inOff, out, outOff);\n state.ciphers[1]._update(out, outOff, out, outOff);\n state.ciphers[2]._update(out, outOff, out, outOff);\n};\n\nEDE.prototype._pad = DES.prototype._pad;\nEDE.prototype._unpad = DES.prototype._unpad;\n\n\n//# sourceURL=webpack://dcp/./node_modules/des.js/lib/des/ede.js?"); + +/***/ }), + +/***/ "./node_modules/des.js/lib/des/utils.js": +/*!**********************************************!*\ + !*** ./node_modules/des.js/lib/des/utils.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +eval("\n\nexports.readUInt32BE = function readUInt32BE(bytes, off) {\n var res = (bytes[0 + off] << 24) |\n (bytes[1 + off] << 16) |\n (bytes[2 + off] << 8) |\n bytes[3 + off];\n return res >>> 0;\n};\n\nexports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {\n bytes[0 + off] = value >>> 24;\n bytes[1 + off] = (value >>> 16) & 0xff;\n bytes[2 + off] = (value >>> 8) & 0xff;\n bytes[3 + off] = value & 0xff;\n};\n\nexports.ip = function ip(inL, inR, out, off) {\n var outL = 0;\n var outR = 0;\n\n for (var i = 6; i >= 0; i -= 2) {\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= (inR >>> (j + i)) & 1;\n }\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= (inL >>> (j + i)) & 1;\n }\n }\n\n for (var i = 6; i >= 0; i -= 2) {\n for (var j = 1; j <= 25; j += 8) {\n outR <<= 1;\n outR |= (inR >>> (j + i)) & 1;\n }\n for (var j = 1; j <= 25; j += 8) {\n outR <<= 1;\n outR |= (inL >>> (j + i)) & 1;\n }\n }\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nexports.rip = function rip(inL, inR, out, off) {\n var outL = 0;\n var outR = 0;\n\n for (var i = 0; i < 4; i++) {\n for (var j = 24; j >= 0; j -= 8) {\n outL <<= 1;\n outL |= (inR >>> (j + i)) & 1;\n outL <<= 1;\n outL |= (inL >>> (j + i)) & 1;\n }\n }\n for (var i = 4; i < 8; i++) {\n for (var j = 24; j >= 0; j -= 8) {\n outR <<= 1;\n outR |= (inR >>> (j + i)) & 1;\n outR <<= 1;\n outR |= (inL >>> (j + i)) & 1;\n }\n }\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nexports.pc1 = function pc1(inL, inR, out, off) {\n var outL = 0;\n var outR = 0;\n\n // 7, 15, 23, 31, 39, 47, 55, 63\n // 6, 14, 22, 30, 39, 47, 55, 63\n // 5, 13, 21, 29, 39, 47, 55, 63\n // 4, 12, 20, 28\n for (var i = 7; i >= 5; i--) {\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= (inR >> (j + i)) & 1;\n }\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= (inL >> (j + i)) & 1;\n }\n }\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= (inR >> (j + i)) & 1;\n }\n\n // 1, 9, 17, 25, 33, 41, 49, 57\n // 2, 10, 18, 26, 34, 42, 50, 58\n // 3, 11, 19, 27, 35, 43, 51, 59\n // 36, 44, 52, 60\n for (var i = 1; i <= 3; i++) {\n for (var j = 0; j <= 24; j += 8) {\n outR <<= 1;\n outR |= (inR >> (j + i)) & 1;\n }\n for (var j = 0; j <= 24; j += 8) {\n outR <<= 1;\n outR |= (inL >> (j + i)) & 1;\n }\n }\n for (var j = 0; j <= 24; j += 8) {\n outR <<= 1;\n outR |= (inL >> (j + i)) & 1;\n }\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nexports.r28shl = function r28shl(num, shift) {\n return ((num << shift) & 0xfffffff) | (num >>> (28 - shift));\n};\n\nvar pc2table = [\n // inL => outL\n 14, 11, 17, 4, 27, 23, 25, 0,\n 13, 22, 7, 18, 5, 9, 16, 24,\n 2, 20, 12, 21, 1, 8, 15, 26,\n\n // inR => outR\n 15, 4, 25, 19, 9, 1, 26, 16,\n 5, 11, 23, 8, 12, 7, 17, 0,\n 22, 3, 10, 14, 6, 20, 27, 24\n];\n\nexports.pc2 = function pc2(inL, inR, out, off) {\n var outL = 0;\n var outR = 0;\n\n var len = pc2table.length >>> 1;\n for (var i = 0; i < len; i++) {\n outL <<= 1;\n outL |= (inL >>> pc2table[i]) & 0x1;\n }\n for (var i = len; i < pc2table.length; i++) {\n outR <<= 1;\n outR |= (inR >>> pc2table[i]) & 0x1;\n }\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nexports.expand = function expand(r, out, off) {\n var outL = 0;\n var outR = 0;\n\n outL = ((r & 1) << 5) | (r >>> 27);\n for (var i = 23; i >= 15; i -= 4) {\n outL <<= 6;\n outL |= (r >>> i) & 0x3f;\n }\n for (var i = 11; i >= 3; i -= 4) {\n outR |= (r >>> i) & 0x3f;\n outR <<= 6;\n }\n outR |= ((r & 0x1f) << 1) | (r >>> 31);\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nvar sTable = [\n 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1,\n 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8,\n 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7,\n 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13,\n\n 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14,\n 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5,\n 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2,\n 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9,\n\n 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10,\n 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1,\n 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7,\n 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12,\n\n 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3,\n 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9,\n 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8,\n 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14,\n\n 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1,\n 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6,\n 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13,\n 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3,\n\n 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5,\n 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8,\n 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10,\n 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13,\n\n 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10,\n 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6,\n 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7,\n 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12,\n\n 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4,\n 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2,\n 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13,\n 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11\n];\n\nexports.substitute = function substitute(inL, inR) {\n var out = 0;\n for (var i = 0; i < 4; i++) {\n var b = (inL >>> (18 - i * 6)) & 0x3f;\n var sb = sTable[i * 0x40 + b];\n\n out <<= 4;\n out |= sb;\n }\n for (var i = 0; i < 4; i++) {\n var b = (inR >>> (18 - i * 6)) & 0x3f;\n var sb = sTable[4 * 0x40 + i * 0x40 + b];\n\n out <<= 4;\n out |= sb;\n }\n return out >>> 0;\n};\n\nvar permuteTable = [\n 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22,\n 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7\n];\n\nexports.permute = function permute(num) {\n var out = 0;\n for (var i = 0; i < permuteTable.length; i++) {\n out <<= 1;\n out |= (num >>> permuteTable[i]) & 0x1;\n }\n return out >>> 0;\n};\n\nexports.padSplit = function padSplit(num, size, group) {\n var str = num.toString(2);\n while (str.length < size)\n str = '0' + str;\n\n var out = [];\n for (var i = 0; i < size; i += group)\n out.push(str.slice(i, i + group));\n return out.join(' ');\n};\n\n\n//# sourceURL=webpack://dcp/./node_modules/des.js/lib/des/utils.js?"); + +/***/ }), + +/***/ "./node_modules/diffie-hellman/browser.js": +/*!************************************************!*\ + !*** ./node_modules/diffie-hellman/browser.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +eval("/* provided dependency */ var Buffer = __webpack_require__(/*! ./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js */ \"./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js\")[\"Buffer\"];\nvar generatePrime = __webpack_require__(/*! ./lib/generatePrime */ \"./node_modules/diffie-hellman/lib/generatePrime.js\")\nvar primes = __webpack_require__(/*! ./lib/primes.json */ \"./node_modules/diffie-hellman/lib/primes.json\")\n\nvar DH = __webpack_require__(/*! ./lib/dh */ \"./node_modules/diffie-hellman/lib/dh.js\")\n\nfunction getDiffieHellman (mod) {\n var prime = new Buffer(primes[mod].prime, 'hex')\n var gen = new Buffer(primes[mod].gen, 'hex')\n\n return new DH(prime, gen)\n}\n\nvar ENCODINGS = {\n 'binary': true, 'hex': true, 'base64': true\n}\n\nfunction createDiffieHellman (prime, enc, generator, genc) {\n if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) {\n return createDiffieHellman(prime, 'binary', enc, generator)\n }\n\n enc = enc || 'binary'\n genc = genc || 'binary'\n generator = generator || new Buffer([2])\n\n if (!Buffer.isBuffer(generator)) {\n generator = new Buffer(generator, genc)\n }\n\n if (typeof prime === 'number') {\n return new DH(generatePrime(prime, generator), generator, true)\n }\n\n if (!Buffer.isBuffer(prime)) {\n prime = new Buffer(prime, enc)\n }\n\n return new DH(prime, generator, true)\n}\n\nexports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman\nexports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman\n\n\n//# sourceURL=webpack://dcp/./node_modules/diffie-hellman/browser.js?"); + +/***/ }), + +/***/ "./node_modules/diffie-hellman/lib/dh.js": +/*!***********************************************!*\ + !*** ./node_modules/diffie-hellman/lib/dh.js ***! + \***********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("/* provided dependency */ var Buffer = __webpack_require__(/*! ./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js */ \"./node_modules/node-polyfill-webpack-plugin/node_modules/buffer/index.js\")[\"Buffer\"];\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\nvar MillerRabin = __webpack_require__(/*! miller-rabin */ \"./node_modules/miller-rabin/lib/mr.js\");\nvar millerRabin = new MillerRabin();\nvar TWENTYFOUR = new BN(24);\nvar ELEVEN = new BN(11);\nvar TEN = new BN(10);\nvar THREE = new BN(3);\nvar SEVEN = new BN(7);\nvar primes = __webpack_require__(/*! ./generatePrime */ \"./node_modules/diffie-hellman/lib/generatePrime.js\");\nvar randomBytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\");\nmodule.exports = DH;\n\nfunction setPublicKey(pub, enc) {\n enc = enc || 'utf8';\n if (!Buffer.isBuffer(pub)) {\n pub = new Buffer(pub, enc);\n }\n this._pub = new BN(pub);\n return this;\n}\n\nfunction setPrivateKey(priv, enc) {\n enc = enc || 'utf8';\n if (!Buffer.isBuffer(priv)) {\n priv = new Buffer(priv, enc);\n }\n this._priv = new BN(priv);\n return this;\n}\n\nvar primeCache = {};\nfunction checkPrime(prime, generator) {\n var gen = generator.toString('hex');\n var hex = [gen, prime.toString(16)].join('_');\n if (hex in primeCache) {\n return primeCache[hex];\n }\n var error = 0;\n\n if (prime.isEven() ||\n !primes.simpleSieve ||\n !primes.fermatTest(prime) ||\n !millerRabin.test(prime)) {\n //not a prime so +1\n error += 1;\n\n if (gen === '02' || gen === '05') {\n // we'd be able to check the generator\n // it would fail so +8\n error += 8;\n } else {\n //we wouldn't be able to test the generator\n // so +4\n error += 4;\n }\n primeCache[hex] = error;\n return error;\n }\n if (!millerRabin.test(prime.shrn(1))) {\n //not a safe prime\n error += 2;\n }\n var rem;\n switch (gen) {\n case '02':\n if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) {\n // unsuidable generator\n error += 8;\n }\n break;\n case '05':\n rem = prime.mod(TEN);\n if (rem.cmp(THREE) && rem.cmp(SEVEN)) {\n // prime mod 10 needs to equal 3 or 7\n error += 8;\n }\n break;\n default:\n error += 4;\n }\n primeCache[hex] = error;\n return error;\n}\n\nfunction DH(prime, generator, malleable) {\n this.setGenerator(generator);\n this.__prime = new BN(prime);\n this._prime = BN.mont(this.__prime);\n this._primeLen = prime.length;\n this._pub = undefined;\n this._priv = undefined;\n this._primeCode = undefined;\n if (malleable) {\n this.setPublicKey = setPublicKey;\n this.setPrivateKey = setPrivateKey;\n } else {\n this._primeCode = 8;\n }\n}\nObject.defineProperty(DH.prototype, 'verifyError', {\n enumerable: true,\n get: function () {\n if (typeof this._primeCode !== 'number') {\n this._primeCode = checkPrime(this.__prime, this.__gen);\n }\n return this._primeCode;\n }\n});\nDH.prototype.generateKeys = function () {\n if (!this._priv) {\n this._priv = new BN(randomBytes(this._primeLen));\n }\n this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();\n return this.getPublicKey();\n};\n\nDH.prototype.computeSecret = function (other) {\n other = new BN(other);\n other = other.toRed(this._prime);\n var secret = other.redPow(this._priv).fromRed();\n var out = new Buffer(secret.toArray());\n var prime = this.getPrime();\n if (out.length < prime.length) {\n var front = new Buffer(prime.length - out.length);\n front.fill(0);\n out = Buffer.concat([front, out]);\n }\n return out;\n};\n\nDH.prototype.getPublicKey = function getPublicKey(enc) {\n return formatReturnValue(this._pub, enc);\n};\n\nDH.prototype.getPrivateKey = function getPrivateKey(enc) {\n return formatReturnValue(this._priv, enc);\n};\n\nDH.prototype.getPrime = function (enc) {\n return formatReturnValue(this.__prime, enc);\n};\n\nDH.prototype.getGenerator = function (enc) {\n return formatReturnValue(this._gen, enc);\n};\n\nDH.prototype.setGenerator = function (gen, enc) {\n enc = enc || 'utf8';\n if (!Buffer.isBuffer(gen)) {\n gen = new Buffer(gen, enc);\n }\n this.__gen = gen;\n this._gen = new BN(gen);\n return this;\n};\n\nfunction formatReturnValue(bn, enc) {\n var buf = new Buffer(bn.toArray());\n if (!enc) {\n return buf;\n } else {\n return buf.toString(enc);\n }\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/diffie-hellman/lib/dh.js?"); + +/***/ }), + +/***/ "./node_modules/diffie-hellman/lib/generatePrime.js": +/*!**********************************************************!*\ + !*** ./node_modules/diffie-hellman/lib/generatePrime.js ***! + \**********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval("var randomBytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\");\nmodule.exports = findPrime;\nfindPrime.simpleSieve = simpleSieve;\nfindPrime.fermatTest = fermatTest;\nvar BN = __webpack_require__(/*! bn.js */ \"./node_modules/bn.js/lib/bn.js\");\nvar TWENTYFOUR = new BN(24);\nvar MillerRabin = __webpack_require__(/*! miller-rabin */ \"./node_modules/miller-rabin/lib/mr.js\");\nvar millerRabin = new MillerRabin();\nvar ONE = new BN(1);\nvar TWO = new BN(2);\nvar FIVE = new BN(5);\nvar SIXTEEN = new BN(16);\nvar EIGHT = new BN(8);\nvar TEN = new BN(10);\nvar THREE = new BN(3);\nvar SEVEN = new BN(7);\nvar ELEVEN = new BN(11);\nvar FOUR = new BN(4);\nvar TWELVE = new BN(12);\nvar primes = null;\n\nfunction _getPrimes() {\n if (primes !== null)\n return primes;\n\n var limit = 0x100000;\n var res = [];\n res[0] = 2;\n for (var i = 1, k = 3; k < limit; k += 2) {\n var sqrt = Math.ceil(Math.sqrt(k));\n for (var j = 0; j < i && res[j] <= sqrt; j++)\n if (k % res[j] === 0)\n break;\n\n if (i !== j && res[j] <= sqrt)\n continue;\n\n res[i++] = k;\n }\n primes = res;\n return res;\n}\n\nfunction simpleSieve(p) {\n var primes = _getPrimes();\n\n for (var i = 0; i < primes.length; i++)\n if (p.modn(primes[i]) === 0) {\n if (p.cmpn(primes[i]) === 0) {\n return true;\n } else {\n return false;\n }\n }\n\n return true;\n}\n\nfunction fermatTest(p) {\n var red = BN.mont(p);\n return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;\n}\n\nfunction findPrime(bits, gen) {\n if (bits < 16) {\n // this is what openssl does\n if (gen === 2 || gen === 5) {\n return new BN([0x8c, 0x7b]);\n } else {\n return new BN([0x8c, 0x27]);\n }\n }\n gen = new BN(gen);\n\n var num, n2;\n\n while (true) {\n num = new BN(randomBytes(Math.ceil(bits / 8)));\n while (num.bitLength() > bits) {\n num.ishrn(1);\n }\n if (num.isEven()) {\n num.iadd(ONE);\n }\n if (!num.testn(1)) {\n num.iadd(TWO);\n }\n if (!gen.cmp(TWO)) {\n while (num.mod(TWENTYFOUR).cmp(ELEVEN)) {\n num.iadd(FOUR);\n }\n } else if (!gen.cmp(FIVE)) {\n while (num.mod(TEN).cmp(THREE)) {\n num.iadd(FOUR);\n }\n }\n n2 = num.shrn(1);\n if (simpleSieve(n2) && simpleSieve(num) &&\n fermatTest(n2) && fermatTest(num) &&\n millerRabin.test(n2) && millerRabin.test(num)) {\n return num;\n }\n }\n\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/diffie-hellman/lib/generatePrime.js?"); + +/***/ }), + +/***/ "./node_modules/dom-serializer/lib/foreignNames.js": +/*!*********************************************************!*\ + !*** ./node_modules/dom-serializer/lib/foreignNames.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.attributeNames = exports.elementNames = void 0;\nexports.elementNames = new Map([\n [\"altglyph\", \"altGlyph\"],\n [\"altglyphdef\", \"altGlyphDef\"],\n [\"altglyphitem\", \"altGlyphItem\"],\n [\"animatecolor\", \"animateColor\"],\n [\"animatemotion\", \"animateMotion\"],\n [\"animatetransform\", \"animateTransform\"],\n [\"clippath\", \"clipPath\"],\n [\"feblend\", \"feBlend\"],\n [\"fecolormatrix\", \"feColorMatrix\"],\n [\"fecomponenttransfer\", \"feComponentTransfer\"],\n [\"fecomposite\", \"feComposite\"],\n [\"feconvolvematrix\", \"feConvolveMatrix\"],\n [\"fediffuselighting\", \"feDiffuseLighting\"],\n [\"fedisplacementmap\", \"feDisplacementMap\"],\n [\"fedistantlight\", \"feDistantLight\"],\n [\"fedropshadow\", \"feDropShadow\"],\n [\"feflood\", \"feFlood\"],\n [\"fefunca\", \"feFuncA\"],\n [\"fefuncb\", \"feFuncB\"],\n [\"fefuncg\", \"feFuncG\"],\n [\"fefuncr\", \"feFuncR\"],\n [\"fegaussianblur\", \"feGaussianBlur\"],\n [\"feimage\", \"feImage\"],\n [\"femerge\", \"feMerge\"],\n [\"femergenode\", \"feMergeNode\"],\n [\"femorphology\", \"feMorphology\"],\n [\"feoffset\", \"feOffset\"],\n [\"fepointlight\", \"fePointLight\"],\n [\"fespecularlighting\", \"feSpecularLighting\"],\n [\"fespotlight\", \"feSpotLight\"],\n [\"fetile\", \"feTile\"],\n [\"feturbulence\", \"feTurbulence\"],\n [\"foreignobject\", \"foreignObject\"],\n [\"glyphref\", \"glyphRef\"],\n [\"lineargradient\", \"linearGradient\"],\n [\"radialgradient\", \"radialGradient\"],\n [\"textpath\", \"textPath\"],\n]);\nexports.attributeNames = new Map([\n [\"definitionurl\", \"definitionURL\"],\n [\"attributename\", \"attributeName\"],\n [\"attributetype\", \"attributeType\"],\n [\"basefrequency\", \"baseFrequency\"],\n [\"baseprofile\", \"baseProfile\"],\n [\"calcmode\", \"calcMode\"],\n [\"clippathunits\", \"clipPathUnits\"],\n [\"diffuseconstant\", \"diffuseConstant\"],\n [\"edgemode\", \"edgeMode\"],\n [\"filterunits\", \"filterUnits\"],\n [\"glyphref\", \"glyphRef\"],\n [\"gradienttransform\", \"gradientTransform\"],\n [\"gradientunits\", \"gradientUnits\"],\n [\"kernelmatrix\", \"kernelMatrix\"],\n [\"kernelunitlength\", \"kernelUnitLength\"],\n [\"keypoints\", \"keyPoints\"],\n [\"keysplines\", \"keySplines\"],\n [\"keytimes\", \"keyTimes\"],\n [\"lengthadjust\", \"lengthAdjust\"],\n [\"limitingconeangle\", \"limitingConeAngle\"],\n [\"markerheight\", \"markerHeight\"],\n [\"markerunits\", \"markerUnits\"],\n [\"markerwidth\", \"markerWidth\"],\n [\"maskcontentunits\", \"maskContentUnits\"],\n [\"maskunits\", \"maskUnits\"],\n [\"numoctaves\", \"numOctaves\"],\n [\"pathlength\", \"pathLength\"],\n [\"patterncontentunits\", \"patternContentUnits\"],\n [\"patterntransform\", \"patternTransform\"],\n [\"patternunits\", \"patternUnits\"],\n [\"pointsatx\", \"pointsAtX\"],\n [\"pointsaty\", \"pointsAtY\"],\n [\"pointsatz\", \"pointsAtZ\"],\n [\"preservealpha\", \"preserveAlpha\"],\n [\"preserveaspectratio\", \"preserveAspectRatio\"],\n [\"primitiveunits\", \"primitiveUnits\"],\n [\"refx\", \"refX\"],\n [\"refy\", \"refY\"],\n [\"repeatcount\", \"repeatCount\"],\n [\"repeatdur\", \"repeatDur\"],\n [\"requiredextensions\", \"requiredExtensions\"],\n [\"requiredfeatures\", \"requiredFeatures\"],\n [\"specularconstant\", \"specularConstant\"],\n [\"specularexponent\", \"specularExponent\"],\n [\"spreadmethod\", \"spreadMethod\"],\n [\"startoffset\", \"startOffset\"],\n [\"stddeviation\", \"stdDeviation\"],\n [\"stitchtiles\", \"stitchTiles\"],\n [\"surfacescale\", \"surfaceScale\"],\n [\"systemlanguage\", \"systemLanguage\"],\n [\"tablevalues\", \"tableValues\"],\n [\"targetx\", \"targetX\"],\n [\"targety\", \"targetY\"],\n [\"textlength\", \"textLength\"],\n [\"viewbox\", \"viewBox\"],\n [\"viewtarget\", \"viewTarget\"],\n [\"xchannelselector\", \"xChannelSelector\"],\n [\"ychannelselector\", \"yChannelSelector\"],\n [\"zoomandpan\", \"zoomAndPan\"],\n]);\n\n\n//# sourceURL=webpack://dcp/./node_modules/dom-serializer/lib/foreignNames.js?"); + +/***/ }), + +/***/ "./node_modules/dom-serializer/lib/index.js": +/*!**************************************************!*\ + !*** ./node_modules/dom-serializer/lib/index.js ***! + \**************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n/*\n * Module dependencies\n */\nvar ElementType = __importStar(__webpack_require__(/*! domelementtype */ \"./node_modules/domelementtype/lib/index.js\"));\nvar entities_1 = __webpack_require__(/*! entities */ \"./node_modules/entities/lib/index.js\");\n/**\n * Mixed-case SVG and MathML tags & attributes\n * recognized by the HTML parser.\n *\n * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign\n */\nvar foreignNames_1 = __webpack_require__(/*! ./foreignNames */ \"./node_modules/dom-serializer/lib/foreignNames.js\");\nvar unencodedElements = new Set([\n \"style\",\n \"script\",\n \"xmp\",\n \"iframe\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"noscript\",\n]);\n/**\n * Format attributes\n */\nfunction formatAttributes(attributes, opts) {\n if (!attributes)\n return;\n return Object.keys(attributes)\n .map(function (key) {\n var _a, _b;\n var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : \"\";\n if (opts.xmlMode === \"foreign\") {\n /* Fix up mixed-case attribute names */\n key = (_b = foreignNames_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;\n }\n if (!opts.emptyAttrs && !opts.xmlMode && value === \"\") {\n return key;\n }\n return key + \"=\\\"\" + (opts.decodeEntities !== false\n ? entities_1.encodeXML(value)\n : value.replace(/\"/g, \""\")) + \"\\\"\";\n })\n .join(\" \");\n}\n/**\n * Self-enclosing tags\n */\nvar singleTag = new Set([\n \"area\",\n \"base\",\n \"basefont\",\n \"br\",\n \"col\",\n \"command\",\n \"embed\",\n \"frame\",\n \"hr\",\n \"img\",\n \"input\",\n \"isindex\",\n \"keygen\",\n \"link\",\n \"meta\",\n \"param\",\n \"source\",\n \"track\",\n \"wbr\",\n]);\n/**\n * Renders a DOM node or an array of DOM nodes to a string.\n *\n * Can be thought of as the equivalent of the `outerHTML` of the passed node(s).\n *\n * @param node Node to be rendered.\n * @param options Changes serialization behavior\n */\nfunction render(node, options) {\n if (options === void 0) { options = {}; }\n var nodes = \"length\" in node ? node : [node];\n var output = \"\";\n for (var i = 0; i < nodes.length; i++) {\n output += renderNode(nodes[i], options);\n }\n return output;\n}\nexports[\"default\"] = render;\nfunction renderNode(node, options) {\n switch (node.type) {\n case ElementType.Root:\n return render(node.children, options);\n case ElementType.Directive:\n case ElementType.Doctype:\n return renderDirective(node);\n case ElementType.Comment:\n return renderComment(node);\n case ElementType.CDATA:\n return renderCdata(node);\n case ElementType.Script:\n case ElementType.Style:\n case ElementType.Tag:\n return renderTag(node, options);\n case ElementType.Text:\n return renderText(node, options);\n }\n}\nvar foreignModeIntegrationPoints = new Set([\n \"mi\",\n \"mo\",\n \"mn\",\n \"ms\",\n \"mtext\",\n \"annotation-xml\",\n \"foreignObject\",\n \"desc\",\n \"title\",\n]);\nvar foreignElements = new Set([\"svg\", \"math\"]);\nfunction renderTag(elem, opts) {\n var _a;\n // Handle SVG / MathML in HTML\n if (opts.xmlMode === \"foreign\") {\n /* Fix up mixed-case element names */\n elem.name = (_a = foreignNames_1.elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;\n /* Exit foreign mode at integration points */\n if (elem.parent &&\n foreignModeIntegrationPoints.has(elem.parent.name)) {\n opts = __assign(__assign({}, opts), { xmlMode: false });\n }\n }\n if (!opts.xmlMode && foreignElements.has(elem.name)) {\n opts = __assign(__assign({}, opts), { xmlMode: \"foreign\" });\n }\n var tag = \"<\" + elem.name;\n var attribs = formatAttributes(elem.attribs, opts);\n if (attribs) {\n tag += \" \" + attribs;\n }\n if (elem.children.length === 0 &&\n (opts.xmlMode\n ? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags\n opts.selfClosingTags !== false\n : // User explicitly asked for self-closing tags, even in HTML mode\n opts.selfClosingTags && singleTag.has(elem.name))) {\n if (!opts.xmlMode)\n tag += \" \";\n tag += \"/>\";\n }\n else {\n tag += \">\";\n if (elem.children.length > 0) {\n tag += render(elem.children, opts);\n }\n if (opts.xmlMode || !singleTag.has(elem.name)) {\n tag += \"\";\n }\n }\n return tag;\n}\nfunction renderDirective(elem) {\n return \"<\" + elem.data + \">\";\n}\nfunction renderText(elem, opts) {\n var data = elem.data || \"\";\n // If entities weren't decoded, no need to encode them back\n if (opts.decodeEntities !== false &&\n !(!opts.xmlMode &&\n elem.parent &&\n unencodedElements.has(elem.parent.name))) {\n data = entities_1.encodeXML(data);\n }\n return data;\n}\nfunction renderCdata(elem) {\n return \"\";\n}\nfunction renderComment(elem) {\n return \"\";\n}\n\n\n//# sourceURL=webpack://dcp/./node_modules/dom-serializer/lib/index.js?"); + +/***/ }), + +/***/ "./node_modules/domelementtype/lib/index.js": +/*!**************************************************!*\ + !*** ./node_modules/domelementtype/lib/index.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;\n/** Types of elements found in htmlparser2's DOM */\nvar ElementType;\n(function (ElementType) {\n /** Type for the root element of a document */\n ElementType[\"Root\"] = \"root\";\n /** Type for Text */\n ElementType[\"Text\"] = \"text\";\n /** Type for */\n ElementType[\"Directive\"] = \"directive\";\n /** Type for */\n ElementType[\"Comment\"] = \"comment\";\n /** Type for