From 0c0e978aa41e4d78ae9d01d9e9ba5b409f550f9b Mon Sep 17 00:00:00 2001 From: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Date: Wed, 2 Oct 2024 09:11:17 -0400 Subject: [PATCH] Use rspack for local gateway (#153) * fix local dev * remove pnpm * use rspack over webpack --- gateway/.babelrc | 3 - gateway/config/presets/loadPreset.js | 2 +- gateway/config/presets/webpack.analyze.js | 6 - ...k.development.js => rspack.development.js} | 2 +- ...ack.production.js => rspack.production.js} | 7 +- .../dist/1112.ab151794d1354bdd1bd7.bundle.js | 11 + .../dist/114.1fc600bf2d8a3bc5e9b6.bundle.js | 35 + .../dist/1218.eadecaf97cf8f748e034.bundle.js | 23 + .../dist/1234.45819a346281db80fbd9.bundle.js | 1 - .../dist/1245.818b9bb5b7de48a35dfc.bundle.js | 38 + .../dist/1295.b2379ebe2a00adbaba80.bundle.js | 25 + .../dist/1312.8e610301a93a5385b13d.bundle.js | 1 + .../dist/1330.b3527ff21b477fd9d743.bundle.js | 1 - .../dist/1355.5da6953679170f874a61.bundle.js | 1 - .../dist/1395.232c85c29d30a7510bf0.bundle.js | 1 + .../dist/1396.a12ab5241bed7a88bb9f.bundle.js | 5 + .../dist/1452.b0471f4475fc6e0622af.bundle.js | 1 - .../dist/1538.41b23ed9cc4362bbb783.bundle.js | 1 - .../dist/1567.c5a4eba87e8f9c034239.bundle.js | 1 + .../dist/1578.9af710df8d59be65d8b7.bundle.js | 24 + .../dist/1732.4b52c96d845aed7b735a.bundle.js | 14 + .../dist/1837.1a25b8a749e0f19f2ae4.bundle.js | 1 - .../dist/1867.7ff8e54c66bcffa47fb9.bundle.js | 29 + .../dist/1948.9d9d13821d34fb44e6a9.bundle.js | 1 - .../dist/2003.728e563e769e331b1e91.bundle.js | 24 + .../dist/2131.cac4250904cbb3352b7e.bundle.js | 1 - .../dist/2193.1ebee688a2fd529ab36a.bundle.js | 17 + .../dist/220.e3f35d30ea038871d3a2.bundle.js | 1 + .../dist/2367.6a1021887fc8612575dd.bundle.js | 8 + .../dist/2419.8124d4cee1b8cfe82b37.bundle.js | 90 + .../dist/2526.5fb06436fd3e9730bc58.bundle.js | 1 - .../dist/2643.8a0ce44d2108b8ba9766.bundle.js | 1 + .../dist/268.f32d875bfd317398481f.bundle.js | 1 + .../dist/2686.839243715ee705221a5a.bundle.js | 14 + .../dist/2687.854f324ad04dc2a8dc0b.bundle.js | 1 - .../dist/2706.c491132f28b88b1dbebf.bundle.js | 7 + .../dist/2711.34691f88d26d3e342523.bundle.js | 1 - .../dist/2720.f4edb04151cbcbb909a7.bundle.js | 1 - .../dist/2813.08972e0adab829ca3fd4.bundle.js | 13 + .../dist/2815.fcefde563530f833b75c.bundle.js | 190 - ...fcefde563530f833b75c.bundle.js.LICENSE.txt | 88 - .../dist/2848.355eeac4e32f854576cd.bundle.js | 1 - .../dist/2870.199f9c06d1b28d416d7c.bundle.js | 21 + ...js => 3020.c33c8cdf944cb1c55816.bundle.js} | 6 +- .../dist/3023.7adb0b7a5d6dd0bf1d46.bundle.js | 66 + .../dist/3045.922d694536bac057e781.bundle.js | 1 - .../dist/3135.abfdb48361bde7f07ba0.bundle.js | 1 - .../dist/3244.55c8fb9b189a2848cce4.bundle.js | 10 + .../dist/3253.96df91213c349dbad5a4.bundle.js | 1 - .../dist/326.4377a2161c36c972e1f4.bundle.js | 1 - .../dist/3320.2cf060bc929ba3bf4ef6.bundle.js | 61 + .../dist/3366.ccef6180d21b1c0cf962.bundle.js | 5 + .../dist/338.22d16eebb052d119b5e5.bundle.js | 1 + .../dist/3397.9be06f229ca7567136e7.bundle.js | 1 + .../dist/3431.f06ef3df51ef30f2fee1.bundle.js | 1 - .../dist/3540.5c49c61afe51e59929bb.bundle.js | 1 - .../dist/3555.82d7bba8870f8cde7eaf.bundle.js | 8 + .../dist/3560.2de24841b0ffa215fdf7.bundle.js | 13 + .../dist/3561.f9917d1c4f2ccef5e385.bundle.js | 102 + .../dist/3587.b41e1f3db5057287a406.bundle.js | 1 + .../dist/360.07ffcb35e74751752453.bundle.js | 2 + .../dist/3696.484b5c3e88eb580b79e6.bundle.js | 67 + .../dist/3789.c447e068ca9227687e14.bundle.js | 38 + .../dist/3802.aa43fb7d44214d3d24fa.bundle.js | 1 - .../dist/3824.83fc270f7b9c26a0e9fb.bundle.js | 1 - .../dist/393.11bc352eb5e404500501.bundle.js | 6 + .../dist/3940.b1204557aca2699cfc87.bundle.js | 1 - .../dist/3950.81336ffa1b0f9c9cb9c9.bundle.js | 1 + gateway/dist/404.html | 15 +- .../dist/4051.4d3e8276e18428265416.bundle.js | 1 - .../dist/4351.29d6cb8f987f2776d4dd.bundle.js | 1 - .../dist/439.622bd661c8941f578b4c.bundle.js | 1 - .../dist/4534.e780b9850ebfb2dce487.bundle.js | 195 + .../dist/4653.c60b0383407dd053a077.bundle.js | 2 - ...c60b0383407dd053a077.bundle.js.LICENSE.txt | 14 - .../dist/4676.abc8c1bcd0180286ae79.bundle.js | 1 - .../dist/4752.b06a6ec5ebef56aedd28.bundle.js | 1 - .../dist/4919.3d1178f03a6d781ff09d.bundle.js | 5 + .../dist/4922.861ecafaeb017fbc98e1.bundle.js | 1 - .../dist/4954.79f8e832b60190165e28.bundle.js | 1 - .../dist/5114.51066a22b5c38ae8777d.bundle.js | 1 - .../dist/5120.c2209edf901cf1e600b2.bundle.js | 22 + .../dist/5131.f84624e5bdd75c2b407a.bundle.js | 1 - .../dist/5238.03b09525d6665d1680b5.bundle.js | 1 - .../dist/5307.01359ba965382c59353d.bundle.js | 1 - .../dist/5360.c0adfe285eb48b34264c.bundle.js | 6 + .../dist/5378.05d3e405a72d1ddbc7b3.bundle.js | 6 + .../dist/5485.4dcf7ee9648b01347027.bundle.js | 1 - .../dist/5541.38c318b1f32f02d1cbc1.bundle.js | 10 + .../dist/5609.df84877458ba025795c3.bundle.js | 1 + .../dist/5715.155fc339bcda6a3350b7.bundle.js | 10 + .../dist/5781.385a740bec4f6f4ae69c.bundle.js | 47 + .../dist/579.16bd0ac29099e78cbf78.bundle.js | 1 - .../dist/595.20e6f755853d9cb33ced.bundle.js | 20 + .../dist/6092.883f476239d0c9effed2.bundle.js | 4 + .../dist/6122.595b036a9792071bed65.bundle.js | 22 + .../dist/6148.d56fdf334b4dc1ae9010.bundle.js | 13 + .../dist/6220.6b1b7064f98f59941d9b.bundle.js | 1 + .../dist/6240.ed605a7e6aeb106051d4.bundle.js | 5 + .../dist/630.9eec816bb384c786ad80.bundle.js | 2 - ...9eec816bb384c786ad80.bundle.js.LICENSE.txt | 35 - .../dist/6347.32ffdfdf1bdcddfa56d0.bundle.js | 1 - .../dist/6451.002c334019ed4baddbae.bundle.js | 11 + .../dist/6480.00c9d7d73fd051060141.bundle.js | 2 - ...00c9d7d73fd051060141.bundle.js.LICENSE.txt | 17 - .../dist/6672.e4741887893336ad7fbf.bundle.js | 1 + .../dist/6710.90abc32171d5bfa2f3f5.bundle.js | 1 + .../dist/6875.d92ea05951dca33140d8.bundle.js | 1 - .../dist/6890.de1cf85dcb991e8aa04b.bundle.js | 1 - .../dist/6902.8e9e0c75f023b969e0f3.bundle.js | 1 - .../dist/6939.30cf76314557574c3f84.bundle.js | 39 + .../dist/7051.1eaf730e1a90804f53af.bundle.js | 1 - .../dist/7107.5e399af17883b2b06676.bundle.js | 1 - .../dist/7116.f52b256d347bd4bf8cf0.bundle.js | 10 + .../dist/712.3bec5914ed3a70e0ce44.bundle.js | 1 - .../dist/7183.79cb162a697c72808120.bundle.js | 6 + .../dist/7197.6a481a5c9996e74e66d1.bundle.js | 1 + .../dist/7402.6cd86c50b508d6cbf816.bundle.js | 1 - .../dist/7408.84c523260f7a35b3859a.bundle.js | 1 + .../dist/7448.8ce9d26c12692f3ac1d9.bundle.js | 2 - ...8ce9d26c12692f3ac1d9.bundle.js.LICENSE.txt | 14 - .../dist/750.fa45af13d007c163edae.bundle.js | 1 - .../dist/7546.d5d8091f3ea0a3d7b1c5.bundle.js | 1 - .../dist/7618.160ed110b1a1470a744d.bundle.js | 15 + .../dist/7641.cb0416c60a83701c76e5.bundle.js | 1 - .../dist/7705.f66f3fa5bf68b7931114.bundle.js | 1 - .../dist/778.6032dcba6309a8a062eb.bundle.js | 1 - .../dist/7984.7269ab87a0dafac9a20d.bundle.js | 1 - .../dist/8044.bbc949d85f6589bd9ccd.bundle.js | 1 - .../dist/8088.41a56870b402abd748b0.bundle.js | 4 + .../dist/8101.7d95bbed20601426e308.bundle.js | 3 + .../dist/8172.0fc136b800be3b3fdc3e.bundle.js | 1 - .../dist/819.ee9df663087b83a00ea6.bundle.js | 2 - ...ee9df663087b83a00ea6.bundle.js.LICENSE.txt | 23 - .../dist/8206.3e675870166189d5479b.bundle.js | 1 - .../dist/8370.af05790ae1a8fa206ce4.bundle.js | 23 + .../dist/8437.34c210b2aa9c2cb302bd.bundle.js | 1 - .../dist/8503.cfceef23eab5d5bff474.bundle.js | 1 - .../dist/8584.cd91e5acdd2ca5728df4.bundle.js | 26 + .../dist/8630.b3670f7ece51071786c0.bundle.js | 2 - ...b3670f7ece51071786c0.bundle.js.LICENSE.txt | 8 - .../dist/8766.75e1cce2f373e1bd7ee3.bundle.js | 1 - .../dist/8786.14ec9edb89729c0f374d.bundle.js | 1 - .../dist/8976.1df713c842feb6d1ef46.bundle.js | 3 + .../dist/9009.7f8be251a9d1c16365cf.bundle.js | 1 - .../dist/9132.25e6043810068428e33a.bundle.js | 15 + .../dist/9262.c1f400df2abb905ce0a0.bundle.js | 1 - .../dist/9318.1005c4549d0c3e605cb1.bundle.js | 1 - .../dist/9323.56d31495662d36ae13b8.bundle.js | 69 + .../dist/9336.7d7dfaac9df1bdae61f1.bundle.js | 1 - .../dist/9382.1df9c47ecaeab3060d27.bundle.js | 1 - .../dist/940.871f5e05385983f03a35.bundle.js | 1 - .../dist/9432.3297ff41bee4e2c9ee62.bundle.js | 1 - .../dist/9469.36b6045891159b1ac5eb.bundle.js | 1 - .../dist/9469.cbd1fa67b4143a1ee5b4.bundle.js | 1 + .../dist/9495.c4a06ae3cf7d5c77749b.bundle.js | 32 + .../dist/9522.50a7d4ff033886a39891.bundle.js | 15 + .../dist/9573.6d5a45fd06fced095eb2.bundle.js | 1 - .../dist/9592.782ac9402b7e849bc3cb.bundle.js | 32 + .../dist/974.5a34b849d63a84cbc832.bundle.js | 1 - .../dist/9833.64fd3ea468d630009740.bundle.js | 24 + .../dist/9895.f175ce47a1fc4ba20ced.bundle.js | 1 - .../dist/9953.dbfef64b055275e8c075.bundle.js | 4 + .../dist/9995.3800a73c6c3992180371.bundle.js | 1 - gateway/dist/index.html | 15 +- .../dist/main.4d162b07652fc08a52e0.bundle.js | 371 + .../dist/main.9a8feb49fef53c955bcf.bundle.js | 8 - ...9a8feb49fef53c955bcf.bundle.js.LICENSE.txt | 196 - .../runtime.64197f69905c1990ff98.bundle.js | 1 + .../runtime.8441d271053c46f9400c.bundle.js | 1 - gateway/package-lock.json | 17162 ++++++++++++++++ gateway/package.json | 32 +- .../{webpack.config.js => rspack.config.js} | 50 +- gateway/yarn.lock | 3260 +-- 174 files changed, 19869 insertions(+), 3226 deletions(-) delete mode 100644 gateway/.babelrc delete mode 100644 gateway/config/presets/webpack.analyze.js rename gateway/config/{webpack.development.js => rspack.development.js} (95%) rename gateway/config/{webpack.production.js => rspack.production.js} (89%) create mode 100644 gateway/dist/1112.ab151794d1354bdd1bd7.bundle.js create mode 100644 gateway/dist/114.1fc600bf2d8a3bc5e9b6.bundle.js create mode 100644 gateway/dist/1218.eadecaf97cf8f748e034.bundle.js delete mode 100644 gateway/dist/1234.45819a346281db80fbd9.bundle.js create mode 100644 gateway/dist/1245.818b9bb5b7de48a35dfc.bundle.js create mode 100644 gateway/dist/1295.b2379ebe2a00adbaba80.bundle.js create mode 100644 gateway/dist/1312.8e610301a93a5385b13d.bundle.js delete mode 100644 gateway/dist/1330.b3527ff21b477fd9d743.bundle.js delete mode 100644 gateway/dist/1355.5da6953679170f874a61.bundle.js create mode 100644 gateway/dist/1395.232c85c29d30a7510bf0.bundle.js create mode 100644 gateway/dist/1396.a12ab5241bed7a88bb9f.bundle.js delete mode 100644 gateway/dist/1452.b0471f4475fc6e0622af.bundle.js delete mode 100644 gateway/dist/1538.41b23ed9cc4362bbb783.bundle.js create mode 100644 gateway/dist/1567.c5a4eba87e8f9c034239.bundle.js create mode 100644 gateway/dist/1578.9af710df8d59be65d8b7.bundle.js create mode 100644 gateway/dist/1732.4b52c96d845aed7b735a.bundle.js delete mode 100644 gateway/dist/1837.1a25b8a749e0f19f2ae4.bundle.js create mode 100644 gateway/dist/1867.7ff8e54c66bcffa47fb9.bundle.js delete mode 100644 gateway/dist/1948.9d9d13821d34fb44e6a9.bundle.js create mode 100644 gateway/dist/2003.728e563e769e331b1e91.bundle.js delete mode 100644 gateway/dist/2131.cac4250904cbb3352b7e.bundle.js create mode 100644 gateway/dist/2193.1ebee688a2fd529ab36a.bundle.js create mode 100644 gateway/dist/220.e3f35d30ea038871d3a2.bundle.js create mode 100644 gateway/dist/2367.6a1021887fc8612575dd.bundle.js create mode 100644 gateway/dist/2419.8124d4cee1b8cfe82b37.bundle.js delete mode 100644 gateway/dist/2526.5fb06436fd3e9730bc58.bundle.js create mode 100644 gateway/dist/2643.8a0ce44d2108b8ba9766.bundle.js create mode 100644 gateway/dist/268.f32d875bfd317398481f.bundle.js create mode 100644 gateway/dist/2686.839243715ee705221a5a.bundle.js delete mode 100644 gateway/dist/2687.854f324ad04dc2a8dc0b.bundle.js create mode 100644 gateway/dist/2706.c491132f28b88b1dbebf.bundle.js delete mode 100644 gateway/dist/2711.34691f88d26d3e342523.bundle.js delete mode 100644 gateway/dist/2720.f4edb04151cbcbb909a7.bundle.js create mode 100644 gateway/dist/2813.08972e0adab829ca3fd4.bundle.js delete mode 100644 gateway/dist/2815.fcefde563530f833b75c.bundle.js delete mode 100644 gateway/dist/2815.fcefde563530f833b75c.bundle.js.LICENSE.txt delete mode 100644 gateway/dist/2848.355eeac4e32f854576cd.bundle.js create mode 100644 gateway/dist/2870.199f9c06d1b28d416d7c.bundle.js rename gateway/dist/{6172.062cc396c9ece9b1eb36.bundle.js => 3020.c33c8cdf944cb1c55816.bundle.js} (79%) create mode 100644 gateway/dist/3023.7adb0b7a5d6dd0bf1d46.bundle.js delete mode 100644 gateway/dist/3045.922d694536bac057e781.bundle.js delete mode 100644 gateway/dist/3135.abfdb48361bde7f07ba0.bundle.js create mode 100644 gateway/dist/3244.55c8fb9b189a2848cce4.bundle.js delete mode 100644 gateway/dist/3253.96df91213c349dbad5a4.bundle.js delete mode 100644 gateway/dist/326.4377a2161c36c972e1f4.bundle.js create mode 100644 gateway/dist/3320.2cf060bc929ba3bf4ef6.bundle.js create mode 100644 gateway/dist/3366.ccef6180d21b1c0cf962.bundle.js create mode 100644 gateway/dist/338.22d16eebb052d119b5e5.bundle.js create mode 100644 gateway/dist/3397.9be06f229ca7567136e7.bundle.js delete mode 100644 gateway/dist/3431.f06ef3df51ef30f2fee1.bundle.js delete mode 100644 gateway/dist/3540.5c49c61afe51e59929bb.bundle.js create mode 100644 gateway/dist/3555.82d7bba8870f8cde7eaf.bundle.js create mode 100644 gateway/dist/3560.2de24841b0ffa215fdf7.bundle.js create mode 100644 gateway/dist/3561.f9917d1c4f2ccef5e385.bundle.js create mode 100644 gateway/dist/3587.b41e1f3db5057287a406.bundle.js create mode 100644 gateway/dist/360.07ffcb35e74751752453.bundle.js create mode 100644 gateway/dist/3696.484b5c3e88eb580b79e6.bundle.js create mode 100644 gateway/dist/3789.c447e068ca9227687e14.bundle.js delete mode 100644 gateway/dist/3802.aa43fb7d44214d3d24fa.bundle.js delete mode 100644 gateway/dist/3824.83fc270f7b9c26a0e9fb.bundle.js create mode 100644 gateway/dist/393.11bc352eb5e404500501.bundle.js delete mode 100644 gateway/dist/3940.b1204557aca2699cfc87.bundle.js create mode 100644 gateway/dist/3950.81336ffa1b0f9c9cb9c9.bundle.js delete mode 100644 gateway/dist/4051.4d3e8276e18428265416.bundle.js delete mode 100644 gateway/dist/4351.29d6cb8f987f2776d4dd.bundle.js delete mode 100644 gateway/dist/439.622bd661c8941f578b4c.bundle.js create mode 100644 gateway/dist/4534.e780b9850ebfb2dce487.bundle.js delete mode 100644 gateway/dist/4653.c60b0383407dd053a077.bundle.js delete mode 100644 gateway/dist/4653.c60b0383407dd053a077.bundle.js.LICENSE.txt delete mode 100644 gateway/dist/4676.abc8c1bcd0180286ae79.bundle.js delete mode 100644 gateway/dist/4752.b06a6ec5ebef56aedd28.bundle.js create mode 100644 gateway/dist/4919.3d1178f03a6d781ff09d.bundle.js delete mode 100644 gateway/dist/4922.861ecafaeb017fbc98e1.bundle.js delete mode 100644 gateway/dist/4954.79f8e832b60190165e28.bundle.js delete mode 100644 gateway/dist/5114.51066a22b5c38ae8777d.bundle.js create mode 100644 gateway/dist/5120.c2209edf901cf1e600b2.bundle.js delete mode 100644 gateway/dist/5131.f84624e5bdd75c2b407a.bundle.js delete mode 100644 gateway/dist/5238.03b09525d6665d1680b5.bundle.js delete mode 100644 gateway/dist/5307.01359ba965382c59353d.bundle.js create mode 100644 gateway/dist/5360.c0adfe285eb48b34264c.bundle.js create mode 100644 gateway/dist/5378.05d3e405a72d1ddbc7b3.bundle.js delete mode 100644 gateway/dist/5485.4dcf7ee9648b01347027.bundle.js create mode 100644 gateway/dist/5541.38c318b1f32f02d1cbc1.bundle.js create mode 100644 gateway/dist/5609.df84877458ba025795c3.bundle.js create mode 100644 gateway/dist/5715.155fc339bcda6a3350b7.bundle.js create mode 100644 gateway/dist/5781.385a740bec4f6f4ae69c.bundle.js delete mode 100644 gateway/dist/579.16bd0ac29099e78cbf78.bundle.js create mode 100644 gateway/dist/595.20e6f755853d9cb33ced.bundle.js create mode 100644 gateway/dist/6092.883f476239d0c9effed2.bundle.js create mode 100644 gateway/dist/6122.595b036a9792071bed65.bundle.js create mode 100644 gateway/dist/6148.d56fdf334b4dc1ae9010.bundle.js create mode 100644 gateway/dist/6220.6b1b7064f98f59941d9b.bundle.js create mode 100644 gateway/dist/6240.ed605a7e6aeb106051d4.bundle.js delete mode 100644 gateway/dist/630.9eec816bb384c786ad80.bundle.js delete mode 100644 gateway/dist/630.9eec816bb384c786ad80.bundle.js.LICENSE.txt delete mode 100644 gateway/dist/6347.32ffdfdf1bdcddfa56d0.bundle.js create mode 100644 gateway/dist/6451.002c334019ed4baddbae.bundle.js delete mode 100644 gateway/dist/6480.00c9d7d73fd051060141.bundle.js delete mode 100644 gateway/dist/6480.00c9d7d73fd051060141.bundle.js.LICENSE.txt create mode 100644 gateway/dist/6672.e4741887893336ad7fbf.bundle.js create mode 100644 gateway/dist/6710.90abc32171d5bfa2f3f5.bundle.js delete mode 100644 gateway/dist/6875.d92ea05951dca33140d8.bundle.js delete mode 100644 gateway/dist/6890.de1cf85dcb991e8aa04b.bundle.js delete mode 100644 gateway/dist/6902.8e9e0c75f023b969e0f3.bundle.js create mode 100644 gateway/dist/6939.30cf76314557574c3f84.bundle.js delete mode 100644 gateway/dist/7051.1eaf730e1a90804f53af.bundle.js delete mode 100644 gateway/dist/7107.5e399af17883b2b06676.bundle.js create mode 100644 gateway/dist/7116.f52b256d347bd4bf8cf0.bundle.js delete mode 100644 gateway/dist/712.3bec5914ed3a70e0ce44.bundle.js create mode 100644 gateway/dist/7183.79cb162a697c72808120.bundle.js create mode 100644 gateway/dist/7197.6a481a5c9996e74e66d1.bundle.js delete mode 100644 gateway/dist/7402.6cd86c50b508d6cbf816.bundle.js create mode 100644 gateway/dist/7408.84c523260f7a35b3859a.bundle.js delete mode 100644 gateway/dist/7448.8ce9d26c12692f3ac1d9.bundle.js delete mode 100644 gateway/dist/7448.8ce9d26c12692f3ac1d9.bundle.js.LICENSE.txt delete mode 100644 gateway/dist/750.fa45af13d007c163edae.bundle.js delete mode 100644 gateway/dist/7546.d5d8091f3ea0a3d7b1c5.bundle.js create mode 100644 gateway/dist/7618.160ed110b1a1470a744d.bundle.js delete mode 100644 gateway/dist/7641.cb0416c60a83701c76e5.bundle.js delete mode 100644 gateway/dist/7705.f66f3fa5bf68b7931114.bundle.js delete mode 100644 gateway/dist/778.6032dcba6309a8a062eb.bundle.js delete mode 100644 gateway/dist/7984.7269ab87a0dafac9a20d.bundle.js delete mode 100644 gateway/dist/8044.bbc949d85f6589bd9ccd.bundle.js create mode 100644 gateway/dist/8088.41a56870b402abd748b0.bundle.js create mode 100644 gateway/dist/8101.7d95bbed20601426e308.bundle.js delete mode 100644 gateway/dist/8172.0fc136b800be3b3fdc3e.bundle.js delete mode 100644 gateway/dist/819.ee9df663087b83a00ea6.bundle.js delete mode 100644 gateway/dist/819.ee9df663087b83a00ea6.bundle.js.LICENSE.txt delete mode 100644 gateway/dist/8206.3e675870166189d5479b.bundle.js create mode 100644 gateway/dist/8370.af05790ae1a8fa206ce4.bundle.js delete mode 100644 gateway/dist/8437.34c210b2aa9c2cb302bd.bundle.js delete mode 100644 gateway/dist/8503.cfceef23eab5d5bff474.bundle.js create mode 100644 gateway/dist/8584.cd91e5acdd2ca5728df4.bundle.js delete mode 100644 gateway/dist/8630.b3670f7ece51071786c0.bundle.js delete mode 100644 gateway/dist/8630.b3670f7ece51071786c0.bundle.js.LICENSE.txt delete mode 100644 gateway/dist/8766.75e1cce2f373e1bd7ee3.bundle.js delete mode 100644 gateway/dist/8786.14ec9edb89729c0f374d.bundle.js create mode 100644 gateway/dist/8976.1df713c842feb6d1ef46.bundle.js delete mode 100644 gateway/dist/9009.7f8be251a9d1c16365cf.bundle.js create mode 100644 gateway/dist/9132.25e6043810068428e33a.bundle.js delete mode 100644 gateway/dist/9262.c1f400df2abb905ce0a0.bundle.js delete mode 100644 gateway/dist/9318.1005c4549d0c3e605cb1.bundle.js create mode 100644 gateway/dist/9323.56d31495662d36ae13b8.bundle.js delete mode 100644 gateway/dist/9336.7d7dfaac9df1bdae61f1.bundle.js delete mode 100644 gateway/dist/9382.1df9c47ecaeab3060d27.bundle.js delete mode 100644 gateway/dist/940.871f5e05385983f03a35.bundle.js delete mode 100644 gateway/dist/9432.3297ff41bee4e2c9ee62.bundle.js delete mode 100644 gateway/dist/9469.36b6045891159b1ac5eb.bundle.js create mode 100644 gateway/dist/9469.cbd1fa67b4143a1ee5b4.bundle.js create mode 100644 gateway/dist/9495.c4a06ae3cf7d5c77749b.bundle.js create mode 100644 gateway/dist/9522.50a7d4ff033886a39891.bundle.js delete mode 100644 gateway/dist/9573.6d5a45fd06fced095eb2.bundle.js create mode 100644 gateway/dist/9592.782ac9402b7e849bc3cb.bundle.js delete mode 100644 gateway/dist/974.5a34b849d63a84cbc832.bundle.js create mode 100644 gateway/dist/9833.64fd3ea468d630009740.bundle.js delete mode 100644 gateway/dist/9895.f175ce47a1fc4ba20ced.bundle.js create mode 100644 gateway/dist/9953.dbfef64b055275e8c075.bundle.js delete mode 100644 gateway/dist/9995.3800a73c6c3992180371.bundle.js create mode 100644 gateway/dist/main.4d162b07652fc08a52e0.bundle.js delete mode 100644 gateway/dist/main.9a8feb49fef53c955bcf.bundle.js delete mode 100644 gateway/dist/main.9a8feb49fef53c955bcf.bundle.js.LICENSE.txt create mode 100644 gateway/dist/runtime.64197f69905c1990ff98.bundle.js delete mode 100644 gateway/dist/runtime.8441d271053c46f9400c.bundle.js create mode 100644 gateway/package-lock.json rename gateway/{webpack.config.js => rspack.config.js} (72%) diff --git a/gateway/.babelrc b/gateway/.babelrc deleted file mode 100644 index 0dce8c0a..00000000 --- a/gateway/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@babel/env", "@babel/preset-react"] -} diff --git a/gateway/config/presets/loadPreset.js b/gateway/config/presets/loadPreset.js index cfea5187..b7b5f4ad 100644 --- a/gateway/config/presets/loadPreset.js +++ b/gateway/config/presets/loadPreset.js @@ -5,7 +5,7 @@ const loadPresets = (env = { presets: [] }) => { /** @type {string[]} */ const mergedPresets = [].concat(...[presets]); const mergedConfigs = mergedPresets.map((presetName) => - require(`./webpack.${presetName}.js`)(env), + require(`./rspack.${presetName}.js`)(env), ); return merge({}, ...mergedConfigs); diff --git a/gateway/config/presets/webpack.analyze.js b/gateway/config/presets/webpack.analyze.js deleted file mode 100644 index 5dba45f0..00000000 --- a/gateway/config/presets/webpack.analyze.js +++ /dev/null @@ -1,6 +0,0 @@ -const WebpackBundleAnalyzer = - require("webpack-bundle-analyzer").BundleAnalyzerPlugin; - -module.exports = () => ({ - plugins: [new WebpackBundleAnalyzer()], -}); diff --git a/gateway/config/webpack.development.js b/gateway/config/rspack.development.js similarity index 95% rename from gateway/config/webpack.development.js rename to gateway/config/rspack.development.js index 8f80c135..2ef41d85 100644 --- a/gateway/config/webpack.development.js +++ b/gateway/config/rspack.development.js @@ -1,5 +1,5 @@ const path = require("path"); -const { HotModuleReplacementPlugin } = require("webpack"); +const { HotModuleReplacementPlugin } = require('@rspack/core'); module.exports = () => ({ devtool: false, diff --git a/gateway/config/webpack.production.js b/gateway/config/rspack.production.js similarity index 89% rename from gateway/config/webpack.production.js rename to gateway/config/rspack.production.js index 91976315..5864678e 100644 --- a/gateway/config/webpack.production.js +++ b/gateway/config/rspack.production.js @@ -1,5 +1,4 @@ -const MiniCssExtractPlugin = require("mini-css-extract-plugin"); -const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); +const rspack = require('@rspack/core'); const path = require("path"); module.exports = () => { @@ -60,14 +59,14 @@ module.exports = () => { ], }, plugins: [ - new MiniCssExtractPlugin({ + new rspack.CssExtractRspackPlugin({ filename: "styles/[name].[contenthash].css", chunkFilename: "[id].css", }), ], optimization: { minimize: true, - minimizer: [new CssMinimizerPlugin(), "..."], + minimizer: [new rspack.LightningCssMinimizerRspackPlugin(), "..."], runtimeChunk: { name: "runtime", }, diff --git a/gateway/dist/1112.ab151794d1354bdd1bd7.bundle.js b/gateway/dist/1112.ab151794d1354bdd1bd7.bundle.js new file mode 100644 index 00000000..d28cb8d7 --- /dev/null +++ b/gateway/dist/1112.ab151794d1354bdd1bd7.bundle.js @@ -0,0 +1,11 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["1112"],{15812:function(s,h,E){E.r(h),E.d(h,{default:function(){return V}});let V=` + + + + + + + + + +`}}]); \ No newline at end of file diff --git a/gateway/dist/114.1fc600bf2d8a3bc5e9b6.bundle.js b/gateway/dist/114.1fc600bf2d8a3bc5e9b6.bundle.js new file mode 100644 index 00000000..5afe569d --- /dev/null +++ b/gateway/dist/114.1fc600bf2d8a3bc5e9b6.bundle.js @@ -0,0 +1,35 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["114"],{72998:function(C,t,e){e.r(t),e.d(t,{default:function(){return i}});let i=` + + + + + + + + + + + +`}}]); \ No newline at end of file diff --git a/gateway/dist/1218.eadecaf97cf8f748e034.bundle.js b/gateway/dist/1218.eadecaf97cf8f748e034.bundle.js new file mode 100644 index 00000000..19bbd8c6 --- /dev/null +++ b/gateway/dist/1218.eadecaf97cf8f748e034.bundle.js @@ -0,0 +1,23 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["1218"],{16633:function(t,e,n){n.r(e),n.d(e,{default:function(){return W}});var o=n(26633),i=n(64608),r=n(42951),a=n(53805),l=n(55016);function s(t,{from:e,to:n},i={}){let r=getComputedStyle(t),a="none"===r.transform?"":r.transform,[l,d]=r.transformOrigin.split(" ").map(parseFloat),c=e.left+e.width*l/n.width-(n.left+l),f=e.top+e.height*d/n.height-(n.top+d),{delay:p=0,duration:v=t=>120*Math.sqrt(t),easing:u=o.an}=i;return{delay:p,duration:(0,o.Z)(v)?v(Math.sqrt(c*c+f*f)):v,easing:u,css:(t,o)=>{let i=t+o*e.width/n.width,r=t+o*e.height/n.height;return`transform: ${a} translate(${o*c}px, ${o*f}px) scale(${i}, ${r});`}}}function d(t){(0,o.a)(t,"svelte-13cuwwo","div.svelte-13cuwwo{box-sizing:content-box}.border.svelte-13cuwwo{border:2px solid;border-radius:120px;overflow:hidden}")}function c(t){let e,n;return{c(){e=(0,o.j)("div"),(0,o.k)(e,"class","border svelte-13cuwwo"),(0,o.k)(e,"style",n=` + width: ${t[2]-2*t[3]}px; + height: ${t[2]-2*t[3]}px; + border-color: var(${t[1]}); + padding: ${t[3]}px; + background-color: ${t[4]}; + border-radius: 50%; + display: flex; + justify-content: center; + `)},m(n,i){(0,o.b)(n,e,i),e.innerHTML=t[0]},p(t,[i]){1&i&&(e.innerHTML=t[0]),30&i&&n!==(n=` + width: ${t[2]-2*t[3]}px; + height: ${t[2]-2*t[3]}px; + border-color: var(${t[1]}); + padding: ${t[3]}px; + background-color: ${t[4]}; + border-radius: 50%; + display: flex; + justify-content: center; + `)&&(0,o.k)(e,"style",n)},i:o.n,o:o.n,d(t){t&&(0,o.d)(e)}}}function f(t,e,n){let{icon:o}=e,{borderColorVar:i}=e,{size:r}=e,{padding:a=0}=e,{background:l="transparent"}=e;return t.$$set=t=>{"icon"in t&&n(0,o=t.icon),"borderColorVar"in t&&n(1,i=t.borderColorVar),"size"in t&&n(2,r=t.size),"padding"in t&&n(3,a=t.padding),"background"in t&&n(4,l=t.background)},[o,i,r,a,l]}n(51206),n(42705),n(20041),n(98075),n(90202),n(46748),n(72378),n(26729);class p extends o.S{constructor(t){super(),(0,o.i)(this,t,f,c,o.s,{icon:0,borderColorVar:1,size:2,padding:3,background:4},d)}}function v(t){(0,o.a)(t,"svelte-jvic9v","div.notification-icons-wrapper.svelte-jvic9v{height:32px;width:32px}.border.svelte-jvic9v{border-radius:8px}div.notification-icon.svelte-jvic9v{padding:6px}div.pending-icon.svelte-jvic9v{animation:svelte-jvic9v-blink 2s ease-in infinite;height:100%;width:100%;padding:7px}@keyframes svelte-jvic9v-blink{from,to{opacity:1}50%{opacity:0.2}}div.border-action.svelte-jvic9v{height:32px;min-width:32px;border-radius:8px;overflow:hidden;will-change:transform}div.border-action.svelte-jvic9v:before{content:'';background-image:conic-gradient(#b1b7f2 20deg, #6370e5 120deg);height:140%;width:140%;position:absolute;left:-25%;top:-25%;animation:svelte-jvic9v-rotate 2s infinite linear}div.chain-icon-container.svelte-jvic9v{left:18px;top:18px}@keyframes svelte-jvic9v-rotate{100%{transform:rotate(-360deg)}}")}function u(t){let e,n,i,r,a,l,s,d;let c=o.ao[t[1].type].eventIcon+"",f=!t[1].id.includes("customNotification")&&!t[1].id.includes("preflight"),p="pending"===t[1].type&&y(),v=f&&m(t);return{c(){e=(0,o.j)("div"),p&&p.c(),n=(0,o.G)(),i=(0,o.j)("div"),r=(0,o.j)("div"),s=(0,o.G)(),v&&v.c(),(0,o.k)(r,"class",a=(0,o.l)(`notification-icon flex items-center justify-center ${"pending"===t[1].type?"pending-icon":""}`)+" svelte-jvic9v"),(0,o.k)(i,"class","flex items-center justify-center border relative notification-icons-wrapper svelte-jvic9v"),(0,o.k)(i,"style",l=`background:${o.ao[t[1].type].backgroundColor}; color: ${o.ao[t[1].type].iconColor||""}; ${"pending"===t[1].type?"height: 28px; width: 28px; margin: 2px;":`border: 2px solid ${o.ao[t[1].type].borderColor}`}; `),(0,o.k)(e,"class","relative")},m(t,a){(0,o.b)(t,e,a),p&&p.m(e,null),(0,o.m)(e,n),(0,o.m)(e,i),(0,o.m)(i,r),r.innerHTML=c,(0,o.m)(e,s),v&&v.m(e,null),d=!0},p(t,s){"pending"===t[1].type?p||((p=y()).c(),p.m(e,n)):p&&(p.d(1),p=null),(!d||2&s)&&c!==(c=o.ao[t[1].type].eventIcon+"")&&(r.innerHTML=c),(!d||2&s&&a!==(a=(0,o.l)(`notification-icon flex items-center justify-center ${"pending"===t[1].type?"pending-icon":""}`)+" svelte-jvic9v"))&&(0,o.k)(r,"class",a),(!d||2&s&&l!==(l=`background:${o.ao[t[1].type].backgroundColor}; color: ${o.ao[t[1].type].iconColor||""}; ${"pending"===t[1].type?"height: 28px; width: 28px; margin: 2px;":`border: 2px solid ${o.ao[t[1].type].borderColor}`}; `))&&(0,o.k)(i,"style",l),2&s&&(f=!t[1].id.includes("customNotification")&&!t[1].id.includes("preflight")),f?v?(v.p(t,s),2&s&&(0,o.x)(v,1)):((v=m(t)).c(),(0,o.x)(v,1),v.m(e,null)):v&&((0,o.y)(),(0,o.A)(v,1,1,()=>{v=null}),(0,o.z)())},i(t){!d&&((0,o.x)(v),d=!0)},o(t){(0,o.A)(v),d=!1},d(t){t&&(0,o.d)(e),p&&p.d(),v&&v.d()}}}function y(t){let e;return{c(){e=(0,o.j)("div"),(0,o.k)(e,"class","border-action absolute svelte-jvic9v")},m(t,n){(0,o.b)(t,e,n)},d(t){t&&(0,o.d)(e)}}}function m(t){let e,n,i;return n=new p({props:{icon:t[0].icon,size:16,background:t[0].color,borderColorVar:"--notify-onboard-background, var(--onboard-gray-600, var(--gray-600))",padding:3}}),{c(){e=(0,o.j)("div"),(0,o.F)(n.$$.fragment),(0,o.k)(e,"class","absolute chain-icon-container svelte-jvic9v")},m(t,r){(0,o.b)(t,e,r),(0,o.I)(n,e,null),i=!0},p(t,e){let o={};1&e&&(o.icon=t[0].icon),1&e&&(o.background=t[0].color),n.$set(o)},i(t){!i&&((0,o.x)(n.$$.fragment,t),i=!0)},o(t){(0,o.A)(n.$$.fragment,t),i=!1},d(t){t&&(0,o.d)(e),(0,o.K)(n)}}}function b(t){let e,n;let i=t[1].type&&u(t);return{c(){i&&i.c(),e=(0,o.e)()},m(t,r){i&&i.m(t,r),(0,o.b)(t,e,r),n=!0},p(t,[n]){t[1].type?i?(i.p(t,n),2&n&&(0,o.x)(i,1)):((i=u(t)).c(),(0,o.x)(i,1),i.m(e.parentNode,e)):i&&((0,o.y)(),(0,o.A)(i,1,1,()=>{i=null}),(0,o.z)())},i(t){!n&&((0,o.x)(i),n=!0)},o(t){(0,o.A)(i),n=!1},d(t){i&&i.d(t),t&&(0,o.d)(e)}}}function h(t,e,n){let{chainStyles:i=o.a6}=e,{notification:r}=e;return t.$$set=t=>{"chainStyles"in t&&n(0,i=t.chainStyles),"notification"in t&&n(1,r=t.notification)},[i,r]}class g extends o.S{constructor(t){super(),(0,o.i)(this,t,h,b,o.s,{chainStyles:0,notification:1},v)}}function k(t){(0,o.a)(t,"svelte-pm7idu","div.svelte-pm7idu{display:flex;justify-content:center;font-size:inherit;font-family:inherit;margin:0 1.5rem 0 0.75rem}span.svelte-pm7idu{font-family:inherit;display:flex;align-items:center;margin:0 2px}.time.svelte-pm7idu{color:var(\n --notify-onboard-timer-color,\n var(--onboard-gray-300, var(--gray-300))\n );margin-left:4px}")}function x(t){let e,n,i,r;let a=t[2](t[1]-t[0])+"";return{c(){e=(0,o.t)("-\n "),n=(0,o.j)("span"),i=(0,o.t)(a),r=(0,o.t)("\n ago"),(0,o.k)(n,"class","svelte-pm7idu")},m(t,a){(0,o.b)(t,e,a),(0,o.b)(t,n,a),(0,o.m)(n,i),(0,o.b)(t,r,a)},p(t,e){3&e&&a!==(a=t[2](t[1]-t[0])+"")&&(0,o.v)(i,a)},d(t){t&&(0,o.d)(e),t&&(0,o.d)(n),t&&(0,o.d)(r)}}}function w(t){let e;let n=t[0]&&x(t);return{c(){e=(0,o.j)("div"),n&&n.c(),(0,o.k)(e,"class","time svelte-pm7idu")},m(t,i){(0,o.b)(t,e,i),n&&n.m(e,null)},p(t,[o]){t[0]?n?n.p(t,o):((n=x(t)).c(),n.m(e,null)):n&&(n.d(1),n=null)},i:o.n,o:o.n,d(t){t&&(0,o.d)(e),n&&n.d()}}}function $(t,e,n){let r,a;(0,o.c)(t,i._,t=>n(3,r=t)),(0,o.c)(t,i.SP,t=>n(4,a=t));let{startTime:l}=e,s=Date.now(),d=setInterval(()=>{n(1,s=Date.now())},1e3);return(0,o.al)(()=>{clearInterval(d)}),t.$$set=t=>{"startTime"in t&&n(0,l=t.startTime)},[l,s,function(t){let e=Math.floor(t/1e3),n=e<0?0:e;return n>=60?`${Math.floor(n/60).toLocaleString(a)} ${r("notify.time.minutes")}`:`${n.toLocaleString(a)} ${r("notify.time.seconds")}`}]}class j extends o.S{constructor(t){super(),(0,o.i)(this,t,$,w,o.s,{startTime:0},k)}}function z(t){(0,o.a)(t,"svelte-1otz6tt","div.notify-transaction-data.svelte-1otz6tt{font-size:var(\n --notify-onboard-transaction-font-size,\n var(--onboard-font-size-6, var(--font-size-6))\n );font-family:inherit;margin:0px 20px 0px 8px;justify-content:center}.hash-time.svelte-1otz6tt{display:inline-flex;margin-top:4px;font-size:var(\n --notify-onboard-hash-time-font-size,\n var(--onboard-font-size-7, var(--font-size-7))\n );line-height:var(\n --notify-onboard-hash-time-font-line-height,\n var(--onboard-font-line-height-4, var(--font-line-height-4))\n )}.address-hash.svelte-1otz6tt{color:var(\n --notify-onboard-address-hash-color,\n var(--onboard-primary-200, var(--primary-200))\n )}a.address-hash.svelte-1otz6tt{color:var(\n --notify-onboard-anchor-color,\n var(--onboard-primary-400, var(--primary-400))\n )}a.svelte-1otz6tt{display:flex;text-decoration:none;color:inherit}.transaction-status.svelte-1otz6tt{color:var(--notify-onboard-transaction-status, inherit);line-height:var(\n --notify-onboard-font-size-5,\n var(--onboard-font-size-5, var(--font-size-5))\n );font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}")}function C(t){let e,n,i,r;function a(t,e){return t[0].link?T:L}let l=a(t),s=l(t);return i=new j({props:{startTime:t[0].startTime}}),{c(){e=(0,o.j)("span"),s.c(),n=(0,o.G)(),(0,o.F)(i.$$.fragment),(0,o.k)(e,"class","hash-time svelte-1otz6tt")},m(t,a){(0,o.b)(t,e,a),s.m(e,null),(0,o.m)(e,n),(0,o.I)(i,e,null),r=!0},p(t,o){l===(l=a(t))&&s?s.p(t,o):(s.d(1),(s=l(t))&&(s.c(),s.m(e,n)));let r={};1&o&&(r.startTime=t[0].startTime),i.$set(r)},i(t){!r&&((0,o.x)(i.$$.fragment,t),r=!0)},o(t){(0,o.A)(i.$$.fragment,t),r=!1},d(t){t&&(0,o.d)(e),s.d(),(0,o.K)(i)}}}function L(t){let e,n;let i=(0,o.E)(t[0].id)+"";return{c(){e=(0,o.j)("div"),n=(0,o.t)(i),(0,o.k)(e,"class","address-hash svelte-1otz6tt")},m(t,i){(0,o.b)(t,e,i),(0,o.m)(e,n)},p(t,e){1&e&&i!==(i=(0,o.E)(t[0].id)+"")&&(0,o.v)(n,i)},d(t){t&&(0,o.d)(e)}}}function T(t){let e,n,i;let r=(0,o.E)(t[0].id)+"";return{c(){e=(0,o.j)("a"),n=(0,o.t)(r),(0,o.k)(e,"class","address-hash svelte-1otz6tt"),(0,o.k)(e,"href",i=t[0].link),(0,o.k)(e,"target","_blank"),(0,o.k)(e,"rel","noreferrer noopener")},m(t,i){(0,o.b)(t,e,i),(0,o.m)(e,n)},p(t,a){1&a&&r!==(r=(0,o.E)(t[0].id)+"")&&(0,o.v)(n,r),1&a&&i!==(i=t[0].link)&&(0,o.k)(e,"href",i)},d(t){t&&(0,o.d)(e)}}}function S(t){let e,n,i,r,a;let l=t[0].message+"",s=t[0].id&&!t[0].id.includes("customNotification")&&!t[0].id.includes("preflight"),d=s&&C(t);return{c(){e=(0,o.j)("div"),n=(0,o.j)("span"),i=(0,o.t)(l),r=(0,o.G)(),d&&d.c(),(0,o.k)(n,"class","transaction-status svelte-1otz6tt"),(0,o.k)(e,"class","flex flex-column notify-transaction-data svelte-1otz6tt")},m(t,l){(0,o.b)(t,e,l),(0,o.m)(e,n),(0,o.m)(n,i),(0,o.m)(e,r),d&&d.m(e,null),a=!0},p(t,[n]){(!a||1&n)&&l!==(l=t[0].message+"")&&(0,o.v)(i,l),1&n&&(s=t[0].id&&!t[0].id.includes("customNotification")&&!t[0].id.includes("preflight")),s?d?(d.p(t,n),1&n&&(0,o.x)(d,1)):((d=C(t)).c(),(0,o.x)(d,1),d.m(e,null)):d&&((0,o.y)(),(0,o.A)(d,1,1,()=>{d=null}),(0,o.z)())},i(t){!a&&((0,o.x)(d),a=!0)},o(t){(0,o.A)(d),a=!1},d(t){t&&(0,o.d)(e),d&&d.d()}}}function A(t,e,n){let{notification:o}=e;return t.$$set=t=>{"notification"in t&&n(0,o=t.notification)},[o]}class M extends o.S{constructor(t){super(),(0,o.i)(this,t,A,S,o.s,{notification:0},z)}}var P=` + + + +`;let I=["txPool"],E=["main","matic-main"],F=["Ledger","Trezor","Keystone","KeepKey","D'CENT"],G=t=>I.includes(t),H=t=>E.includes(t),R=t=>t&&F.includes(t.label);async function K({type:t,wallet:e,transaction:n}){let{from:i,input:r,value:a,to:s,nonce:d,gas:c,network:f}=n,p=o.ap[f],{gasPriceProbability:v}=o.a3.get().notify.replacement,{gas:u,apiKey:y}=o.af,[m]=await u.get({chains:[o.ap[f]],endpoint:"blockPrices",apiKey:y}),{maxFeePerGas:b,maxPriorityFeePerGas:h}=m.blockPrices[0].estimatedPrices.find(({confidence:e})=>e===("speedup"===t?v.speedup:v.cancel)),g=(0,o.aq)(b),k=(0,o.aq)(h);return e.provider.request({method:"eth_sendTransaction",params:[{type:"0x2",from:i,to:"cancel"===t?i:s,chainId:parseInt(p),value:`${l.O$.from(a).toHexString()}`,nonce:(0,o.ar)(d),gasLimit:(0,o.ar)(c),maxFeePerGas:g,maxPriorityFeePerGas:k,..."0x"===r?{}:{data:r}}]})}function _(t){(0,o.a)(t,"svelte-ftkynd",".bn-notify-notification.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{--backround-color:var(--notify-onboard-background, var(--w3o-backround-color, var(--gray-700)));--foreground-color:var(--w3o-foreground-color, var(--gray-600));--text-color:var(--w3o-text-color, #FFF);--border-color:var(--w3o-border-color);font-family:inherit;transition:background 300ms ease-in-out, color 300ms ease-in-out;pointer-events:all;backdrop-filter:blur(5px);width:100%;min-height:56px;display:flex;flex-direction:column;position:relative;overflow:hidden;border:1px solid transparent;border-radius:var(\n --notify-onboard-border-radius,\n var(--onboard-border-radius-4, var(--border-radius-4))\n );background:var(--foreground-color);color:var(--text-color)}.bn-notify-notification-inner.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{padding:0.75rem}.bn-notify-notification.svelte-ftkynd:hover>div.bn-notify-notification-inner.svelte-ftkynd>div.notify-close-btn-desktop.svelte-ftkynd{visibility:visible;opacity:1}div.notify-close-btn.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{margin-left:auto;margin-bottom:auto;height:24px;width:24px;position:absolute;top:8px;right:8px;justify-content:center;align-items:center}div.notify-close-btn-desktop.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{visibility:hidden;transition:visibility 0.15s linear, opacity 0.15s linear;opacity:0}.notify-close-btn.svelte-ftkynd .close-icon.svelte-ftkynd.svelte-ftkynd{width:20px;margin:auto;color:var(--text-color)}.notify-close-btn.svelte-ftkynd>.close-icon.svelte-ftkynd.svelte-ftkynd{color:var(--notify-onboard-close-icon-color)}.notify-close-btn.svelte-ftkynd:hover>.close-icon.svelte-ftkynd.svelte-ftkynd{color:var(--notify-onboard-close-icon-hover)}.transaction-status.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{color:var(\n --notify-onboard-transaction-status-color,\n var(--onboard-primary-100, var(--primary-100))\n );line-height:14px}.dropdown.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{height:0px;overflow:hidden;transition:height 150ms ease-in-out}.dropdown-visible.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{height:48px}.dropdown-buttons.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{background-color:var(\n --notify-onboard-dropdown-background,\n var(--onboard-gray-700, var(--gray-700))\n );width:100%;padding:8px}.dropdown-button.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{padding:4px 12px;border-radius:var(\n --notify-onboard-dropdown-border-radius,\n var(--onboard-border-radius-5, var(--border-radius-5))\n );background-color:transparent;font-size:var(\n --notify-onboard-dropdown-font-size,\n var(--onboard-font-size-6, var(--font-size-6))\n );color:var(\n --notify-onboard-dropdown-text-color,\n var(--onboard-primary-400, var(--primary-400))\n );transition:all 150ms ease-in-out;cursor:pointer}.dropdown-button.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd:hover{background:var(\n --notify-onboard-dropdown-btn-hover-background,\n rgba(146, 155, 237, 0.2)\n )}")}function D(t){let e,n,i,r,a,l;return{c(){e=(0,o.j)("div"),(n=(0,o.j)("button")).textContent="Cancel",i=(0,o.G)(),(r=(0,o.j)("button")).textContent="Speed-up",(0,o.k)(n,"class","dropdown-button svelte-ftkynd"),(0,o.k)(r,"class","dropdown-button svelte-ftkynd"),(0,o.k)(e,"class","dropdown-buttons flex items-center justify-end svelte-ftkynd")},m(s,d){(0,o.b)(s,e,d),(0,o.m)(e,n),(0,o.m)(e,i),(0,o.m)(e,r),!a&&(l=[(0,o.p)(n,"click",t[9]),(0,o.p)(r,"click",t[10])],a=!0)},p:o.n,d(t){t&&(0,o.d)(e),a=!1,(0,o.L)(l)}}}function N(t){let e,n,i,r,a,l,s,d,c,f,p,v,u,y;i=new g({props:{notification:t[0],chainStyles:o.as[o.ap[t[0].network]]}}),a=new M({props:{notification:t[0]}});let m="txPool"===t[0].eventCode&&D(t);return{c(){e=(0,o.j)("div"),n=(0,o.j)("div"),(0,o.F)(i.$$.fragment),r=(0,o.G)(),(0,o.F)(a.$$.fragment),l=(0,o.G)(),s=(0,o.j)("div"),d=(0,o.j)("div"),c=(0,o.G)(),f=(0,o.j)("div"),m&&m.c(),(0,o.k)(d,"class","flex items-center close-icon svelte-ftkynd"),(0,o.k)(s,"class","notify-close-btn notify-close-btn-"+t[4].type+" pointer flex svelte-ftkynd"),(0,o.k)(n,"class","flex bn-notify-notification-inner svelte-ftkynd"),(0,o.k)(f,"class","dropdown svelte-ftkynd"),(0,o.H)(f,"dropdown-visible",t[2]&&t[5]&&G(t[0].eventCode)&&H(t[0].network)&&R(t[7])),(0,o.k)(e,"class",p="bn-notify-notification bn-notify-notification-"+t[0].type+"} svelte-ftkynd"),(0,o.H)(e,"bn-notify-clickable",t[0].onClick)},m(p,b){(0,o.b)(p,e,b),(0,o.m)(e,n),(0,o.I)(i,n,null),(0,o.m)(n,r),(0,o.I)(a,n,null),(0,o.m)(n,l),(0,o.m)(n,s),(0,o.m)(s,d),d.innerHTML=P,(0,o.m)(e,c),(0,o.m)(e,f),m&&m.m(f,null),v=!0,!u&&(y=[(0,o.p)(s,"click",(0,o.J)(t[8])),(0,o.p)(e,"mouseenter",t[11]),(0,o.p)(e,"mouseleave",t[12]),(0,o.p)(e,"click",t[13])],u=!0)},p(t,[n]){let r={};1&n&&(r.notification=t[0]),1&n&&(r.chainStyles=o.as[o.ap[t[0].network]]),i.$set(r);let l={};1&n&&(l.notification=t[0]),a.$set(l),"txPool"===t[0].eventCode?m?m.p(t,n):((m=D(t)).c(),m.m(f,null)):m&&(m.d(1),m=null),(!v||165&n)&&(0,o.H)(f,"dropdown-visible",t[2]&&t[5]&&G(t[0].eventCode)&&H(t[0].network)&&R(t[7])),(!v||1&n&&p!==(p="bn-notify-notification bn-notify-notification-"+t[0].type+"} svelte-ftkynd"))&&(0,o.k)(e,"class",p),(!v||1&n)&&(0,o.H)(e,"bn-notify-clickable",t[0].onClick)},i(t){!v&&((0,o.x)(i.$$.fragment,t),(0,o.x)(a.$$.fragment,t),v=!0)},o(t){(0,o.A)(i.$$.fragment,t),(0,o.A)(a.$$.fragment,t),v=!1},d(t){t&&(0,o.d)(e),(0,o.K)(i),(0,o.K)(a),m&&m.d(),u=!1,(0,o.L)(y)}}}function O(t,e,n){let r,a,l;(0,o.c)(t,o.w,t=>n(15,r=t)),(0,o.c)(t,i._,t=>n(3,a=t));let{device:s,gas:d}=o.af,{notification:c}=e,{updateParentOnRemove:f}=e,p=!1,v=o.at.getValue().find(({hash:t})=>t===c.id),u=v&&r.find(({accounts:t})=>!!t.find(({address:t})=>t.toLowerCase()===v.from.toLowerCase()));(0,o.al)(()=>{clearTimeout(l)});let y=async()=>{try{await K({type:"cancel",wallet:u,transaction:v})}catch(e){let t=`${v.hash.slice(0,9)}:txReplaceError${v.hash.slice(-5)}`;(0,o.aw)({id:t,type:"hint",eventCode:"txError",message:a("notify.transaction.txReplaceError"),key:t,autoDismiss:4e3})}},m=async()=>{try{await K({type:"speedup",wallet:u,transaction:v})}catch(e){let t=`${v.hash.slice(0,9)}:txReplaceError${v.hash.slice(-5)}`;(0,o.aw)({id:t,type:"hint",eventCode:"txError",message:a("notify.transaction.txReplaceError"),key:t,autoDismiss:4e3})}};return t.$$set=t=>{"notification"in t&&n(0,c=t.notification),"updateParentOnRemove"in t&&n(1,f=t.updateParentOnRemove)},t.$$.update=()=>{1&t.$$.dirty&&c.autoDismiss&&(l=setTimeout(()=>{(0,o.au)(c.id),(0,o.av)(c.id)},c.autoDismiss))},[c,f,p,a,s,d,v,u,()=>{(0,o.au)(c.id),(0,o.av)(c.id),f()},y,m,()=>n(2,p=!0),()=>n(2,p=!1),t=>c.onClick&&c.onClick(t)]}class V extends o.S{constructor(t){super(),(0,o.i)(this,t,O,N,o.s,{notification:0,updateParentOnRemove:1},_)}}function q(t){(0,o.a)(t,"svelte-1h8mmo3","ul.svelte-1h8mmo3{padding-left:0;display:flex;flex-flow:column nowrap;font-size:var(\n --notify-onboard-font-size,\n var(--onboard-font-size-5, var(--font-size-5))\n );list-style-type:none;overflow:visible;scrollbar-width:none;box-sizing:border-box;z-index:var(--notify-onboard-z-index, 300);font-family:var(\n --notify-onboard-font-family,\n var(--onboard-font-family-normal, inherit)\n );margin:8px 0;pointer-events:all}.y-scroll.svelte-1h8mmo3{overflow-y:scroll}.y-visible.svelte-1h8mmo3{overflow-y:visible}li.notification-list-top.svelte-1h8mmo3:not(:first-child){margin-top:8px}li.notification-list-bottom.svelte-1h8mmo3:not(:first-child){margin-bottom:8px}ul.bn-notify-bottomLeft.svelte-1h8mmo3,ul.bn-notify-bottomRight.svelte-1h8mmo3{flex-direction:column-reverse}@media only screen and (max-width: 450px){ul.svelte-1h8mmo3{width:100%}}.bn-notify-clickable:hover{cursor:pointer}.svelte-1h8mmo3::-webkit-scrollbar{display:none}")}function Z(t,e,n){let o=t.slice();return o[12]=e[n],o}function B(t){let e,n,i,r;let a=[],l=new Map,s=t[2],d=t=>t[12].key;for(let e=0;e{f&&(d&&d.end(1),(l=(0,o.V)(n,o.ab,{duration:1200,delay:300,x:e[3],y:e[4],easing:X})).start())}),f=!0)},o(t){(0,o.A)(i.$$.fragment,t),l&&l.invalidate(),d=(0,o.ak)(n,o.X,{duration:300,easing:o.an}),f=!1},d(t){t&&(0,o.d)(n),(0,o.K)(i),t&&d&&d.end(),p=!1,v()}}}function U(t){let e,n;let i=t[2].length&&B(t);return{c(){i&&i.c(),e=(0,o.e)()},m(t,r){i&&i.m(t,r),(0,o.b)(t,e,r),n=!0},p(t,[n]){t[2].length?i?(i.p(t,n),4&n&&(0,o.x)(i,1)):((i=B(t)).c(),(0,o.x)(i,1),i.m(e.parentNode,e)):i&&((0,o.y)(),(0,o.A)(i,1,1,()=>{i=null}),(0,o.z)())},i(t){!n&&((0,o.x)(i),n=!0)},o(t){(0,o.A)(i),n=!1},d(t){i&&i.d(t),t&&(0,o.d)(e)}}}function X(t){return Math.sin(-13*(t+1)*Math.PI/2)*Math.pow(2,-35*t)+1}function Q(t,e,n){let i,l,s;let{device:d}=o.af,c=o.a3.select("accountCenter").pipe((0,r.O)(o.a3.get().accountCenter),(0,a.d)(1));(0,o.c)(t,c,t=>n(6,i=t));let{position:f}=e,{sharedContainer:p}=e,{notifications:v}=e;l=0;let u="y-scroll";let y=(s=null,(t,e)=>{clearTimeout(s),s=setTimeout(t,e)});return t.$$set=t=>{"position"in t&&n(0,f=t.position),"sharedContainer"in t&&n(1,p=t.sharedContainer),"notifications"in t&&n(2,v=t.notifications)},t.$$.update=()=>{1&t.$$.dirty&&(f.includes("top")?n(4,l=-50):n(4,l=50))},[f,p,v,0,l,u,i,d,c,()=>{"y-visible"!==u&&n(5,u="y-visible"),y(function(){n(5,u="y-scroll")},1e3)},function(e){o.ai.call(this,t,e)}]}class W extends o.S{constructor(t){super(),(0,o.i)(this,t,Q,U,o.s,{position:0,sharedContainer:1,notifications:2},q)}}}}]); \ No newline at end of file diff --git a/gateway/dist/1234.45819a346281db80fbd9.bundle.js b/gateway/dist/1234.45819a346281db80fbd9.bundle.js deleted file mode 100644 index c0c3216c..00000000 --- a/gateway/dist/1234.45819a346281db80fbd9.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([[1234],{31234:(e,i,r)=>{r.r(i),r.d(i,{default:()=>n});const 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\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\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\n\n\n'}}]); \ No newline at end of file diff --git a/gateway/dist/1245.818b9bb5b7de48a35dfc.bundle.js b/gateway/dist/1245.818b9bb5b7de48a35dfc.bundle.js new file mode 100644 index 00000000..64021a75 --- /dev/null +++ b/gateway/dist/1245.818b9bb5b7de48a35dfc.bundle.js @@ -0,0 +1,38 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["1245"],{78591:function(e,n,t){t.r(n),t.d(n,{default:()=>e1});var r=t("26633"),o=t("94975"),a=t("28395"),i=function(e){function n(n,t){return e.call(this)||this}return(0,a.ZT)(n,e),n.prototype.schedule=function(e,n){return void 0===n&&(n=0),this},n}(t("7435").w0),l={setInterval:function(e,n){for(var t=[],r=2;r + + +`;function G(e){(0,r.a)(e,"svelte-1uqued6","select.svelte-1uqued6{border:none;background-image:none;background-color:transparent;-webkit-appearance:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;appearance:none;font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));transition:width 250ms ease-in-out;background-repeat:no-repeat, repeat;background-position:right 0px top 0px, 0 0;scrollbar-width:none;-ms-overflow-style:none;padding:0 14px 0 0;white-space:nowrap;text-overflow:ellipsis}select.minimized_ac.svelte-1uqued6{min-width:80px;max-width:80px}select.maximized_ac.svelte-1uqued6{width:auto !important}select.svelte-1uqued6:focus{outline:none}span.switching-placeholder.svelte-1uqued6{font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));min-width:80px;max-width:80px;padding:0 8px 0 4px}")}function T(e,n,t){let r=e.slice();return r[15]=n[t],r}function I(e){let n;function t(e,n){return e[7]?F:_}let o=t(e),a=o(e);return{c(){a.c(),n=(0,r.e)()},m(e,t){a.m(e,t),(0,r.b)(e,n,t)},p(e,r){o===(o=t(e))&&a?a.p(e,r):(a.d(1),(a=o(e))&&(a.c(),a.m(n.parentNode,n)))},d(e){a.d(e),e&&(0,r.d)(n)}}}function _(e){let n,t,o,a,i,l,c;let s=!(0,r.h)(e[6].chains[0],e[2]),d=[],u=new Map,m=s&&H(e),p=e[2],v=e=>e[15].id;for(let n=0;nt(12,s=e));let{selectIcon:g=z}=n,{colorVar:h}=n,{chains:b}=n,{bold:j=!1}=n,{parentCSSId:A=""}=n,G=new x.X(!1);(0,r.c)(e,G,e=>t(7,d=e));let T=(function(){for(var e=[],n=0;n"boolean"!=typeof e&&"boolean"!=typeof n&&e[0]&&n[0]&&e[0].chains[0].id===n[0].chains[0].id));async function I(){let e=u.selectedOptions[0].value;e!==l.chains[0].id&&(G.next(!0),await (0,r.f)({chainId:e,chainNamespace:"evm",wallet:l.label}),G.next(!1))}return(0,r.c)(e,T,e=>t(11,c=e)),e.$$set=e=>{"selectIcon"in e&&t(0,g=e.selectIcon),"colorVar"in e&&t(1,h=e.colorVar),"chains"in e&&t(2,b=e.chains),"bold"in e&&t(3,j=e.bold),"parentCSSId"in e&&t(4,A=e.parentCSSId)},e.$$.update=()=>{4096&e.$$.dirty&&t(6,[l]=s,l),2048&e.$$.dirty&&c&&!function(){if(!u)return;let e=document.createElement("option");e.textContent=u.selectedOptions[0].textContent;let n=document.createElement("select");n.style.visibility="hidden",n.style.position="fixed",n.appendChild(e),u.after(n),t(5,u.style.width=`${n.clientWidth-22}px`,u),n.remove()}()},[g,h,b,j,A,u,l,d,G,T,I,c,s,function(e){r.g[e?"unshift":"push"](()=>{t(5,u=e),t(2,b),t(6,l),t(12,s)})}]}class q extends r.S{constructor(e){super(),(0,r.i)(this,e,P,L,r.s,{selectIcon:0,colorVar:1,chains:2,bold:3,parentCSSId:4},G)}}var V=` + + + +`;function D(e){(0,r.a)(e,"svelte-hb2n95",".container.svelte-hb2n95.svelte-hb2n95{display:flex;align-items:center;gap:0.5rem;cursor:pointer;position:relative;z-index:0;width:100%;padding:0.25rem;margin-bottom:0.25rem;border-radius:12px;transition:background-color 150ms ease-in-out}.container.svelte-hb2n95.svelte-hb2n95::before{content:'';display:block;position:absolute;top:0;bottom:0;left:0;right:0;height:100%;width:100%;background:var(--action-color);border-radius:12px;z-index:-1;opacity:0}.container.svelte-hb2n95.svelte-hb2n95:hover::before{opacity:0.2}.container.svelte-hb2n95:hover .balance.svelte-hb2n95,.container.svelte-hb2n95:hover .elipsis-container.svelte-hb2n95{opacity:1}.container.svelte-hb2n95:hover .balance.svelte-hb2n95{color:var(--account-center-maximized-balance-color, inherit)}.container.primary.svelte-hb2n95.svelte-hb2n95:hover{background-color:var(\n --account-center-maximized-account-section-background-hover\n )}.account-details.svelte-hb2n95.svelte-hb2n95{flex:1 1;display:flex;gap:inherit;overflow:hidden}.address-domain.svelte-hb2n95.svelte-hb2n95{flex:1 0 auto;max-width:70%;white-space:nowrap;font-weight:600;color:var(--account-center-maximized-address-color, inherit);overflow:scroll;scrollbar-width:none;-ms-overflow-style:none}.address-domain.svelte-hb2n95.svelte-hb2n95::-webkit-scrollbar{display:none}.balance.svelte-hb2n95.svelte-hb2n95{flex:1 1 auto;max-width:70%;white-space:nowrap;text-align:end;opacity:0.4;transition:color 150ms ease-in-out, background-color 150ms ease-in-out;overflow:scroll;scrollbar-width:none;-ms-overflow-style:none}.balance.svelte-hb2n95.svelte-hb2n95::-webkit-scrollbar{display:none}.elipsis-container.svelte-hb2n95.svelte-hb2n95{flex:0;padding:0.25rem;border-radius:24px;transition:color 150ms ease-in-out, background-color 150ms ease-in-out;background-color:transparent;opacity:0.4}.elipsis-container.svelte-hb2n95.svelte-hb2n95:hover{color:var(--text-color)}.elipsis-container.active.svelte-hb2n95.svelte-hb2n95{color:var(--text-color)}.elipsis.svelte-hb2n95.svelte-hb2n95{width:24px}.menu.svelte-hb2n95.svelte-hb2n95{background:var(--onboard-white, var(--white));border:1px solid var(--onboard-gray-100, var(--gray-100));border-radius:8px;list-style-type:none;right:0.25rem;top:2.25rem;margin:0;padding:0;border:none;overflow:hidden;z-index:1}.menu.svelte-hb2n95 li.svelte-hb2n95{color:var(--onboard-primary-500, var(--primary-500));font-size:var(--onboard-font-size-5, var(--font-size-5));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));padding:12px 16px;background:var(--onboard-white, var(--white));transition:background-color 150ms ease-in-out;cursor:pointer}.menu.svelte-hb2n95 li.svelte-hb2n95:hover{background:var(--onboard-primary-200, var(--primary-200))}")}function S(e,n,t){let r=e.slice();return r[14]=n[t].address,r[15]=n[t].ens,r[16]=n[t].uns,r[17]=n[t].balance,r[19]=t,r}function Z(e){let n,t,o;return t=new r.R({props:{size:14}}),{c(){n=(0,r.j)("div"),(0,r.F)(t.$$.fragment),(0,r.T)(n,"right","-5px"),(0,r.T)(n,"bottom","-5px"),(0,r.k)(n,"class","drop-shadow absolute")},m(e,a){(0,r.b)(e,n,a),(0,r.I)(t,n,null),o=!0},i(e){!o&&((0,r.x)(t.$$.fragment,e),o=!0)},o(e){(0,r.A)(t.$$.fragment,e),o=!1},d(e){e&&(0,r.d)(n),(0,r.K)(t)}}}function E(e){let n,t,o;let a=O(e[17])+"";return{c(){n=(0,r.j)("div"),t=(0,r.t)(a),(0,r.k)(n,"class","balance svelte-hb2n95")},m(e,o){(0,r.b)(e,n,o),(0,r.m)(n,t)},p(e,n){1&n&&a!==(a=O(e[17])+"")&&(0,r.v)(t,a)},i(e){e&&!o&&(0,r.U)(()=>{(o=(0,r.V)(n,r.X,{})).start()})},o:r.n,d(e){e&&(0,r.d)(n)}}}function K(e){let n,t,o,a,i,l,c,s,d,u,m,p,v;let f=e[4]("accountCenter.addAccount",{default:e[2].accountCenter.addAccount})+"",g=e[4]("accountCenter.disconnectWallet",{default:e[2].accountCenter.disconnectWallet})+"",h=e[2].accountCenter.copyAddress+"",b=!(e[1]&&0===e[19])&&B(e);function x(){return e[13](e[15],e[16],e[14])}return{c(){n=(0,r.j)("ul"),t=(0,r.j)("li"),o=(0,r.t)(f),a=(0,r.G)(),b&&b.c(),i=(0,r.G)(),l=(0,r.j)("li"),c=(0,r.t)(g),s=(0,r.G)(),d=(0,r.j)("li"),u=(0,r.t)(h),(0,r.k)(t,"class","svelte-hb2n95"),(0,r.k)(l,"class","svelte-hb2n95"),(0,r.k)(d,"class","svelte-hb2n95"),(0,r.k)(n,"class","menu absolute svelte-hb2n95")},m(m,f){(0,r.b)(m,n,f),(0,r.m)(n,t),(0,r.m)(t,o),(0,r.m)(n,a),b&&b.m(n,null),(0,r.m)(n,i),(0,r.m)(n,l),(0,r.m)(l,c),(0,r.m)(n,s),(0,r.m)(n,d),(0,r.m)(d,u),!p&&(v=[(0,r.p)(t,"click",(0,r.J)(e[10])),(0,r.p)(l,"click",(0,r.J)(e[12])),(0,r.p)(d,"click",(0,r.J)(x))],p=!0)},p(t,a){e=t,20&a&&f!==(f=e[4]("accountCenter.addAccount",{default:e[2].accountCenter.addAccount})+"")&&(0,r.v)(o,f),e[1]&&0===e[19]?b&&(b.d(1),b=null):b?b.p(e,a):((b=B(e)).c(),b.m(n,i)),20&a&&g!==(g=e[4]("accountCenter.disconnectWallet",{default:e[2].accountCenter.disconnectWallet})+"")&&(0,r.v)(c,g),4&a&&h!==(h=e[2].accountCenter.copyAddress+"")&&(0,r.v)(u,h)},i(e){e&&!m&&(0,r.U)(()=>{(m=(0,r.V)(n,r.X,{})).start()})},o:r.n,d(e){e&&(0,r.d)(n),b&&b.d(),p=!1,(0,r.L)(v)}}}function B(e){let n,t,o,a;let i=e[4]("accountCenter.setPrimaryAccount",{default:e[2].accountCenter.setPrimaryAccount})+"";function l(){return e[11](e[14])}return{c(){n=(0,r.j)("li"),t=(0,r.t)(i),(0,r.k)(n,"class","svelte-hb2n95")},m(e,i){(0,r.b)(e,n,i),(0,r.m)(n,t),!o&&(a=(0,r.p)(n,"click",(0,r.J)(l)),o=!0)},p(n,o){e=n,20&o&&i!==(i=e[4]("accountCenter.setPrimaryAccount",{default:e[2].accountCenter.setPrimaryAccount})+"")&&(0,r.v)(t,i)},d(e){e&&(0,r.d)(n),o=!1,a()}}}function W(e){let n,t,o,a,i,l,c,s,d,u,m,p,v,f,g,h,b,x;let w=(e[15]?(0,r.D)(e[15].name):e[16]?(0,r.D)(e[16].name):(0,r.E)(e[14]))+"";a=new r.W({props:{size:32,padding:4,background:"custom",color:"#EFF1FC",customBackgroundColor:e[1]&&0===e[19]?"rgba(24, 206, 102, 0.2)":"rgba(235, 235, 237, 0.1)",border:e[1]&&0===e[19]?"green":"gray",radius:8,icon:e[0].icon}});let y=e[1]&&0===e[19]&&Z(),k=e[17]&&E(e);function $(){return e[8](e[14])}function C(){return e[9](e[14])}let j=e[3]===e[14]&&K(e);return{c(){n=(0,r.j)("div"),t=(0,r.j)("div"),o=(0,r.j)("div"),(0,r.F)(a.$$.fragment),i=(0,r.G)(),y&&y.c(),l=(0,r.G)(),c=(0,r.j)("div"),s=(0,r.j)("div"),d=(0,r.t)(w),u=(0,r.G)(),k&&k.c(),m=(0,r.G)(),p=(0,r.j)("div"),v=(0,r.j)("div"),f=(0,r.G)(),j&&j.c(),g=(0,r.G)(),(0,r.k)(o,"class","flex items-center relative"),(0,r.k)(s,"class","address-domain svelte-hb2n95"),(0,r.k)(c,"class","account-details svelte-hb2n95"),(0,r.k)(v,"class","elipsis pointer flex items-center justify-center relative svelte-hb2n95"),(0,r.k)(p,"class","elipsis-container svelte-hb2n95"),(0,r.H)(p,"active",e[3]===e[14]),(0,r.k)(t,"class","container svelte-hb2n95"),(0,r.H)(t,"primary",e[1]&&0===e[19]),(0,r.k)(n,"class","relative")},m(e,w){(0,r.b)(e,n,w),(0,r.m)(n,t),(0,r.m)(t,o),(0,r.I)(a,o,null),(0,r.m)(o,i),y&&y.m(o,null),(0,r.m)(t,l),(0,r.m)(t,c),(0,r.m)(c,s),(0,r.m)(s,d),(0,r.m)(c,u),k&&k.m(c,null),(0,r.m)(t,m),(0,r.m)(t,p),(0,r.m)(p,v),v.innerHTML=V,(0,r.m)(n,f),j&&j.m(n,null),(0,r.m)(n,g),h=!0,!b&&(x=[(0,r.p)(v,"click",(0,r.J)($)),(0,r.p)(t,"click",C)],b=!0)},p(i,l){e=i;let s={};2&l&&(s.customBackgroundColor=e[1]&&0===e[19]?"rgba(24, 206, 102, 0.2)":"rgba(235, 235, 237, 0.1)"),2&l&&(s.border=e[1]&&0===e[19]?"green":"gray"),1&l&&(s.icon=e[0].icon),a.$set(s),e[1]&&0===e[19]?y?2&l&&(0,r.x)(y,1):((y=Z()).c(),(0,r.x)(y,1),y.m(o,null)):y&&((0,r.y)(),(0,r.A)(y,1,1,()=>{y=null}),(0,r.z)()),(!h||1&l)&&w!==(w=(e[15]?(0,r.D)(e[15].name):e[16]?(0,r.D)(e[16].name):(0,r.E)(e[14]))+"")&&(0,r.v)(d,w),e[17]?k?(k.p(e,l),1&l&&(0,r.x)(k,1)):((k=E(e)).c(),(0,r.x)(k,1),k.m(c,null)):k&&(k.d(1),k=null),(!h||9&l)&&(0,r.H)(p,"active",e[3]===e[14]),(!h||2&l)&&(0,r.H)(t,"primary",e[1]&&0===e[19]),e[3]===e[14]?j?(j.p(e,l),9&l&&(0,r.x)(j,1)):((j=K(e)).c(),(0,r.x)(j,1),j.m(n,g)):j&&(j.d(1),j=null)},i(e){!h&&((0,r.x)(a.$$.fragment,e),(0,r.x)(y),(0,r.x)(k),(0,r.x)(j),h=!0)},o(e){(0,r.A)(a.$$.fragment,e),(0,r.A)(y),h=!1},d(e){e&&(0,r.d)(n),(0,r.K)(a),y&&y.d(),k&&k.d(),j&&j.d(),b=!1,(0,r.L)(x)}}}function N(e){let n,t;let o=e[0].accounts,a=[];for(let n=0;n(0,r.A)(a[e],1,1,()=>{a[e]=null});return{c(){for(let e=0;e7?e[n].slice(0,7):e[n]} ${n}`}function R(e,n,t){let o;(0,r.c)(e,b._,e=>t(4,o=e));let{wallet:a}=n,{primary:i}=n;function l(){t(3,c="")}let c="";async function s(e){try{await (0,r.M)(e.provider)}catch(t){let{code:n}=t;(n===j.ProviderRpcErrorCode.UNSUPPORTED_METHOD||n===j.ProviderRpcErrorCode.DOES_NOT_EXIST)&&r.N.next({inProgress:!1,actionRequired:e.label})}}function d(){t(2,r.C.accountCenter.copyAddress="Copied Successfully",r.C),setTimeout(l,500),setTimeout(()=>{t(2,r.C.accountCenter.copyAddress="Copy Wallet address",r.C)},700)}return e.$$set=e=>{"wallet"in e&&t(0,a=e.wallet),"primary"in e&&t(1,i=e.primary)},[a,i,r.C,c,o,s,d,l,e=>t(3,c=c===e?"":e),e=>(0,r.O)(a,e),()=>{t(3,c=""),s(a)},e=>{t(3,c=""),(0,r.O)(a,e)},()=>{t(3,c=""),(0,r.P)({label:a.label})},(e,n,t)=>{(0,r.Q)(e?e.name:n?n.name:t).then(()=>{d()})}]}class U extends r.S{constructor(e){super(),(0,r.i)(this,e,R,N,r.s,{wallet:0,primary:1,hideMenu:7},D)}get hideMenu(){return this.$$.ctx[7]}}var J=` + + + +`,X=` + + + +`,Y=` + + +`;function Q(e){(0,r.a)(e,"svelte-1ubxcdp",".content.svelte-1ubxcdp{padding:1rem;width:300px;font-family:var(--onboard-font-family-normal, var(--font-family-normal));font-size:var(--onboard-font-size-5, var(--font-size-5));line-height:24px}.icon-container.svelte-1ubxcdp{width:3rem;height:3rem;background:var(--onboard-warning-100, var(--warning-100));border-radius:24px;padding:12px;color:var(--onboard-warning-500, var(--warning-500))}h4.svelte-1ubxcdp{margin:1.5rem 0 0.5rem 0;font-weight:600}p.svelte-1ubxcdp{margin:0;font-weight:400}button.svelte-1ubxcdp{margin-top:1.5rem;width:50%;font-weight:600}.right.svelte-1ubxcdp{margin-left:0.5rem;width:60%}")}function ee(e){let n,t,o,a,i,l,c,s,d,u,m,p,v,f,g,h,b;let x=e[2]("modals.confirmDisconnectAll.heading",{default:r.C.modals.confirmDisconnectAll.heading})+"",w=e[2]("modals.confirmDisconnectAll.description")+"",y=e[2]("modals.confirmDisconnectAll.cancel",{default:r.C.modals.confirmDisconnectAll.cancel})+"",k=e[2]("modals.confirmDisconnectAll.confirm",{default:r.C.modals.confirmDisconnectAll.confirm})+"";return{c(){n=(0,r.j)("div"),t=(0,r.j)("div"),o=(0,r.G)(),a=(0,r.j)("h4"),i=(0,r.t)(x),l=(0,r.G)(),c=(0,r.j)("p"),s=(0,r.t)(w),d=(0,r.G)(),u=(0,r.j)("div"),m=(0,r.j)("button"),p=(0,r.t)(y),v=(0,r.G)(),f=(0,r.j)("button"),g=(0,r.t)(k),(0,r.k)(t,"class","icon-container flex justify-center items-center svelte-1ubxcdp"),(0,r.k)(a,"class","svelte-1ubxcdp"),(0,r.k)(c,"class","svelte-1ubxcdp"),(0,r.k)(m,"class","button-neutral-solid-b rounded svelte-1ubxcdp"),(0,r.k)(f,"class","right button-neutral-solid rounded svelte-1ubxcdp"),(0,r.k)(u,"class","flex justify-between items-center w-100"),(0,r.k)(n,"class","content svelte-1ubxcdp")},m(x,w){(0,r.b)(x,n,w),(0,r.m)(n,t),t.innerHTML=A,(0,r.m)(n,o),(0,r.m)(n,a),(0,r.m)(a,i),(0,r.m)(n,l),(0,r.m)(n,c),(0,r.m)(c,s),(0,r.m)(n,d),(0,r.m)(n,u),(0,r.m)(u,m),(0,r.m)(m,p),(0,r.m)(u,v),(0,r.m)(u,f),(0,r.m)(f,g),!h&&(b=[(0,r.p)(m,"click",function(){(0,r.Z)(e[1])&&e[1].apply(this,arguments)}),(0,r.p)(f,"click",function(){(0,r.Z)(e[0])&&e[0].apply(this,arguments)})],h=!0)},p(n,t){e=n,4&t&&x!==(x=e[2]("modals.confirmDisconnectAll.heading",{default:r.C.modals.confirmDisconnectAll.heading})+"")&&(0,r.v)(i,x),4&t&&w!==(w=e[2]("modals.confirmDisconnectAll.description")+"")&&(0,r.v)(s,w),4&t&&y!==(y=e[2]("modals.confirmDisconnectAll.cancel",{default:r.C.modals.confirmDisconnectAll.cancel})+"")&&(0,r.v)(p,y),4&t&&k!==(k=e[2]("modals.confirmDisconnectAll.confirm",{default:r.C.modals.confirmDisconnectAll.confirm})+"")&&(0,r.v)(g,k)},d(e){e&&(0,r.d)(n),h=!1,(0,r.L)(b)}}}function en(e){let n,t;return n=new r.Y({props:{close:e[1],$$slots:{default:[ee]},$$scope:{ctx:e}}}),{c(){(0,r.F)(n.$$.fragment)},m(e,o){(0,r.I)(n,e,o),t=!0},p(e,[t]){let r={};2&t&&(r.close=e[1]),15&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){!t&&((0,r.x)(n.$$.fragment,e),t=!0)},o(e){(0,r.A)(n.$$.fragment,e),t=!1},d(e){(0,r.K)(n,e)}}}function et(e,n,t){let o;(0,r.c)(e,b._,e=>t(2,o=e));let{onConfirm:a}=n,{onClose:i}=n;return e.$$set=e=>{"onConfirm"in e&&t(0,a=e.onConfirm),"onClose"in e&&t(1,i=e.onClose)},[a,i,o]}class er extends r.S{constructor(e){super(),(0,r.i)(this,e,et,en,r.s,{onConfirm:0,onClose:1},Q)}}function eo(e){(0,r.a)(e,"svelte-ruodf3",".content.svelte-ruodf3{--background-color:var(--w3o-background-color);--text-color:var(--w3o-text-color);--action-color:var(--w3o-action-color, var(--primary-500));font-size:1rem;line-height:1.5rem;display:flex;flex-flow:column;gap:1.5rem;padding:1rem;max-width:320px;background:var(--background-color);color:var(--text-color)}.icon-container.svelte-ruodf3{position:relative;overflow:hidden;width:3rem;height:3rem;border-radius:24px;padding:0.75rem;background:none}.icon-container.svelte-ruodf3::before{content:'';position:absolute;height:100%;width:100%;opacity:0.2;background:var(--action-color)}.text-container.svelte-ruodf3{display:flex;flex-flow:column;gap:0.5rem;padding:0 0.5rem}.actions-container.svelte-ruodf3{display:flex;flex-flow:row nowrap;gap:1rem}.heading.svelte-ruodf3{font-weight:600}button.svelte-ruodf3{font-weight:600}button.primary.svelte-ruodf3{background:var(--action-color)}")}function ea(e){let n,t,o,a,i,l,c,s,d,u,m,p,v,f,g,h,b,x,w,y,k;let $=e[3]("modals.confirmTransactionProtection.heading",{default:r.C.modals.confirmTransactionProtection.heading})+"",C=e[3]("modals.confirmTransactionProtection.description")+"",j=e[3]("modals.confirmTransactionProtection.link",{default:r.C.modals.confirmTransactionProtection.link})+"",z=e[3]("modals.confirmTransactionProtection.dismiss",{default:r.C.modals.confirmTransactionProtection.dismiss})+"",A=e[3]("modals.confirmTransactionProtection.enable",{default:r.C.modals.confirmTransactionProtection.enable})+"";return{c(){n=(0,r.j)("div"),t=(0,r.j)("div"),o=(0,r.G)(),a=(0,r.j)("div"),i=(0,r.j)("div"),l=(0,r.t)($),c=(0,r.G)(),s=(0,r.j)("div"),d=(0,r.t)(C),u=(0,r.G)(),m=(0,r.j)("a"),p=(0,r.t)(j),v=(0,r.G)(),f=(0,r.j)("div"),g=(0,r.j)("button"),h=(0,r.t)(z),b=(0,r.G)(),x=(0,r.j)("button"),w=(0,r.t)(A),(0,r.k)(t,"class","icon-container flex justify-center items-center svelte-ruodf3"),(0,r.k)(i,"class","heading svelte-ruodf3"),(0,r.k)(m,"href",e[2]),(0,r.k)(m,"target","_blank"),(0,r.k)(m,"rel","noreferrer noopener"),(0,r.k)(m,"class","no-link"),(0,r.k)(a,"class","text-container svelte-ruodf3"),(0,r.k)(g,"class","button-neutral-solid-b svelte-ruodf3"),(0,r.k)(x,"class","button-neutral-solid rounded primary svelte-ruodf3"),(0,r.k)(f,"class","actions-container svelte-ruodf3"),(0,r.k)(n,"class","content svelte-ruodf3")},m($,C){(0,r.b)($,n,C),(0,r.m)(n,t),t.innerHTML=Y,(0,r.m)(n,o),(0,r.m)(n,a),(0,r.m)(a,i),(0,r.m)(i,l),(0,r.m)(a,c),(0,r.m)(a,s),(0,r.m)(s,d),(0,r.m)(a,u),(0,r.m)(a,m),(0,r.m)(m,p),(0,r.m)(n,v),(0,r.m)(n,f),(0,r.m)(f,g),(0,r.m)(g,h),(0,r.m)(f,b),(0,r.m)(f,x),(0,r.m)(x,w),!y&&(k=[(0,r.p)(g,"click",function(){(0,r.Z)(e[1])&&e[1].apply(this,arguments)}),(0,r.p)(x,"click",function(){(0,r.Z)(e[0])&&e[0].apply(this,arguments)})],y=!0)},p(n,t){e=n,8&t&&$!==($=e[3]("modals.confirmTransactionProtection.heading",{default:r.C.modals.confirmTransactionProtection.heading})+"")&&(0,r.v)(l,$),8&t&&C!==(C=e[3]("modals.confirmTransactionProtection.description")+"")&&(0,r.v)(d,C),8&t&&j!==(j=e[3]("modals.confirmTransactionProtection.link",{default:r.C.modals.confirmTransactionProtection.link})+"")&&(0,r.v)(p,j),4&t&&(0,r.k)(m,"href",e[2]),8&t&&z!==(z=e[3]("modals.confirmTransactionProtection.dismiss",{default:r.C.modals.confirmTransactionProtection.dismiss})+"")&&(0,r.v)(h,z),8&t&&A!==(A=e[3]("modals.confirmTransactionProtection.enable",{default:r.C.modals.confirmTransactionProtection.enable})+"")&&(0,r.v)(w,A)},d(e){e&&(0,r.d)(n),y=!1,(0,r.L)(k)}}}function ei(e){let n,t;return n=new r.Y({props:{close:e[1],$$slots:{default:[ea]},$$scope:{ctx:e}}}),{c(){(0,r.F)(n.$$.fragment)},m(e,o){(0,r.I)(n,e,o),t=!0},p(e,[t]){let r={};2&t&&(r.close=e[1]),31&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){!t&&((0,r.x)(n.$$.fragment,e),t=!0)},o(e){(0,r.A)(n.$$.fragment,e),t=!1},d(e){(0,r.K)(n,e)}}}function el(e,n,t){let o;(0,r.c)(e,b._,e=>t(3,o=e));let{onEnable:a}=n,{onDismiss:i}=n,{infoLink:l}=n;return e.$$set=e=>{"onEnable"in e&&t(0,a=e.onEnable),"onDismiss"in e&&t(1,i=e.onDismiss),"infoLink"in e&&t(2,l=e.infoLink)},[a,i,l,o]}class ec extends r.S{constructor(e){super(),(0,r.i)(this,e,el,ei,r.s,{onEnable:0,onDismiss:1,infoLink:2},eo)}}function es(e){(0,r.a)(e,"svelte-b848yl",".secondary-token-container.svelte-b848yl.svelte-b848yl{width:100%}table.svelte-b848yl.svelte-b848yl{width:100%}tr.svelte-b848yl.svelte-b848yl{padding:0.25rem 1rem;line-height:1rem;border-bottom:1px solid var(--border-color);display:flex;flex-direction:row;align-items:flex-start;gap:1rem}thead.svelte-b848yl .secondary-token-table-header.svelte-b848yl{text-align:inherit;font-size:var(--onboard-font-size-7, var(--font-size-7))}.token-icon.svelte-b848yl.svelte-b848yl{width:30%;font-weight:700;font-size:var(--onboard-font-size-6, var(--font-size-6));color:var(--text-color)}.icon-name-container.svelte-b848yl.svelte-b848yl{display:flex;flex-direction:row;align-items:flex-start;padding:0px;gap:0.5rem}.icon.svelte-b848yl.svelte-b848yl{width:1rem;height:1rem}img.svelte-b848yl.svelte-b848yl{height:100%;width:100%}.token-balance.svelte-b848yl.svelte-b848yl{width:70%;font-weight:200;font-size:var(--onboard-font-size-6, var(--font-size-6));color:var(--text-color)}")}function ed(e,n,t){let r=e.slice();return r[1]=n[t],r}function eu(e){let n,t,o,a,i,l,c,s,d;let u=e[1].name.toUpperCase()+"",m=(e[1].balance.length>7?e[1].balance.slice(0,7):e[1].balance)+"";function p(e,n){return e[1].icon?ep:em}let v=p(e),f=v(e);return{c(){n=(0,r.j)("tr"),t=(0,r.j)("td"),o=(0,r.j)("div"),f.c(),a=(0,r.G)(),i=(0,r.t)(u),l=(0,r.G)(),c=(0,r.j)("td"),s=(0,r.t)(m),d=(0,r.G)(),(0,r.k)(o,"class","icon-name-container svelte-b848yl"),(0,r.k)(t,"class","token-icon svelte-b848yl"),(0,r.k)(c,"class","token-balance svelte-b848yl"),(0,r.k)(n,"class","token-row svelte-b848yl")},m(e,u){(0,r.b)(e,n,u),(0,r.m)(n,t),(0,r.m)(t,o),f.m(o,null),(0,r.m)(o,a),(0,r.m)(o,i),(0,r.m)(n,l),(0,r.m)(n,c),(0,r.m)(c,s),(0,r.m)(n,d)},p(e,n){v===(v=p(e))&&f?f.p(e,n):(f.d(1),(f=v(e))&&(f.c(),f.m(o,a))),1&n&&u!==(u=e[1].name.toUpperCase()+"")&&(0,r.v)(i,u),1&n&&m!==(m=(e[1].balance.length>7?e[1].balance.slice(0,7):e[1].balance)+"")&&(0,r.v)(s,m)},d(e){e&&(0,r.d)(n),f.d()}}}function em(e){let n;return{c(){n=(0,r.j)("div"),(0,r.k)(n,"class","icon svelte-b848yl")},m(e,t){(0,r.b)(e,n,t)},p:r.n,d(e){e&&(0,r.d)(n)}}}function ep(e){let n,t;let o={ctx:e,current:null,token:null,hasCatch:!1,pending:eb,then:ef,catch:ev,value:4};return(0,r._)(t=e[1].icon,o),{c(){n=(0,r.e)(),o.block.c()},m(e,t){(0,r.b)(e,n,t),o.block.m(e,o.anchor=t),o.mount=()=>n.parentNode,o.anchor=n},p(n,a){e=n,o.ctx=e,1&a&&t!==(t=e[1].icon)&&(0,r._)(t,o)||(0,r.$)(o,e,a)},d(e){e&&(0,r.d)(n),o.block.d(e),o.token=null,o=null}}}function ev(e){return{c:r.n,m:r.n,p:r.n,i:r.n,o:r.n,d:r.n}}function ef(e){let n,t,o;function a(e,n){return(1&n&&(t=null),null==t&&(t=!!(0,r.a0)(e[4])),t)?eh:eg}let i=a(e,-1),l=i(e);return{c(){n=(0,r.j)("div"),l.c(),(0,r.k)(n,"class","icon svelte-b848yl")},m(e,t){(0,r.b)(e,n,t),l.m(n,null)},p(e,t){i===(i=a(e,t))&&l?l.p(e,t):(l.d(1),(l=i(e))&&(l.c(),l.m(n,null)))},i(e){e&&!o&&(0,r.U)(()=>{(o=(0,r.V)(n,r.X,{})).start()})},o:r.n,d(e){e&&(0,r.d)(n),l.d()}}}function eg(e){let n,t;return{c(){n=(0,r.j)("img"),!(0,r.a1)(n.src,t=e[4])&&(0,r.k)(n,"src",t),(0,r.k)(n,"alt","logo"),(0,r.k)(n,"class","svelte-b848yl")},m(e,t){(0,r.b)(e,n,t)},p(e,o){1&o&&!(0,r.a1)(n.src,t=e[4])&&(0,r.k)(n,"src",t)},d(e){e&&(0,r.d)(n)}}}function eh(e){let n,t;let o=e[4]+"";return{c(){n=new r.a2(!1),t=(0,r.e)(),n.a=t},m(e,a){n.m(o,e,a),(0,r.b)(e,t,a)},p(e,t){1&t&&o!==(o=e[4]+"")&&n.p(o)},d(e){e&&(0,r.d)(t),e&&n.d()}}}function eb(e){return{c:r.n,m:r.n,p:r.n,i:r.n,o:r.n,d:r.n}}function ex(e){let n;let t=e[1]&&e[1].name&&e[1].balance&&eu(e);return{c(){t&&t.c(),n=(0,r.e)()},m(e,o){t&&t.m(e,o),(0,r.b)(e,n,o)},p(e,r){e[1]&&e[1].name&&e[1].balance?t?t.p(e,r):((t=eu(e)).c(),t.m(n.parentNode,n)):t&&(t.d(1),t=null)},d(e){t&&t.d(e),e&&(0,r.d)(n)}}}function ew(e){let n,t,o,a,i;let l=e[0],c=[];for(let n=0;nToken Balances:',a=(0,r.G)(),i=(0,r.j)("tbody");for(let e=0;e{"secondaryTokens"in e&&t(0,r=e.secondaryTokens)},[r]}class ek extends r.S{constructor(e){super(),(0,r.i)(this,e,ey,ew,r.s,{secondaryTokens:0},es)}}function e$(e){(0,r.a)(e,"svelte-177u10y",".outer-container.svelte-177u10y{--background-color:var(--w3o-background-color);--text-color:var(--w3o-text-color);--border-color:var(--w3o-border-color, var(--gray-500));--action-color:var(--w3o-action-color, var(--primary-500));--border-radius:var(--w3o-border-radius, 1rem);--account-center-network-selector-color:var(--text-color, white);width:100%;overflow:hidden;pointer-events:auto;border:1px solid transparent;background:var(\n --account-center-maximized-upper-background,\n var(--background-color)\n );border-color:var(--border-color);border-radius:var(--account-center-border-radius, var(--border-radius))}.wallets-section.svelte-177u10y{width:100%;color:var(--text-color, var(--gray-100));background:var(--background-color, var(--gray-700))}.p5.svelte-177u10y{padding:var(--onboard-spacing-5, var(--spacing-5))}.wallets.svelte-177u10y{width:100%;margin-bottom:0.5rem}.actions.svelte-177u10y{color:var(\n --account-center-maximized-upper-action-color,\n var(--action-color)\n );padding-left:2px}.action-container.svelte-177u10y{padding:0.25rem 12px 0.25rem 0.5rem;border-radius:0.5rem;transition:background-color 150ms ease-in-out}.action-container.svelte-177u10y:hover{background-color:var(\n --account-center-maximized-upper-action-background-hover,\n rgba(146, 155, 237, 0.2)\n )}.plus-icon.svelte-177u10y{width:20px}.arrow-forward.svelte-177u10y{width:20px}.mt.svelte-177u10y{margin-top:0.25rem}.action-text.svelte-177u10y{font-size:var(--onboard-font-size-6, var(--font-size-6));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));margin-left:0.5rem}.background-blue.svelte-177u10y{background:var(\n --account-center-maximized-network-section-background,\n var(--onboard-primary-100, var(--primary-100))\n )}.background-gray.svelte-177u10y{background:var(--onboard-gray-100, var(--gray-100))}.background-yellow.svelte-177u10y{background:var(--onboard-warning-100, var(--warning-100))}.network-container.svelte-177u10y{background:var(--background-color);border-top:1px solid var(--border-color);width:100%;display:flex;flex-direction:column;align-items:flex-start;padding:0.75rem;gap:0.5rem;border-radius:var(\n --account-center-border-radius,\n var(--onboard-border-radius-3, var(--border-radius-3))\n );color:var(\n --account-center-maximized-network-text-color,\n var(--account-center-maximized-network-section, inherit)\n )}.network-section.svelte-177u10y{flex-direction:row;align-items:flex-start;padding:0px;gap:16px}.network-selector-container.svelte-177u10y{width:100%}.protect.svelte-177u10y{flex-direction:row;padding:0.25rem 0.375rem 0;gap:0.375rem;width:100%}.shield.svelte-177u10y{width:20px;height:20px;display:flex;justify-content:center}.protect-text.svelte-177u10y{font-size:var(--onboard-font-size-6, var(--font-size-6));color:var(\n --account-center-maximized-upper-action-color,\n var(--action-color)\n );line-height:1.75rem;display:flex;align-items:center}.network-selector-container.svelte-177u10y{margin-left:1rem;width:100%}.network-selector-label.svelte-177u10y{font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3))}.app-info-container.svelte-177u10y{color:var(--text-color, var(--gray-700));background:var(\n --account-center-maximized-info-section-background-color,\n var(\n --account-center-maximized-info-section,\n var(--background-color, #fff)\n )\n );border-top:1px solid var(--border-color);border-radius:var(--account-center-border-radius, inherit);display:flex;flex-direction:column;align-items:flex-start;padding:0px}.app-info-header.svelte-177u10y{width:100%;flex-direction:column;align-items:flex-start;padding:0.75rem;gap:0.5rem;border-bottom:1px solid var(--border-color)}.app-icon-name.svelte-177u10y{display:flex;align-items:center;flex-direction:row;gap:0.75rem}.app-name.svelte-177u10y{font-size:1rem;font-weight:600;line-height:1rem;margin-bottom:0.25rem;color:var(--account-center-maximized-app-name-color, inherit)}.app-description.svelte-177u10y{margin:0;font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));color:var(--account-center-maximized-app-info-color, inherit);display:flex;flex-direction:row;align-items:flex-start;padding:0px 0.25rem;gap:1rem}.app-info.svelte-177u10y{width:100%;font-size:var(--onboard-font-size-7, var(--font-size-7));line-height:var(--onboard-font-line-height-3, var(--font-line-height-3));color:var(--account-center-maximized-app-info-color, inherit);border-bottom:1px solid var(--border-color);display:flex;flex-direction:column;align-items:flex-start;padding:0.5rem 1rem;gap:0.25rem}.app-info-heading.svelte-177u10y{font-weight:700;color:var(--account-center-maximized-app-info-color, inherit)}.w100.svelte-177u10y{width:100%}a.svelte-177u10y{font-weight:700}.powered-by-container.svelte-177u10y{color:var(--text-color);padding:0.75rem}")}function eC(e,n,t){let r=e.slice();return r[29]=n[t],r[31]=t,r}function ej(e){let n,t;return n=new er({props:{onClose:e[22],onConfirm:e[13]}}),{c(){(0,r.F)(n.$$.fragment)},m(e,o){(0,r.I)(n,e,o),t=!0},p(e,t){let r={};4&t[0]&&(r.onClose=e[22]),n.$set(r)},i(e){!t&&((0,r.x)(n.$$.fragment,e),t=!0)},o(e){(0,r.A)(n.$$.fragment,e),t=!1},d(e){(0,r.K)(n,e)}}}function ez(e){let n,t;return n=new ec({props:{onDismiss:e[23],onEnable:e[24],infoLink:e[9].transactionProtectionInfoLink||r.a5}}),{c(){(0,r.F)(n.$$.fragment)},m(e,o){(0,r.I)(n,e,o),t=!0},p(e,t){let o={};16&t[0]&&(o.onDismiss=e[23]),512&t[0]&&(o.infoLink=e[9].transactionProtectionInfoLink||r.a5),n.$set(o)},i(e){!t&&((0,r.x)(n.$$.fragment,e),t=!0)},o(e){(0,r.A)(n.$$.fragment,e),t=!1},d(e){(0,r.K)(n,e)}}}function eA(e){let n,t,o,a,i,l,c,s,d,u,m,p,v,f,g,h,b,x,w,y,k,$,C,j,z,G,T,I,_,F;let H=[],M=new Map,L=e[10]("accountCenter.currentNetwork",{default:r.C.accountCenter.currentNetwork})+"",P=e[1],V=e=>e[29].label;for(let n=0;n',parentCSSId:"maximized_ac"}});let Z=!e[9].hideTransactionProtectionBtn&&(e[6]||e[5]?.protectedRpcUrl)&&eI(e),E=e[11]&&e_(e),K=e[8]&&e[8].length&&eL(e);return{c(){n=(0,r.j)("div"),t=(0,r.j)("div"),o=(0,r.j)("div"),a=(0,r.j)("div");for(let e=0;e{S=null}),(0,r.z)()),(!I||1024&t[0])&&L!==(L=e[10]("accountCenter.currentNetwork",{default:r.C.accountCenter.currentNetwork})+"")&&(0,r.v)(h,L),!e[9].hideTransactionProtectionBtn&&(e[6]||e[5]?.protectedRpcUrl)?Z?Z.p(e,t):((Z=eI(e)).c(),Z.m(s,null)):Z&&(Z.d(1),Z=null),(!I||160&t[0])&&(0,r.H)(s,"background-blue",e[5]&&e[5].icon||e[7]),(!I||32&t[0])&&(0,r.H)(s,"background-yellow",!e[5]),(!I||160&t[0])&&(0,r.H)(s,"background-gray",e[5]&&!e[7]),e[11]?E?(E.p(e,t),2048&t[0]&&(0,r.x)(E,1)):((E=e_(e)).c(),(0,r.x)(E,1),E.m($,C)):E&&((0,r.y)(),(0,r.A)(E,1,1,()=>{E=null}),(0,r.z)()),e[8]&&e[8].length?K?(K.p(e,t),256&t[0]&&(0,r.x)(K,1)):((K=eL(e)).c(),(0,r.x)(K,1),K.m($,j)):K&&((0,r.y)(),(0,r.A)(K,1,1,()=>{K=null}),(0,r.z)())},i(t){if(!I){for(let e=0;e{I&&(!T&&(T=(0,r.a9)(n,r.ab,{duration:600,y:e[16].includes("bottom")?56:-76,easing:r.aa,opacity:0},!0)),T.run(1))}),I=!0}},o(t){for(let e=0;e(0,r.ac)(o,"hideMenu",l)),{key:e,first:null,c(){t=(0,r.e)(),(0,r.F)(o.$$.fragment),this.first=t},m(e,n){(0,r.b)(e,t,n),(0,r.I)(o,e,n),i=!0},p(e,t){n=e;let i={};2&t[0]&&(i.wallet=n[29]),2&t[0]&&(i.primary=0===n[31]),!a&&8&t[0]&&(a=!0,i.hideMenu=n[3],(0,r.ad)(()=>a=!1)),o.$set(i)},i(e){!i&&((0,r.x)(o.$$.fragment,e),i=!0)},o(e){(0,r.A)(o.$$.fragment,e),i=!1},d(e){e&&(0,r.d)(t),(0,r.K)(o,e)}}}function eT(e){let n,t,o;return t=new r.R({props:{size:14}}),{c(){n=(0,r.j)("div"),(0,r.F)(t.$$.fragment),(0,r.T)(n,"right","-5px"),(0,r.T)(n,"bottom","-5px"),(0,r.k)(n,"class","drop-shadow absolute")},m(e,a){(0,r.b)(e,n,a),(0,r.I)(t,n,null),o=!0},i(e){!o&&((0,r.x)(t.$$.fragment,e),o=!0)},o(e){(0,r.A)(t.$$.fragment,e),o=!1},d(e){e&&(0,r.d)(n),(0,r.K)(t)}}}function eI(e){let n,t,o,a,i,l,c;let s=e[10]("accountCenter.enableTransactionProtection",{default:r.C.accountCenter.enableTransactionProtection})+"";return{c(){n=(0,r.j)("div"),t=(0,r.j)("div"),o=(0,r.G)(),a=(0,r.j)("span"),i=(0,r.t)(s),(0,r.k)(t,"class","shield svelte-177u10y"),(0,r.k)(a,"class","protect-text svelte-177u10y"),(0,r.k)(n,"class","protect action-container flex items-center pointer svelte-177u10y")},m(s,d){(0,r.b)(s,n,d),(0,r.m)(n,t),t.innerHTML=Y,(0,r.m)(n,o),(0,r.m)(n,a),(0,r.m)(a,i),!l&&(c=(0,r.p)(n,"click",e[28]),l=!0)},p(e,n){1024&n[0]&&s!==(s=e[10]("accountCenter.enableTransactionProtection",{default:r.C.accountCenter.enableTransactionProtection})+"")&&(0,r.v)(i,s)},d(e){e&&(0,r.d)(n),l=!1,c()}}}function e_(e){let n,t,o,a,i,l,c,s,d,u,m,p;let v=(e[11]&&e[11].name||"App Name")+"",f=(e[11]&&e[11].description||"This app has not added a description.")+"";o=new r.W({props:{size:32,padding:4,background:"white",border:"black",radius:8,icon:e[11]&&e[11].icon||r.ae}});let g=(e[11].gettingStartedGuide||e[11].explore)&&eF(e);return{c(){n=(0,r.j)("div"),t=(0,r.j)("div"),(0,r.F)(o.$$.fragment),a=(0,r.G)(),i=(0,r.j)("div"),l=(0,r.t)(v),c=(0,r.G)(),s=(0,r.j)("div"),d=(0,r.t)(f),u=(0,r.G)(),g&&g.c(),m=(0,r.e)(),(0,r.k)(i,"class","app-name svelte-177u10y"),(0,r.k)(t,"class","relative flex app-icon-name svelte-177u10y"),(0,r.k)(s,"class","app-description svelte-177u10y"),(0,r.k)(n,"class","flex items-start app-info-header svelte-177u10y")},m(e,v){(0,r.b)(e,n,v),(0,r.m)(n,t),(0,r.I)(o,t,null),(0,r.m)(t,a),(0,r.m)(t,i),(0,r.m)(i,l),(0,r.m)(n,c),(0,r.m)(n,s),(0,r.m)(s,d),(0,r.b)(e,u,v),g&&g.m(e,v),(0,r.b)(e,m,v),p=!0},p(e,n){let t={};2048&n[0]&&(t.icon=e[11]&&e[11].icon||r.ae),o.$set(t),(!p||2048&n[0])&&v!==(v=(e[11]&&e[11].name||"App Name")+"")&&(0,r.v)(l,v),(!p||2048&n[0])&&f!==(f=(e[11]&&e[11].description||"This app has not added a description.")+"")&&(0,r.v)(d,f),e[11].gettingStartedGuide||e[11].explore?g?g.p(e,n):((g=eF(e)).c(),g.m(m.parentNode,m)):g&&(g.d(1),g=null)},i(e){!p&&((0,r.x)(o.$$.fragment,e),p=!0)},o(e){(0,r.A)(o.$$.fragment,e),p=!1},d(e){e&&(0,r.d)(n),(0,r.K)(o),e&&(0,r.d)(u),g&&g.d(e),e&&(0,r.d)(m)}}}function eF(e){let n,t,o,a,i;let l=e[10]("accountCenter.appInfo",{default:r.C.accountCenter.appInfo})+"",c=e[11].gettingStartedGuide&&eH(e),s=e[11].explore&&eM(e);return{c(){n=(0,r.j)("div"),t=(0,r.j)("div"),o=(0,r.t)(l),a=(0,r.G)(),c&&c.c(),i=(0,r.G)(),s&&s.c(),(0,r.k)(t,"class","app-info-heading svelte-177u10y"),(0,r.k)(n,"class","app-info svelte-177u10y")},m(e,l){(0,r.b)(e,n,l),(0,r.m)(n,t),(0,r.m)(t,o),(0,r.m)(n,a),c&&c.m(n,null),(0,r.m)(n,i),s&&s.m(n,null)},p(e,t){1024&t[0]&&l!==(l=e[10]("accountCenter.appInfo",{default:r.C.accountCenter.appInfo})+"")&&(0,r.v)(o,l),e[11].gettingStartedGuide?c?c.p(e,t):((c=eH(e)).c(),c.m(n,i)):c&&(c.d(1),c=null),e[11].explore?s?s.p(e,t):((s=eM(e)).c(),s.m(n,null)):s&&(s.d(1),s=null)},d(e){e&&(0,r.d)(n),c&&c.d(),s&&s.d()}}}function eH(e){let n,t,o,a,i,l,c;let s=e[10]("accountCenter.learnMore",{default:r.C.accountCenter.learnMore})+"",d=e[10]("accountCenter.gettingStartedGuide",{default:r.C.accountCenter.gettingStartedGuide})+"";return{c(){n=(0,r.j)("div"),t=(0,r.j)("div"),o=(0,r.t)(s),a=(0,r.G)(),i=(0,r.j)("a"),l=(0,r.t)(d),(0,r.k)(i,"href",c=e[11].gettingStartedGuide),(0,r.k)(i,"target","_blank"),(0,r.k)(i,"rel","noreferrer noopener"),(0,r.k)(i,"class","svelte-177u10y"),(0,r.k)(n,"class","flex justify-between items-center w100 svelte-177u10y")},m(e,c){(0,r.b)(e,n,c),(0,r.m)(n,t),(0,r.m)(t,o),(0,r.m)(n,a),(0,r.m)(n,i),(0,r.m)(i,l)},p(e,n){1024&n[0]&&s!==(s=e[10]("accountCenter.learnMore",{default:r.C.accountCenter.learnMore})+"")&&(0,r.v)(o,s),1024&n[0]&&d!==(d=e[10]("accountCenter.gettingStartedGuide",{default:r.C.accountCenter.gettingStartedGuide})+"")&&(0,r.v)(l,d),2048&n[0]&&c!==(c=e[11].gettingStartedGuide)&&(0,r.k)(i,"href",c)},d(e){e&&(0,r.d)(n)}}}function eM(e){let n,t,o,a,i,l,c;let s=e[10]("accountCenter.smartContracts",{default:r.C.accountCenter.smartContracts})+"",d=e[10]("accountCenter.explore",{default:r.C.accountCenter.explore})+"";return{c(){n=(0,r.j)("div"),t=(0,r.j)("div"),o=(0,r.t)(s),a=(0,r.G)(),i=(0,r.j)("a"),l=(0,r.t)(d),(0,r.k)(i,"href",c=e[11].explore),(0,r.k)(i,"target","_blank"),(0,r.k)(i,"rel","noreferrer noopener"),(0,r.k)(i,"class","svelte-177u10y"),(0,r.k)(n,"class","flex justify-between items-center w100 svelte-177u10y")},m(e,c){(0,r.b)(e,n,c),(0,r.m)(n,t),(0,r.m)(t,o),(0,r.m)(n,a),(0,r.m)(n,i),(0,r.m)(i,l)},p(e,n){1024&n[0]&&s!==(s=e[10]("accountCenter.smartContracts",{default:r.C.accountCenter.smartContracts})+"")&&(0,r.v)(o,s),1024&n[0]&&d!==(d=e[10]("accountCenter.explore",{default:r.C.accountCenter.explore})+"")&&(0,r.v)(l,d),2048&n[0]&&c!==(c=e[11].explore)&&(0,r.k)(i,"href",c)},d(e){e&&(0,r.d)(n)}}}function eL(e){let n,t;return n=new ek({props:{secondaryTokens:e[8]}}),{c(){(0,r.F)(n.$$.fragment)},m(e,o){(0,r.I)(n,e,o),t=!0},p(e,t){let r={};256&t[0]&&(r.secondaryTokens=e[8]),n.$set(r)},i(e){!t&&((0,r.x)(n.$$.fragment,e),t=!0)},o(e){(0,r.A)(n.$$.fragment,e),t=!1},d(e){(0,r.K)(n,e)}}}function eP(e){let n,t,o,a;let i=e[2]&&ej(e),l=e[4]&&ez(e),c=e[0]&&eA(e);return{c(){i&&i.c(),n=(0,r.G)(),l&&l.c(),t=(0,r.G)(),c&&c.c(),o=(0,r.e)()},m(e,s){i&&i.m(e,s),(0,r.b)(e,n,s),l&&l.m(e,s),(0,r.b)(e,t,s),c&&c.m(e,s),(0,r.b)(e,o,s),a=!0},p(e,a){e[2]?i?(i.p(e,a),4&a[0]&&(0,r.x)(i,1)):((i=ej(e)).c(),(0,r.x)(i,1),i.m(n.parentNode,n)):i&&((0,r.y)(),(0,r.A)(i,1,1,()=>{i=null}),(0,r.z)()),e[4]?l?(l.p(e,a),16&a[0]&&(0,r.x)(l,1)):((l=ez(e)).c(),(0,r.x)(l,1),l.m(t.parentNode,t)):l&&((0,r.y)(),(0,r.A)(l,1,1,()=>{l=null}),(0,r.z)()),e[0]?c?(c.p(e,a),1&a[0]&&(0,r.x)(c,1)):((c=eA(e)).c(),(0,r.x)(c,1),c.m(o.parentNode,o)):c&&((0,r.y)(),(0,r.A)(c,1,1,()=>{c=null}),(0,r.z)())},i(e){!a&&((0,r.x)(i),(0,r.x)(l),(0,r.x)(c),a=!0)},o(e){(0,r.A)(i),(0,r.A)(l),(0,r.A)(c),a=!1},d(e){i&&i.d(e),e&&(0,r.d)(n),l&&l.d(e),e&&(0,r.d)(t),c&&c.d(e),e&&(0,r.d)(o)}}}function eq(e,n,t){let o,a,i,l,c,s,d,u,m,p,v;(0,r.c)(e,r.w,e=>t(1,d=e)),(0,r.c)(e,b._,e=>t(10,m=e));let{expanded:f}=n,x=r.a3.select("accountCenter").pipe((0,g.O)(r.a3.get().accountCenter),(0,h.d)(1));(0,r.c)(e,x,e=>t(9,u=e));let{chains:w}=r.a3.get(),y=!1,k=!1,$=r.a3.select("appMetadata").pipe((0,g.O)(r.a3.get().appMetadata),(0,h.d)(1));(0,r.c)(e,$,e=>t(11,p=e));let{position:C}=r.a3.get().accountCenter,{device:j}=r.af,z=async()=>{try{await (0,r.ag)(o.provider,l,l?.protectedRpcUrl||r.ah),t(4,k=!1)}catch(n){let{code:e}=n;console.log(n,e)}};return e.$$set=e=>{"expanded"in e&&t(0,f=e.expanded)},e.$$.update=()=>{2&e.$$.dirty[0]&&t(19,[o]=d,o),524288&e.$$.dirty[0]&&t(20,[a]=o?o.chains:[],a),524288&e.$$.dirty[0]&&t(8,i=o&&o.accounts.length&&o.accounts[0].secondaryTokens),1048576&e.$$.dirty[0]&&t(5,l=w.find(({id:e,namespace:n})=>!!a&&e===a.id&&n===a.namespace)),1048576&e.$$.dirty[0]&&t(7,c=(0,r.a4)(a&&a.id)),1048576&e.$$.dirty[0]&&t(6,s=a&&"0x1"===a.id)},[f,d,y,v,k,l,s,c,i,u,m,p,x,function(){d.forEach(({label:e})=>(0,r.P)({label:e}))},w,$,C,j,z,o,a,function(n){r.ai.call(this,e,n)},()=>t(2,y=!1),()=>t(4,k=!1),()=>z(),function(e){t(3,v=e)},()=>(0,r.aj)(),()=>t(2,y=!0),()=>t(4,k=!0)]}class eV extends r.S{constructor(e){super(),(0,r.i)(this,e,eq,eP,r.s,{expanded:0},e$,[-1,-1])}}function eD(e){(0,r.a)(e,"svelte-1xsvwqj",".ac-trigger.svelte-1xsvwqj{--background-color:var(\n --account-center-minimized-background,\n var(--w3o-background-color, white)\n );--text-color:var(--w3o-text-color, var(--gray-700));--border-color:var(\n --account-center-border,\n var(--w3o-border-color, var(--onboard-gray-200, var(--gray-200)))\n );--border-radius:var(\n --account-center-border-radius,\n var(--w3o-border-radius, 1rem)\n );cursor:pointer;pointer-events:auto;width:100%;padding:0.5rem;border:1px solid;background:var(--background-color);color:var(--text-color);border-color:var(--border-color);border-radius:var(--border-radius);box-shadow:var(\n --account-center-box-shadow,\n var(--onboard-shadow-3, var(--shadow-3))\n );z-index:var(--account-center-z-index, 1)}.inner-row.svelte-1xsvwqj{display:flex;flex-flow:row nowrap;align-items:center;gap:0.5rem;padding:0 0.25rem}.wallet-info.svelte-1xsvwqj{display:flex;flex:1;flex-flow:column;height:2.5rem;overflow:hidden}.address.svelte-1xsvwqj{font-weight:600;line-height:1.25rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--account-center-minimized-address-color, inherit)}.balance.svelte-1xsvwqj{font-weight:400;line-height:1.25rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;opacity:0.6;color:var(--account-center-minimized-balance-color, inherit)}.chain-icon-container.svelte-1xsvwqj{margin-right:4px}.container.svelte-1xsvwqj{border:1px solid transparent;border-radius:16px;padding:1px;transition:border-color 250ms ease-in-out, backround 250ms ease-in-out;max-width:128px;cursor:default}.drop-shadow.svelte-1xsvwqj{filter:drop-shadow(0px 1px 4px rgba(0, 0, 0, 0.2))}")}function eS(e){let n,t,o,a,i;let l=(e[5].length>7?e[5].slice(0,7):e[5])+"";return{c(){n=(0,r.j)("div"),t=(0,r.t)(l),o=(0,r.G)(),a=(0,r.t)(e[2]),(0,r.k)(n,"class","balance svelte-1xsvwqj")},m(e,i){(0,r.b)(e,n,i),(0,r.m)(n,t),(0,r.m)(n,o),(0,r.m)(n,a)},p(e,n){32&n&&l!==(l=(e[5].length>7?e[5].slice(0,7):e[5])+"")&&(0,r.v)(t,l),4&n&&(0,r.v)(a,e[2])},i(e){e&&!i&&(0,r.U)(()=>{(i=(0,r.V)(n,r.X,{})).start()})},o:r.n,d(e){e&&(0,r.d)(n)}}}function eZ(e){let n,t,o,a,i,l,c,s,d,u,m,p,v,f,g,h,b,x,w,y,k,$,C,j,G,T,I,_,F,H;let M=(e[8]?(0,r.D)(e[8]):e[7]?(0,r.D)(e[7]):e[6])+"";i=new r.W({props:{size:32,padding:4,background:"white",border:"darkGreen",radius:8,icon:e[9]&&e[9].icon||r.ae}}),s=new r.W({props:{size:32,padding:4,background:"green",border:"darkGreen",radius:8,icon:e[1]?e[1].icon:""}}),m=new r.R({props:{size:14}});let L=e[5]&&eS(e);return $=new r.W({props:{size:22,padding:4,background:"custom",color:e[4]?e[4].icon?void 0:"var(--onboard-primary-100, var(--primary-100))":`var( + --account-center-chain-warning, + var(--onboard-warning-500, var(--warning-500)) + )`,customBackgroundColor:e[4]?e[4].color||e[3]&&e[3].color||r.a6.color:"var(--onboard-warning-200, var(--warning-200))",border:"transparent",radius:25,icon:e[4]?e[4].icon||e[3]&&e[3].icon||r.a6.icon:A}}),j=new q({props:{chains:e[11],colorVar:"--account-center-minimized-network-selector-color",selectIcon:z,parentCSSId:"minimized_ac"}}),{c(){n=(0,r.j)("div"),t=(0,r.j)("div"),o=(0,r.j)("div"),a=(0,r.j)("div"),(0,r.F)(i.$$.fragment),l=(0,r.G)(),c=(0,r.j)("div"),(0,r.F)(s.$$.fragment),d=(0,r.G)(),u=(0,r.j)("div"),(0,r.F)(m.$$.fragment),p=(0,r.G)(),v=(0,r.j)("div"),f=(0,r.j)("div"),g=(0,r.t)(M),h=(0,r.G)(),L&&L.c(),b=(0,r.G)(),x=(0,r.j)("div"),w=(0,r.j)("div"),y=(0,r.j)("div"),k=(0,r.j)("div"),(0,r.F)($.$$.fragment),C=(0,r.G)(),(0,r.F)(j.$$.fragment),(0,r.k)(a,"class","drop-shadow svelte-1xsvwqj"),(0,r.T)(c,"margin-left","-0.5rem"),(0,r.k)(c,"class","drop-shadow svelte-1xsvwqj"),(0,r.T)(u,"right","-4px"),(0,r.T)(u,"bottom","-4px"),(0,r.k)(u,"class","drop-shadow absolute svelte-1xsvwqj"),(0,r.k)(o,"class","flex relative"),(0,r.k)(f,"class","address svelte-1xsvwqj"),(0,r.k)(v,"class","wallet-info svelte-1xsvwqj"),(0,r.k)(k,"class","chain-icon-container svelte-1xsvwqj"),(0,r.k)(y,"class","flex items-center"),(0,r.k)(w,"class","container shadow-1 flex items-center svelte-1xsvwqj"),(0,r.k)(w,"style",G=`border-color: var(${e[4]?"--onboard-primary-200, var(--primary-200)":"--onboard-warning-500, var(--warning-500)"}); background-color: var(${e[4]?"--account-center-minimized-chain-select-background, var(--primary-100)":"--account-center-minimized-chain-select-background-warning, var(--warning-100)"})`),(0,r.k)(x,"class","network"),(0,r.k)(t,"class","inner-row svelte-1xsvwqj"),(0,r.k)(n,"class","ac-trigger svelte-1xsvwqj")},m(z,A){(0,r.b)(z,n,A),(0,r.m)(n,t),(0,r.m)(t,o),(0,r.m)(o,a),(0,r.I)(i,a,null),(0,r.m)(o,l),(0,r.m)(o,c),(0,r.I)(s,c,null),(0,r.m)(o,d),(0,r.m)(o,u),(0,r.I)(m,u,null),(0,r.m)(t,p),(0,r.m)(t,v),(0,r.m)(v,f),(0,r.m)(f,g),(0,r.m)(v,h),L&&L.m(v,null),(0,r.m)(t,b),(0,r.m)(t,x),(0,r.m)(x,w),(0,r.m)(w,y),(0,r.m)(y,k),(0,r.I)($,k,null),(0,r.m)(y,C),(0,r.I)(j,y,null),_=!0,!F&&(H=[(0,r.p)(w,"click",(0,r.J)(e[15])),(0,r.p)(n,"click",(0,r.J)(function(){(0,r.Z)(e[0])&&e[0].apply(this,arguments)}))],F=!0)},p(n,[t]){e=n;let o={};512&t&&(o.icon=e[9]&&e[9].icon||r.ae),i.$set(o);let a={};2&t&&(a.icon=e[1]?e[1].icon:""),s.$set(a),(!_||448&t)&&M!==(M=(e[8]?(0,r.D)(e[8]):e[7]?(0,r.D)(e[7]):e[6])+"")&&(0,r.v)(g,M),e[5]?L?(L.p(e,t),32&t&&(0,r.x)(L,1)):((L=eS(e)).c(),(0,r.x)(L,1),L.m(v,null)):L&&(L.d(1),L=null);let l={};16&t&&(l.color=e[4]?e[4].icon?void 0:"var(--onboard-primary-100, var(--primary-100))":`var( + --account-center-chain-warning, + var(--onboard-warning-500, var(--warning-500)) + )`),24&t&&(l.customBackgroundColor=e[4]?e[4].color||e[3]&&e[3].color||r.a6.color:"var(--onboard-warning-200, var(--warning-200))"),24&t&&(l.icon=e[4]?e[4].icon||e[3]&&e[3].icon||r.a6.icon:A),$.$set(l),(!_||16&t&&G!==(G=`border-color: var(${e[4]?"--onboard-primary-200, var(--primary-200)":"--onboard-warning-500, var(--warning-500)"}); background-color: var(${e[4]?"--account-center-minimized-chain-select-background, var(--primary-100)":"--account-center-minimized-chain-select-background-warning, var(--warning-100)"})`))&&(0,r.k)(w,"style",G)},i(e){!_&&((0,r.x)(i.$$.fragment,e),(0,r.x)(s.$$.fragment,e),(0,r.x)(m.$$.fragment,e),(0,r.x)(L),(0,r.x)($.$$.fragment,e),(0,r.x)(j.$$.fragment,e),e&&(0,r.U)(()=>{_&&(I&&I.end(1),(T=(0,r.V)(n,r.X,{duration:250})).start())}),_=!0)},o(e){(0,r.A)(i.$$.fragment,e),(0,r.A)(s.$$.fragment,e),(0,r.A)(m.$$.fragment,e),(0,r.A)($.$$.fragment,e),(0,r.A)(j.$$.fragment,e),T&&T.invalidate(),I=(0,r.ak)(n,r.X,{duration:100}),_=!1},d(e){e&&(0,r.d)(n),(0,r.K)(i),(0,r.K)(s),(0,r.K)(m),L&&L.d(),(0,r.K)($),(0,r.K)(j),e&&I&&I.end(),F=!1,(0,r.L)(H)}}}function eE(e,n,t){let o,a,i,l,c,s,d,u,m,p,v,f;(0,r.c)(e,r.w,e=>t(14,v=e));let{toggle:b}=n,x=r.a3.select("appMetadata").pipe((0,g.O)(r.a3.get().appMetadata),(0,h.d)(1));(0,r.c)(e,x,e=>t(9,f=e));let w=r.a3.get().chains;return e.$$set=e=>{"toggle"in e&&t(0,b=e.toggle)},e.$$.update=()=>{16384&e.$$.dirty&&t(1,[o]=v,o),2&e.$$.dirty&&t(13,[a]=o?o.accounts:[],a),8192&e.$$.dirty&&t(8,i=a&&a.ens&&(0,r.D)(a.ens.name)),8192&e.$$.dirty&&t(7,l=a&&a.uns&&(0,r.D)(a.uns.name)),8192&e.$$.dirty&&t(6,c=a?(0,r.E)(a.address):""),8192&e.$$.dirty&&t(2,[s]=a&&a.balance?Object.keys(a.balance):[],s),8196&e.$$.dirty&&t(5,d=a&&a.balance?a.balance[s]:null),2&e.$$.dirty&&t(12,u=o&&o.chains[0]),4096&e.$$.dirty&&t(4,m=w.find(({id:e,namespace:n})=>!!u&&e===u.id&&n===u.namespace)),4096&e.$$.dirty&&t(3,p=(0,r.a4)(u&&u.id))},[b,o,s,p,m,d,c,l,i,f,x,w,u,a,v,function(n){r.ai.call(this,e,n)}]}class eK extends r.S{constructor(e){super(),(0,r.i)(this,e,eE,eZ,r.s,{toggle:0},eD)}}function eB(e){(0,r.a)(e,"svelte-1o9vinu",".ac-trigger.svelte-1o9vinu{--background-color:var(\n --account-center-minimized-background,\n var(--w3o-background-color, white)\n );--text-color:var(--w3o-text-color, var(--gray-700));--border-color:var(\n --account-center-border,\n var(--w3o-border-color, var(--onboard-gray-200, var(--gray-200)))\n );--border-radius:var(\n --account-center-border-radius,\n var(--w3o-border-radius, 1rem)\n );position:relative;cursor:pointer;pointer-events:auto;min-width:80px;background:var(--background-color);color:var(--text-color);border:1px solid var(--border-color);border-radius:var(--border-radius);box-shadow:var(\n --account-center-box-shadow,\n var(--onboard-shadow-3, var(--shadow-3))\n );z-index:var(--account-center-z-index, 1)}.wallet-square-wrapper.svelte-1o9vinu{position:relative;margin-left:-8px}.check-icon-wrapper.svelte-1o9vinu{position:absolute;right:-4px;bottom:-4px}.inner-row.svelte-1o9vinu{display:flex;flex-flow:row nowrap;width:80px;padding:0.75rem}.drop-shadow.svelte-1o9vinu{filter:drop-shadow(0px 1px 4px rgba(0, 0, 0, 0.2))}")}function eW(e){let n,t,o,a,i,l,c,s,d,u,m,p,v,f,g;return a=new r.W({props:{size:32,padding:4,background:"white",border:"darkGreen",radius:8,icon:e[3]&&e[3].icon||r.ae}}),s=new r.W({props:{size:32,padding:4,background:"green",border:"darkGreen",radius:8,icon:e[1]?e[1].icon:""}}),m=new r.R({props:{size:14}}),{c(){n=(0,r.j)("div"),t=(0,r.j)("div"),o=(0,r.j)("div"),(0,r.F)(a.$$.fragment),i=(0,r.G)(),l=(0,r.j)("div"),c=(0,r.j)("div"),(0,r.F)(s.$$.fragment),d=(0,r.G)(),u=(0,r.j)("div"),(0,r.F)(m.$$.fragment),(0,r.k)(o,"class","drop-shadow svelte-1o9vinu"),(0,r.k)(c,"class","drop-shadow svelte-1o9vinu"),(0,r.k)(u,"class","check-icon-wrapper drop-shadow svelte-1o9vinu"),(0,r.k)(l,"class","wallet-square-wrapper svelte-1o9vinu"),(0,r.k)(t,"class","inner-row svelte-1o9vinu"),(0,r.k)(n,"class","ac-trigger svelte-1o9vinu"),(0,r.k)(n,"style",p=e[2].position.includes("Left")?"align-self: flex-start":null)},m(p,h){(0,r.b)(p,n,h),(0,r.m)(n,t),(0,r.m)(t,o),(0,r.I)(a,o,null),(0,r.m)(t,i),(0,r.m)(t,l),(0,r.m)(l,c),(0,r.I)(s,c,null),(0,r.m)(l,d),(0,r.m)(l,u),(0,r.I)(m,u,null),v=!0,!f&&(g=(0,r.p)(n,"click",(0,r.J)(function(){(0,r.Z)(e[0])&&e[0].apply(this,arguments)})),f=!0)},p(t,[o]){e=t;let i={};8&o&&(i.icon=e[3]&&e[3].icon||r.ae),a.$set(i);let l={};2&o&&(l.icon=e[1]?e[1].icon:""),s.$set(l),(!v||4&o&&p!==(p=e[2].position.includes("Left")?"align-self: flex-start":null))&&(0,r.k)(n,"style",p)},i(e){!v&&((0,r.x)(a.$$.fragment,e),(0,r.x)(s.$$.fragment,e),(0,r.x)(m.$$.fragment,e),v=!0)},o(e){(0,r.A)(a.$$.fragment,e),(0,r.A)(s.$$.fragment,e),(0,r.A)(m.$$.fragment,e),v=!1},d(e){e&&(0,r.d)(n),(0,r.K)(a),(0,r.K)(s),(0,r.K)(m),f=!1,g()}}}function eN(e,n,t){let o,a,i,l;(0,r.c)(e,r.w,e=>t(6,a=e));let{toggle:c}=n,s=r.a3.select("appMetadata").pipe((0,g.O)(r.a3.get().appMetadata),(0,h.d)(1));(0,r.c)(e,s,e=>t(3,l=e));let d=r.a3.select("accountCenter").pipe((0,g.O)(r.a3.get().accountCenter),(0,h.d)(1));return(0,r.c)(e,d,e=>t(2,i=e)),e.$$set=e=>{"toggle"in e&&t(0,c=e.toggle)},e.$$.update=()=>{64&e.$$.dirty&&t(1,[o]=a,o)},[c,o,i,l,s,d,a]}class eO extends r.S{constructor(e){super(),(0,r.i)(this,e,eN,eW,r.s,{toggle:0},eB)}}function eR(e){(0,r.a)(e,"svelte-1nua59o",".ac-container.svelte-1nua59o{display:flex;flex-flow:column;align-items:flex-end;gap:0.5rem}")}function eU(e){let n,t;return n=new eV({props:{expanded:e[0]}}),{c(){(0,r.F)(n.$$.fragment)},m(e,o){(0,r.I)(n,e,o),t=!0},p(e,t){let r={};1&t&&(r.expanded=e[0]),n.$set(r)},i(e){!t&&((0,r.x)(n.$$.fragment,e),t=!0)},o(e){(0,r.A)(n.$$.fragment,e),t=!1},d(e){(0,r.K)(n,e)}}}function eJ(e){let n,t;return n=new eK({props:{toggle:e[4]}}),{c(){(0,r.F)(n.$$.fragment)},m(e,o){(0,r.I)(n,e,o),t=!0},p:r.n,i(e){!t&&((0,r.x)(n.$$.fragment,e),t=!0)},o(e){(0,r.A)(n.$$.fragment,e),t=!1},d(e){(0,r.K)(n,e)}}}function eX(e){let n,t;return n=new eO({props:{toggle:e[4]}}),{c(){(0,r.F)(n.$$.fragment)},m(e,o){(0,r.I)(n,e,o),t=!0},p:r.n,i(e){!t&&((0,r.x)(n.$$.fragment,e),t=!0)},o(e){(0,r.A)(n.$$.fragment,e),t=!1},d(e){(0,r.K)(n,e)}}}function eY(e){let n,t;return n=new eV({props:{expanded:e[0]}}),{c(){(0,r.F)(n.$$.fragment)},m(e,o){(0,r.I)(n,e,o),t=!0},p(e,t){let r={};1&t&&(r.expanded=e[0]),n.$set(r)},i(e){!t&&((0,r.x)(n.$$.fragment,e),t=!0)},o(e){(0,r.A)(n.$$.fragment,e),t=!1},d(e){(0,r.K)(n,e)}}}function eQ(e){let n,t,o,a,i,l,c,s;let d=e[1].position.includes("bottom"),u=e[1].position.includes("top"),m=d&&eU(e),p=[eX,eJ],v=[];function f(e,n){return e[1].minimal?0:1}a=v[o=f(e)]=p[o](e);let g=u&&eY(e);return{c(){n=(0,r.j)("div"),m&&m.c(),t=(0,r.G)(),a.c(),i=(0,r.G)(),g&&g.c(),(0,r.k)(n,"class","ac-container svelte-1nua59o")},m(a,d){(0,r.b)(a,n,d),m&&m.m(n,null),(0,r.m)(n,t),v[o].m(n,null),(0,r.m)(n,i),g&&g.m(n,null),l=!0,!c&&(s=(0,r.p)(window,"click",e[3]),c=!0)},p(e,[l]){2&l&&(d=e[1].position.includes("bottom")),d?m?(m.p(e,l),2&l&&(0,r.x)(m,1)):((m=eU(e)).c(),(0,r.x)(m,1),m.m(n,t)):m&&((0,r.y)(),(0,r.A)(m,1,1,()=>{m=null}),(0,r.z)());let c=o;(o=f(e))===c?v[o].p(e,l):((0,r.y)(),(0,r.A)(v[c],1,1,()=>{v[c]=null}),(0,r.z)(),(a=v[o])?a.p(e,l):(a=v[o]=p[o](e)).c(),(0,r.x)(a,1),a.m(n,i)),2&l&&(u=e[1].position.includes("top")),u?g?(g.p(e,l),2&l&&(0,r.x)(g,1)):((g=eY(e)).c(),(0,r.x)(g,1),g.m(n,null)):g&&((0,r.y)(),(0,r.A)(g,1,1,()=>{g=null}),(0,r.z)())},i(e){!l&&((0,r.x)(m),(0,r.x)(a),(0,r.x)(g),l=!0)},o(e){(0,r.A)(m),(0,r.A)(a),(0,r.A)(g),l=!1},d(e){e&&(0,r.d)(n),m&&m.d(),v[o].d(),g&&g.d(),c=!1,s()}}}function e0(e,n,t){let o;let a=!1,i=r.a3.select("accountCenter").pipe((0,g.O)(r.a3.get().accountCenter),(0,h.d)(1));function l(){o.expanded&&((0,r.am)({expanded:!1}),t(0,a=!1))}return(0,r.c)(e,i,e=>t(1,o=e)),(0,r.al)(l),[a,o,i,l,function(){(0,r.am)({expanded:!o.expanded}),t(0,a=!a)}]}class e1 extends r.S{constructor(e){super(),(0,r.i)(this,e,e0,eQ,r.s,{},eR)}}}}]); \ No newline at end of file diff --git a/gateway/dist/1295.b2379ebe2a00adbaba80.bundle.js b/gateway/dist/1295.b2379ebe2a00adbaba80.bundle.js new file mode 100644 index 00000000..7144f72e --- /dev/null +++ b/gateway/dist/1295.b2379ebe2a00adbaba80.bundle.js @@ -0,0 +1,25 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["1295"],{34164:function(t,i,e){e.r(i),e.d(i,{default:function(){return l}});let l=` + + + + + + + + + + + + + + + + + + + + + + + +`}}]); \ No newline at end of file diff --git a/gateway/dist/1312.8e610301a93a5385b13d.bundle.js b/gateway/dist/1312.8e610301a93a5385b13d.bundle.js new file mode 100644 index 00000000..569eec1c --- /dev/null +++ b/gateway/dist/1312.8e610301a93a5385b13d.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["1312"],{65596:function(e,c,s){s.r(c),s.d(c,{default:function(){return t}});let t=''}}]); \ No newline at end of file diff --git a/gateway/dist/1330.b3527ff21b477fd9d743.bundle.js b/gateway/dist/1330.b3527ff21b477fd9d743.bundle.js deleted file mode 100644 index caf9fd6d..00000000 --- a/gateway/dist/1330.b3527ff21b477fd9d743.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([[1330],{1330:(C,e,t)=>{t.r(e),t.d(e,{default:()=>s});const s='\n\n\n\n'}}]); \ No newline at end of file diff --git a/gateway/dist/1355.5da6953679170f874a61.bundle.js b/gateway/dist/1355.5da6953679170f874a61.bundle.js deleted file mode 100644 index 0d0d4e0f..00000000 --- a/gateway/dist/1355.5da6953679170f874a61.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([[1355],{41355:(s,C,e)=>{e.r(C),e.d(C,{default:()=>w});const w='\n\n\n'}}]); \ No newline at end of file diff --git a/gateway/dist/1395.232c85c29d30a7510bf0.bundle.js b/gateway/dist/1395.232c85c29d30a7510bf0.bundle.js new file mode 100644 index 00000000..bdea6873 --- /dev/null +++ b/gateway/dist/1395.232c85c29d30a7510bf0.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["1395"],{20290:function(t,e,l){l.r(e),l.d(e,{default:function(){return i}});let i=''}}]); \ No newline at end of file diff --git a/gateway/dist/1396.a12ab5241bed7a88bb9f.bundle.js b/gateway/dist/1396.a12ab5241bed7a88bb9f.bundle.js new file mode 100644 index 00000000..7cb85b35 --- /dev/null +++ b/gateway/dist/1396.a12ab5241bed7a88bb9f.bundle.js @@ -0,0 +1,5 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["1396"],{41447:function(C,t,e){e.r(t),e.d(t,{default:function(){return w}});let w=` + + + +`}}]); \ No newline at end of file diff --git a/gateway/dist/1452.b0471f4475fc6e0622af.bundle.js b/gateway/dist/1452.b0471f4475fc6e0622af.bundle.js deleted file mode 100644 index ab2a9124..00000000 --- a/gateway/dist/1452.b0471f4475fc6e0622af.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([[1452],{71452:(t,n,i)=>{i.r(n),i.d(n,{default:()=>e});const e='\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n'}}]); \ No newline at end of file diff --git a/gateway/dist/1538.41b23ed9cc4362bbb783.bundle.js b/gateway/dist/1538.41b23ed9cc4362bbb783.bundle.js deleted file mode 100644 index cfeee3c3..00000000 --- a/gateway/dist/1538.41b23ed9cc4362bbb783.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([[1538],{1538:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});const s='Coin98'}}]); \ No newline at end of file diff --git a/gateway/dist/1567.c5a4eba87e8f9c034239.bundle.js b/gateway/dist/1567.c5a4eba87e8f9c034239.bundle.js new file mode 100644 index 00000000..ba16e4c0 --- /dev/null +++ b/gateway/dist/1567.c5a4eba87e8f9c034239.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["1567"],{83121:function(){}}]); \ No newline at end of file diff --git a/gateway/dist/1578.9af710df8d59be65d8b7.bundle.js b/gateway/dist/1578.9af710df8d59be65d8b7.bundle.js new file mode 100644 index 00000000..28186506 --- /dev/null +++ b/gateway/dist/1578.9af710df8d59be65d8b7.bundle.js @@ -0,0 +1,24 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["1578"],{7771:function(t,e,i){i.r(e),i.d(e,{default:function(){return a}});let a=` + + + + + + + + + + + + + + + + + + + + + + +`}}]); \ No newline at end of file diff --git a/gateway/dist/1732.4b52c96d845aed7b735a.bundle.js b/gateway/dist/1732.4b52c96d845aed7b735a.bundle.js new file mode 100644 index 00000000..29f81927 --- /dev/null +++ b/gateway/dist/1732.4b52c96d845aed7b735a.bundle.js @@ -0,0 +1,14 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["1732"],{30297:function(e,l,o){o.r(l),o.d(l,{default:function(){return r}});let r=` + + + + + + + + + + + + +`}}]); \ No newline at end of file diff --git a/gateway/dist/1837.1a25b8a749e0f19f2ae4.bundle.js b/gateway/dist/1837.1a25b8a749e0f19f2ae4.bundle.js deleted file mode 100644 index 2c8578f5..00000000 --- a/gateway/dist/1837.1a25b8a749e0f19f2ae4.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([[1837],{81837:(n,C,e)=>{e.r(C),e.d(C,{default:()=>t});const t='\n\n\n\n\n\n\n \n \n \n \n\n'}}]); \ No newline at end of file diff --git a/gateway/dist/1867.7ff8e54c66bcffa47fb9.bundle.js b/gateway/dist/1867.7ff8e54c66bcffa47fb9.bundle.js new file mode 100644 index 00000000..57f989e8 --- /dev/null +++ b/gateway/dist/1867.7ff8e54c66bcffa47fb9.bundle.js @@ -0,0 +1,29 @@ +(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["1867"],{80519:function(t,e,r){"use strict";let i,n,s,o;r.d(e,{REQUIRED_METHODS:()=>gQ,default:()=>g6});var a,f,h,u,l,c,d,p,g,m,v,y,b,A,w,x,M,E,I,S,_,N,C,B,R,P,O,T,D,U,k,q,F,z,L,H,Q,j,K,J,G,Y,V,W,X,Z,$,tt,te,tr,ti,tn,ts,to,ta,tf,th=r("17187"),tu=r.n(th),tl=r("66736"),tc=r("62873"),td=r("65755"),tp=r("17563"),tg=r("15501"),tm=r("512"),tv=r("31416"),ty=r("73294"),tb=r("39108"),tA=r("31714"),tw=r(34155);function tx(t,e=[]){let r=[];return Object.keys(t).forEach(i=>{if(e.length&&!e.includes(i))return;let n=t[i];r.push(...n.accounts)}),r}r(48764).Buffer,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var tM="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},tE={exports:{}};a=tE,function(){var t="input is invalid type",e="object"==typeof window,r=e?window:{};r.JS_SHA3_NO_WINDOW&&(e=!1);var i=!e&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof tw&&tw.versions&&tw.versions.node?r=tM:i&&(r=self);var n=!r.JS_SHA3_NO_COMMON_JS&&a.exports,s=!r.JS_SHA3_NO_ARRAY_BUFFER&&"u">typeof ArrayBuffer,o="0123456789abcdef".split(""),f=[4,1024,262144,0x4000000],h=[0,8,16,24],u=[1,0,32898,0,32906,0x80000000,0x80008000,0x80000000,32907,0,0x80000001,0,0x80008081,0x80000000,32777,0x80000000,138,0,136,0,0x80008009,0,0x8000000a,0,0x8000808b,0,139,0x80000000,32905,0x80000000,32771,0x80000000,32770,0x80000000,128,0x80000000,32778,0,0x8000000a,0x80000000,0x80008081,0x80000000,32896,0x80000000,0x80000001,0,0x80008008,0x80000000],l=[224,256,384,512],c=[128,256],d=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};(r.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),s&&(r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var g=function(t,e,r){return function(i){return new B(t,e,t).update(i)[r]()}},m=function(t,e,r){return function(i,n){return new B(t,e,n).update(i)[r]()}},v=function(t,e,r){return function(e,i,n,s){return x["cshake"+t].update(e,i,n,s)[r]()}},y=function(t,e,r){return function(e,i,n,s){return x["kmac"+t].update(e,i,n,s)[r]()}},b=function(t,e,r,i){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function R(t,e,r){B.call(this,t,e,r)}B.prototype.update=function(e){if(this.finalized)throw Error("finalize already called");var r,i=typeof e;if("string"!==i){if("object"===i){if(null===e)throw Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!s||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}for(var n,o,a=this.blocks,f=this.byteCount,u=e.length,l=this.blockCount,c=0,d=this.s;c>2]|=e[c]<>2]|=o<>2]|=(192|o>>6)<=57344?a[n>>2]|=(224|o>>12)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=f){for(this.start=n-f,this.block=a[l],n=0;n>=8,r=255&t;r>0;)n.unshift(r),t>>=8,r=255&t,++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},B.prototype.encodeString=function(e){var r,i=typeof e;if("string"!==i){if("object"===i){if(null===e)throw Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!s||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}var n=0,o=e.length;if(r)n=o;else for(var a=0;a=57344?n+=3:(f=65536+((1023&f)<<10|1023&e.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(e),n},B.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];a%e==0&&(P(r),s=0)}return n&&(f+=o[(t=r[s])>>4&15]+o[15&t],n>1&&(f+=o[t>>12&15]+o[t>>8&15]),n>2&&(f+=o[t>>20&15]+o[t>>16&15])),f},B.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,s=0,o=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var f=new Uint32Array(t);o>8&255,f[t+2]=e>>16&255,f[t+3]=e>>24&255;a%r==0&&P(i)}return s&&(t=a<<2,e=i[o],f[t]=255&e,s>1&&(f[t+1]=e>>8&255),s>2&&(f[t+2]=e>>16&255)),f},R.prototype=new B,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var P=function(t){var e,r,i,n,s,o,a,f,h,l,c,d,p,g,m,v,y,b,A,w,x,M,E,I,S,_,N,C,B,R,P,O,T,D,U,k,q,F,z,L,H,Q,j,K,J,G,Y,V,W,X,Z,$,tt,te,tr,ti,tn,ts,to,ta,tf,th,tu;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],f=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],d=t[8]^t[18]^t[28]^t[38]^t[48],p=t[9]^t[19]^t[29]^t[39]^t[49],e=d^(o<<1|a>>>31),r=p^(a<<1|o>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(f<<1|h>>>31),r=s^(h<<1|f>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=o^(l<<1|c>>>31),r=a^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=f^(d<<1|p>>>31),r=h^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(n<<1|s>>>31),r=c^(s<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,g=t[0],m=t[1],G=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,C=t[20]<<3|t[21]>>>29,B=t[21]<<3|t[20]>>>29,ta=t[31]<<9|t[30]>>>23,tf=t[30]<<9|t[31]>>>23,Q=t[40]<<18|t[41]>>>14,j=t[41]<<18|t[40]>>>14,D=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,V=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,R=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,th=t[42]<<2|t[43]>>>30,tu=t[43]<<2|t[42]>>>30,te=t[5]<<30|t[4]>>>2,tr=t[4]<<30|t[5]>>>2,k=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,O=t[45]<<29|t[44]>>>3,T=t[44]<<29|t[45]>>>3,I=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,ti=t[17]<<23|t[16]>>>9,tn=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,x=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,J=t[9]<<27|t[8]>>>5,_=t[18]<<20|t[19]>>>12,N=t[19]<<20|t[18]>>>12,ts=t[29]<<7|t[28]>>>25,to=t[28]<<7|t[29]>>>25,L=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=g^~v&b,t[1]=m^~y&A,t[10]=I^~_&C,t[11]=S^~N&B,t[20]=D^~k&F,t[21]=U^~q&z,t[30]=K^~G&V,t[31]=J^~Y&W,t[40]=te^~ti&ts,t[41]=tr^~tn&to,t[2]=v^~b&w,t[3]=y^~A&x,t[12]=_^~C&R,t[13]=N^~B&P,t[22]=k^~F&L,t[23]=q^~z&H,t[32]=G^~V&X,t[33]=Y^~W&Z,t[42]=ti^~ts&ta,t[43]=tn^~to&tf,t[4]=b^~w&M,t[5]=A^~x&E,t[14]=C^~R&O,t[15]=B^~P&T,t[24]=F^~L&Q,t[25]=z^~H&j,t[34]=V^~X&$,t[35]=W^~Z&tt,t[44]=ts^~ta&th,t[45]=to^~tf&tu,t[6]=w^~M&g,t[7]=x^~E&m,t[16]=R^~O&I,t[17]=P^~T&S,t[26]=L^~Q&D,t[27]=H^~j&U,t[36]=X^~$&K,t[37]=Z^~tt&J,t[46]=ta^~th&te,t[47]=tf^~tu&tr,t[8]=M^~g&v,t[9]=E^~m&y,t[18]=O^~I&_,t[19]=T^~S&N,t[28]=Q^~D&k,t[29]=j^~U&q,t[38]=$^~K&G,t[39]=tt^~J&Y,t[48]=th^~te&ti,t[49]=tu^~tr&tn,t[0]^=u[i],t[1]^=u[i+1]};if(n)a.exports=x;else for(E=0;E{try{if("test"!=="test".normalize(e))throw Error("bad normalize")}catch{t.push(e)}}),t.length)throw Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw Error("broken implementation")}catch(t){return t.message}return null}();(f=Q||(Q={})).DEBUG="DEBUG",f.INFO="INFO",f.WARNING="WARNING",f.ERROR="ERROR",f.OFF="OFF",(h=j||(j={})).UNKNOWN_ERROR="UNKNOWN_ERROR",h.NOT_IMPLEMENTED="NOT_IMPLEMENTED",h.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",h.NETWORK_ERROR="NETWORK_ERROR",h.SERVER_ERROR="SERVER_ERROR",h.TIMEOUT="TIMEOUT",h.BUFFER_OVERRUN="BUFFER_OVERRUN",h.NUMERIC_FAULT="NUMERIC_FAULT",h.MISSING_NEW="MISSING_NEW",h.INVALID_ARGUMENT="INVALID_ARGUMENT",h.MISSING_ARGUMENT="MISSING_ARGUMENT",h.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",h.CALL_EXCEPTION="CALL_EXCEPTION",h.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",h.NONCE_EXPIRED="NONCE_EXPIRED",h.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",h.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",h.TRANSACTION_REPLACED="TRANSACTION_REPLACED",h.ACTION_REJECTED="ACTION_REJECTED";let tR="0123456789abcdef";class tP{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){let r=t.toLowerCase();null==t_[r]&&this.throwArgumentError("invalid log level name","logLevel",t),tN>t_[r]||console.log.apply(console,e)}debug(...t){this._log(tP.levels.DEBUG,t)}info(...t){this._log(tP.levels.INFO,t)}warn(...t){this._log(tP.levels.WARNING,t)}makeError(t,e,r){if(tS)return this.makeError("censored error",e,{});e||(e=tP.errors.UNKNOWN_ERROR),r||(r={});let i=[];Object.keys(r).forEach(t=>{let e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t>4],r+=tR[15&e[t]];i.push(t+"=Uint8Array(0x"+r+")")}else i.push(t+"="+JSON.stringify(e))}catch{i.push(t+"="+JSON.stringify(r[t].toString()))}}),i.push(`code=${e}`),i.push(`version=${this.version}`);let n=t,s="";switch(e){case j.NUMERIC_FAULT:{s="NUMERIC_FAULT";let e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":s+="-"+e;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case j.CALL_EXCEPTION:case j.INSUFFICIENT_FUNDS:case j.MISSING_NEW:case j.NONCE_EXPIRED:case j.REPLACEMENT_UNDERPRICED:case j.TRANSACTION_REPLACED:case j.UNPREDICTABLE_GAS_LIMIT:s=e}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(t+=" ("+i.join(", ")+")");let o=Error(t);return o.reason=n,o.code=e,Object.keys(r).forEach(function(t){o[t]=r[t]}),o}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,tP.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,i){t||this.throwError(e,r,i)}assertArgument(t,e,r,i){t||this.throwArgumentError(e,r,i)}checkNormalize(t){tB&&this.throwError("platform missing String.prototype.normalize",tP.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:tB})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=0x1fffffffffffff)&&this.throwError(e,tP.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,tP.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,tP.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||null==t)&&this.throwError("missing new",tP.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",tP.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||null==t)&&this.throwError("missing new",tP.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return tC||(tC=new tP("logger/5.7.0")),tC}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",tP.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),tI){if(!t)return;this.globalLogger().throwError("error censorship permanent",tP.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}tS=!!t,tI=!!e}static setLogLevel(t){let e=t_[t.toLowerCase()];if(null==e){tP.globalLogger().warn("invalid log level - "+t);return}tN=e}static from(t){return new tP(t)}}tP.errors=j,tP.levels=Q;let tO=new tP("bytes/5.7.0");function tT(t){return!!t.toHexString}function tD(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return tD(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function tU(t){return"number"==typeof t&&t==t&&t%1==0}function tk(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!tU(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function tq(t,e){if(e||(e={}),"number"==typeof t){tO.checkSafeUint53(t,"invalid arrayify value");let e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),tD(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),tT(t)&&(t=t.toHexString()),tF(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":tO.throwArgumentError("hex data is odd-length","value",t));let i=[];for(let t=0;t>4]+tz[15&i]}return e}return tO.throwArgumentError("invalid hexlify value","value",t)}function tH(t,e){for("string"!=typeof t?t=tL(t):tF(t)||tO.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&tO.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}var tQ={exports:{}},tj=function(t){var e=t.default;if("function"==typeof e){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}),r}(Object.freeze({__proto__:null,default:{}}));!function(t,e){function r(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{u="u">typeof window&&"u">typeof window.Buffer?window.Buffer:tj.Buffer}catch{}function s(t,e){var i=t.charCodeAt(e);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+t)}function o(t,e,r){var i=s(t,r);return r-1>=e&&(i|=s(t,r-1)<<4),i}function a(t,e,i,n){for(var s=0,o=0,a=Math.min(t.length,i),f=e;f=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&o0?t:e},n.min=function(t,e){return 0>t.cmp(e)?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,s++);return this._strip()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var i=0;i=e;i-=2)n=o(t,e,i)<=18?(s-=18,a+=1,this.words[a]|=n>>>26):s+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(s-=18,a+=1,this.words[a]|=n>>>26):s+=8;this._strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,f=Math.min(s,s-o)+r,h=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"u">typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch{n.prototype.inspect=h}else n.prototype.inspect=h;function h(){return(this.red?""}var u,l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];n.prototype.toString=function(t,e){if(t=t||10,e=0|e||1,16===t||"hex"===t){i="";for(var i,n=0,s=0,o=0;o>>24-n&0xffffff,(n+=2)>=26&&(n-=26,o--),i=0!==s||o!==this.length-1?l[6-f.length]+f+i:f+i}for(0!==s&&(i=s.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],u=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(u).toString(t);i=(p=p.idivn(u)).isZero()?g+i:l[h-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?t+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},u&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(u,t,e)}),n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};n.prototype.toArrayLike=function(t,e,i){this._strip();var n,s,o=this.byteLength(),a=i||Math.max(1,o);r(o<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0");var f=(n=t,s=a,n.allocUnsafe?n.allocUnsafe(s):new n(s));return this["_toArrayLike"+("le"===e?"LE":"BE")](f,o),f},n.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,s=0;n>8&255),r>16&255),6===s?(r>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===s?(r>=0&&(t[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e};function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=0x3ffffff&o,f=o/0x4000000|0;r.words[0]=a;for(var h=1;h>>26,l=0x3ffffff&f,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;n=0|t.words[p],u+=(o=n*(s=0|e.words[d])+l)/0x4000000|0,l=0x3ffffff&o}r.words[h]=0|l,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r._strip()}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i),this._strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),e?this.words[i]=this.words[i]|1<t.length?(r=this,i=t):(r=t,i=this);for(var e,r,i,n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;st.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(e=this,r=t):(e=t,r=this);for(var s=0,o=0;o>26,this.words[o]=0x3ffffff&i;for(;0!==s&&o>26,this.words[o]=0x3ffffff&i;if(0===s&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,m=0|o[2],v=8191&m,y=m>>>13,b=0|o[3],A=8191&b,w=b>>>13,x=0|o[4],M=8191&x,E=x>>>13,I=0|o[5],S=8191&I,_=I>>>13,N=0|o[6],C=8191&N,B=N>>>13,R=0|o[7],P=8191&R,O=R>>>13,T=0|o[8],D=8191&T,U=T>>>13,k=0|o[9],q=8191&k,F=k>>>13,z=0|a[0],L=8191&z,H=z>>>13,Q=0|a[1],j=8191&Q,K=Q>>>13,J=0|a[2],G=8191&J,Y=J>>>13,V=0|a[3],W=8191&V,X=V>>>13,Z=0|a[4],$=8191&Z,tt=Z>>>13,te=0|a[5],tr=8191&te,ti=te>>>13,tn=0|a[6],ts=8191&tn,to=tn>>>13,ta=0|a[7],tf=8191&ta,th=ta>>>13,tu=0|a[8],tl=8191&tu,tc=tu>>>13,td=0|a[9],tp=8191&td,tg=td>>>13;r.negative=t.negative^e.negative,r.length=19,i=Math.imul(l,L),n=(n=Math.imul(l,H))+Math.imul(c,L)|0,s=Math.imul(c,H);var tm=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tm>>>26)|0,tm&=0x3ffffff,i=Math.imul(p,L),n=(n=Math.imul(p,H))+Math.imul(g,L)|0,s=Math.imul(g,H),i=i+Math.imul(l,j)|0,n=(n=n+Math.imul(l,K)|0)+Math.imul(c,j)|0,s=s+Math.imul(c,K)|0;var tv=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tv>>>26)|0,tv&=0x3ffffff,i=Math.imul(v,L),n=(n=Math.imul(v,H))+Math.imul(y,L)|0,s=Math.imul(y,H),i=i+Math.imul(p,j)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(g,j)|0,s=s+Math.imul(g,K)|0,i=i+Math.imul(l,G)|0,n=(n=n+Math.imul(l,Y)|0)+Math.imul(c,G)|0,s=s+Math.imul(c,Y)|0;var ty=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(ty>>>26)|0,ty&=0x3ffffff,i=Math.imul(A,L),n=(n=Math.imul(A,H))+Math.imul(w,L)|0,s=Math.imul(w,H),i=i+Math.imul(v,j)|0,n=(n=n+Math.imul(v,K)|0)+Math.imul(y,j)|0,s=s+Math.imul(y,K)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,G)|0,s=s+Math.imul(g,Y)|0,i=i+Math.imul(l,W)|0,n=(n=n+Math.imul(l,X)|0)+Math.imul(c,W)|0,s=s+Math.imul(c,X)|0;var tb=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tb>>>26)|0,tb&=0x3ffffff,i=Math.imul(M,L),n=(n=Math.imul(M,H))+Math.imul(E,L)|0,s=Math.imul(E,H),i=i+Math.imul(A,j)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(w,j)|0,s=s+Math.imul(w,K)|0,i=i+Math.imul(v,G)|0,n=(n=n+Math.imul(v,Y)|0)+Math.imul(y,G)|0,s=s+Math.imul(y,Y)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,X)|0,i=i+Math.imul(l,$)|0,n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,$)|0,s=s+Math.imul(c,tt)|0;var tA=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tA>>>26)|0,tA&=0x3ffffff,i=Math.imul(S,L),n=(n=Math.imul(S,H))+Math.imul(_,L)|0,s=Math.imul(_,H),i=i+Math.imul(M,j)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(E,j)|0,s=s+Math.imul(E,K)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(w,G)|0,s=s+Math.imul(w,Y)|0,i=i+Math.imul(v,W)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(y,W)|0,s=s+Math.imul(y,X)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,$)|0,s=s+Math.imul(g,tt)|0,i=i+Math.imul(l,tr)|0,n=(n=n+Math.imul(l,ti)|0)+Math.imul(c,tr)|0,s=s+Math.imul(c,ti)|0;var tw=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tw>>>26)|0,tw&=0x3ffffff,i=Math.imul(C,L),n=(n=Math.imul(C,H))+Math.imul(B,L)|0,s=Math.imul(B,H),i=i+Math.imul(S,j)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(_,j)|0,s=s+Math.imul(_,K)|0,i=i+Math.imul(M,G)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(E,G)|0,s=s+Math.imul(E,Y)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(w,W)|0,s=s+Math.imul(w,X)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(y,$)|0,s=s+Math.imul(y,tt)|0,i=i+Math.imul(p,tr)|0,n=(n=n+Math.imul(p,ti)|0)+Math.imul(g,tr)|0,s=s+Math.imul(g,ti)|0,i=i+Math.imul(l,ts)|0,n=(n=n+Math.imul(l,to)|0)+Math.imul(c,ts)|0,s=s+Math.imul(c,to)|0;var tx=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tx>>>26)|0,tx&=0x3ffffff,i=Math.imul(P,L),n=(n=Math.imul(P,H))+Math.imul(O,L)|0,s=Math.imul(O,H),i=i+Math.imul(C,j)|0,n=(n=n+Math.imul(C,K)|0)+Math.imul(B,j)|0,s=s+Math.imul(B,K)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,Y)|0,i=i+Math.imul(M,W)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(E,W)|0,s=s+Math.imul(E,X)|0,i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(w,$)|0,s=s+Math.imul(w,tt)|0,i=i+Math.imul(v,tr)|0,n=(n=n+Math.imul(v,ti)|0)+Math.imul(y,tr)|0,s=s+Math.imul(y,ti)|0,i=i+Math.imul(p,ts)|0,n=(n=n+Math.imul(p,to)|0)+Math.imul(g,ts)|0,s=s+Math.imul(g,to)|0,i=i+Math.imul(l,tf)|0,n=(n=n+Math.imul(l,th)|0)+Math.imul(c,tf)|0,s=s+Math.imul(c,th)|0;var tM=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tM>>>26)|0,tM&=0x3ffffff,i=Math.imul(D,L),n=(n=Math.imul(D,H))+Math.imul(U,L)|0,s=Math.imul(U,H),i=i+Math.imul(P,j)|0,n=(n=n+Math.imul(P,K)|0)+Math.imul(O,j)|0,s=s+Math.imul(O,K)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(B,G)|0,s=s+Math.imul(B,Y)|0,i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(M,$)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(E,$)|0,s=s+Math.imul(E,tt)|0,i=i+Math.imul(A,tr)|0,n=(n=n+Math.imul(A,ti)|0)+Math.imul(w,tr)|0,s=s+Math.imul(w,ti)|0,i=i+Math.imul(v,ts)|0,n=(n=n+Math.imul(v,to)|0)+Math.imul(y,ts)|0,s=s+Math.imul(y,to)|0,i=i+Math.imul(p,tf)|0,n=(n=n+Math.imul(p,th)|0)+Math.imul(g,tf)|0,s=s+Math.imul(g,th)|0,i=i+Math.imul(l,tl)|0,n=(n=n+Math.imul(l,tc)|0)+Math.imul(c,tl)|0,s=s+Math.imul(c,tc)|0;var tE=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tE>>>26)|0,tE&=0x3ffffff,i=Math.imul(q,L),n=(n=Math.imul(q,H))+Math.imul(F,L)|0,s=Math.imul(F,H),i=i+Math.imul(D,j)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(U,j)|0,s=s+Math.imul(U,K)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(O,G)|0,s=s+Math.imul(O,Y)|0,i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(B,W)|0,s=s+Math.imul(B,X)|0,i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(_,$)|0,s=s+Math.imul(_,tt)|0,i=i+Math.imul(M,tr)|0,n=(n=n+Math.imul(M,ti)|0)+Math.imul(E,tr)|0,s=s+Math.imul(E,ti)|0,i=i+Math.imul(A,ts)|0,n=(n=n+Math.imul(A,to)|0)+Math.imul(w,ts)|0,s=s+Math.imul(w,to)|0,i=i+Math.imul(v,tf)|0,n=(n=n+Math.imul(v,th)|0)+Math.imul(y,tf)|0,s=s+Math.imul(y,th)|0,i=i+Math.imul(p,tl)|0,n=(n=n+Math.imul(p,tc)|0)+Math.imul(g,tl)|0,s=s+Math.imul(g,tc)|0,i=i+Math.imul(l,tp)|0,n=(n=n+Math.imul(l,tg)|0)+Math.imul(c,tp)|0,s=s+Math.imul(c,tg)|0;var tI=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tI>>>26)|0,tI&=0x3ffffff,i=Math.imul(q,j),n=(n=Math.imul(q,K))+Math.imul(F,j)|0,s=Math.imul(F,K),i=i+Math.imul(D,G)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(U,G)|0,s=s+Math.imul(U,Y)|0,i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,W)|0,s=s+Math.imul(O,X)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(B,$)|0,s=s+Math.imul(B,tt)|0,i=i+Math.imul(S,tr)|0,n=(n=n+Math.imul(S,ti)|0)+Math.imul(_,tr)|0,s=s+Math.imul(_,ti)|0,i=i+Math.imul(M,ts)|0,n=(n=n+Math.imul(M,to)|0)+Math.imul(E,ts)|0,s=s+Math.imul(E,to)|0,i=i+Math.imul(A,tf)|0,n=(n=n+Math.imul(A,th)|0)+Math.imul(w,tf)|0,s=s+Math.imul(w,th)|0,i=i+Math.imul(v,tl)|0,n=(n=n+Math.imul(v,tc)|0)+Math.imul(y,tl)|0,s=s+Math.imul(y,tc)|0,i=i+Math.imul(p,tp)|0,n=(n=n+Math.imul(p,tg)|0)+Math.imul(g,tp)|0,s=s+Math.imul(g,tg)|0;var tS=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tS>>>26)|0,tS&=0x3ffffff,i=Math.imul(q,G),n=(n=Math.imul(q,Y))+Math.imul(F,G)|0,s=Math.imul(F,Y),i=i+Math.imul(D,W)|0,n=(n=n+Math.imul(D,X)|0)+Math.imul(U,W)|0,s=s+Math.imul(U,X)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(O,$)|0,s=s+Math.imul(O,tt)|0,i=i+Math.imul(C,tr)|0,n=(n=n+Math.imul(C,ti)|0)+Math.imul(B,tr)|0,s=s+Math.imul(B,ti)|0,i=i+Math.imul(S,ts)|0,n=(n=n+Math.imul(S,to)|0)+Math.imul(_,ts)|0,s=s+Math.imul(_,to)|0,i=i+Math.imul(M,tf)|0,n=(n=n+Math.imul(M,th)|0)+Math.imul(E,tf)|0,s=s+Math.imul(E,th)|0,i=i+Math.imul(A,tl)|0,n=(n=n+Math.imul(A,tc)|0)+Math.imul(w,tl)|0,s=s+Math.imul(w,tc)|0,i=i+Math.imul(v,tp)|0,n=(n=n+Math.imul(v,tg)|0)+Math.imul(y,tp)|0,s=s+Math.imul(y,tg)|0;var t_=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(t_>>>26)|0,t_&=0x3ffffff,i=Math.imul(q,W),n=(n=Math.imul(q,X))+Math.imul(F,W)|0,s=Math.imul(F,X),i=i+Math.imul(D,$)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(U,$)|0,s=s+Math.imul(U,tt)|0,i=i+Math.imul(P,tr)|0,n=(n=n+Math.imul(P,ti)|0)+Math.imul(O,tr)|0,s=s+Math.imul(O,ti)|0,i=i+Math.imul(C,ts)|0,n=(n=n+Math.imul(C,to)|0)+Math.imul(B,ts)|0,s=s+Math.imul(B,to)|0,i=i+Math.imul(S,tf)|0,n=(n=n+Math.imul(S,th)|0)+Math.imul(_,tf)|0,s=s+Math.imul(_,th)|0,i=i+Math.imul(M,tl)|0,n=(n=n+Math.imul(M,tc)|0)+Math.imul(E,tl)|0,s=s+Math.imul(E,tc)|0,i=i+Math.imul(A,tp)|0,n=(n=n+Math.imul(A,tg)|0)+Math.imul(w,tp)|0,s=s+Math.imul(w,tg)|0;var tN=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tN>>>26)|0,tN&=0x3ffffff,i=Math.imul(q,$),n=(n=Math.imul(q,tt))+Math.imul(F,$)|0,s=Math.imul(F,tt),i=i+Math.imul(D,tr)|0,n=(n=n+Math.imul(D,ti)|0)+Math.imul(U,tr)|0,s=s+Math.imul(U,ti)|0,i=i+Math.imul(P,ts)|0,n=(n=n+Math.imul(P,to)|0)+Math.imul(O,ts)|0,s=s+Math.imul(O,to)|0,i=i+Math.imul(C,tf)|0,n=(n=n+Math.imul(C,th)|0)+Math.imul(B,tf)|0,s=s+Math.imul(B,th)|0,i=i+Math.imul(S,tl)|0,n=(n=n+Math.imul(S,tc)|0)+Math.imul(_,tl)|0,s=s+Math.imul(_,tc)|0,i=i+Math.imul(M,tp)|0,n=(n=n+Math.imul(M,tg)|0)+Math.imul(E,tp)|0,s=s+Math.imul(E,tg)|0;var tC=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tC>>>26)|0,tC&=0x3ffffff,i=Math.imul(q,tr),n=(n=Math.imul(q,ti))+Math.imul(F,tr)|0,s=Math.imul(F,ti),i=i+Math.imul(D,ts)|0,n=(n=n+Math.imul(D,to)|0)+Math.imul(U,ts)|0,s=s+Math.imul(U,to)|0,i=i+Math.imul(P,tf)|0,n=(n=n+Math.imul(P,th)|0)+Math.imul(O,tf)|0,s=s+Math.imul(O,th)|0,i=i+Math.imul(C,tl)|0,n=(n=n+Math.imul(C,tc)|0)+Math.imul(B,tl)|0,s=s+Math.imul(B,tc)|0,i=i+Math.imul(S,tp)|0,n=(n=n+Math.imul(S,tg)|0)+Math.imul(_,tp)|0,s=s+Math.imul(_,tg)|0;var tB=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tB>>>26)|0,tB&=0x3ffffff,i=Math.imul(q,ts),n=(n=Math.imul(q,to))+Math.imul(F,ts)|0,s=Math.imul(F,to),i=i+Math.imul(D,tf)|0,n=(n=n+Math.imul(D,th)|0)+Math.imul(U,tf)|0,s=s+Math.imul(U,th)|0,i=i+Math.imul(P,tl)|0,n=(n=n+Math.imul(P,tc)|0)+Math.imul(O,tl)|0,s=s+Math.imul(O,tc)|0,i=i+Math.imul(C,tp)|0,n=(n=n+Math.imul(C,tg)|0)+Math.imul(B,tp)|0,s=s+Math.imul(B,tg)|0;var tR=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tR>>>26)|0,tR&=0x3ffffff,i=Math.imul(q,tf),n=(n=Math.imul(q,th))+Math.imul(F,tf)|0,s=Math.imul(F,th),i=i+Math.imul(D,tl)|0,n=(n=n+Math.imul(D,tc)|0)+Math.imul(U,tl)|0,s=s+Math.imul(U,tc)|0,i=i+Math.imul(P,tp)|0,n=(n=n+Math.imul(P,tg)|0)+Math.imul(O,tp)|0,s=s+Math.imul(O,tg)|0;var tP=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tP>>>26)|0,tP&=0x3ffffff,i=Math.imul(q,tl),n=(n=Math.imul(q,tc))+Math.imul(F,tl)|0,s=Math.imul(F,tc),i=i+Math.imul(D,tp)|0,n=(n=n+Math.imul(D,tg)|0)+Math.imul(U,tp)|0,s=s+Math.imul(U,tg)|0;var tO=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tO>>>26)|0,tO&=0x3ffffff,i=Math.imul(q,tp),n=(n=Math.imul(q,tg))+Math.imul(F,tp)|0,s=Math.imul(F,tg);var tT=(h+i|0)+((8191&n)<<13)|0;return h=(s+(n>>>13)|0)+(tT>>>26)|0,tT&=0x3ffffff,f[0]=tm,f[1]=tv,f[2]=ty,f[3]=tb,f[4]=tA,f[5]=tw,f[6]=tx,f[7]=tM,f[8]=tE,f[9]=tI,f[10]=tS,f[11]=t_,f[12]=tN,f[13]=tC,f[14]=tB,f[15]=tR,f[16]=tP,f[17]=tO,f[18]=tT,0!==h&&(f[19]=h,r.length++),r};function m(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=0x3ffffff}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function v(t,e,r){return m(t,e,r)}Math.imul||(g=p),n.prototype.mulTo=function(t,e){var r,i,n=this.length+t.length;return 10===this.length&&10===t.length?i=g(this,t,e):n<63?i=p(this,t,e):n<1024?i=m(this,t,e):(r=this,i=m(r,t,e)),i},n.prototype.mul=function(t){var e=new n(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e,r=new n(null);return r.words=Array(this.length+t.length),e=this,m(e,t,r)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<0x4000000);for(var i=0,n=0;n>=26,i+=(s/0x4000000|0)+(o>>>26),this.words[n]=0x3ffffff&o}return 0!==i&&(this.words[n]=i,this.length++),e?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i=0);var e,i=t%26,n=(t-i)/26,s=0x3ffffff>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var n,s=t%26,o=Math.min((t-s)/26,this.length),a=0x3ffffff^0x3ffffff>>>s<o)for(this.length-=o,f=0;f=0&&(0!==h||f>=n);f--){var u=0|this.words[f];this.words[f]=h<<26-s|u>>>s,h=u&a}return i&&0!==h&&(i.words[i.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;return!(this.length<=i)&&!!(this.words[i]&1<=0);var e=t%26,i=(t-e)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==e&&i++,this.length=Math.min(i,this.length),0!==e&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>e<=0x4000000;e++)this.words[e]-=0x4000000,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<0x4000000),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(f/0x4000000|0),this.words[n+i]=0x3ffffff&o}for(;n>26,this.words[n+i]=0x3ffffff&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n>26,this.words[n]=0x3ffffff&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(t,e){var r=this.length-t.length,i=this.clone(),s=t,o=0|s.words[s.length-1];0!=(r=26-this._countBits(o))&&(s=s.ushln(r),i.iushln(r),o=0|s.words[s.length-1]);var a,f=i.length-s.length;if("mod"!==e){(a=new n(null)).length=f+1,a.words=Array(a.length);for(var h=0;h=0;l--){var c=(0|i.words[s.length+l])*0x4000000+(0|i.words[s.length+l-1]);for(c=Math.min(c/o|0,0x3ffffff),i._ishlnsubmul(s,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(s,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(t,e,i){var s,o,a;return(r(!t.isZero()),this.isZero())?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(s=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:s,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(s=a.div.neg()),{div:s,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||0>this.cmp(t)?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this._wordDiv(t,e)},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var i=0x4000000%t,n=0,s=this.length-1;s>=0;s--)n=(i*n+(0|this.words[s]))%t;return e?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var i=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+0x4000000*i;this.words[n]=s/t|0,i=s%t}return this._strip(),e?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var s=new n(1),o=new n(0),a=new n(0),f=new n(1),h=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;!(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(s.isOdd()||o.isOdd())&&(s.iadd(u),o.isub(l)),s.iushrn(1),o.iushrn(1);for(var p=0,g=1;!(i.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(u),f.isub(l)),a.iushrn(1),f.iushrn(1);e.cmp(i)>=0?(e.isub(i),s.isub(a),o.isub(f)):(i.isub(e),a.isub(s),f.isub(o))}return{a:a,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e,i=this,s=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var o=new n(1),a=new n(0),f=s.clone();i.cmpn(1)>0&&s.cmpn(1)>0;){for(var h=0,u=1;!(i.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(i.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);for(var l=0,c=1;!(s.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(s.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);i.cmp(s)>=0?(i.isub(s),o.isub(a)):(s.isub(i),a.isub(o))}return 0>(e=0===i.cmpn(1)?o:a).cmpn(0)&&e.iadd(t),e},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return(1&this.words[0])==0},n.prototype.isOdd=function(){return(1&this.words[0])==1},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,a&=0x3ffffff,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=0x3ffffff,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return -1===this.cmpn(t)},n.prototype.lt=function(t){return -1===this.cmp(t)},n.prototype.lten=function(t){return 0>=this.cmpn(t)},n.prototype.lte=function(t){return 0>=this.cmp(t)},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new E(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function I(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new n(null);return t.words=Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(A,b),A.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=s}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){var e;if(y[t])return y[t];if("k256"===t)e=new A;else if("p224"===t)e=new w;else if("p192"===t)e=new x;else if("p25519"===t)e=new M;else throw Error("Unknown prime "+t);return y[t]=e,e},E.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){r((t.negative|e.negative)==0,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(f(t,t.umod(this.m)._forceRed(this)),t)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var s=this.m.subn(1),o=0;!s.isZero()&&0===s.andln(1);)o++,s.iushrn(1);r(!s.isZero());var a=new n(1).toRed(this),f=a.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var l=this.pow(u,s),c=this.pow(t,s.addn(1).iushrn(1)),d=this.pow(t,s),p=o;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();r(m=0;i--){for(var h=e.words[i],u=f-1;u>=0;u--){var l=h>>u&1;if(s!==r[0]&&(s=this.sqr(s)),0===l&&0===o){a=0;continue}o<<=1,o|=l,4!=++a&&(0!==i||0!==u)||(s=this.mul(s,r[o]),a=0,o=0)}f=26}return s},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new I(t)},i(I,E),I.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},I.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},I.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},I.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=r.isub(i).iushrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):0>s.cmpn(0)&&(o=s.iadd(this.m)),o._forceRed(this)},I.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(tQ,tM);var tK=tQ.exports;let tJ="bignumber/5.7.0";var tG=tK.BN;let tY=new tP(tJ),tV={},tW=!1;class tX{constructor(t,e){t!==tV&&tY.throwError("cannot call constructor directly; use BigNumber.from",tP.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return t$(t0(this).fromTwos(t))}toTwos(t){return t$(t0(this).toTwos(t))}abs(){return"-"===this._hex[0]?tX.from(this._hex.substring(1)):this}add(t){return t$(t0(this).add(t0(t)))}sub(t){return t$(t0(this).sub(t0(t)))}div(t){return tX.from(t).isZero()&&t1("division-by-zero","div"),t$(t0(this).div(t0(t)))}mul(t){return t$(t0(this).mul(t0(t)))}mod(t){let e=t0(t);return e.isNeg()&&t1("division-by-zero","mod"),t$(t0(this).umod(e))}pow(t){let e=t0(t);return e.isNeg()&&t1("negative-power","pow"),t$(t0(this).pow(e))}and(t){let e=t0(t);return(this.isNegative()||e.isNeg())&&t1("unbound-bitwise-result","and"),t$(t0(this).and(e))}or(t){let e=t0(t);return(this.isNegative()||e.isNeg())&&t1("unbound-bitwise-result","or"),t$(t0(this).or(e))}xor(t){let e=t0(t);return(this.isNegative()||e.isNeg())&&t1("unbound-bitwise-result","xor"),t$(t0(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&t1("negative-width","mask"),t$(t0(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&t1("negative-width","shl"),t$(t0(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&t1("negative-width","shr"),t$(t0(this).shrn(t))}eq(t){return t0(this).eq(t0(t))}lt(t){return t0(this).lt(t0(t))}lte(t){return t0(this).lte(t0(t))}gt(t){return t0(this).gt(t0(t))}gte(t){return t0(this).gte(t0(t))}isNegative(){return"-"===this._hex[0]}isZero(){return t0(this).isZero()}toNumber(){try{return t0(this).toNumber()}catch{t1("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return tY.throwError("this platform does not support BigInt",tP.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?tW||(tW=!0,tY.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?tY.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",tP.errors.UNEXPECTED_ARGUMENT,{}):tY.throwError("BigNumber.toString does not accept parameters",tP.errors.UNEXPECTED_ARGUMENT,{})),t0(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof tX)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new tX(tV,tZ(t)):t.match(/^-?[0-9]+$/)?new tX(tV,tZ(new tG(t))):tY.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&t1("underflow","BigNumber.from",t),(t>=0x1fffffffffffff||t<=-0x1fffffffffffff)&&t1("overflow","BigNumber.from",t),tX.from(String(t));if("bigint"==typeof t)return tX.from(t.toString());if(tk(t))return tX.from(tL(t));if(t){if(t.toHexString){let e=t.toHexString();if("string"==typeof e)return tX.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(tF(e)||"-"===e[0]&&tF(e.substring(1))))return tX.from(e)}}return tY.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function tZ(t){if("string"!=typeof t)return tZ(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&tY.throwArgumentError("invalid hex","value",t),"0x00"===(t=tZ(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function t$(t){return tX.from(tZ(t))}function t0(t){let e=tX.from(t).toHexString();return"-"===e[0]?new tG("-"+e.substring(3),16):new tG(e.substring(2),16)}function t1(t,e,r){let i={fault:t,operation:e};return null!=r&&(i.value=r),tY.throwError(t,tP.errors.NUMERIC_FAULT,i)}let t2=new tP(tJ),t3={},t6=tX.from(0),t8=tX.from(-1);function t5(t,e,r,i){let n={fault:e,operation:r};return void 0!==i&&(n.value=i),t2.throwError(t,tP.errors.NUMERIC_FAULT,n)}let t4="0";for(;t4.length<256;)t4+=t4;function t9(t){if("number"!=typeof t)try{t=tX.from(t).toNumber()}catch{}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+t4.substring(0,t):t2.throwArgumentError("invalid decimal size","decimals",t)}function t7(t,e){null==e&&(e=0);let r=t9(e),i=(t=tX.from(t)).lt(t6);i&&(t=t.mul(t8));let n=t.mod(r).toString();for(;n.length2&&t2.throwArgumentError("too many decimal points","value",t);let s=n[0],o=n[1];for(s||(s="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>r.length-1&&t5("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.lengthnull==t[e]?i:(typeof t[e]!==r&&t2.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=n("signed","boolean",e),r=n("width","number",r),i=n("decimals","number",i)}return r%8&&t2.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&t2.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new ee(t3,e,r,i)}}class er{constructor(t,e,r,i){t!==t3&&t2.throwError("cannot use FixedNumber constructor; use FixedNumber.from",tP.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&t2.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);let e=et(this._value,this.format.decimals),r=et(t._value,t.format.decimals);return er.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);let e=et(this._value,this.format.decimals),r=et(t._value,t.format.decimals);return er.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);let e=et(this._value,this.format.decimals),r=et(t._value,t.format.decimals);return er.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);let e=et(this._value,this.format.decimals),r=et(t._value,t.format.decimals);return er.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=er.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(ei.toFormat(e.format))),e}ceiling(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=er.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(ei.toFormat(e.format))),e}round(t){null==t&&(t=0);let e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&t2.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;let r=er.from("1"+t4.substring(0,t),this.format),i=en.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){return null==t?this._hex:(t%8&&t2.throwArgumentError("invalid byte width","width",t),tH(tX.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return er.fromString(this._value,t)}static fromValue(t,e,r){var i;return null!=r||null==e||null!=(i=e)&&(tX.isBigNumber(i)||"number"==typeof i&&i%1==0||"string"==typeof i&&i.match(/^-?[0-9]+$/)||tF(i)||"bigint"==typeof i||tk(i))||(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),er.fromString(t7(t,e),ee.from(r))}static fromString(t,e){null==e&&(e="fixed");let r=ee.from(e),i=et(t,r.decimals);!r.signed&&i.lt(t6)&&t5("unsigned value cannot be negative","overflow","value",t);let n=null;return n=r.signed?i.toTwos(r.width).toHexString():tH(n=i.toHexString(),r.width/8),new er(t3,n,t7(i,r.decimals),r)}static fromBytes(t,e){null==e&&(e="fixed");let r=ee.from(e);if(tq(t).length>r.width/8)throw Error("overflow");let i=tX.from(t);r.signed&&(i=i.fromTwos(r.width));let n=i.toTwos((r.signed?0:1)+r.width).toHexString();return new er(t3,n,t7(i,r.decimals),r)}static from(t,e){if("string"==typeof t)return er.fromString(t,e);if(tk(t))return er.fromBytes(t,e);try{return er.fromValue(t,0,e)}catch(t){if(t.code!==tP.errors.INVALID_ARGUMENT)throw t}return t2.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!!(t&&t._isFixedNumber)}}let ei=er.from(1),en=er.from("0.5"),es=new tP("strings/5.7.0");(u=K||(K={})).current="",u.NFC="NFC",u.NFD="NFD",u.NFKC="NFKC",u.NFKD="NFKD",(l=J||(J={})).UNEXPECTED_CONTINUE="unexpected continuation byte",l.BAD_PREFIX="bad codepoint prefix",l.OVERRUN="string overrun",l.MISSING_CONTINUE="missing continuation byte",l.OUT_OF_RANGE="out of UTF-8 range",l.UTF16_SURROGATE="UTF-16 surrogate",l.OVERLONG="overlong representation";function eo(t,e,r,i,n){if(t===J.BAD_PREFIX||t===J.UNEXPECTED_CONTINUE){let t=0;for(let i=e+1;i>6==2;i++)t++;return t}return t===J.OVERRUN?r.length-e-1:0}Object.freeze({error:function(t,e,r,i,n){return es.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:eo,replace:function(t,e,r,i,n){return t===J.OVERLONG?(i.push(n),0):(i.push(65533),eo(t,e,r))}});function ea(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,i={};return t.split(",").forEach(t=>{let n=t.split(":");i[r+=parseInt(n[0],16)]=e(n[1])}),i}function ef(t){let e=0;return t.split(",").map(t=>{let r=t.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:e+parseInt(r[0],16),h:e=parseInt(r[1],16)}})}ef("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),ea("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),ea("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),ea("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",function(t){if(t.length%4!=0)throw Error("bad data");let e=[];for(let r=0;r0&&Array.isArray(t)?n(t,e-1):r.push(t)})};return n(t,e),r}function el(t,e){let r=Array(t);for(let i=0,n=-1;ie[t]):r}function ed(t,e,r){let i=Array(t).fill(void 0).map(()=>[]);for(let n=0;n>1:i>>1}return r})(t,r).forEach((t,e)=>i[e].push(t));return i}let ep=function(){var t;let e;return t=function(t){let e=0;function r(){return t[e++]<<8|t[e++]}let i=r(),n=1,s=[0,1];for(let t=1;t>--f&1}let l=0x40000000,c=0x20000000,d=0x7fffffff,p=0;for(let t=0;t<31;t++)p=p<<1|u();let g=[],m=0,v=0x80000000;for(;;){let t=Math.floor(((p-m+1)*n-1)/v),e=0,r=i;for(;r-e>1;){let i=e+r>>>1;t>>1|u(),o=o<<1^l,a=(a^l)<<1|l|1;m=o,v=1+a-o}let y=i-4;return g.map(e=>{switch(e-y){case 3:return y+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return y+256+(t[a++]<<8|t[a++]);case 1:return y+t[a++];default:return e-1}})}(function(t){t=atob(t);let e=[];for(let r=0;rt[e++]}();ec(ep),ec(ep),function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(function(t,e){let r=1+e(),i=e(),n=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(r)}return e}(e);return eu(ed(n.length,1+t,e).map((t,e)=>{let s=t[0],o=t.slice(1);return Array(n[e]).fill(void 0).map((t,e)=>{let n=e*i;return[s+e*r,o.map(t=>t+n)]})}))}(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(function(t,e){return ed(1+e(),1+t,e).map(t=>[t[0],t.slice(1)])}(r,t))}(function(t){let e={};for(let r=0;rt-e),function t(){let e=[];for(;;){let r=ec(c,i);if(0==r.length)break;e.push({set:new Set(r),node:t()})}e.sort((t,e)=>e.set.size-t.set.size);let r=c();return{branches:e,valid:r%3,fe0f:!!(1&(r=r/3|0)),save:1==(r>>=1),check:2==r}}(),new tP(eh),new Uint8Array(32).fill(0);new tP("rlp/5.7.0"),new tP("address/5.7.0");let eg={};for(let t=0;t<10;t++)eg[String(t)]=String(t);for(let t=0;t<26;t++)eg[String.fromCharCode(65+t)]=String(10+t);d=0x1fffffffffffff,Math.log10;new tP("properties/5.7.0"),new tP(eh),new Uint8Array(32).fill(0),tX.from(-1);let em=tX.from(0),ev=tX.from(1);tX.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),tH(ev.toHexString(),32),tH(em.toHexString(),32);var ey={},eb={};function eA(t,e){if(!t)throw Error(e||"Assertion failed")}eA.equal=function(t,e,r){if(t!=e)throw Error(r||"Assertion failed: "+t+" != "+e)};var ew={exports:{}};"function"==typeof Object.create?ew.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ew.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var ex=ew.exports;eb.inherits=ex;eb.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t){if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(t="0"+t),n=0;n>6|192:((s=t,o=n,(64512&s.charCodeAt(o))!=55296||o<0||o+1>=s.length||(64512&s.charCodeAt(o+1))!=56320)?r[i++]=a>>12|224:(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++n)),r[i++]=a>>18|240,r[i++]=a>>12&63|128),r[i++]=a>>6&63|128),r[i++]=63&a|128)}}else for(n=0;n>>24|t>>>8&65280|t<<8&0xff0000|(255&t)<<24)>>>0}eb.toHex=function(t){for(var e="",r=0;r>>0;return o};eb.split32=function(t,e){for(var r=Array(4*t.length),i=0,n=0;i>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r};eb.rotr32=function(t,e){return t>>>e|t<<32-e};eb.rotl32=function(t,e){return t<>>32-e};eb.sum32=function(t,e){return t+e>>>0};eb.sum32_3=function(t,e,r){return t+e+r>>>0};eb.sum32_4=function(t,e,r,i){return t+e+r+i>>>0};eb.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0};eb.sum64=function(t,e,r,i){var n=t[e],s=i+t[e+1]>>>0;t[e]=(s>>0,t[e+1]=s};eb.sum64_hi=function(t,e,r,i){return(e+i>>>0>>0};eb.sum64_lo=function(t,e,r,i){return e+i>>>0};eb.sum64_4_hi=function(t,e,r,i,n,s,o,a){var f,h=e;return f=0+((h=h+i>>>0)>>0)>>0)>>0};eb.sum64_4_lo=function(t,e,r,i,n,s,o,a){return e+i+s+a>>>0};eb.sum64_5_hi=function(t,e,r,i,n,s,o,a,f,h){var u,l=e;return u=0+((l=l+i>>>0)>>0)>>0)>>0)>>0};eb.sum64_5_lo=function(t,e,r,i,n,s,o,a,f,h){return e+i+s+a+h>>>0};eb.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0};eb.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};eb.shr64_hi=function(t,e,r){return t>>>r};eb.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};var eS={};function e_(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}eS.BlockHash=e_,e_.prototype.update=function(t,e){if(t=eb.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=eb.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s>>3};eC.g1_256=function(t){return eB(t,17)^eB(t,19)^t>>>10};var eT=eb.rotl32,eD=eb.sum32,eU=eb.sum32_5,ek=eC.ft_1,eq=eS.BlockHash,eF=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6];function ez(){if(!(this instanceof ez))return new ez;eq.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.W=Array(80)}eb.inherits(ez,eq);ez.blockSize=512,ez.outSize=160,ez.hmacStrength=80,ez.padLength=64,ez.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;ithis.blockSize&&(t=new this.Hash().update(t).digest()),eA(t.length<=this.blockSize);for(var e=t.length;e>8,o=255&n;s?r.push(s,o):r.push(o)}return r},e.zero2=r,e.toHex=i,e.encode=function(t,e){return"hex"===e?i(t):t}}),rx=ry(function(t,e){e.assert=rb,e.toArray=rw.toArray,e.zero2=rw.zero2,e.toHex=rw.toHex,e.encode=rw.encode;e.getNAF=function(t,e,r){var i=Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-f:f,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i};e.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,s=0;t.cmpn(-n)>0||e.cmpn(-s)>0;){var o,a,f=t.andln(3)+n&3,h=e.andln(3)+s&3;3===f&&(f=-1),3===h&&(h=-1),o=1&f?(3==(i=t.andln(7)+n&7)||5===i)&&2===h?-f:f:0,r[0].push(o),a=1&h?(3==(i=e.andln(7)+s&7)||5===i)&&2===f?-h:h:0,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r};e.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}};e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t};e.intFromLE=function(t){return new tK(t,"hex","le")}}),rM=rx.getNAF,rE=rx.getJSF,rI=rx.assert;function rS(t,e){this.type=t,this.p=new tK(e.p,16),this.red=e.prime?tK.red(e.prime):tK.mont(this.p),this.zero=new tK(0).toRed(this.red),this.one=new tK(1).toRed(this.red),this.two=new tK(2).toRed(this.red),this.n=e.n&&new tK(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function r_(t,e){this.curve=t,this.type=e,this.precomputed=null}rS.prototype.point=function(){throw Error("Not implemented")},rS.prototype.validate=function(){throw Error("Not implemented")},rS.prototype._fixedNafMul=function(t,e){rI(t.precomputed);var r=t._getDoubles(),i=rM(e,1,this._bitLength),n=(1<=s;f--)o=(o<<1)+i[f];a.push(o)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=n;l>0;l--){for(s=0;s=0;a--){for(var f=0;a>=0&&0===s[a];a--)f++;if(a>=0&&f++,o=o.dblp(f),a<0)break;var h=s[a];rI(0!==h),o="affine"===t.type?h>0?o.mixedAdd(n[h-1>>1]):o.mixedAdd(n[-h-1>>1].neg()):h>0?o.add(n[h-1>>1]):o.add(n[-h-1>>1].neg())}return"affine"===t.type?o.toP():o},rS.prototype._wnafMulAdd=function(t,e,r,i,n){var s,o,a,f=this._wnafT1,h=this._wnafT2,u=this._wnafT3,l=0;for(s=0;s=1;s-=2){var d=s-1,p=s;if(1!==f[d]||1!==f[p]){u[d]=rM(r[d],f[d],this._bitLength),u[p]=rM(r[p],f[p],this._bitLength),l=Math.max(u[d].length,l),l=Math.max(u[p].length,l);continue}var g=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(g[1]=e[d].add(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].add(e[p].neg())):(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=rE(r[d],r[p]);for(l=Math.max(v[0].length,l),u[d]=Array(l),u[p]=Array(l),o=0;o=0;s--){for(var x=0;s>=0;){var M=!0;for(o=0;o=0&&x++,A=A.dblp(x),s<0)break;for(o=0;o0?a=h[o][E-1>>1]:E<0&&(a=h[o][-E-1>>1].neg()),A="affine"===a.type?A.mixedAdd(a):A.add(a))}}for(s=0;s=Math.ceil((t.bitLength()+1)/e.step)},r_.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;nn[0].cmp(n[1])?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new tK(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))?r=s[0]:(r=s[1],rC(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return i=t.basis?t.basis.map(function(t){return{a:new tK(t.a,16),b:new tK(t.b,16)}}):this._getEndoBasis(r),{beta:e,lambda:r,basis:i}}},rB.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:tK.mont(t),r=new tK(2).toRed(e).redInvm(),i=r.redNeg(),n=new tK(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},rB.prototype._getEndoBasis=function(t){for(var e,r,i,n,s,o,a,f,h,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,c=this.n.clone(),d=new tK(1),p=new tK(0),g=new tK(0),m=new tK(1),v=0;0!==l.cmpn(0);){var y=c.div(l);f=c.sub(y.mul(l)),h=g.sub(y.mul(d));var b=m.sub(y.mul(p));if(!i&&0>f.cmp(u))e=a.neg(),r=d,i=f.neg(),n=h;else if(i&&2==++v)break;a=f,c=l,l=f,g=d,d=h,m=p,p=b}s=f.neg(),o=h;var A=i.sqr().add(n.sqr());return s.sqr().add(o.sqr()).cmp(A)>=0&&(s=e,o=r),i.negative&&(i=i.neg(),n=n.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:i,b:n},{a:s,b:o}]},rB.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),f=n.mul(r.b),h=s.mul(i.b);return{k1:t.sub(o).sub(a),k2:f.add(h).neg()}},rB.prototype.pointFromX=function(t,e){(t=new tK(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},rB.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},rB.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s":""},rR.prototype.isInfinity=function(){return this.inf},rR.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t)||0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},rR.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},rR.prototype.getX=function(){return this.x.fromRed()},rR.prototype.getY=function(){return this.y.fromRed()},rR.prototype.mul=function(t){return t=new tK(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},rR.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},rR.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},rR.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},rR.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},rR.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},rN(rP,rS.BasePoint),rB.prototype.jpoint=function(t,e,r){return new rP(this,t,e,r)},rP.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},rP.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},rP.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),f=s.redSub(o);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),u=h.redMul(a),l=i.redMul(h),c=f.redSqr().redIAdd(u).redISub(l).redISub(l),d=f.redMul(l.redISub(c)).redISub(s.redMul(u)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(c,d,p)},rP.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),h=f.redMul(o),u=r.redMul(f),l=a.redSqr().redIAdd(h).redISub(u).redISub(u),c=a.redMul(u.redISub(l)).redISub(n.redMul(h)),d=this.z.redMul(o);return this.curve.jpoint(l,c,d)},rP.prototype.dblp=function(t){if(0===t||this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var e,r=this;for(e=0;e=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},rP.prototype.inspect=function(){return this.isInfinity()?"":""},rP.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var rO=ry(function(t,e){e.base=rS,e.short=rB,e.mont=null,e.edwards=null}),rT=ry(function(t,e){var r,i=rx.assert;function n(t){"short"===t.type?this.curve=new rO.short(t):"edwards"===t.type?this.curve=new rO.edwards(t):this.curve=new rO.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var i=new n(r);return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:i}),i}})}e.PresetCurve=n,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:ey.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:ey.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:ey.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:ey.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:ey.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ey.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ey.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch{r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:ey.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function rD(t){if(!(this instanceof rD))return new rD(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=rw.toArray(t.entropy,t.entropyEnc||"hex"),r=rw.toArray(t.nonce,t.nonceEnc||"hex"),i=rw.toArray(t.pers,t.persEnc||"hex");rb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}rD.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},rD.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=rw.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length"};var rq=rx.assert;function rF(t,e){if(t instanceof rF)return t;this._importDER(t,e)||(rq(t.r&&t.s,"Signature without r or s"),this.r=new tK(t.r,16),this.s=new tK(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function rz(){this.place=0}function rL(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=e.place;s>>=0;return!(n<=127)&&(e.place=o,n)}function rH(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}rF.prototype._importDER=function(t,e){t=rx.toArray(t,e);var r=new rz;if(48!==t[r.place++])return!1;var i=rL(t,r);if(!1===i||i+r.place!==t.length||2!==t[r.place++])return!1;var n=rL(t,r);if(!1===n)return!1;var s=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var o=rL(t,r);if(!1===o||t.length!==o+r.place)return!1;var a=t.slice(r.place,o+r.place);if(0===s[0]){if(!(128&s[1]))return!1;else s=s.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;else a=a.slice(1)}return this.r=new tK(s),this.s=new tK(a),this.recoveryParam=null,!0},rF.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=rH(e),r=rH(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var i=[2];rQ(i,e.length),(i=i.concat(e)).push(2),rQ(i,r.length);var n=i.concat(r),s=[48];return rQ(s,n.length),s=s.concat(n),rx.encode(s,t)};var rj=function(){throw Error("unsupported")},rK=rx.assert;function rJ(t){if(!(this instanceof rJ))return new rJ(t);"string"==typeof t&&(rK(Object.prototype.hasOwnProperty.call(rT,t),"Unknown curve "+t),t=rT[t]),t instanceof rT.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}rJ.prototype.keyPair=function(t){return new rk(this,t)},rJ.prototype.keyFromPrivate=function(t,e){return rk.fromPrivate(this,t,e)},rJ.prototype.keyFromPublic=function(t,e){return rk.fromPublic(this,t,e)},rJ.prototype.genKeyPair=function(t){t||(t={});for(var e=new rD({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||rj(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new tK(2));;){var n=new tK(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},rJ.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},rJ.prototype.sign=function(t,e,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new tK(t,16));for(var n=this.n.byteLength(),s=e.getPrivate().toArray("be",n),o=t.toArray("be",n),a=new rD({hash:this.hash,entropy:s,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),f=this.n.sub(new tK(1)),h=0;;h++){var u=i.k?i.k(h):new tK(a.generate(this.n.byteLength()));if(!(0>=(u=this._truncateToN(u,!0)).cmpn(1)||u.cmp(f)>=0)){var l=this.g.mul(u);if(!l.isInfinity()){var c=l.getX(),d=c.umod(this.n);if(0!==d.cmpn(0)){var p=u.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(l.getY().isOdd()?1:0)|(0!==c.cmp(d)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new rF({r:d,s:p,recoveryParam:g})}}}}}},rJ.prototype.verify=function(t,e,r,i){t=this._truncateToN(new tK(t,16)),r=this.keyFromPublic(r,i);var n=(e=new rF(e,"hex")).r,s=e.s;if(0>n.cmpn(1)||n.cmp(this.n)>=0||0>s.cmpn(1)||s.cmp(this.n)>=0)return!1;var o,a=s.invm(this.n),f=a.mul(t).umod(this.n),h=a.mul(n).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(f,r.getPublic(),h)).isInfinity()&&o.eqXToP(n):!(o=this.g.mulAdd(f,r.getPublic(),h)).isInfinity()&&0===o.getX().umod(this.n).cmp(n)},rJ.prototype.recoverPubKey=function(t,e,r,i){rK((3&r)===r,"The recovery param is more than two bits"),e=new rF(e,i);var n=this.n,s=new tK(t),o=e.r,a=e.s,f=1&r,h=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw Error("Unable to find sencond key candinate");o=h?this.curve.pointFromX(o.add(this.curve.n),f):this.curve.pointFromX(o,f);var u=e.r.invm(n),l=n.sub(s).mul(u).umod(n),c=a.mul(u).umod(n);return this.g.mulAdd(l,o,c)},rJ.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new rF(e,i)).recoveryParam)return e.recoveryParam;for(var n,s=0;s<4;s++){try{n=this.recoverPubKey(t,e,s)}catch{continue}if(n.eq(r))return s}throw Error("Unable to find valid recovery factor")},ry(function(t,e){e.version="6.5.4",e.utils=rx,e.rand=function(){throw Error("unsupported")},e.curve=rO,e.curves=rT,e.ec=rJ,e.eddsa=null}).ec,new tP("signing-key/5.7.0");new tP("transactions/5.7.0"),(g=G||(G={}))[g.legacy=0]="legacy",g[g.eip2930=1]="eip2930",g[g.eip1559=2]="eip1559",Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;let rG={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}};function rY(t,e){return!!Array.isArray(t)&&(!("u">typeof e)||!t.length||t.every(e))}var rV=r("63064"),rW=r("90772"),rX=r("12044"),rZ=r("38200");class r$ extends rZ.q{constructor(t){super(),this.opts=t,this.protocol="wc",this.version=2}}class r0 extends rZ.q{constructor(t,e){super(),this.core=t,this.logger=e,this.records=new Map}}class r1{constructor(t,e){this.logger=t,this.core=e}}class r2 extends rZ.q{constructor(t,e){super(),this.relayer=t,this.logger=e}}class r3 extends rZ.q{constructor(t){super()}}class r6{constructor(t,e,r,i){this.core=t,this.logger=e,this.name=r}}class r8 extends rZ.q{constructor(t,e){super(),this.relayer=t,this.logger=e}}class r5 extends rZ.q{constructor(t,e){super(),this.core=t,this.logger=e}}class r4{constructor(t,e){this.projectId=t,this.logger=e}}class r9{constructor(t,e){this.projectId=t,this.logger=e}}var r7=r("85094"),it=r("15144"),ie=r("43631"),ir=r("58183"),ii=r(34155);r(48764).Buffer;var is=Object.defineProperty,io=Object.getOwnPropertySymbols,ia=Object.prototype.hasOwnProperty,ih=Object.prototype.propertyIsEnumerable,iu=(t,e,r)=>e in t?is(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,il=(t,e)=>{for(var r in e||(e={}))ia.call(e,r)&&iu(t,r,e[r]);if(io)for(var r of io(e))ih.call(e,r)&&iu(t,r,e[r]);return t};let ic={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"};function id(){return"u">typeof ii&&"u">typeof ii.versions&&"u">typeof ii.versions.node}function ip(){return!(0,tc.getDocument)()&&!!(0,tc.getNavigator)()&&"ReactNative"===navigator.product}function ig(){return!id()&&!!(0,tc.getNavigator)()&&!!(0,tc.getDocument)()}function im(){return ip()?ic.reactNative:id()?ic.node:ig()?ic.browser:ic.unknown}function iv(t){return Object.fromEntries(t.entries())}function iy(t){return new Map(Object.entries(t))}function ib(t,e,r){return new Promise(async(i,n)=>{let s=setTimeout(()=>n(Error(r)),e);try{let e=await t;i(e)}catch(t){n(t)}clearTimeout(s)})}function iA(t,e){if("string"==typeof e&&e.startsWith(`${t}:`))return e;if("topic"===t.toLowerCase()){if("string"!=typeof e)throw Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}if("id"===t.toLowerCase()){if("number"!=typeof e)throw Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw Error(`Unknown expirer target type: ${t}`)}function iw(t,e){return(0,tl.fromMiliseconds)((e||Date.now())+(0,tl.toMiliseconds)(t))}function ix(t){return Date.now()>=(0,tl.toMiliseconds)(t)}function iM(t,e){return`${t}${e?`:${e}`:""}`}var iE="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},iI={exports:{}};m=iI,function(){var t="input is invalid type",e="object"==typeof window,r=e?window:{};r.JS_SHA3_NO_WINDOW&&(e=!1);var i=!e&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof ii&&ii.versions&&ii.versions.node?r=iE:i&&(r=self);var n=!r.JS_SHA3_NO_COMMON_JS&&m.exports,s=!r.JS_SHA3_NO_ARRAY_BUFFER&&"u">typeof ArrayBuffer,o="0123456789abcdef".split(""),a=[4,1024,262144,0x4000000],f=[0,8,16,24],h=[1,0,32898,0,32906,0x80000000,0x80008000,0x80000000,32907,0,0x80000001,0,0x80008081,0x80000000,32777,0x80000000,138,0,136,0,0x80008009,0,0x8000000a,0,0x8000808b,0,139,0x80000000,32905,0x80000000,32771,0x80000000,32770,0x80000000,128,0x80000000,32778,0,0x8000000a,0x80000000,0x80008081,0x80000000,32896,0x80000000,0x80000001,0,0x80008008,0x80000000],u=[224,256,384,512],l=[128,256],c=["hex","buffer","arrayBuffer","array","digest"],d={128:168,256:136};(r.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),s&&(r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var p=function(t,e,r){return function(i){return new B(t,e,t).update(i)[r]()}},g=function(t,e,r){return function(i,n){return new B(t,e,n).update(i)[r]()}},v=function(t,e,r){return function(e,i,n,s){return x["cshake"+t].update(e,i,n,s)[r]()}},y=function(t,e,r){return function(e,i,n,s){return x["kmac"+t].update(e,i,n,s)[r]()}},b=function(t,e,r,i){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function R(t,e,r){B.call(this,t,e,r)}B.prototype.update=function(e){if(this.finalized)throw Error("finalize already called");var r,i=typeof e;if("string"!==i){if("object"===i){if(null===e)throw Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!s||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}for(var n,o,a=this.blocks,h=this.byteCount,u=e.length,l=this.blockCount,c=0,d=this.s;c>2]|=e[c]<>2]|=o<>2]|=(192|o>>6)<=57344?a[n>>2]|=(224|o>>12)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(this.start=n-h,this.block=a[l],n=0;n>=8,r=255&t;r>0;)n.unshift(r),t>>=8,r=255&t,++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},B.prototype.encodeString=function(e){var r,i=typeof e;if("string"!==i){if("object"===i){if(null===e)throw Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!s||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}var n=0,o=e.length;if(r)n=o;else for(var a=0;a=57344?n+=3:(f=65536+((1023&f)<<10|1023&e.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(e),n},B.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];a%e==0&&(P(r),s=0)}return n&&(f+=o[(t=r[s])>>4&15]+o[15&t],n>1&&(f+=o[t>>12&15]+o[t>>8&15]),n>2&&(f+=o[t>>20&15]+o[t>>16&15])),f},B.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,s=0,o=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var f=new Uint32Array(t);o>8&255,f[t+2]=e>>16&255,f[t+3]=e>>24&255;a%r==0&&P(i)}return s&&(t=a<<2,e=i[o],f[t]=255&e,s>1&&(f[t+1]=e>>8&255),s>2&&(f[t+2]=e>>16&255)),f},R.prototype=new B,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var P=function(t){var e,r,i,n,s,o,a,f,u,l,c,d,p,g,m,v,y,b,A,w,x,M,E,I,S,_,N,C,B,R,P,O,T,D,U,k,q,F,z,L,H,Q,j,K,J,G,Y,V,W,X,Z,$,tt,te,tr,ti,tn,ts,to,ta,tf,th,tu;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],f=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],d=t[8]^t[18]^t[28]^t[38]^t[48],p=t[9]^t[19]^t[29]^t[39]^t[49],e=d^(o<<1|a>>>31),r=p^(a<<1|o>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(f<<1|u>>>31),r=s^(u<<1|f>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=o^(l<<1|c>>>31),r=a^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=f^(d<<1|p>>>31),r=u^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(n<<1|s>>>31),r=c^(s<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,g=t[0],m=t[1],G=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,C=t[20]<<3|t[21]>>>29,B=t[21]<<3|t[20]>>>29,ta=t[31]<<9|t[30]>>>23,tf=t[30]<<9|t[31]>>>23,Q=t[40]<<18|t[41]>>>14,j=t[41]<<18|t[40]>>>14,D=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,V=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,R=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,th=t[42]<<2|t[43]>>>30,tu=t[43]<<2|t[42]>>>30,te=t[5]<<30|t[4]>>>2,tr=t[4]<<30|t[5]>>>2,k=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,O=t[45]<<29|t[44]>>>3,T=t[44]<<29|t[45]>>>3,I=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,ti=t[17]<<23|t[16]>>>9,tn=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,x=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,J=t[9]<<27|t[8]>>>5,_=t[18]<<20|t[19]>>>12,N=t[19]<<20|t[18]>>>12,ts=t[29]<<7|t[28]>>>25,to=t[28]<<7|t[29]>>>25,L=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=g^~v&b,t[1]=m^~y&A,t[10]=I^~_&C,t[11]=S^~N&B,t[20]=D^~k&F,t[21]=U^~q&z,t[30]=K^~G&V,t[31]=J^~Y&W,t[40]=te^~ti&ts,t[41]=tr^~tn&to,t[2]=v^~b&w,t[3]=y^~A&x,t[12]=_^~C&R,t[13]=N^~B&P,t[22]=k^~F&L,t[23]=q^~z&H,t[32]=G^~V&X,t[33]=Y^~W&Z,t[42]=ti^~ts&ta,t[43]=tn^~to&tf,t[4]=b^~w&M,t[5]=A^~x&E,t[14]=C^~R&O,t[15]=B^~P&T,t[24]=F^~L&Q,t[25]=z^~H&j,t[34]=V^~X&$,t[35]=W^~Z&tt,t[44]=ts^~ta&th,t[45]=to^~tf&tu,t[6]=w^~M&g,t[7]=x^~E&m,t[16]=R^~O&I,t[17]=P^~T&S,t[26]=L^~Q&D,t[27]=H^~j&U,t[36]=X^~$&K,t[37]=Z^~tt&J,t[46]=ta^~th&te,t[47]=tf^~tu&tr,t[8]=M^~g&v,t[9]=E^~m&y,t[18]=O^~I&_,t[19]=T^~S&N,t[28]=Q^~D&k,t[29]=j^~U&q,t[38]=$^~K&G,t[39]=tt^~J&Y,t[48]=th^~te&ti,t[49]=tu^~tr&tn,t[0]^=h[i],t[1]^=h[i+1]};if(n)m.exports=x;else for(E=0;E{try{if("test"!=="test".normalize(e))throw Error("bad normalize")}catch{t.push(e)}}),t.length)throw Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw Error("broken implementation")}catch(t){return t.message}return null}();(v=Y||(Y={})).DEBUG="DEBUG",v.INFO="INFO",v.WARNING="WARNING",v.ERROR="ERROR",v.OFF="OFF",(y=V||(V={})).UNKNOWN_ERROR="UNKNOWN_ERROR",y.NOT_IMPLEMENTED="NOT_IMPLEMENTED",y.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",y.NETWORK_ERROR="NETWORK_ERROR",y.SERVER_ERROR="SERVER_ERROR",y.TIMEOUT="TIMEOUT",y.BUFFER_OVERRUN="BUFFER_OVERRUN",y.NUMERIC_FAULT="NUMERIC_FAULT",y.MISSING_NEW="MISSING_NEW",y.INVALID_ARGUMENT="INVALID_ARGUMENT",y.MISSING_ARGUMENT="MISSING_ARGUMENT",y.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",y.CALL_EXCEPTION="CALL_EXCEPTION",y.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",y.NONCE_EXPIRED="NONCE_EXPIRED",y.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",y.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",y.TRANSACTION_REPLACED="TRANSACTION_REPLACED",y.ACTION_REJECTED="ACTION_REJECTED";let iP="0123456789abcdef";class iO{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){let r=t.toLowerCase();null==iN[r]&&this.throwArgumentError("invalid log level name","logLevel",t),iC>iN[r]||console.log.apply(console,e)}debug(...t){this._log(iO.levels.DEBUG,t)}info(...t){this._log(iO.levels.INFO,t)}warn(...t){this._log(iO.levels.WARNING,t)}makeError(t,e,r){if(i_)return this.makeError("censored error",e,{});e||(e=iO.errors.UNKNOWN_ERROR),r||(r={});let i=[];Object.keys(r).forEach(t=>{let e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t>4],r+=iP[15&e[t]];i.push(t+"=Uint8Array(0x"+r+")")}else i.push(t+"="+JSON.stringify(e))}catch{i.push(t+"="+JSON.stringify(r[t].toString()))}}),i.push(`code=${e}`),i.push(`version=${this.version}`);let n=t,s="";switch(e){case V.NUMERIC_FAULT:{s="NUMERIC_FAULT";let e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":s+="-"+e;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case V.CALL_EXCEPTION:case V.INSUFFICIENT_FUNDS:case V.MISSING_NEW:case V.NONCE_EXPIRED:case V.REPLACEMENT_UNDERPRICED:case V.TRANSACTION_REPLACED:case V.UNPREDICTABLE_GAS_LIMIT:s=e}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(t+=" ("+i.join(", ")+")");let o=Error(t);return o.reason=n,o.code=e,Object.keys(r).forEach(function(t){o[t]=r[t]}),o}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,iO.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,i){t||this.throwError(e,r,i)}assertArgument(t,e,r,i){t||this.throwArgumentError(e,r,i)}checkNormalize(t){iR&&this.throwError("platform missing String.prototype.normalize",iO.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:iR})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=0x1fffffffffffff)&&this.throwError(e,iO.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,iO.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,iO.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||null==t)&&this.throwError("missing new",iO.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",iO.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||null==t)&&this.throwError("missing new",iO.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return iB||(iB=new iO("logger/5.7.0")),iB}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",iO.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),iS){if(!t)return;this.globalLogger().throwError("error censorship permanent",iO.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}i_=!!t,iS=!!e}static setLogLevel(t){let e=iN[t.toLowerCase()];if(null==e){iO.globalLogger().warn("invalid log level - "+t);return}iC=e}static from(t){return new iO(t)}}iO.errors=V,iO.levels=Y;let iT=new iO("bytes/5.7.0");function iD(t){return!!t.toHexString}function iU(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return iU(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function ik(t){return"number"==typeof t&&t==t&&t%1==0}function iq(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!ik(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function iF(t,e){if(e||(e={}),"number"==typeof t){iT.checkSafeUint53(t,"invalid arrayify value");let e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),iU(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),iD(t)&&(t=t.toHexString()),iz(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":iT.throwArgumentError("hex data is odd-length","value",t));let i=[];for(let t=0;t>4]+iL[15&i]}return e}return iT.throwArgumentError("invalid hexlify value","value",t)}function iQ(t,e){for("string"!=typeof t?t=iH(t):iz(t)||iT.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&iT.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}var ij={exports:{}},iK=function(t){var e=t.default;if("function"==typeof e){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}),r}(Object.freeze({__proto__:null,default:{}}));!function(t,e){function r(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{u="u">typeof window&&"u">typeof window.Buffer?window.Buffer:iK.Buffer}catch{}function s(t,e){var i=t.charCodeAt(e);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+t)}function o(t,e,r){var i=s(t,r);return r-1>=e&&(i|=s(t,r-1)<<4),i}function a(t,e,i,n){for(var s=0,o=0,a=Math.min(t.length,i),f=e;f=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&o0?t:e},n.min=function(t,e){return 0>t.cmp(e)?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,s++);return this._strip()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var i=0;i=e;i-=2)n=o(t,e,i)<=18?(s-=18,a+=1,this.words[a]|=n>>>26):s+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(s-=18,a+=1,this.words[a]|=n>>>26):s+=8;this._strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,f=Math.min(s,s-o)+r,h=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"u">typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch{n.prototype.inspect=h}else n.prototype.inspect=h;function h(){return(this.red?""}var u,l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];n.prototype.toString=function(t,e){if(t=t||10,e=0|e||1,16===t||"hex"===t){i="";for(var i,n=0,s=0,o=0;o>>24-n&0xffffff,(n+=2)>=26&&(n-=26,o--),i=0!==s||o!==this.length-1?l[6-f.length]+f+i:f+i}for(0!==s&&(i=s.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],u=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(u).toString(t);i=(p=p.idivn(u)).isZero()?g+i:l[h-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?t+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},u&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(u,t,e)}),n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};n.prototype.toArrayLike=function(t,e,i){this._strip();var n,s,o=this.byteLength(),a=i||Math.max(1,o);r(o<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0");var f=(n=t,s=a,n.allocUnsafe?n.allocUnsafe(s):new n(s));return this["_toArrayLike"+("le"===e?"LE":"BE")](f,o),f},n.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,s=0;n>8&255),r>16&255),6===s?(r>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===s?(r>=0&&(t[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e};function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=0x3ffffff&o,f=o/0x4000000|0;r.words[0]=a;for(var h=1;h>>26,l=0x3ffffff&f,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;n=0|t.words[p],u+=(o=n*(s=0|e.words[d])+l)/0x4000000|0,l=0x3ffffff&o}r.words[h]=0|l,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r._strip()}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i),this._strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),e?this.words[i]=this.words[i]|1<t.length?(r=this,i=t):(r=t,i=this);for(var e,r,i,n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;st.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(e=this,r=t):(e=t,r=this);for(var s=0,o=0;o>26,this.words[o]=0x3ffffff&i;for(;0!==s&&o>26,this.words[o]=0x3ffffff&i;if(0===s&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,m=0|o[2],v=8191&m,y=m>>>13,b=0|o[3],A=8191&b,w=b>>>13,x=0|o[4],M=8191&x,E=x>>>13,I=0|o[5],S=8191&I,_=I>>>13,N=0|o[6],C=8191&N,B=N>>>13,R=0|o[7],P=8191&R,O=R>>>13,T=0|o[8],D=8191&T,U=T>>>13,k=0|o[9],q=8191&k,F=k>>>13,z=0|a[0],L=8191&z,H=z>>>13,Q=0|a[1],j=8191&Q,K=Q>>>13,J=0|a[2],G=8191&J,Y=J>>>13,V=0|a[3],W=8191&V,X=V>>>13,Z=0|a[4],$=8191&Z,tt=Z>>>13,te=0|a[5],tr=8191&te,ti=te>>>13,tn=0|a[6],ts=8191&tn,to=tn>>>13,ta=0|a[7],tf=8191&ta,th=ta>>>13,tu=0|a[8],tl=8191&tu,tc=tu>>>13,td=0|a[9],tp=8191&td,tg=td>>>13;r.negative=t.negative^e.negative,r.length=19,i=Math.imul(l,L),n=(n=Math.imul(l,H))+Math.imul(c,L)|0,s=Math.imul(c,H);var tm=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tm>>>26)|0,tm&=0x3ffffff,i=Math.imul(p,L),n=(n=Math.imul(p,H))+Math.imul(g,L)|0,s=Math.imul(g,H),i=i+Math.imul(l,j)|0,n=(n=n+Math.imul(l,K)|0)+Math.imul(c,j)|0,s=s+Math.imul(c,K)|0;var tv=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tv>>>26)|0,tv&=0x3ffffff,i=Math.imul(v,L),n=(n=Math.imul(v,H))+Math.imul(y,L)|0,s=Math.imul(y,H),i=i+Math.imul(p,j)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(g,j)|0,s=s+Math.imul(g,K)|0,i=i+Math.imul(l,G)|0,n=(n=n+Math.imul(l,Y)|0)+Math.imul(c,G)|0,s=s+Math.imul(c,Y)|0;var ty=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(ty>>>26)|0,ty&=0x3ffffff,i=Math.imul(A,L),n=(n=Math.imul(A,H))+Math.imul(w,L)|0,s=Math.imul(w,H),i=i+Math.imul(v,j)|0,n=(n=n+Math.imul(v,K)|0)+Math.imul(y,j)|0,s=s+Math.imul(y,K)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,G)|0,s=s+Math.imul(g,Y)|0,i=i+Math.imul(l,W)|0,n=(n=n+Math.imul(l,X)|0)+Math.imul(c,W)|0,s=s+Math.imul(c,X)|0;var tb=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tb>>>26)|0,tb&=0x3ffffff,i=Math.imul(M,L),n=(n=Math.imul(M,H))+Math.imul(E,L)|0,s=Math.imul(E,H),i=i+Math.imul(A,j)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(w,j)|0,s=s+Math.imul(w,K)|0,i=i+Math.imul(v,G)|0,n=(n=n+Math.imul(v,Y)|0)+Math.imul(y,G)|0,s=s+Math.imul(y,Y)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,X)|0,i=i+Math.imul(l,$)|0,n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,$)|0,s=s+Math.imul(c,tt)|0;var tA=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tA>>>26)|0,tA&=0x3ffffff,i=Math.imul(S,L),n=(n=Math.imul(S,H))+Math.imul(_,L)|0,s=Math.imul(_,H),i=i+Math.imul(M,j)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(E,j)|0,s=s+Math.imul(E,K)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(w,G)|0,s=s+Math.imul(w,Y)|0,i=i+Math.imul(v,W)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(y,W)|0,s=s+Math.imul(y,X)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,$)|0,s=s+Math.imul(g,tt)|0,i=i+Math.imul(l,tr)|0,n=(n=n+Math.imul(l,ti)|0)+Math.imul(c,tr)|0,s=s+Math.imul(c,ti)|0;var tw=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tw>>>26)|0,tw&=0x3ffffff,i=Math.imul(C,L),n=(n=Math.imul(C,H))+Math.imul(B,L)|0,s=Math.imul(B,H),i=i+Math.imul(S,j)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(_,j)|0,s=s+Math.imul(_,K)|0,i=i+Math.imul(M,G)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(E,G)|0,s=s+Math.imul(E,Y)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(w,W)|0,s=s+Math.imul(w,X)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(y,$)|0,s=s+Math.imul(y,tt)|0,i=i+Math.imul(p,tr)|0,n=(n=n+Math.imul(p,ti)|0)+Math.imul(g,tr)|0,s=s+Math.imul(g,ti)|0,i=i+Math.imul(l,ts)|0,n=(n=n+Math.imul(l,to)|0)+Math.imul(c,ts)|0,s=s+Math.imul(c,to)|0;var tx=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tx>>>26)|0,tx&=0x3ffffff,i=Math.imul(P,L),n=(n=Math.imul(P,H))+Math.imul(O,L)|0,s=Math.imul(O,H),i=i+Math.imul(C,j)|0,n=(n=n+Math.imul(C,K)|0)+Math.imul(B,j)|0,s=s+Math.imul(B,K)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,Y)|0,i=i+Math.imul(M,W)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(E,W)|0,s=s+Math.imul(E,X)|0,i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(w,$)|0,s=s+Math.imul(w,tt)|0,i=i+Math.imul(v,tr)|0,n=(n=n+Math.imul(v,ti)|0)+Math.imul(y,tr)|0,s=s+Math.imul(y,ti)|0,i=i+Math.imul(p,ts)|0,n=(n=n+Math.imul(p,to)|0)+Math.imul(g,ts)|0,s=s+Math.imul(g,to)|0,i=i+Math.imul(l,tf)|0,n=(n=n+Math.imul(l,th)|0)+Math.imul(c,tf)|0,s=s+Math.imul(c,th)|0;var tM=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tM>>>26)|0,tM&=0x3ffffff,i=Math.imul(D,L),n=(n=Math.imul(D,H))+Math.imul(U,L)|0,s=Math.imul(U,H),i=i+Math.imul(P,j)|0,n=(n=n+Math.imul(P,K)|0)+Math.imul(O,j)|0,s=s+Math.imul(O,K)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(B,G)|0,s=s+Math.imul(B,Y)|0,i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(M,$)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(E,$)|0,s=s+Math.imul(E,tt)|0,i=i+Math.imul(A,tr)|0,n=(n=n+Math.imul(A,ti)|0)+Math.imul(w,tr)|0,s=s+Math.imul(w,ti)|0,i=i+Math.imul(v,ts)|0,n=(n=n+Math.imul(v,to)|0)+Math.imul(y,ts)|0,s=s+Math.imul(y,to)|0,i=i+Math.imul(p,tf)|0,n=(n=n+Math.imul(p,th)|0)+Math.imul(g,tf)|0,s=s+Math.imul(g,th)|0,i=i+Math.imul(l,tl)|0,n=(n=n+Math.imul(l,tc)|0)+Math.imul(c,tl)|0,s=s+Math.imul(c,tc)|0;var tE=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tE>>>26)|0,tE&=0x3ffffff,i=Math.imul(q,L),n=(n=Math.imul(q,H))+Math.imul(F,L)|0,s=Math.imul(F,H),i=i+Math.imul(D,j)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(U,j)|0,s=s+Math.imul(U,K)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(O,G)|0,s=s+Math.imul(O,Y)|0,i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(B,W)|0,s=s+Math.imul(B,X)|0,i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(_,$)|0,s=s+Math.imul(_,tt)|0,i=i+Math.imul(M,tr)|0,n=(n=n+Math.imul(M,ti)|0)+Math.imul(E,tr)|0,s=s+Math.imul(E,ti)|0,i=i+Math.imul(A,ts)|0,n=(n=n+Math.imul(A,to)|0)+Math.imul(w,ts)|0,s=s+Math.imul(w,to)|0,i=i+Math.imul(v,tf)|0,n=(n=n+Math.imul(v,th)|0)+Math.imul(y,tf)|0,s=s+Math.imul(y,th)|0,i=i+Math.imul(p,tl)|0,n=(n=n+Math.imul(p,tc)|0)+Math.imul(g,tl)|0,s=s+Math.imul(g,tc)|0,i=i+Math.imul(l,tp)|0,n=(n=n+Math.imul(l,tg)|0)+Math.imul(c,tp)|0,s=s+Math.imul(c,tg)|0;var tI=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tI>>>26)|0,tI&=0x3ffffff,i=Math.imul(q,j),n=(n=Math.imul(q,K))+Math.imul(F,j)|0,s=Math.imul(F,K),i=i+Math.imul(D,G)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(U,G)|0,s=s+Math.imul(U,Y)|0,i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,W)|0,s=s+Math.imul(O,X)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(B,$)|0,s=s+Math.imul(B,tt)|0,i=i+Math.imul(S,tr)|0,n=(n=n+Math.imul(S,ti)|0)+Math.imul(_,tr)|0,s=s+Math.imul(_,ti)|0,i=i+Math.imul(M,ts)|0,n=(n=n+Math.imul(M,to)|0)+Math.imul(E,ts)|0,s=s+Math.imul(E,to)|0,i=i+Math.imul(A,tf)|0,n=(n=n+Math.imul(A,th)|0)+Math.imul(w,tf)|0,s=s+Math.imul(w,th)|0,i=i+Math.imul(v,tl)|0,n=(n=n+Math.imul(v,tc)|0)+Math.imul(y,tl)|0,s=s+Math.imul(y,tc)|0,i=i+Math.imul(p,tp)|0,n=(n=n+Math.imul(p,tg)|0)+Math.imul(g,tp)|0,s=s+Math.imul(g,tg)|0;var tS=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tS>>>26)|0,tS&=0x3ffffff,i=Math.imul(q,G),n=(n=Math.imul(q,Y))+Math.imul(F,G)|0,s=Math.imul(F,Y),i=i+Math.imul(D,W)|0,n=(n=n+Math.imul(D,X)|0)+Math.imul(U,W)|0,s=s+Math.imul(U,X)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(O,$)|0,s=s+Math.imul(O,tt)|0,i=i+Math.imul(C,tr)|0,n=(n=n+Math.imul(C,ti)|0)+Math.imul(B,tr)|0,s=s+Math.imul(B,ti)|0,i=i+Math.imul(S,ts)|0,n=(n=n+Math.imul(S,to)|0)+Math.imul(_,ts)|0,s=s+Math.imul(_,to)|0,i=i+Math.imul(M,tf)|0,n=(n=n+Math.imul(M,th)|0)+Math.imul(E,tf)|0,s=s+Math.imul(E,th)|0,i=i+Math.imul(A,tl)|0,n=(n=n+Math.imul(A,tc)|0)+Math.imul(w,tl)|0,s=s+Math.imul(w,tc)|0,i=i+Math.imul(v,tp)|0,n=(n=n+Math.imul(v,tg)|0)+Math.imul(y,tp)|0,s=s+Math.imul(y,tg)|0;var t_=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(t_>>>26)|0,t_&=0x3ffffff,i=Math.imul(q,W),n=(n=Math.imul(q,X))+Math.imul(F,W)|0,s=Math.imul(F,X),i=i+Math.imul(D,$)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(U,$)|0,s=s+Math.imul(U,tt)|0,i=i+Math.imul(P,tr)|0,n=(n=n+Math.imul(P,ti)|0)+Math.imul(O,tr)|0,s=s+Math.imul(O,ti)|0,i=i+Math.imul(C,ts)|0,n=(n=n+Math.imul(C,to)|0)+Math.imul(B,ts)|0,s=s+Math.imul(B,to)|0,i=i+Math.imul(S,tf)|0,n=(n=n+Math.imul(S,th)|0)+Math.imul(_,tf)|0,s=s+Math.imul(_,th)|0,i=i+Math.imul(M,tl)|0,n=(n=n+Math.imul(M,tc)|0)+Math.imul(E,tl)|0,s=s+Math.imul(E,tc)|0,i=i+Math.imul(A,tp)|0,n=(n=n+Math.imul(A,tg)|0)+Math.imul(w,tp)|0,s=s+Math.imul(w,tg)|0;var tN=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tN>>>26)|0,tN&=0x3ffffff,i=Math.imul(q,$),n=(n=Math.imul(q,tt))+Math.imul(F,$)|0,s=Math.imul(F,tt),i=i+Math.imul(D,tr)|0,n=(n=n+Math.imul(D,ti)|0)+Math.imul(U,tr)|0,s=s+Math.imul(U,ti)|0,i=i+Math.imul(P,ts)|0,n=(n=n+Math.imul(P,to)|0)+Math.imul(O,ts)|0,s=s+Math.imul(O,to)|0,i=i+Math.imul(C,tf)|0,n=(n=n+Math.imul(C,th)|0)+Math.imul(B,tf)|0,s=s+Math.imul(B,th)|0,i=i+Math.imul(S,tl)|0,n=(n=n+Math.imul(S,tc)|0)+Math.imul(_,tl)|0,s=s+Math.imul(_,tc)|0,i=i+Math.imul(M,tp)|0,n=(n=n+Math.imul(M,tg)|0)+Math.imul(E,tp)|0,s=s+Math.imul(E,tg)|0;var tC=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tC>>>26)|0,tC&=0x3ffffff,i=Math.imul(q,tr),n=(n=Math.imul(q,ti))+Math.imul(F,tr)|0,s=Math.imul(F,ti),i=i+Math.imul(D,ts)|0,n=(n=n+Math.imul(D,to)|0)+Math.imul(U,ts)|0,s=s+Math.imul(U,to)|0,i=i+Math.imul(P,tf)|0,n=(n=n+Math.imul(P,th)|0)+Math.imul(O,tf)|0,s=s+Math.imul(O,th)|0,i=i+Math.imul(C,tl)|0,n=(n=n+Math.imul(C,tc)|0)+Math.imul(B,tl)|0,s=s+Math.imul(B,tc)|0,i=i+Math.imul(S,tp)|0,n=(n=n+Math.imul(S,tg)|0)+Math.imul(_,tp)|0,s=s+Math.imul(_,tg)|0;var tB=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tB>>>26)|0,tB&=0x3ffffff,i=Math.imul(q,ts),n=(n=Math.imul(q,to))+Math.imul(F,ts)|0,s=Math.imul(F,to),i=i+Math.imul(D,tf)|0,n=(n=n+Math.imul(D,th)|0)+Math.imul(U,tf)|0,s=s+Math.imul(U,th)|0,i=i+Math.imul(P,tl)|0,n=(n=n+Math.imul(P,tc)|0)+Math.imul(O,tl)|0,s=s+Math.imul(O,tc)|0,i=i+Math.imul(C,tp)|0,n=(n=n+Math.imul(C,tg)|0)+Math.imul(B,tp)|0,s=s+Math.imul(B,tg)|0;var tR=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tR>>>26)|0,tR&=0x3ffffff,i=Math.imul(q,tf),n=(n=Math.imul(q,th))+Math.imul(F,tf)|0,s=Math.imul(F,th),i=i+Math.imul(D,tl)|0,n=(n=n+Math.imul(D,tc)|0)+Math.imul(U,tl)|0,s=s+Math.imul(U,tc)|0,i=i+Math.imul(P,tp)|0,n=(n=n+Math.imul(P,tg)|0)+Math.imul(O,tp)|0,s=s+Math.imul(O,tg)|0;var tP=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tP>>>26)|0,tP&=0x3ffffff,i=Math.imul(q,tl),n=(n=Math.imul(q,tc))+Math.imul(F,tl)|0,s=Math.imul(F,tc),i=i+Math.imul(D,tp)|0,n=(n=n+Math.imul(D,tg)|0)+Math.imul(U,tp)|0,s=s+Math.imul(U,tg)|0;var tO=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tO>>>26)|0,tO&=0x3ffffff,i=Math.imul(q,tp),n=(n=Math.imul(q,tg))+Math.imul(F,tp)|0,s=Math.imul(F,tg);var tT=(h+i|0)+((8191&n)<<13)|0;return h=(s+(n>>>13)|0)+(tT>>>26)|0,tT&=0x3ffffff,f[0]=tm,f[1]=tv,f[2]=ty,f[3]=tb,f[4]=tA,f[5]=tw,f[6]=tx,f[7]=tM,f[8]=tE,f[9]=tI,f[10]=tS,f[11]=t_,f[12]=tN,f[13]=tC,f[14]=tB,f[15]=tR,f[16]=tP,f[17]=tO,f[18]=tT,0!==h&&(f[19]=h,r.length++),r};function m(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=0x3ffffff}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function v(t,e,r){return m(t,e,r)}Math.imul||(g=p),n.prototype.mulTo=function(t,e){var r,i,n=this.length+t.length;return 10===this.length&&10===t.length?i=g(this,t,e):n<63?i=p(this,t,e):n<1024?i=m(this,t,e):(r=this,i=m(r,t,e)),i},n.prototype.mul=function(t){var e=new n(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e,r=new n(null);return r.words=Array(this.length+t.length),e=this,m(e,t,r)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<0x4000000);for(var i=0,n=0;n>=26,i+=(s/0x4000000|0)+(o>>>26),this.words[n]=0x3ffffff&o}return 0!==i&&(this.words[n]=i,this.length++),e?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i=0);var e,i=t%26,n=(t-i)/26,s=0x3ffffff>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var n,s=t%26,o=Math.min((t-s)/26,this.length),a=0x3ffffff^0x3ffffff>>>s<o)for(this.length-=o,f=0;f=0&&(0!==h||f>=n);f--){var u=0|this.words[f];this.words[f]=h<<26-s|u>>>s,h=u&a}return i&&0!==h&&(i.words[i.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;return!(this.length<=i)&&!!(this.words[i]&1<=0);var e=t%26,i=(t-e)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==e&&i++,this.length=Math.min(i,this.length),0!==e&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>e<=0x4000000;e++)this.words[e]-=0x4000000,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<0x4000000),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(f/0x4000000|0),this.words[n+i]=0x3ffffff&o}for(;n>26,this.words[n+i]=0x3ffffff&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n>26,this.words[n]=0x3ffffff&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(t,e){var r=this.length-t.length,i=this.clone(),s=t,o=0|s.words[s.length-1];0!=(r=26-this._countBits(o))&&(s=s.ushln(r),i.iushln(r),o=0|s.words[s.length-1]);var a,f=i.length-s.length;if("mod"!==e){(a=new n(null)).length=f+1,a.words=Array(a.length);for(var h=0;h=0;l--){var c=(0|i.words[s.length+l])*0x4000000+(0|i.words[s.length+l-1]);for(c=Math.min(c/o|0,0x3ffffff),i._ishlnsubmul(s,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(s,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(t,e,i){var s,o,a;return(r(!t.isZero()),this.isZero())?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(s=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:s,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(s=a.div.neg()),{div:s,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||0>this.cmp(t)?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this._wordDiv(t,e)},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var i=0x4000000%t,n=0,s=this.length-1;s>=0;s--)n=(i*n+(0|this.words[s]))%t;return e?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var i=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+0x4000000*i;this.words[n]=s/t|0,i=s%t}return this._strip(),e?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var s=new n(1),o=new n(0),a=new n(0),f=new n(1),h=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;!(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(s.isOdd()||o.isOdd())&&(s.iadd(u),o.isub(l)),s.iushrn(1),o.iushrn(1);for(var p=0,g=1;!(i.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(u),f.isub(l)),a.iushrn(1),f.iushrn(1);e.cmp(i)>=0?(e.isub(i),s.isub(a),o.isub(f)):(i.isub(e),a.isub(s),f.isub(o))}return{a:a,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e,i=this,s=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var o=new n(1),a=new n(0),f=s.clone();i.cmpn(1)>0&&s.cmpn(1)>0;){for(var h=0,u=1;!(i.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(i.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);for(var l=0,c=1;!(s.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(s.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);i.cmp(s)>=0?(i.isub(s),o.isub(a)):(s.isub(i),a.isub(o))}return 0>(e=0===i.cmpn(1)?o:a).cmpn(0)&&e.iadd(t),e},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return(1&this.words[0])==0},n.prototype.isOdd=function(){return(1&this.words[0])==1},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,a&=0x3ffffff,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=0x3ffffff,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return -1===this.cmpn(t)},n.prototype.lt=function(t){return -1===this.cmp(t)},n.prototype.lten=function(t){return 0>=this.cmpn(t)},n.prototype.lte=function(t){return 0>=this.cmp(t)},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new E(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function I(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new n(null);return t.words=Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(A,b),A.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=s}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){var e;if(y[t])return y[t];if("k256"===t)e=new A;else if("p224"===t)e=new w;else if("p192"===t)e=new x;else if("p25519"===t)e=new M;else throw Error("Unknown prime "+t);return y[t]=e,e},E.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){r((t.negative|e.negative)==0,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(f(t,t.umod(this.m)._forceRed(this)),t)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var s=this.m.subn(1),o=0;!s.isZero()&&0===s.andln(1);)o++,s.iushrn(1);r(!s.isZero());var a=new n(1).toRed(this),f=a.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var l=this.pow(u,s),c=this.pow(t,s.addn(1).iushrn(1)),d=this.pow(t,s),p=o;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();r(m=0;i--){for(var h=e.words[i],u=f-1;u>=0;u--){var l=h>>u&1;if(s!==r[0]&&(s=this.sqr(s)),0===l&&0===o){a=0;continue}o<<=1,o|=l,4!=++a&&(0!==i||0!==u)||(s=this.mul(s,r[o]),a=0,o=0)}f=26}return s},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new I(t)},i(I,E),I.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},I.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},I.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},I.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=r.isub(i).iushrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):0>s.cmpn(0)&&(o=s.iadd(this.m)),o._forceRed(this)},I.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(ij,iE);var iJ=ij.exports;let iG="bignumber/5.7.0";var iY=iJ.BN;let iV=new iO(iG),iW={},iX=!1;class iZ{constructor(t,e){t!==iW&&iV.throwError("cannot call constructor directly; use BigNumber.from",iO.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return i0(i1(this).fromTwos(t))}toTwos(t){return i0(i1(this).toTwos(t))}abs(){return"-"===this._hex[0]?iZ.from(this._hex.substring(1)):this}add(t){return i0(i1(this).add(i1(t)))}sub(t){return i0(i1(this).sub(i1(t)))}div(t){return iZ.from(t).isZero()&&i2("division-by-zero","div"),i0(i1(this).div(i1(t)))}mul(t){return i0(i1(this).mul(i1(t)))}mod(t){let e=i1(t);return e.isNeg()&&i2("division-by-zero","mod"),i0(i1(this).umod(e))}pow(t){let e=i1(t);return e.isNeg()&&i2("negative-power","pow"),i0(i1(this).pow(e))}and(t){let e=i1(t);return(this.isNegative()||e.isNeg())&&i2("unbound-bitwise-result","and"),i0(i1(this).and(e))}or(t){let e=i1(t);return(this.isNegative()||e.isNeg())&&i2("unbound-bitwise-result","or"),i0(i1(this).or(e))}xor(t){let e=i1(t);return(this.isNegative()||e.isNeg())&&i2("unbound-bitwise-result","xor"),i0(i1(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&i2("negative-width","mask"),i0(i1(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&i2("negative-width","shl"),i0(i1(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&i2("negative-width","shr"),i0(i1(this).shrn(t))}eq(t){return i1(this).eq(i1(t))}lt(t){return i1(this).lt(i1(t))}lte(t){return i1(this).lte(i1(t))}gt(t){return i1(this).gt(i1(t))}gte(t){return i1(this).gte(i1(t))}isNegative(){return"-"===this._hex[0]}isZero(){return i1(this).isZero()}toNumber(){try{return i1(this).toNumber()}catch{i2("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return iV.throwError("this platform does not support BigInt",iO.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?iX||(iX=!0,iV.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?iV.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",iO.errors.UNEXPECTED_ARGUMENT,{}):iV.throwError("BigNumber.toString does not accept parameters",iO.errors.UNEXPECTED_ARGUMENT,{})),i1(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof iZ)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new iZ(iW,i$(t)):t.match(/^-?[0-9]+$/)?new iZ(iW,i$(new iY(t))):iV.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&i2("underflow","BigNumber.from",t),(t>=0x1fffffffffffff||t<=-0x1fffffffffffff)&&i2("overflow","BigNumber.from",t),iZ.from(String(t));if("bigint"==typeof t)return iZ.from(t.toString());if(iq(t))return iZ.from(iH(t));if(t){if(t.toHexString){let e=t.toHexString();if("string"==typeof e)return iZ.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(iz(e)||"-"===e[0]&&iz(e.substring(1))))return iZ.from(e)}}return iV.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function i$(t){if("string"!=typeof t)return i$(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&iV.throwArgumentError("invalid hex","value",t),"0x00"===(t=i$(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function i0(t){return iZ.from(i$(t))}function i1(t){let e=iZ.from(t).toHexString();return"-"===e[0]?new iY("-"+e.substring(3),16):new iY(e.substring(2),16)}function i2(t,e,r){let i={fault:t,operation:e};return null!=r&&(i.value=r),iV.throwError(t,iO.errors.NUMERIC_FAULT,i)}let i3=new iO(iG),i6={},i8=iZ.from(0),i5=iZ.from(-1);function i4(t,e,r,i){let n={fault:e,operation:r};return void 0!==i&&(n.value=i),i3.throwError(t,iO.errors.NUMERIC_FAULT,n)}let i9="0";for(;i9.length<256;)i9+=i9;function i7(t){if("number"!=typeof t)try{t=iZ.from(t).toNumber()}catch{}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+i9.substring(0,t):i3.throwArgumentError("invalid decimal size","decimals",t)}function nt(t,e){null==e&&(e=0);let r=i7(e),i=(t=iZ.from(t)).lt(i8);i&&(t=t.mul(i5));let n=t.mod(r).toString();for(;n.length2&&i3.throwArgumentError("too many decimal points","value",t);let s=n[0],o=n[1];for(s||(s="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>r.length-1&&i4("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.lengthnull==t[e]?i:(typeof t[e]!==r&&i3.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=n("signed","boolean",e),r=n("width","number",r),i=n("decimals","number",i)}return r%8&&i3.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&i3.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new nr(i6,e,r,i)}}class ni{constructor(t,e,r,i){t!==i6&&i3.throwError("cannot use FixedNumber constructor; use FixedNumber.from",iO.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&i3.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);let e=ne(this._value,this.format.decimals),r=ne(t._value,t.format.decimals);return ni.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);let e=ne(this._value,this.format.decimals),r=ne(t._value,t.format.decimals);return ni.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);let e=ne(this._value,this.format.decimals),r=ne(t._value,t.format.decimals);return ni.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);let e=ne(this._value,this.format.decimals),r=ne(t._value,t.format.decimals);return ni.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=ni.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(nn.toFormat(e.format))),e}ceiling(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=ni.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(nn.toFormat(e.format))),e}round(t){null==t&&(t=0);let e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&i3.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;let r=ni.from("1"+i9.substring(0,t),this.format),i=ns.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){return null==t?this._hex:(t%8&&i3.throwArgumentError("invalid byte width","width",t),iQ(iZ.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return ni.fromString(this._value,t)}static fromValue(t,e,r){var i;return null!=r||null==e||null!=(i=e)&&(iZ.isBigNumber(i)||"number"==typeof i&&i%1==0||"string"==typeof i&&i.match(/^-?[0-9]+$/)||iz(i)||"bigint"==typeof i||iq(i))||(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),ni.fromString(nt(t,e),nr.from(r))}static fromString(t,e){null==e&&(e="fixed");let r=nr.from(e),i=ne(t,r.decimals);!r.signed&&i.lt(i8)&&i4("unsigned value cannot be negative","overflow","value",t);let n=null;return n=r.signed?i.toTwos(r.width).toHexString():iQ(n=i.toHexString(),r.width/8),new ni(i6,n,nt(i,r.decimals),r)}static fromBytes(t,e){null==e&&(e="fixed");let r=nr.from(e);if(iF(t).length>r.width/8)throw Error("overflow");let i=iZ.from(t);r.signed&&(i=i.fromTwos(r.width));let n=i.toTwos((r.signed?0:1)+r.width).toHexString();return new ni(i6,n,nt(i,r.decimals),r)}static from(t,e){if("string"==typeof t)return ni.fromString(t,e);if(iq(t))return ni.fromBytes(t,e);try{return ni.fromValue(t,0,e)}catch(t){if(t.code!==iO.errors.INVALID_ARGUMENT)throw t}return i3.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!!(t&&t._isFixedNumber)}}let nn=ni.from(1),ns=ni.from("0.5"),no=new iO("strings/5.7.0");(b=W||(W={})).current="",b.NFC="NFC",b.NFD="NFD",b.NFKC="NFKC",b.NFKD="NFKD",(A=X||(X={})).UNEXPECTED_CONTINUE="unexpected continuation byte",A.BAD_PREFIX="bad codepoint prefix",A.OVERRUN="string overrun",A.MISSING_CONTINUE="missing continuation byte",A.OUT_OF_RANGE="out of UTF-8 range",A.UTF16_SURROGATE="UTF-16 surrogate",A.OVERLONG="overlong representation";function na(t,e,r,i,n){if(t===X.BAD_PREFIX||t===X.UNEXPECTED_CONTINUE){let t=0;for(let i=e+1;i>6==2;i++)t++;return t}return t===X.OVERRUN?r.length-e-1:0}Object.freeze({error:function(t,e,r,i,n){return no.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:na,replace:function(t,e,r,i,n){return t===X.OVERLONG?(i.push(n),0):(i.push(65533),na(t,e,r))}});function nf(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,i={};return t.split(",").forEach(t=>{let n=t.split(":");i[r+=parseInt(n[0],16)]=e(n[1])}),i}function nh(t){let e=0;return t.split(",").map(t=>{let r=t.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:e+parseInt(r[0],16),h:e=parseInt(r[1],16)}})}nh("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),nf("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),nf("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),nf("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",function(t){if(t.length%4!=0)throw Error("bad data");let e=[];for(let r=0;r0&&Array.isArray(t)?n(t,e-1):r.push(t)})};return n(t,e),r}function nc(t,e){let r=Array(t);for(let i=0,n=-1;ie[t]):r}function np(t,e,r){let i=Array(t).fill(void 0).map(()=>[]);for(let n=0;n>1:i>>1}return r})(t,r).forEach((t,e)=>i[e].push(t));return i}let ng=function(){var t;let e;return t=function(t){let e=0;function r(){return t[e++]<<8|t[e++]}let i=r(),n=1,s=[0,1];for(let t=1;t>--f&1}let l=0x40000000,c=0x20000000,d=0x7fffffff,p=0;for(let t=0;t<31;t++)p=p<<1|u();let g=[],m=0,v=0x80000000;for(;;){let t=Math.floor(((p-m+1)*n-1)/v),e=0,r=i;for(;r-e>1;){let i=e+r>>>1;t>>1|u(),o=o<<1^l,a=(a^l)<<1|l|1;m=o,v=1+a-o}let y=i-4;return g.map(e=>{switch(e-y){case 3:return y+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return y+256+(t[a++]<<8|t[a++]);case 1:return y+t[a++];default:return e-1}})}(function(t){t=atob(t);let e=[];for(let r=0;rt[e++]}();nd(ng),nd(ng),function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(function(t,e){let r=1+e(),i=e(),n=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(r)}return e}(e);return nl(np(n.length,1+t,e).map((t,e)=>{let s=t[0],o=t.slice(1);return Array(n[e]).fill(void 0).map((t,e)=>{let n=e*i;return[s+e*r,o.map(t=>t+n)]})}))}(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(function(t,e){return np(1+e(),1+t,e).map(t=>[t[0],t.slice(1)])}(r,t))}(function(t){let e={};for(let r=0;rt-e),function t(){let e=[];for(;;){let r=nd(w,n);if(0==r.length)break;e.push({set:new Set(r),node:t()})}e.sort((t,e)=>e.set.size-t.set.size);let r=w();return{branches:e,valid:r%3,fe0f:!!(1&(r=r/3|0)),save:1==(r>>=1),check:2==r}}(),new iO(nu),new Uint8Array(32).fill(0);new iO("rlp/5.7.0"),new iO("address/5.7.0");let nm={};for(let t=0;t<10;t++)nm[String(t)]=String(t);for(let t=0;t<26;t++)nm[String.fromCharCode(65+t)]=String(10+t);x=0x1fffffffffffff,Math.log10;new iO("properties/5.7.0"),new iO(nu),new Uint8Array(32).fill(0),iZ.from(-1);let nv=iZ.from(0),ny=iZ.from(1);iZ.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),iQ(ny.toHexString(),32),iQ(nv.toHexString(),32);var nb={},nA={};function nw(t,e){if(!t)throw Error(e||"Assertion failed")}nw.equal=function(t,e,r){if(t!=e)throw Error(r||"Assertion failed: "+t+" != "+e)};var nx={exports:{}};"function"==typeof Object.create?nx.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:nx.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var nM=nx.exports;nA.inherits=nM;nA.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t){if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(t="0"+t),n=0;n>6|192:((s=t,o=n,(64512&s.charCodeAt(o))!=55296||o<0||o+1>=s.length||(64512&s.charCodeAt(o+1))!=56320)?r[i++]=a>>12|224:(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++n)),r[i++]=a>>18|240,r[i++]=a>>12&63|128),r[i++]=a>>6&63|128),r[i++]=63&a|128)}}else for(n=0;n>>24|t>>>8&65280|t<<8&0xff0000|(255&t)<<24)>>>0}nA.toHex=function(t){for(var e="",r=0;r>>0;return o};nA.split32=function(t,e){for(var r=Array(4*t.length),i=0,n=0;i>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r};nA.rotr32=function(t,e){return t>>>e|t<<32-e};nA.rotl32=function(t,e){return t<>>32-e};nA.sum32=function(t,e){return t+e>>>0};nA.sum32_3=function(t,e,r){return t+e+r>>>0};nA.sum32_4=function(t,e,r,i){return t+e+r+i>>>0};nA.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0};nA.sum64=function(t,e,r,i){var n=t[e],s=i+t[e+1]>>>0;t[e]=(s>>0,t[e+1]=s};nA.sum64_hi=function(t,e,r,i){return(e+i>>>0>>0};nA.sum64_lo=function(t,e,r,i){return e+i>>>0};nA.sum64_4_hi=function(t,e,r,i,n,s,o,a){var f,h=e;return f=0+((h=h+i>>>0)>>0)>>0)>>0};nA.sum64_4_lo=function(t,e,r,i,n,s,o,a){return e+i+s+a>>>0};nA.sum64_5_hi=function(t,e,r,i,n,s,o,a,f,h){var u,l=e;return u=0+((l=l+i>>>0)>>0)>>0)>>0)>>0};nA.sum64_5_lo=function(t,e,r,i,n,s,o,a,f,h){return e+i+s+a+h>>>0};nA.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0};nA.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};nA.shr64_hi=function(t,e,r){return t>>>r};nA.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};var n_={};function nN(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}n_.BlockHash=nN,nN.prototype.update=function(t,e){if(t=nA.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=nA.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s>>3};nB.g1_256=function(t){return nR(t,17)^nR(t,19)^t>>>10};var nD=nA.rotl32,nU=nA.sum32,nk=nA.sum32_5,nq=nB.ft_1,nF=n_.BlockHash,nz=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6];function nL(){if(!(this instanceof nL))return new nL;nF.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.W=Array(80)}nA.inherits(nL,nF);nL.blockSize=512,nL.outSize=160,nL.hmacStrength=80,nL.padLength=64,nL.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;ithis.blockSize&&(t=new this.Hash().update(t).digest()),nw(t.length<=this.blockSize);for(var e=t.length;e>8,o=255&n;s?r.push(s,o):r.push(o)}return r},e.zero2=r,e.toHex=i,e.encode=function(t,e){return"hex"===e?i(t):t}}),sM=sb(function(t,e){e.assert=sA,e.toArray=sx.toArray,e.zero2=sx.zero2,e.toHex=sx.toHex,e.encode=sx.encode;e.getNAF=function(t,e,r){var i=Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-f:f,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i};e.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,s=0;t.cmpn(-n)>0||e.cmpn(-s)>0;){var o,a,f=t.andln(3)+n&3,h=e.andln(3)+s&3;3===f&&(f=-1),3===h&&(h=-1),o=1&f?(3==(i=t.andln(7)+n&7)||5===i)&&2===h?-f:f:0,r[0].push(o),a=1&h?(3==(i=e.andln(7)+s&7)||5===i)&&2===f?-h:h:0,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r};e.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}};e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t};e.intFromLE=function(t){return new iJ(t,"hex","le")}}),sE=sM.getNAF,sI=sM.getJSF,sS=sM.assert;function s_(t,e){this.type=t,this.p=new iJ(e.p,16),this.red=e.prime?iJ.red(e.prime):iJ.mont(this.p),this.zero=new iJ(0).toRed(this.red),this.one=new iJ(1).toRed(this.red),this.two=new iJ(2).toRed(this.red),this.n=e.n&&new iJ(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function sN(t,e){this.curve=t,this.type=e,this.precomputed=null}s_.prototype.point=function(){throw Error("Not implemented")},s_.prototype.validate=function(){throw Error("Not implemented")},s_.prototype._fixedNafMul=function(t,e){sS(t.precomputed);var r=t._getDoubles(),i=sE(e,1,this._bitLength),n=(1<=s;f--)o=(o<<1)+i[f];a.push(o)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=n;l>0;l--){for(s=0;s=0;a--){for(var f=0;a>=0&&0===s[a];a--)f++;if(a>=0&&f++,o=o.dblp(f),a<0)break;var h=s[a];sS(0!==h),o="affine"===t.type?h>0?o.mixedAdd(n[h-1>>1]):o.mixedAdd(n[-h-1>>1].neg()):h>0?o.add(n[h-1>>1]):o.add(n[-h-1>>1].neg())}return"affine"===t.type?o.toP():o},s_.prototype._wnafMulAdd=function(t,e,r,i,n){var s,o,a,f=this._wnafT1,h=this._wnafT2,u=this._wnafT3,l=0;for(s=0;s=1;s-=2){var d=s-1,p=s;if(1!==f[d]||1!==f[p]){u[d]=sE(r[d],f[d],this._bitLength),u[p]=sE(r[p],f[p],this._bitLength),l=Math.max(u[d].length,l),l=Math.max(u[p].length,l);continue}var g=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(g[1]=e[d].add(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].add(e[p].neg())):(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=sI(r[d],r[p]);for(l=Math.max(v[0].length,l),u[d]=Array(l),u[p]=Array(l),o=0;o=0;s--){for(var x=0;s>=0;){var M=!0;for(o=0;o=0&&x++,A=A.dblp(x),s<0)break;for(o=0;o0?a=h[o][E-1>>1]:E<0&&(a=h[o][-E-1>>1].neg()),A="affine"===a.type?A.mixedAdd(a):A.add(a))}}for(s=0;s=Math.ceil((t.bitLength()+1)/e.step)},sN.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;nn[0].cmp(n[1])?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new iJ(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))?r=s[0]:(r=s[1],sB(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return i=t.basis?t.basis.map(function(t){return{a:new iJ(t.a,16),b:new iJ(t.b,16)}}):this._getEndoBasis(r),{beta:e,lambda:r,basis:i}}},sR.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:iJ.mont(t),r=new iJ(2).toRed(e).redInvm(),i=r.redNeg(),n=new iJ(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},sR.prototype._getEndoBasis=function(t){for(var e,r,i,n,s,o,a,f,h,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,c=this.n.clone(),d=new iJ(1),p=new iJ(0),g=new iJ(0),m=new iJ(1),v=0;0!==l.cmpn(0);){var y=c.div(l);f=c.sub(y.mul(l)),h=g.sub(y.mul(d));var b=m.sub(y.mul(p));if(!i&&0>f.cmp(u))e=a.neg(),r=d,i=f.neg(),n=h;else if(i&&2==++v)break;a=f,c=l,l=f,g=d,d=h,m=p,p=b}s=f.neg(),o=h;var A=i.sqr().add(n.sqr());return s.sqr().add(o.sqr()).cmp(A)>=0&&(s=e,o=r),i.negative&&(i=i.neg(),n=n.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:i,b:n},{a:s,b:o}]},sR.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),f=n.mul(r.b),h=s.mul(i.b);return{k1:t.sub(o).sub(a),k2:f.add(h).neg()}},sR.prototype.pointFromX=function(t,e){(t=new iJ(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},sR.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},sR.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s":""},sP.prototype.isInfinity=function(){return this.inf},sP.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t)||0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},sP.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},sP.prototype.getX=function(){return this.x.fromRed()},sP.prototype.getY=function(){return this.y.fromRed()},sP.prototype.mul=function(t){return t=new iJ(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},sP.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},sP.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},sP.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},sP.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},sP.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},sC(sO,s_.BasePoint),sR.prototype.jpoint=function(t,e,r){return new sO(this,t,e,r)},sO.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},sO.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},sO.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),f=s.redSub(o);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),u=h.redMul(a),l=i.redMul(h),c=f.redSqr().redIAdd(u).redISub(l).redISub(l),d=f.redMul(l.redISub(c)).redISub(s.redMul(u)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(c,d,p)},sO.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),h=f.redMul(o),u=r.redMul(f),l=a.redSqr().redIAdd(h).redISub(u).redISub(u),c=a.redMul(u.redISub(l)).redISub(n.redMul(h)),d=this.z.redMul(o);return this.curve.jpoint(l,c,d)},sO.prototype.dblp=function(t){if(0===t||this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var e,r=this;for(e=0;e=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},sO.prototype.inspect=function(){return this.isInfinity()?"":""},sO.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var sT=sb(function(t,e){e.base=s_,e.short=sR,e.mont=null,e.edwards=null}),sD=sb(function(t,e){var r,i=sM.assert;function n(t){"short"===t.type?this.curve=new sT.short(t):"edwards"===t.type?this.curve=new sT.edwards(t):this.curve=new sT.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var i=new n(r);return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:i}),i}})}e.PresetCurve=n,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:nb.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:nb.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:nb.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:nb.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:nb.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:nb.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:nb.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch{r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:nb.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function sU(t){if(!(this instanceof sU))return new sU(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=sx.toArray(t.entropy,t.entropyEnc||"hex"),r=sx.toArray(t.nonce,t.nonceEnc||"hex"),i=sx.toArray(t.pers,t.persEnc||"hex");sA(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}sU.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},sU.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=sx.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length"};var sF=sM.assert;function sz(t,e){if(t instanceof sz)return t;this._importDER(t,e)||(sF(t.r&&t.s,"Signature without r or s"),this.r=new iJ(t.r,16),this.s=new iJ(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function sL(){this.place=0}function sH(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=e.place;s>>=0;return!(n<=127)&&(e.place=o,n)}function sQ(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}sz.prototype._importDER=function(t,e){t=sM.toArray(t,e);var r=new sL;if(48!==t[r.place++])return!1;var i=sH(t,r);if(!1===i||i+r.place!==t.length||2!==t[r.place++])return!1;var n=sH(t,r);if(!1===n)return!1;var s=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var o=sH(t,r);if(!1===o||t.length!==o+r.place)return!1;var a=t.slice(r.place,o+r.place);if(0===s[0]){if(!(128&s[1]))return!1;else s=s.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;else a=a.slice(1)}return this.r=new iJ(s),this.s=new iJ(a),this.recoveryParam=null,!0},sz.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=sQ(e),r=sQ(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var i=[2];sj(i,e.length),(i=i.concat(e)).push(2),sj(i,r.length);var n=i.concat(r),s=[48];return sj(s,n.length),s=s.concat(n),sM.encode(s,t)};var sK=function(){throw Error("unsupported")},sJ=sM.assert;function sG(t){if(!(this instanceof sG))return new sG(t);"string"==typeof t&&(sJ(Object.prototype.hasOwnProperty.call(sD,t),"Unknown curve "+t),t=sD[t]),t instanceof sD.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}sG.prototype.keyPair=function(t){return new sq(this,t)},sG.prototype.keyFromPrivate=function(t,e){return sq.fromPrivate(this,t,e)},sG.prototype.keyFromPublic=function(t,e){return sq.fromPublic(this,t,e)},sG.prototype.genKeyPair=function(t){t||(t={});for(var e=new sU({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||sK(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new iJ(2));;){var n=new iJ(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},sG.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},sG.prototype.sign=function(t,e,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new iJ(t,16));for(var n=this.n.byteLength(),s=e.getPrivate().toArray("be",n),o=t.toArray("be",n),a=new sU({hash:this.hash,entropy:s,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),f=this.n.sub(new iJ(1)),h=0;;h++){var u=i.k?i.k(h):new iJ(a.generate(this.n.byteLength()));if(!(0>=(u=this._truncateToN(u,!0)).cmpn(1)||u.cmp(f)>=0)){var l=this.g.mul(u);if(!l.isInfinity()){var c=l.getX(),d=c.umod(this.n);if(0!==d.cmpn(0)){var p=u.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(l.getY().isOdd()?1:0)|(0!==c.cmp(d)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new sz({r:d,s:p,recoveryParam:g})}}}}}},sG.prototype.verify=function(t,e,r,i){t=this._truncateToN(new iJ(t,16)),r=this.keyFromPublic(r,i);var n=(e=new sz(e,"hex")).r,s=e.s;if(0>n.cmpn(1)||n.cmp(this.n)>=0||0>s.cmpn(1)||s.cmp(this.n)>=0)return!1;var o,a=s.invm(this.n),f=a.mul(t).umod(this.n),h=a.mul(n).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(f,r.getPublic(),h)).isInfinity()&&o.eqXToP(n):!(o=this.g.mulAdd(f,r.getPublic(),h)).isInfinity()&&0===o.getX().umod(this.n).cmp(n)},sG.prototype.recoverPubKey=function(t,e,r,i){sJ((3&r)===r,"The recovery param is more than two bits"),e=new sz(e,i);var n=this.n,s=new iJ(t),o=e.r,a=e.s,f=1&r,h=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw Error("Unable to find sencond key candinate");o=h?this.curve.pointFromX(o.add(this.curve.n),f):this.curve.pointFromX(o,f);var u=e.r.invm(n),l=n.sub(s).mul(u).umod(n),c=a.mul(u).umod(n);return this.g.mulAdd(l,o,c)},sG.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new sz(e,i)).recoveryParam)return e.recoveryParam;for(var n,s=0;s<4;s++){try{n=this.recoverPubKey(t,e,s)}catch{continue}if(n.eq(r))return s}throw Error("Unable to find valid recovery factor")},sb(function(t,e){e.version="6.5.4",e.utils=sM,e.rand=function(){throw Error("unsupported")},e.curve=sT,e.curves=sD,e.ec=sG,e.eddsa=null}).ec,new iO("signing-key/5.7.0");new iO("transactions/5.7.0"),(E=Z||(Z={}))[E.legacy=0]="legacy",E[E.eip2930=1]="eip2930",E[E.eip1559=2]="eip1559",Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;let sY="base10",sV="base16",sW="base64pad",sX="utf8";function sZ(){let t=(0,tv.randomBytes)(32);return(0,tA.BB)(t,sV)}function s$(t){let e=(0,ty.hash)((0,tA.mL)(t,sX));return(0,tA.BB)(e,sV)}function s0(t){return Number((0,tA.BB)(t,sY))}function s1(t){let e=(0,tA.mL)(t,sW),r=e.slice(0,1);if(1===s0(r)){let t=33,i=45,n=e.slice(1,t),s=e.slice(t,i);return{type:r,sealed:e.slice(i),iv:s,senderPublicKey:n}}let i=13,n=e.slice(1,i);return{type:r,sealed:e.slice(i),iv:n}}function s2(t){let e=t?.type||0;if(1===e){if(typeof t?.senderPublicKey>"u")throw Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function s3(t){return 1===t.type&&"string"==typeof t.senderPublicKey&&"string"==typeof t.receiverPublicKey}function s6(t){return t?.relay||{protocol:"irn"}}function s8(t){let e=ir.i[t];if(typeof e>"u")throw Error(`Relay Protocol not supported: ${t}`);return e}var s5=Object.defineProperty,s4=Object.defineProperties,s9=Object.getOwnPropertyDescriptors,s7=Object.getOwnPropertySymbols,ot=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable,or=(t,e,r)=>e in t?s5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,oi=(t,e)=>{for(var r in e||(e={}))ot.call(e,r)&&or(t,r,e[r]);if(s7)for(var r of s7(e))oe.call(e,r)&&or(t,r,e[r]);return t},on=(t,e)=>s4(t,s9(e));function os(t){let e=(t=(t=t.includes("wc://")?t.replace("wc://",""):t).includes("wc:")?t.replace("wc:",""):t).indexOf(":"),r=-1!==t.indexOf("?")?t.indexOf("?"):void 0,i=t.substring(0,e),n=t.substring(e+1,r).split("@"),s="u">typeof r?t.substring(r):"",o=tp.parse(s),a="string"==typeof o.methods?o.methods.split(","):void 0;return{protocol:i,topic:function(t){return t.startsWith("//")?t.substring(2):t}(n[0]),version:parseInt(n[1],10),symKey:o.symKey,relay:function(t,e="-"){let r={},i="relay"+e;return Object.keys(t).forEach(e=>{if(e.startsWith(i)){let n=e.replace(i,""),s=t[e];r[n]=s}}),r}(o),methods:a,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;let oo={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},oa={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function of(t,e){let{message:r,code:i}=oa[t];return{message:e?`${r} ${e}`:r,code:i}}function oh(t,e){let{message:r,code:i}=oo[t];return{message:e?`${r} ${e}`:r,code:i}}function ou(t){return typeof t>"u"}function ol(t,e){return!!(e&&ou(t))||"string"==typeof t&&!!t.trim().length}function oc(t){return"u">typeof t}function od(){let t=im();return new Promise(e=>{switch(t){case ic.browser:e(function(){return ig()&&navigator?.onLine}());break;case ic.reactNative:e(op());break;case ic.node:e(function(){return!0}());break;default:e(!0)}})}async function op(){if(ip()&&"u">typeof r.g&&null!=r.g&&r.g.NetInfo){let t=await (null==r.g?void 0:r.g.NetInfo.fetch());return t?.isConnected}return!0}var og=r("71499"),om=r("56186");let ov=()=>"u">typeof WebSocket||"u">typeof r.g&&"u">typeof r.g.WebSocket||"u">typeof window&&"u">typeof window.WebSocket||"u">typeof self&&"u">typeof self.WebSocket,oy=t=>t.split("?")[0],ob="u">typeof WebSocket?WebSocket:"u">typeof r.g&&"u">typeof r.g.WebSocket?r.g.WebSocket:"u">typeof window&&"u">typeof window.WebSocket?window.WebSocket:"u">typeof self&&"u">typeof self.WebSocket?self.WebSocket:r(72030);class oA{constructor(t){if(this.url=t,this.events=new th.EventEmitter,this.registering=!1,!(0,om.isWsUrl)(t))throw Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}get connected(){return"u">typeof this.socket}get connecting(){return this.registering}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async open(t=this.url){await this.register(t)}async close(){return new Promise((t,e)=>{if(typeof this.socket>"u"){e(Error("Connection already closed"));return}this.socket.onclose=e=>{this.onClose(e),t()},this.socket.close()})}async send(t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send((0,r7.u)(t))}catch(e){this.onError(t.id,e)}}register(t=this.url){if(!(0,om.isWsUrl)(t))throw Error(`Provided URL is not compatible with WebSocket connection: ${t}`);if(this.registering){let t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((t,e)=>{this.events.once("register_error",t=>{this.resetMaxListeners(),e(t)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return e(Error("WebSocket connection is missing or invalid"));t(this.socket)})})}return this.url=t,this.registering=!0,new Promise((e,r)=>{let i=new URLSearchParams(t).get("origin"),n=(0,om.isReactNative)()?{headers:{origin:i}}:{rejectUnauthorized:!(0,om.isLocalhostUrl)(t)},s=new ob(t,[],n);ov()?s.onerror=t=>{r(this.emitError(t.error))}:s.on("error",t=>{r(this.emitError(t))}),s.onopen=()=>{this.onOpen(s),e(s)}})}onOpen(t){t.onmessage=t=>this.onPayload(t),t.onclose=t=>this.onClose(t),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;let e="string"==typeof t.data?(0,r7.D)(t.data):t.data;this.events.emit("payload",e)}onError(t,e){let r=this.parseError(e),i=r.message||r.toString(),n=(0,om.formatJsonRpcError)(t,i);this.events.emit("payload",n)}parseError(t,e=this.url){return(0,om.parseConnectionError)(t,oy(e),"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(t){let e=this.parseError(Error(t?.message||`WebSocket connection failed for host: ${oy(this.url)}`));return this.events.emit("register_error",e),e}}var ow=r("72307"),ox=r.n(ow),oM=r("80204"),oE=r.n(oM),oI=r(34155),oS=function(t,e){if(t.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i>>0,o=new Uint8Array(s);t[e];){var u=r[t.charCodeAt(e)];if(255===u)return;for(var l=0,c=s-1;(0!==u||l>>0,o[c]=u%256>>>0,u=u/256>>>0;if(0!==u)throw Error("Non-zero carry");n=l,e++}if(" "!==t[e]){for(var d=s-n;d!==s&&0===o[d];)d++;for(var p=new Uint8Array(i+(s-d)),g=i;d!==s;)p[g++]=o[d++];return p}}}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,i=0,n=0,s=e.length;n!==s&&0===e[n];)n++,r++;for(var o=(s-n)*u+1>>>0,h=new Uint8Array(o);n!==s;){for(var l=e[n],c=0,d=o-1;(0!==l||c>>0,h[d]=l%a>>>0,l=l/a>>>0;if(0!==l)throw Error("Non-zero carry");i=c,n++}for(var p=o-i;p!==o&&0===h[p];)p++;for(var g=f.repeat(r);p{if(t instanceof Uint8Array&&"Uint8Array"===t.constructor.name)return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw Error("Unknown type, must be binary type")},oN=t=>new TextEncoder().encode(t),oC=t=>new TextDecoder().decode(t);class oB{constructor(t,e,r){this.name=t,this.prefix=e,this.baseEncode=r}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class oR{constructor(t,e,r){if(this.name=t,this.prefix=e,void 0===e.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=r}decode(t){if("string"==typeof t){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(t){return oO(this,t)}}class oP{constructor(t){this.decoders=t}or(t){return oO(this,t)}decode(t){let e=t[0],r=this.decoders[e];if(r)return r.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let oO=(t,e)=>new oP({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class oT{constructor(t,e,r,i){this.name=t,this.prefix=e,this.baseEncode=r,this.baseDecode=i,this.encoder=new oB(t,e,r),this.decoder=new oR(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}let oD=({name:t,prefix:e,encode:r,decode:i})=>new oT(t,e,r,i),oU=({prefix:t,name:e,alphabet:r})=>{let{encode:i,decode:n}=oS(r,e);return oD({prefix:t,name:e,encode:i,decode:t=>o_(n(t))})},ok=(t,e,r,i)=>{let n={};for(let t=0;t=8&&(a-=8,o[h++]=255&f>>a)}if(a>=r||255&f<<8-a)throw SyntaxError("Unexpected end of data");return o},oq=(t,e,r)=>{let i="="===e[e.length-1],n=(1<r;)o-=r,s+=e[n&a>>o];if(o&&(s+=e[n&a<oD({prefix:e,name:t,encode:t=>oq(t,i,r),decode:e=>ok(e,i,r,t)});var oz=Object.freeze({__proto__:null,identity:oD({prefix:"\0",name:"identity",encode:t=>oC(t),decode:t=>oN(t)})}),oL=Object.freeze({__proto__:null,base2:oF({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),oH=Object.freeze({__proto__:null,base8:oF({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),oQ=Object.freeze({__proto__:null,base10:oU({prefix:"9",name:"base10",alphabet:"0123456789"})});let oj=oF({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4});var oK=Object.freeze({__proto__:null,base16:oj,base16upper:oF({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});let oJ=oF({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),oG=oF({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),oY=oF({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),oV=oF({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),oW=oF({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),oX=oF({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),oZ=oF({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),o$=oF({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5});var o0=Object.freeze({__proto__:null,base32:oJ,base32upper:oG,base32pad:oY,base32padupper:oV,base32hex:oW,base32hexupper:oX,base32hexpad:oZ,base32hexpadupper:o$,base32z:oF({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});let o1=oU({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"});var o2=Object.freeze({__proto__:null,base36:o1,base36upper:oU({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});let o3=oU({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});var o6=Object.freeze({__proto__:null,base58btc:o3,base58flickr:oU({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});let o8=oF({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),o5=oF({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),o4=oF({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6});var o9=Object.freeze({__proto__:null,base64:o8,base64pad:o5,base64url:o4,base64urlpad:oF({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let o7=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),at=o7.reduce((t,e,r)=>(t[r]=e,t),[]),ae=o7.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);var ar=Object.freeze({__proto__:null,base256emoji:oD({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(t){return t.reduce((t,e)=>t+=at[e],"")},decode:function(t){let e=[];for(let r of t){let t=ae[r.codePointAt(0)];if(void 0===t)throw Error(`Non-base256emoji character: ${r}`);e.push(t)}return new Uint8Array(e)}})}),ai=-128;function an(t,e,r){e=e||[],r=r||0;for(var i=r;t>=0x80000000;)e[r++]=255&t|128,t/=128;for(;t&ai;)e[r++]=255&t|128,t>>>=7;return e[r]=0|t,an.bytes=r-i+1,e}function as(t,e){var r,i=0,e=e||0,n=0,s=e,o=t.length;do{if(s>=o)throw as.bytes=0,RangeError("Could not decode varint");r=t[s++],i+=n<28?(127&r)<=128);return as.bytes=s-e,i}var ao=an,aa=function(t){return t<128?1:t<16384?2:t<2097152?3:t<0x10000000?4:t<0x800000000?5:t<0x40000000000?6:t<0x2000000000000?7:t<0x100000000000000?8:t<0x8000000000000000?9:10};let af=(t,e,r=0)=>(ao(t,e,r),e),ah=t=>aa(t),au=(t,e)=>{let r=e.byteLength,i=ah(t),n=i+ah(r),s=new Uint8Array(n+r);return af(t,s,0),af(r,s,i),s.set(e,n),new al(t,r,e,s)};class al{constructor(t,e,r,i){this.code=t,this.size=e,this.digest=r,this.bytes=i}}let ac=({name:t,code:e,encode:r})=>new ad(t,e,r);class ad{constructor(t,e,r){this.name=t,this.code=e,this.encode=r}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?au(this.code,e):e.then(t=>au(this.code,t))}throw Error("Unknown type, must be binary type")}}let ap=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),ag=ac({name:"sha2-256",code:18,encode:ap("SHA-256")});var am=Object.freeze({__proto__:null,sha256:ag,sha512:ac({name:"sha2-512",code:19,encode:ap("SHA-512")})}),av=Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:o_,digest:t=>au(0,o_(t))}});new TextEncoder,new TextDecoder;let ay={...oz,...oL,...oH,...oQ,...oK,...o0,...o2,...o6,...o9,...ar};function ab(t){return null!=globalThis.Buffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}({...am,...av});function aA(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}let aw=aA("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),ax=aA("ascii","a",t=>{let e="a";for(let r=0;r{let e=function(t=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?ab(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}((t=t.substring(1)).length);for(let r=0;r{if(!this.initialized){let t=await this.getKeyChain();"u">typeof t&&(this.keychain=t),this.initialized=!0}},this.has=t=>(this.isInitialized(),this.keychain.has(t)),this.set=async(t,e)=>{this.isInitialized(),this.keychain.set(t,e),await this.persist()},this.get=t=>{this.isInitialized();let e=this.keychain.get(t);if(typeof e>"u"){let{message:e}=of("NO_MATCHING_KEY",`${this.name}: ${t}`);throw Error(e)}return e},this.del=async t=>{this.isInitialized(),this.keychain.delete(t),await this.persist()},this.core=t,this.logger=(0,rX.Ep)(e,this.name)}get context(){return(0,rX.Fd)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(t){await this.core.storage.setItem(this.storageKey,iv(t))}async getKeyChain(){let t=await this.core.storage.getItem(this.storageKey);return"u">typeof t?iy(t):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:t}=of("NOT_INITIALIZED",this.name);throw Error(t)}}}class aG{constructor(t,e,r){this.core=t,this.logger=e,this.name="crypto",this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=t=>(this.isInitialized(),this.keychain.has(t)),this.getClientId=async()=>{this.isInitialized();let t=await this.getClientSeed(),e=it.generateKeyPair(t);return it.encodeIss(e.publicKey)},this.generateKeyPair=()=>{this.isInitialized();let t=function(){let t=tb.generateKeyPair();return{privateKey:(0,tA.BB)(t.secretKey,sV),publicKey:(0,tA.BB)(t.publicKey,sV)}}();return this.setPrivateKey(t.publicKey,t.privateKey)},this.signJWT=async t=>{this.isInitialized();let e=await this.getClientSeed(),r=it.generateKeyPair(e),i=sZ();return await it.signJWT(i,t,aC,r)},this.generateSharedKey=(t,e,r)=>{this.isInitialized();let i=function(t,e){let r=tb.sharedKey((0,tA.mL)(t,sV),(0,tA.mL)(e,sV),!0),i=new tm.HKDF(ty.SHA256,r).expand(32);return(0,tA.BB)(i,sV)}(this.getPrivateKey(t),e);return this.setSymKey(i,r)},this.setSymKey=async(t,e)=>{this.isInitialized();let r=e||function(t){let e=(0,ty.hash)((0,tA.mL)(t,sV));return(0,tA.BB)(e,sV)}(t);return await this.keychain.set(r,t),r},this.deleteKeyPair=async t=>{this.isInitialized(),await this.keychain.del(t)},this.deleteSymKey=async t=>{this.isInitialized(),await this.keychain.del(t)},this.encode=async(t,e,r)=>{this.isInitialized();let i=s2(r),n=(0,r7.u)(e);if(s3(i)){let e=i.senderPublicKey,r=i.receiverPublicKey;t=await this.generateSharedKey(e,r)}let s=this.getSymKey(t),{type:o,senderPublicKey:a}=i;return function(t){var e;let r=(e="u">typeof t.type?t.type:0,(0,tA.mL)(`${e}`,sY));if(1===s0(r)&&typeof t.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");let i="u">typeof t.senderPublicKey?(0,tA.mL)(t.senderPublicKey,sV):void 0,n="u">typeof t.iv?(0,tA.mL)(t.iv,sV):(0,tv.randomBytes)(12);return function(t){if(1===s0(t.type)){if(typeof t.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");return(0,tA.BB)((0,tA.zo)([t.type,t.senderPublicKey,t.iv,t.sealed]),sW)}return(0,tA.BB)((0,tA.zo)([t.type,t.iv,t.sealed]),sW)}({type:r,sealed:new tg.ChaCha20Poly1305((0,tA.mL)(t.symKey,sV)).seal(n,(0,tA.mL)(t.message,sX)),iv:n,senderPublicKey:i})}({type:o,symKey:s,message:n,senderPublicKey:a})},this.decode=async(t,e,r)=>{this.isInitialized();let i=function(t,e){let r=s1(t);return s2({type:s0(r.type),senderPublicKey:"u">typeof r.senderPublicKey?(0,tA.BB)(r.senderPublicKey,sV):void 0,receiverPublicKey:e?.receiverPublicKey})}(e,r);if(s3(i)){let e=i.receiverPublicKey,r=i.senderPublicKey;t=await this.generateSharedKey(e,r)}try{let r=this.getSymKey(t),i=function(t){let e=new tg.ChaCha20Poly1305((0,tA.mL)(t.symKey,sV)),{sealed:r,iv:i}=s1(t.encoded),n=e.open(i,r);if(null===n)throw Error("Failed to decrypt");return(0,tA.BB)(n,sX)}({symKey:r,encoded:e});return(0,r7.D)(i)}catch(e){this.logger.error(`Failed to decode message from topic: '${t}', clientId: '${await this.getClientId()}'`),this.logger.error(e)}},this.getPayloadType=t=>s0(s1(t).type),this.getPayloadSenderPublicKey=t=>{let e=s1(t);return e.senderPublicKey?(0,tA.BB)(e.senderPublicKey,sV):void 0},this.core=t,this.logger=(0,rX.Ep)(e,this.name),this.keychain=r||new aJ(this.core,this.logger)}get context(){return(0,rX.Fd)(this.logger)}async setPrivateKey(t,e){return await this.keychain.set(t,e),t}getPrivateKey(t){return this.keychain.get(t)}async getClientSeed(){let t="";try{t=this.keychain.get(aN)}catch{t=sZ(),await this.keychain.set(aN,t)}return function(t,e="utf8"){let r=aM[e];if(!r)throw Error(`Unsupported encoding "${e}"`);return("utf8"===e||"utf-8"===e)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?ab(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}(t,"base16")}getSymKey(t){return this.keychain.get(t)}isInitialized(){if(!this.initialized){let{message:t}=of("NOT_INITIALIZED",this.name);throw Error(t)}}}class aY extends r1{constructor(t,e){super(t,e),this.logger=t,this.core=e,this.messages=new Map,this.name="messages",this.version="0.3",this.initialized=!1,this.storagePrefix=aI,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{let t=await this.getRelayerMessages();"u">typeof t&&(this.messages=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}finally{this.initialized=!0}}},this.set=async(t,e)=>{this.isInitialized();let r=s$(e),i=this.messages.get(t);return typeof i>"u"&&(i={}),"u">typeof i[r]||(i[r]=e,this.messages.set(t,i),await this.persist()),r},this.get=t=>{this.isInitialized();let e=this.messages.get(t);return typeof e>"u"&&(e={}),e},this.has=(t,e)=>{this.isInitialized();let r=this.get(t);return"u">typeof r[s$(e)]},this.del=async t=>{this.isInitialized(),this.messages.delete(t),await this.persist()},this.logger=(0,rX.Ep)(t,this.name),this.core=e}get context(){return(0,rX.Fd)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(t){await this.core.storage.setItem(this.storageKey,iv(t))}async getRelayerMessages(){let t=await this.core.storage.getItem(this.storageKey);return"u">typeof t?iy(t):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){let{message:t}=of("NOT_INITIALIZED",this.name);throw Error(t)}}}class aV extends r2{constructor(t,e){super(t,e),this.relayer=t,this.logger=e,this.events=new th.EventEmitter,this.name="publisher",this.queue=new Map,this.publishTimeout=(0,tl.toMiliseconds)(tl.ONE_MINUTE),this.failedPublishTimeout=(0,tl.toMiliseconds)(tl.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(t,e,r)=>{var i;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:t,message:e,opts:r}});let n=r?.ttl||aB,s=s6(r),o=r?.prompt||!1,a=r?.tag||0,f=r?.id||(0,om.getBigIntRpcId)().toString(),h={topic:t,message:e,opts:{ttl:n,relay:s,prompt:o,tag:a,id:f}},u=`Failed to publish payload, please try again. id:${f} tag:${a}`,l=Date.now(),c,d=1;try{for(;void 0===c;){if(Date.now()-l>this.publishTimeout)throw Error(u);this.logger.trace({id:f,attempts:d},`publisher.publish - attempt ${d}`),c=await await ib(this.rpcPublish(t,e,n,s,o,a,f).catch(t=>this.logger.warn(t)),this.publishTimeout,u),d++,c||await new Promise(t=>setTimeout(t,this.failedPublishTimeout))}this.relayer.events.emit(aO.publish,h),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:f,topic:t,message:e,opts:r}})}catch(t){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(t),null!=(i=r?.internal)&&i.throwOnFailedPublish)throw t;this.queue.set(f,h)}},this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.relayer=t,this.logger=(0,rX.Ep)(e,this.name),this.registerEventListeners()}get context(){return(0,rX.Fd)(this.logger)}rpcPublish(t,e,r,i,n,s,o){var a,f,h,u;let l={method:s8(i.protocol).publish,params:{topic:t,message:e,ttl:r,prompt:n,tag:s},id:o};return ou(null==(a=l.params)?void 0:a.prompt)&&(null==(f=l.params)||delete f.prompt),ou(null==(h=l.params)?void 0:h.tag)&&(null==(u=l.params)||delete u.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:l}),this.relayer.request(l)}removeRequestFromQueue(t){this.queue.delete(t)}checkQueue(){this.queue.forEach(async t=>{let{topic:e,message:r,opts:i}=t;await this.publish(e,r,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(rW.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(aO.connection_stalled);return}this.checkQueue()}),this.relayer.on(aO.message_ack,t=>{this.removeRequestFromQueue(t.id.toString())})}}class aW{constructor(){this.map=new Map,this.set=(t,e)=>{let r=this.get(t);this.exists(t,e)||this.map.set(t,[...r,e])},this.get=t=>this.map.get(t)||[],this.exists=(t,e)=>this.get(t).includes(e),this.delete=(t,e)=>{if(typeof e>"u"){this.map.delete(t);return}if(!this.map.has(t))return;let r=this.get(t);if(!this.exists(t,e))return;let i=r.filter(t=>t!==e);if(!i.length){this.map.delete(t);return}this.map.set(t,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var aX=Object.defineProperty,aZ=Object.defineProperties,a$=Object.getOwnPropertyDescriptors,a0=Object.getOwnPropertySymbols,a1=Object.prototype.hasOwnProperty,a2=Object.prototype.propertyIsEnumerable,a3=(t,e,r)=>e in t?aX(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,a6=(t,e)=>{for(var r in e||(e={}))a1.call(e,r)&&a3(t,r,e[r]);if(a0)for(var r of a0(e))a2.call(e,r)&&a3(t,r,e[r]);return t},a8=(t,e)=>aZ(t,a$(e));class a5 extends r8{constructor(t,e){super(t,e),this.relayer=t,this.logger=e,this.subscriptions=new Map,this.topicMap=new aW,this.events=new th.EventEmitter,this.name="subscription",this.version="0.3",this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=aI,this.subscribeTimeout=(0,tl.toMiliseconds)(tl.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(t,e)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:e}});try{let r=s6(e),i={topic:t,relay:r};this.pending.set(t,i);let n=await this.rpcSubscribe(t,r);return"string"==typeof n&&(this.onSubscribe(n,i),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:e}})),n}catch(t){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(t),t}},this.unsubscribe=async(t,e)=>{await this.restartToComplete(),this.isInitialized(),"u">typeof e?.id?await this.unsubscribeById(t,e.id,e):await this.unsubscribeByTopic(t,e)},this.isSubscribed=async t=>{if(this.topics.includes(t))return!0;let e=`${this.pendingSubscriptionWatchLabel}_${t}`;return await new Promise((r,i)=>{let n=new tl.Watch;n.start(e);let s=setInterval(()=>{!this.pending.has(t)&&this.topics.includes(t)&&(clearInterval(s),n.stop(e),r(!0)),n.elapsed(e)>=ak&&(clearInterval(s),n.stop(e),i(Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=t,this.logger=(0,rX.Ep)(e,this.name),this.clientId=""}get context(){return(0,rX.Fd)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(t,e){let r=!1;try{r=this.getSubscription(t).topic===e}catch{}return r}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(t,e){let r=this.topicMap.get(t);await Promise.all(r.map(async r=>await this.unsubscribeById(t,r,e)))}async unsubscribeById(t,e,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:e,opts:r}});try{let i=s6(r);await this.rpcUnsubscribe(t,e,i);let n=oh("USER_DISCONNECTED",`${this.name}, ${t}`);await this.onUnsubscribe(t,e,n),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:e,opts:r}})}catch(t){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(t),t}}async rpcSubscribe(t,e){let r={method:s8(e.protocol).subscribe,params:{topic:t}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{return await await ib(this.relayer.request(r).catch(t=>this.logger.warn(t)),this.subscribeTimeout)?s$(t+this.clientId):null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(aO.connection_stalled)}return null}async rpcBatchSubscribe(t){if(!t.length)return;let e={method:s8(t[0].relay.protocol).batchSubscribe,params:{topics:t.map(t=>t.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:e});try{return await await ib(this.relayer.request(e).catch(t=>this.logger.warn(t)),this.subscribeTimeout)}catch{this.relayer.events.emit(aO.connection_stalled)}}rpcUnsubscribe(t,e,r){let i={method:s8(r.protocol).unsubscribe,params:{topic:t,id:e}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(t,e){this.setSubscription(t,a8(a6({},e),{id:t})),this.pending.delete(e.topic)}onBatchSubscribe(t){t.length&&t.forEach(t=>{this.setSubscription(t.id,a6({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(t,e,r){this.events.removeAllListeners(e),this.hasSubscription(e,t)&&this.deleteSubscription(e,r),await this.relayer.messages.del(t)}async setRelayerSubscriptions(t){await this.relayer.core.storage.setItem(this.storageKey,t)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(t,e){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:t,subscription:e}),this.addSubscription(t,e)}addSubscription(t,e){this.subscriptions.set(t,a6({},e)),this.topicMap.set(e.topic,t),this.events.emit(aU.created,e)}getSubscription(t){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:t});let e=this.subscriptions.get(t);if(!e){let{message:e}=of("NO_MATCHING_KEY",`${this.name}: ${t}`);throw Error(e)}return e}deleteSubscription(t,e){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:t,reason:e});let r=this.getSubscription(t);this.subscriptions.delete(t),this.topicMap.delete(r.topic,t),this.events.emit(aU.deleted,a8(a6({},r),{reason:e}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(aU.sync)}async reset(){if(this.cached.length){let t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let e=0;e"u"||!t.length)return;if(this.subscriptions.size){let{message:t}=of("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(t)}this.cached=t,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(t){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(t)}}async batchSubscribe(t){var e,r;if(!t.length)return;let i=await this.rpcBatchSubscribe(t);Array.isArray(e=i)&&this.onBatchSubscribe(i.map((e,r)=>a8(a6({},t[r]),{id:e})))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;let t=[];this.pending.forEach(e=>{t.push(e)}),await this.batchSubscribe(t)}registerEventListeners(){this.relayer.core.heartbeat.on(rW.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.events.on(aU.created,async t=>{let e=aU.created;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),await this.persist()}),this.events.on(aU.deleted,async t=>{let e=aU.deleted;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),await this.persist()})}isInitialized(){if(!this.initialized){let{message:t}=of("NOT_INITIALIZED",this.name);throw Error(t)}}async restartToComplete(){this.restartInProgress&&await new Promise(t=>{let e=setInterval(()=>{this.restartInProgress||(clearInterval(e),t())},this.pollingInterval)})}}var a4=Object.defineProperty,a9=Object.getOwnPropertySymbols,a7=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable,fe=(t,e,r)=>e in t?a4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fr=(t,e)=>{for(var r in e||(e={}))a7.call(e,r)&&fe(t,r,e[r]);if(a9)for(var r of a9(e))ft.call(e,r)&&fe(t,r,e[r]);return t};class fi extends r3{constructor(t){super(t),this.protocol="wc",this.version=2,this.events=new th.EventEmitter,this.name="relayer",this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=(0,tl.toMiliseconds)(tl.THIRTY_SECONDS+tl.ONE_SECOND),this.request=async t=>{var e,r;this.logger.debug("Publishing Request Payload");let i=t.id||(0,om.getBigIntRpcId)().toString();await this.toEstablishConnection();try{let n=this.provider.request(t);this.requestsInFlight.set(i,{promise:n,request:t}),this.logger.trace({id:i,method:t.method,topic:null==(e=t.params)?void 0:e.topic},"relayer.request - attempt to publish...");let s=await new Promise(async(t,e)=>{let r=()=>{e(Error(`relayer.request - publish interrupted, id: ${i}`))};this.provider.on(aT.disconnect,r);let s=await n;this.provider.off(aT.disconnect,r),t(s)});return this.logger.trace({id:i,method:t.method,topic:null==(r=t.params)?void 0:r.topic},"relayer.request - published"),s}catch(t){throw this.logger.debug(`Failed to Publish Request: ${i}`),t}finally{this.requestsInFlight.delete(i)}},this.resetPingTimeout=()=>{if(id())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var t,e,r;null==(r=null==(e=null==(t=this.provider)?void 0:t.connection)?void 0:e.socket)||r.terminate()},this.heartBeatTimeout)}catch(t){this.logger.warn(t)}},this.onPayloadHandler=t=>{this.onProviderPayload(t),this.resetPingTimeout()},this.onConnectHandler=()=>{this.startPingTimeout(),this.events.emit(aO.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(aO.error,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(aT.payload,this.onPayloadHandler),this.provider.on(aT.connect,this.onConnectHandler),this.provider.on(aT.disconnect,this.onDisconnectHandler),this.provider.on(aT.error,this.onProviderErrorHandler)},this.core=t.core,this.logger="u">typeof t.logger&&"string"!=typeof t.logger?(0,rX.Ep)(t.logger,this.name):(0,rX.gw)((0,rX.jI)({level:t.logger||"error"})),this.messages=new aY(this.logger,t.core),this.subscriber=new a5(this,this.logger),this.publisher=new aV(this,this.logger),this.relayUrl=t?.relayUrl||aR,this.projectId=t.projectId,this.bundleId=function(){var t;try{return ip()&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Application)?null==(t=r.g.Application)?void 0:t.applicationId:void 0}catch{return}}(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${aP}...`),await this.restartTransport(aP)}this.initialized=!0,setTimeout(async()=>{0===this.subscriber.topics.length&&0===this.subscriber.pending.size&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},1e4)}get context(){return(0,rX.Fd)(this.logger)}get connected(){var t,e,r;return(null==(r=null==(e=null==(t=this.provider)?void 0:t.connection)?void 0:e.socket)?void 0:r.readyState)===1}get connecting(){var t,e,r;return(null==(r=null==(e=null==(t=this.provider)?void 0:t.connection)?void 0:e.socket)?void 0:r.readyState)===0}async publish(t,e,r){this.isInitialized(),await this.publisher.publish(t,e,r),await this.recordMessageEvent({topic:t,message:e,publishedAt:Date.now()})}async subscribe(t,e){var r;this.isInitialized();let i=(null==(r=this.subscriber.topicMap.get(t))?void 0:r[0])||"",n,s=e=>{e.topic===t&&(this.subscriber.off(aU.created,s),n())};return await Promise.all([new Promise(t=>{n=t,this.subscriber.on(aU.created,s)}),new Promise(async r=>{i=await this.subscriber.subscribe(t,e)||i,r()})]),i}async unsubscribe(t,e){this.isInitialized(),await this.subscriber.unsubscribe(t,e)}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}off(t,e){this.events.off(t,e)}removeListener(t,e){this.events.removeListener(t,e)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(t=>t.promise))}catch(t){this.logger.warn(t)}this.hasExperiencedNetworkDisruption||this.connected?await ib(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(t){await this.confirmOnlineStateOrThrow(),t&&t!==this.relayUrl&&(this.relayUrl=t,await this.transportDisconnect(),await this.createProvider()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(t,e)=>{let r=()=>{this.provider.off(aT.disconnect,r),e(Error("Connection interrupted while trying to subscribe"))};this.provider.on(aT.disconnect,r),await ib(this.provider.connect(),(0,tl.toMiliseconds)(tl.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(t=>{e(t)}),await this.subscriber.start(),this.hasExperiencedNetworkDisruption=!1,t()})}catch(t){this.logger.error(t);if(!this.isConnectionStalled(t.message))throw t}finally{this.connectionAttemptInProgress=!1}}async restartTransport(t){this.connectionAttemptInProgress||(this.relayUrl=t||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await od())throw Error("No internet connection detected. Please restart your network and try again.")}startPingTimeout(){var t,e,r,i,n;if(id())try{null!=(e=null==(t=this.provider)?void 0:t.connection)&&e.socket&&(null==(n=null==(i=null==(r=this.provider)?void 0:r.connection)?void 0:i.socket)||n.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(t){this.logger.warn(t)}}isConnectionStalled(t){return this.staleConnectionErrors.some(e=>t.includes(e))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();let t=await this.core.crypto.signJWT(this.relayUrl);this.provider=new og.r(new oA(function({protocol:t,version:e,relayUrl:i,sdkVersion:n,auth:s,projectId:o,useOnCloseEvent:a,bundleId:f}){var h,u;let l;let c=i.split("?"),d=function(t,e,i){let n=function(){if(im()===ic.reactNative&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Platform)){let{OS:t,Version:e}=r.g.Platform;return[t,e].join("-")}let t=(0,ie.qY)();if(null===t)return"unknown";let e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return"browser"===t.type?[e,t.name,t.version].join("-"):[e,t.version].join("-")}(),s=function(){var t;let e=im();return e===ic.browser?[e,(null==(t=(0,tc.getLocation)())?void 0:t.host)||"unknown"].join(":"):e}();return[[t,e].join("-"),["js",i].join("-"),n,s].join("/")}(t,e,n),p=(h=c[1]||"",u={auth:s,ua:d,projectId:o,useOnCloseEvent:a||void 0,origin:f||void 0},l=il(il({},l=tp.parse(h)),u),h=tp.stringify(l));return c[0]+"?"+p}({sdkVersion:"2.12.1",protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:t,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(t){let{topic:e,message:r}=t;await this.messages.set(e,r)}async shouldIgnoreMessageEvent(t){let{topic:e,message:r}=t;if(!r||0===r.length)return this.logger.debug(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isSubscribed(e))return this.logger.debug(`Ignoring message for non-subscribed topic ${e}`),!0;let i=this.messages.has(e,r);return i&&this.logger.debug(`Ignoring duplicate message: ${r}`),i}async onProviderPayload(t){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:t}),(0,om.isJsonRpcRequest)(t)){if(!t.method.endsWith("_subscription"))return;let e=t.params,{topic:r,message:i,publishedAt:n}=e.data,s={topic:r,message:i,publishedAt:n};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(fr({type:"event",event:e.id},s)),this.events.emit(e.id,s),await this.acknowledgePayload(t),await this.onMessageEvent(s)}else(0,om.isJsonRpcResponse)(t)&&this.events.emit(aO.message_ack,t)}async onMessageEvent(t){await this.shouldIgnoreMessageEvent(t)||(this.events.emit(aO.message,t),await this.recordMessageEvent(t))}async acknowledgePayload(t){let e=(0,om.formatJsonRpcResult)(t.id,!0);await this.provider.connection.send(e)}unregisterProviderListeners(){this.provider.off(aT.payload,this.onPayloadHandler),this.provider.off(aT.connect,this.onConnectHandler),this.provider.off(aT.disconnect,this.onDisconnectHandler),this.provider.off(aT.error,this.onProviderErrorHandler)}async registerEventListeners(){let t=await od();!function(t){switch(im()){case ic.browser:(function(t){!ip()&&ig()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))})(t);break;case ic.reactNative:(function(t){ip()&&"u">typeof r.g&&null!=r.g&&r.g.NetInfo&&r.g?.NetInfo.addEventListener(e=>t(e?.isConnected))})(t);case ic.node:}}(async e=>{t!==e&&(t=e,e?await this.restartTransport().catch(t=>this.logger.error(t)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.events.emit(aO.disconnect),this.connectionAttemptInProgress=!1,this.transportExplicitlyClosed||setTimeout(async()=>{await this.transportOpen().catch(t=>this.logger.error(t))},(0,tl.toMiliseconds)(aD))}isInitialized(){if(!this.initialized){let{message:t}=of("NOT_INITIALIZED",this.name);throw Error(t)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),this.connected||(this.connectionAttemptInProgress&&await new Promise(t=>{let e=setInterval(()=>{this.connected&&(clearInterval(e),t())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var fn=Object.defineProperty,fs=Object.getOwnPropertySymbols,fo=Object.prototype.hasOwnProperty,fa=Object.prototype.propertyIsEnumerable,ff=(t,e,r)=>e in t?fn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fh=(t,e)=>{for(var r in e||(e={}))fo.call(e,r)&&ff(t,r,e[r]);if(fs)for(var r of fs(e))fa.call(e,r)&&ff(t,r,e[r]);return t};class fu extends r6{constructor(t,e,r,i=aI,n){super(t,e,r,i),this.core=t,this.logger=e,this.name=r,this.map=new Map,this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=aI,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(t=>{var e,r,i;this.getKey&&null!==t&&!ou(t)?this.map.set(this.getKey(t),t):(e=t,null==(r=e?.proposer)?void 0:r.publicKey)?this.map.set(t.id,t):(i=t,i?.topic&&this.map.set(t.topic,t))}),this.cached=[],this.initialized=!0)},this.set=async(t,e)=>{this.isInitialized(),this.map.has(t)?await this.update(t,e):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:t,value:e}),this.map.set(t,e),await this.persist())},this.get=t=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:t}),this.getData(t)),this.getAll=t=>(this.isInitialized(),t?this.values.filter(e=>Object.keys(t).every(r=>ox()(e[r],t[r]))):this.values),this.update=async(t,e)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:t,update:e});let r=fh(fh({},this.getData(t)),e);this.map.set(t,r),await this.persist()},this.delete=async(t,e)=>{this.isInitialized(),this.map.has(t)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:t,reason:e}),this.map.delete(t),this.addToRecentlyDeleted(t),await this.persist())},this.logger=(0,rX.Ep)(e,this.name),this.storagePrefix=i,this.getKey=n}get context(){return(0,rX.Fd)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(t){this.recentlyDeleted.push(t),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(t){await this.core.storage.setItem(this.storageKey,t)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(t){let e=this.map.get(t);if(!e){if(this.recentlyDeleted.includes(t)){let{message:e}=of("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${t}`);throw this.logger.error(e),Error(e)}let{message:e}=of("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.error(e),Error(e)}return e}async persist(){await this.setDataStore(this.values)}async restore(){try{let t=await this.getDataStore();if(typeof t>"u"||!t.length)return;if(this.map.size){let{message:t}=of("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),Error(t)}this.cached=t,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(t){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(t)}}isInitialized(){if(!this.initialized){let{message:t}=of("NOT_INITIALIZED",this.name);throw Error(t)}}}class fl{constructor(t,e){this.core=t,this.logger=e,this.name="pairing",this.version="0.3",this.events=new(tu()),this.initialized=!1,this.storagePrefix=aI,this.ignoredPayloadTypes=[1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:t})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...t])]},this.create=async t=>{var e;this.isInitialized();let r=sZ(),i=await this.core.crypto.setSymKey(r),n=iw(tl.FIVE_MINUTES),s={protocol:"irn"},o=(e={protocol:this.core.protocol,version:this.core.version,topic:i,symKey:r,relay:s,expiryTimestamp:n,methods:t?.methods},`${e.protocol}:${e.topic}@${e.version}?`+tp.stringify(oi(on(oi({symKey:e.symKey},function(t,e="-"){let r={};return Object.keys(t).forEach(i=>{t[i]&&(r["relay"+e+i]=t[i])}),r}(e.relay)),{expiryTimestamp:e.expiryTimestamp}),e.methods?{methods:e.methods.join(",")}:{})));return await this.pairings.set(i,{topic:i,expiry:n,relay:s,active:!1}),await this.core.relayer.subscribe(i),this.core.expirer.set(i,n),{topic:i,uri:o}},this.pair=async t=>{this.isInitialized(),this.isValidPair(t);let{topic:e,symKey:r,relay:i,expiryTimestamp:n,methods:s}=os(t.uri);if(this.pairings.keys.includes(e)&&this.pairings.get(e).active)throw Error(`Pairing already exists: ${e}. Please try again with a new connection URI.`);let o=n||iw(tl.FIVE_MINUTES),a={topic:e,relay:i,expiry:o,active:!1,methods:s};return await this.pairings.set(e,a),this.core.expirer.set(e,o),t.activatePairing&&await this.activate({topic:e}),this.events.emit(aF.create,a),this.core.crypto.keychain.has(e)||await this.core.crypto.setSymKey(r,e),await this.core.relayer.subscribe(e,{relay:i}),a},this.activate=async({topic:t})=>{this.isInitialized();let e=iw(tl.THIRTY_DAYS);await this.pairings.update(t,{active:!0,expiry:e}),this.core.expirer.set(t,e)},this.ping=async t=>{this.isInitialized(),await this.isValidPing(t);let{topic:e}=t;if(this.pairings.keys.includes(e)){let t=await this.sendRequest(e,"wc_pairingPing",{}),{done:r,resolve:i,reject:n}=function(t=tl.FIVE_MINUTES,e){let r,i,n;let s=(0,tl.toMiliseconds)(t||tl.FIVE_MINUTES);return{resolve:t=>{n&&r&&(clearTimeout(n),r(t))},reject:t=>{n&&i&&(clearTimeout(n),i(t))},done:()=>new Promise((t,e)=>{n=setTimeout(()=>{e(Error(void 0))},s),r=t,i=e})}}();this.events.once(iM("pairing_ping",t),({error:t})=>{t?n(t):i()}),await r()}},this.updateExpiry=async({topic:t,expiry:e})=>{this.isInitialized(),await this.pairings.update(t,{expiry:e})},this.updateMetadata=async({topic:t,metadata:e})=>{this.isInitialized(),await this.pairings.update(t,{peerMetadata:e})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async t=>{this.isInitialized(),await this.isValidDisconnect(t);let{topic:e}=t;this.pairings.keys.includes(e)&&(await this.sendRequest(e,"wc_pairingDelete",oh("USER_DISCONNECTED")),await this.deletePairing(e))},this.sendRequest=async(t,e,r)=>{let i=(0,om.formatJsonRpcRequest)(e,r),n=await this.core.crypto.encode(t,i),s=aq[e].req;return this.core.history.set(t,i),this.core.relayer.publish(t,n,s),i.id},this.sendResult=async(t,e,r)=>{let i=(0,om.formatJsonRpcResult)(t,r),n=await this.core.crypto.encode(e,i),s=aq[(await this.core.history.get(e,t)).request.method].res;await this.core.relayer.publish(e,n,s),await this.core.history.resolve(i)},this.sendError=async(t,e,r)=>{let i=(0,om.formatJsonRpcError)(t,r),n=await this.core.crypto.encode(e,i),s=await this.core.history.get(e,t),o=aq[s.request.method]?aq[s.request.method].res:aq.unregistered_method.res;await this.core.relayer.publish(e,n,o),await this.core.history.resolve(i)},this.deletePairing=async(t,e)=>{await this.core.relayer.unsubscribe(t),await Promise.all([this.pairings.delete(t,oh("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(t),e?Promise.resolve():this.core.expirer.del(t)])},this.cleanup=async()=>{let t=this.pairings.getAll().filter(t=>ix(t.expiry));await Promise.all(t.map(t=>this.deletePairing(t.topic)))},this.onRelayEventRequest=t=>{let{topic:e,payload:r}=t;switch(r.method){case"wc_pairingPing":return this.onPairingPingRequest(e,r);case"wc_pairingDelete":return this.onPairingDeleteRequest(e,r);default:return this.onUnknownRpcMethodRequest(e,r)}},this.onRelayEventResponse=async t=>{let{topic:e,payload:r}=t,i=(await this.core.history.get(e,r.id)).request.method;if("wc_pairingPing"===i)return this.onPairingPingResponse(e,r);return this.onUnknownRpcMethodResponse(i)},this.onPairingPingRequest=async(t,e)=>{let{id:r}=e;try{this.isValidPing({topic:t}),await this.sendResult(r,t,!0),this.events.emit(aF.ping,{id:r,topic:t})}catch(e){await this.sendError(r,t,e),this.logger.error(e)}},this.onPairingPingResponse=(t,e)=>{let{id:r}=e;setTimeout(()=>{(0,om.isJsonRpcResult)(e)?this.events.emit(iM("pairing_ping",r),{}):(0,om.isJsonRpcError)(e)&&this.events.emit(iM("pairing_ping",r),{error:e.error})},500)},this.onPairingDeleteRequest=async(t,e)=>{let{id:r}=e;try{this.isValidDisconnect({topic:t}),await this.deletePairing(t),this.events.emit(aF.delete,{id:r,topic:t})}catch(e){await this.sendError(r,t,e),this.logger.error(e)}},this.onUnknownRpcMethodRequest=async(t,e)=>{let{id:r,method:i}=e;try{if(this.registeredMethods.includes(i))return;let e=oh("WC_METHOD_UNSUPPORTED",i);await this.sendError(r,t,e),this.logger.error(e)}catch(e){await this.sendError(r,t,e),this.logger.error(e)}},this.onUnknownRpcMethodResponse=t=>{this.registeredMethods.includes(t)||this.logger.error(oh("WC_METHOD_UNSUPPORTED",t))},this.isValidPair=t=>{var e;if(!oc(t)){let{message:e}=of("MISSING_OR_INVALID",`pair() params: ${t}`);throw Error(e)}if(!function(t){if(ol(t,!1))try{return"u">typeof new URL(t)}catch{}return!1}(t.uri)){let{message:e}=of("MISSING_OR_INVALID",`pair() uri: ${t.uri}`);throw Error(e)}let r=os(t.uri);if(!(null!=(e=r?.relay)&&e.protocol)){let{message:t}=of("MISSING_OR_INVALID","pair() uri#relay-protocol");throw Error(t)}if(!(null!=r&&r.symKey)){let{message:t}=of("MISSING_OR_INVALID","pair() uri#symKey");throw Error(t)}if(null!=r&&r.expiryTimestamp&&(0,tl.toMiliseconds)(r?.expiryTimestamp){if(!oc(t)){let{message:e}=of("MISSING_OR_INVALID",`ping() params: ${t}`);throw Error(e)}let{topic:e}=t;await this.isValidPairingTopic(e)},this.isValidDisconnect=async t=>{if(!oc(t)){let{message:e}=of("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw Error(e)}let{topic:e}=t;await this.isValidPairingTopic(e)},this.isValidPairingTopic=async t=>{if(!ol(t,!1)){let{message:e}=of("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw Error(e)}if(!this.pairings.keys.includes(t)){let{message:e}=of("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw Error(e)}if(ix(this.pairings.get(t).expiry)){await this.deletePairing(t);let{message:e}=of("EXPIRED",`pairing topic: ${t}`);throw Error(e)}},this.core=t,this.logger=(0,rX.Ep)(e,this.name),this.pairings=new fu(this.core,this.logger,this.name,this.storagePrefix)}get context(){return(0,rX.Fd)(this.logger)}isInitialized(){if(!this.initialized){let{message:t}=of("NOT_INITIALIZED",this.name);throw Error(t)}}registerRelayerEvents(){this.core.relayer.on(aO.message,async t=>{let{topic:e,message:r}=t;if(!this.pairings.keys.includes(e)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))return;let i=await this.core.crypto.decode(e,r);try{(0,om.isJsonRpcRequest)(i)?(this.core.history.set(e,i),this.onRelayEventRequest({topic:e,payload:i})):(0,om.isJsonRpcResponse)(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:e,payload:i}),this.core.history.delete(e,i.id))}catch(t){this.logger.error(t)}})}registerExpirerEvents(){this.core.expirer.on(aL.expired,async t=>{let{topic:e}=function(t){let[e,r]=t.split(":"),i={id:void 0,topic:void 0};if("topic"===e&&"string"==typeof r)i.topic=r;else if("id"===e&&Number.isInteger(Number(r)))i.id=Number(r);else throw Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return i}(t.target);e&&this.pairings.keys.includes(e)&&(await this.deletePairing(e,!0),this.events.emit(aF.expire,{topic:e}))})}}class fc extends r0{constructor(t,e){super(t,e),this.core=t,this.logger=e,this.records=new Map,this.events=new th.EventEmitter,this.name="history",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=aI,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(t=>this.records.set(t.id,t)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(t,e,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:t,request:e,chainId:r}),this.records.has(e.id))return;let i={id:e.id,topic:t,request:{method:e.method,params:e.params||null},chainId:r,expiry:iw(tl.THIRTY_DAYS)};this.records.set(i.id,i),this.persist(),this.events.emit(az.created,i)},this.resolve=async t=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:t}),!this.records.has(t.id))return;let e=await this.getRecord(t.id);typeof e.response>"u"&&(e.response=(0,om.isJsonRpcError)(t)?{error:t.error}:{result:t.result},this.records.set(e.id,e),this.persist(),this.events.emit(az.updated,e))},this.get=async(t,e)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:t,id:e}),await this.getRecord(e)),this.delete=(t,e)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:e}),this.values.forEach(r=>{r.topic===t&&(!("u">typeof e)||r.id===e)&&(this.records.delete(r.id),this.events.emit(az.deleted,r))}),this.persist()},this.exists=async(t,e)=>(this.isInitialized(),!!this.records.has(e)&&(await this.getRecord(e)).topic===t),this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.logger=(0,rX.Ep)(e,this.name)}get context(){return(0,rX.Fd)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let t=[];return this.values.forEach(e=>{if("u">typeof e.response)return;let r={topic:e.topic,request:(0,om.formatJsonRpcRequest)(e.request.method,e.request.params,e.id),chainId:e.chainId};return t.push(r)}),t}async setJsonRpcRecords(t){await this.core.storage.setItem(this.storageKey,t)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(t){this.isInitialized();let e=this.records.get(t);if(!e){let{message:e}=of("NO_MATCHING_KEY",`${this.name}: ${t}`);throw Error(e)}return e}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(az.sync)}async restore(){try{let t=await this.getJsonRpcRecords();if(typeof t>"u"||!t.length)return;if(this.records.size){let{message:t}=of("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),Error(t)}this.cached=t,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}}registerEventListeners(){this.events.on(az.created,t=>{let e=az.created;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,record:t})}),this.events.on(az.updated,t=>{let e=az.updated;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,record:t})}),this.events.on(az.deleted,t=>{let e=az.deleted;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,record:t})}),this.core.heartbeat.on(rW.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let t=!1;this.records.forEach(e=>{(0,tl.toMiliseconds)(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.records.delete(e.id),this.events.emit(az.deleted,e,!1),t=!0)}),t&&this.persist()}catch(t){this.logger.warn(t)}}isInitialized(){if(!this.initialized){let{message:t}=of("NOT_INITIALIZED",this.name);throw Error(t)}}}class fd extends r5{constructor(t,e){super(t,e),this.core=t,this.logger=e,this.expirations=new Map,this.events=new th.EventEmitter,this.name="expirer",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=aI,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(t=>this.expirations.set(t.target,t)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=t=>{try{let e=this.formatTarget(t);return"u">typeof this.getExpiration(e)}catch{return!1}},this.set=(t,e)=>{this.isInitialized();let r=this.formatTarget(t),i={target:r,expiry:e};this.expirations.set(r,i),this.checkExpiry(r,i),this.events.emit(aL.created,{target:r,expiration:i})},this.get=t=>{this.isInitialized();let e=this.formatTarget(t);return this.getExpiration(e)},this.del=t=>{if(this.isInitialized(),this.has(t)){let e=this.formatTarget(t),r=this.getExpiration(e);this.expirations.delete(e),this.events.emit(aL.deleted,{target:e,expiration:r})}},this.on=(t,e)=>{this.events.on(t,e)},this.once=(t,e)=>{this.events.once(t,e)},this.off=(t,e)=>{this.events.off(t,e)},this.removeListener=(t,e)=>{this.events.removeListener(t,e)},this.logger=(0,rX.Ep)(e,this.name)}get context(){return(0,rX.Fd)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(t){if("string"==typeof t)return iA("topic",t);if("number"==typeof t)return iA("id",t);let{message:e}=of("UNKNOWN_TYPE",`Target type: ${typeof t}`);throw Error(e)}async setExpirations(t){await this.core.storage.setItem(this.storageKey,t)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(aL.sync)}async restore(){try{let t=await this.getExpirations();if(typeof t>"u"||!t.length)return;if(this.expirations.size){let{message:t}=of("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),Error(t)}this.cached=t,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(t){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(t)}}getExpiration(t){let e=this.expirations.get(t);if(!e){let{message:e}=of("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.warn(e),Error(e)}return e}checkExpiry(t,e){let{expiry:r}=e;(0,tl.toMiliseconds)(r)-Date.now()<=0&&this.expire(t,e)}expire(t,e){this.expirations.delete(t),this.events.emit(aL.expired,{target:t,expiration:e})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((t,e)=>this.checkExpiry(e,t))}registerEventListeners(){this.core.heartbeat.on(rW.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(aL.created,t=>{let e=aL.created;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),this.persist()}),this.events.on(aL.expired,t=>{let e=aL.expired;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),this.persist()}),this.events.on(aL.deleted,t=>{let e=aL.deleted;this.logger.info(`Emitting ${e}`),this.logger.debug({type:"event",event:e,data:t}),this.persist()})}isInitialized(){if(!this.initialized){let{message:t}=of("NOT_INITIALIZED",this.name);throw Error(t)}}}class fp extends r4{constructor(t,e){super(t,e),this.projectId=t,this.logger=e,this.name=aH,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async t=>{if(this.verifyDisabled||ip()||!ig())return;let e=this.getVerifyUrl(t?.verifyUrl);this.verifyUrl!==e&&this.removeIframe(),this.verifyUrl=e;try{await this.createIframe()}catch(t){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(t)}if(!this.initialized){this.removeIframe(),this.verifyUrl=aj;try{await this.createIframe()}catch(t){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(t),this.verifyDisabled=!0}}},this.register=async t=>{this.initialized?this.sendPost(t.attestationId):(this.addToQueue(t.attestationId),await this.init())},this.resolve=async t=>{let e;if(this.isDevEnv)return"";let r=this.getVerifyUrl(t?.verifyUrl);try{e=await this.fetchAttestation(t.attestationId,r)}catch(i){this.logger.info(`failed to resolve attestation: ${t.attestationId} from url: ${r}`),this.logger.info(i),e=await this.fetchAttestation(t.attestationId,aj)}return e},this.fetchAttestation=async(t,e)=>{this.logger.info(`resolving attestation: ${t} from url: ${e}`);let r=this.startAbortTimer(2*tl.ONE_SECOND),i=await fetch(`${e}/attestation/${t}`,{signal:this.abortController.signal});return clearTimeout(r),200===i.status?await i.json():void 0},this.addToQueue=t=>{this.queue.push(t)},this.processQueue=()=>{0!==this.queue.length&&(this.queue.forEach(t=>this.sendPost(t)),this.queue=[])},this.sendPost=t=>{var e;try{if(!this.iframe)return;null==(e=this.iframe.contentWindow)||e.postMessage(t,"*"),this.logger.info(`postMessage sent: ${t} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let t;let e=r=>{"verify_ready"===r.data&&(this.onInit(),window.removeEventListener("message",e),t())};await Promise.race([new Promise(r=>{let i=document.getElementById(aH);if(i)return this.iframe=i,this.onInit(),r();window.addEventListener("message",e);let n=document.createElement("iframe");n.id=aH,n.src=`${this.verifyUrl}/${this.projectId}`,n.style.display="none",document.body.append(n),this.iframe=n,t=r}),new Promise((t,r)=>setTimeout(()=>{window.removeEventListener("message",e),r("verify iframe load timeout")},(0,tl.toMiliseconds)(tl.FIVE_SECONDS)))])},this.onInit=()=>{this.initialized=!0,this.processQueue()},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=t=>{let e=t||aQ;return aK.includes(e)||(this.logger.info(`verify url: ${e}, not included in trusted list, assigning default: ${aQ}`),e=aQ),e},this.logger=(0,rX.Ep)(e,this.name),this.verifyUrl=aQ,this.abortController=new AbortController,this.isDevEnv=id()&&oI.env.IS_VITEST}get context(){return(0,rX.Fd)(this.logger)}startAbortTimer(t){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,tl.toMiliseconds)(t))}}class fg extends r9{constructor(t,e){super(t,e),this.projectId=t,this.logger=e,this.context="echo",this.registerDeviceToken=async t=>{let{clientId:e,token:r,notificationType:i,enableEncrypted:n=!1}=t,s=`https://echo.walletconnect.com/${this.projectId}/clients`;await oE()(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:e,type:i,token:r,always_raw:n})})},this.logger=(0,rX.Ep)(e,this.context)}}var fm=Object.defineProperty,fv=Object.getOwnPropertySymbols,fy=Object.prototype.hasOwnProperty,fb=Object.prototype.propertyIsEnumerable,fA=(t,e,r)=>e in t?fm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fw=(t,e)=>{for(var r in e||(e={}))fy.call(e,r)&&fA(t,r,e[r]);if(fv)for(var r of fv(e))fb.call(e,r)&&fA(t,r,e[r]);return t};class fx extends r${constructor(t){var e;super(t),this.protocol="wc",this.version=2,this.name=aE,this.events=new th.EventEmitter,this.initialized=!1,this.on=(t,e)=>this.events.on(t,e),this.once=(t,e)=>this.events.once(t,e),this.off=(t,e)=>this.events.off(t,e),this.removeListener=(t,e)=>this.events.removeListener(t,e),this.projectId=t?.projectId,this.relayUrl=t?.relayUrl||aR,this.customStoragePrefix=null!=t&&t.customStoragePrefix?`:${t.customStoragePrefix}`:"";let r=(0,rX.jI)({level:"string"==typeof t?.logger&&t.logger?t.logger:aS.logger}),{logger:i,chunkLoggerController:n}=(0,rX.Rt)({opts:r,maxSizeInBytes:t?.maxLogBlobSizeInBytes,loggerOverride:t?.logger});this.logChunkController=n,null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var t,e;null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(null==(e=this.logChunkController)||e.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=(0,rX.Ep)(i,this.name),this.heartbeat=new rW.HeartBeat,this.crypto=new aG(this,this.logger,t?.keychain),this.history=new fc(this,this.logger),this.expirer=new fd(this,this.logger),this.storage=null!=t&&t.storage?t.storage:new rV.Z(fw(fw({},a_),t?.storageOptions)),this.relayer=new fi({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new fl(this,this.logger),this.verify=new fp(this.projectId||"",this.logger),this.echoClient=new fg(this.projectId||"",this.logger)}static async init(t){let e=new fx(t);await e.initialize();let r=await e.crypto.getClientId();return await e.storage.setItem("WALLETCONNECT_CLIENT_ID",r),e}get context(){return(0,rX.Fd)(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var t;return null==(t=this.logChunkController)?void 0:t.logsToBlob({clientId:await this.crypto.getClientId()})}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(t){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,t),this.logger.error(t.message),t}}}class fM{constructor(t){this.opts=t,this.protocol="wc",this.version=2}}class fE{constructor(t){this.client=t}}var fI=r(34155),fS=r(48764).Buffer;function f_(t){let[e,r]=t.split(":");return{namespace:e,reference:r}}function fN(t,e){return t.includes(":")?[t]:e.chains||[]}Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;let fC={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"};function fB(){return"u">typeof fI&&"u">typeof fI.versions&&"u">typeof fI.versions.node}function fR(){return!fB()&&!!(0,tc.getNavigator)()&&!!(0,tc.getDocument)()}function fP(t,e){return t.filter(t=>e.includes(t)).length===t.length}function fO(t=tl.FIVE_MINUTES,e){let r,i,n;let s=(0,tl.toMiliseconds)(t||tl.FIVE_MINUTES);return{resolve:t=>{n&&r&&(clearTimeout(n),r(t))},reject:t=>{n&&i&&(clearTimeout(n),i(t))},done:()=>new Promise((t,o)=>{n=setTimeout(()=>{o(Error(e))},s),r=t,i=o})}}function fT(t,e){return(0,tl.fromMiliseconds)((e||Date.now())+(0,tl.toMiliseconds)(t))}function fD(t){return Date.now()>=(0,tl.toMiliseconds)(t)}function fU(t,e){return`${t}${e?`:${e}`:""}`}async function fk({id:t,topic:e,wcDeepLink:i}){try{if(!i)return;let n="string"==typeof i?JSON.parse(i):i,s=n?.href;if("string"!=typeof s)return;s.endsWith("/")&&(s=s.slice(0,-1));let o=`${s}/wc?requestId=${t}&sessionTopic=${e}`,a=!(0,tc.getDocument)()&&(0,tc.getNavigator)()&&"ReactNative"===navigator.product?fC.reactNative:fB()?fC.node:fR()?fC.browser:fC.unknown;a===fC.browser?o.startsWith("https://")||o.startsWith("http://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,"_self","noreferrer noopener"):a===fC.reactNative&&"u">typeof(null==r.g?void 0:r.g.Linking)&&await r.g.Linking.openURL(o)}catch(t){console.error(t)}}async function fq(t,e){try{return await t.getItem(e)||(fR()?localStorage.getItem(e):void 0)}catch(t){console.error(t)}}var fF="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},fz={exports:{}};I=fz,function(){var t="input is invalid type",e="object"==typeof window,r=e?window:{};r.JS_SHA3_NO_WINDOW&&(e=!1);var i=!e&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof fI&&fI.versions&&fI.versions.node?r=fF:i&&(r=self);var n=!r.JS_SHA3_NO_COMMON_JS&&I.exports,s=!r.JS_SHA3_NO_ARRAY_BUFFER&&"u">typeof ArrayBuffer,o="0123456789abcdef".split(""),a=[4,1024,262144,0x4000000],f=[0,8,16,24],h=[1,0,32898,0,32906,0x80000000,0x80008000,0x80000000,32907,0,0x80000001,0,0x80008081,0x80000000,32777,0x80000000,138,0,136,0,0x80008009,0,0x8000000a,0,0x8000808b,0,139,0x80000000,32905,0x80000000,32771,0x80000000,32770,0x80000000,128,0x80000000,32778,0,0x8000000a,0x80000000,0x80008081,0x80000000,32896,0x80000000,0x80000001,0,0x80008008,0x80000000],u=[224,256,384,512],l=[128,256],c=["hex","buffer","arrayBuffer","array","digest"],d={128:168,256:136};(r.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),s&&(r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var p=function(t,e,r){return function(i){return new B(t,e,t).update(i)[r]()}},g=function(t,e,r){return function(i,n){return new B(t,e,n).update(i)[r]()}},m=function(t,e,r){return function(e,i,n,s){return w["cshake"+t].update(e,i,n,s)[r]()}},v=function(t,e,r){return function(e,i,n,s){return w["kmac"+t].update(e,i,n,s)[r]()}},y=function(t,e,r,i){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function R(t,e,r){B.call(this,t,e,r)}B.prototype.update=function(e){if(this.finalized)throw Error("finalize already called");var r,i=typeof e;if("string"!==i){if("object"===i){if(null===e)throw Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!s||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}for(var n,o,a=this.blocks,h=this.byteCount,u=e.length,l=this.blockCount,c=0,d=this.s;c>2]|=e[c]<>2]|=o<>2]|=(192|o>>6)<=57344?a[n>>2]|=(224|o>>12)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(this.start=n-h,this.block=a[l],n=0;n>=8,r=255&t;r>0;)n.unshift(r),t>>=8,r=255&t,++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},B.prototype.encodeString=function(e){var r,i=typeof e;if("string"!==i){if("object"===i){if(null===e)throw Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!s||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}var n=0,o=e.length;if(r)n=o;else for(var a=0;a=57344?n+=3:(f=65536+((1023&f)<<10|1023&e.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(e),n},B.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];a%e==0&&(P(r),s=0)}return n&&(f+=o[(t=r[s])>>4&15]+o[15&t],n>1&&(f+=o[t>>12&15]+o[t>>8&15]),n>2&&(f+=o[t>>20&15]+o[t>>16&15])),f},B.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,s=0,o=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var f=new Uint32Array(t);o>8&255,f[t+2]=e>>16&255,f[t+3]=e>>24&255;a%r==0&&P(i)}return s&&(t=a<<2,e=i[o],f[t]=255&e,s>1&&(f[t+1]=e>>8&255),s>2&&(f[t+2]=e>>16&255)),f},R.prototype=new B,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var P=function(t){var e,r,i,n,s,o,a,f,u,l,c,d,p,g,m,v,y,b,A,w,x,M,E,I,S,_,N,C,B,R,P,O,T,D,U,k,q,F,z,L,H,Q,j,K,J,G,Y,V,W,X,Z,$,tt,te,tr,ti,tn,ts,to,ta,tf,th,tu;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],f=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],d=t[8]^t[18]^t[28]^t[38]^t[48],p=t[9]^t[19]^t[29]^t[39]^t[49],e=d^(o<<1|a>>>31),r=p^(a<<1|o>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(f<<1|u>>>31),r=s^(u<<1|f>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=o^(l<<1|c>>>31),r=a^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=f^(d<<1|p>>>31),r=u^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(n<<1|s>>>31),r=c^(s<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,g=t[0],m=t[1],G=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,C=t[20]<<3|t[21]>>>29,B=t[21]<<3|t[20]>>>29,ta=t[31]<<9|t[30]>>>23,tf=t[30]<<9|t[31]>>>23,Q=t[40]<<18|t[41]>>>14,j=t[41]<<18|t[40]>>>14,D=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,V=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,R=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,th=t[42]<<2|t[43]>>>30,tu=t[43]<<2|t[42]>>>30,te=t[5]<<30|t[4]>>>2,tr=t[4]<<30|t[5]>>>2,k=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,O=t[45]<<29|t[44]>>>3,T=t[44]<<29|t[45]>>>3,I=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,ti=t[17]<<23|t[16]>>>9,tn=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,x=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,J=t[9]<<27|t[8]>>>5,_=t[18]<<20|t[19]>>>12,N=t[19]<<20|t[18]>>>12,ts=t[29]<<7|t[28]>>>25,to=t[28]<<7|t[29]>>>25,L=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=g^~v&b,t[1]=m^~y&A,t[10]=I^~_&C,t[11]=S^~N&B,t[20]=D^~k&F,t[21]=U^~q&z,t[30]=K^~G&V,t[31]=J^~Y&W,t[40]=te^~ti&ts,t[41]=tr^~tn&to,t[2]=v^~b&w,t[3]=y^~A&x,t[12]=_^~C&R,t[13]=N^~B&P,t[22]=k^~F&L,t[23]=q^~z&H,t[32]=G^~V&X,t[33]=Y^~W&Z,t[42]=ti^~ts&ta,t[43]=tn^~to&tf,t[4]=b^~w&M,t[5]=A^~x&E,t[14]=C^~R&O,t[15]=B^~P&T,t[24]=F^~L&Q,t[25]=z^~H&j,t[34]=V^~X&$,t[35]=W^~Z&tt,t[44]=ts^~ta&th,t[45]=to^~tf&tu,t[6]=w^~M&g,t[7]=x^~E&m,t[16]=R^~O&I,t[17]=P^~T&S,t[26]=L^~Q&D,t[27]=H^~j&U,t[36]=X^~$&K,t[37]=Z^~tt&J,t[46]=ta^~th&te,t[47]=tf^~tu&tr,t[8]=M^~g&v,t[9]=E^~m&y,t[18]=O^~I&_,t[19]=T^~S&N,t[28]=Q^~D&k,t[29]=j^~U&q,t[38]=$^~K&G,t[39]=tt^~J&Y,t[48]=th^~te&ti,t[49]=tu^~tr&tn,t[0]^=h[i],t[1]^=h[i+1]};if(n)I.exports=w;else for(M=0;M{try{if("test"!=="test".normalize(e))throw Error("bad normalize")}catch{t.push(e)}}),t.length)throw Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw Error("broken implementation")}catch(t){return t.message}return null}();(S=$||($={})).DEBUG="DEBUG",S.INFO="INFO",S.WARNING="WARNING",S.ERROR="ERROR",S.OFF="OFF",(_=tt||(tt={})).UNKNOWN_ERROR="UNKNOWN_ERROR",_.NOT_IMPLEMENTED="NOT_IMPLEMENTED",_.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",_.NETWORK_ERROR="NETWORK_ERROR",_.SERVER_ERROR="SERVER_ERROR",_.TIMEOUT="TIMEOUT",_.BUFFER_OVERRUN="BUFFER_OVERRUN",_.NUMERIC_FAULT="NUMERIC_FAULT",_.MISSING_NEW="MISSING_NEW",_.INVALID_ARGUMENT="INVALID_ARGUMENT",_.MISSING_ARGUMENT="MISSING_ARGUMENT",_.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",_.CALL_EXCEPTION="CALL_EXCEPTION",_.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",_.NONCE_EXPIRED="NONCE_EXPIRED",_.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",_.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",_.TRANSACTION_REPLACED="TRANSACTION_REPLACED",_.ACTION_REJECTED="ACTION_REJECTED";let fY="0123456789abcdef";class fV{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){let r=t.toLowerCase();null==fj[r]&&this.throwArgumentError("invalid log level name","logLevel",t),fK>fj[r]||console.log.apply(console,e)}debug(...t){this._log(fV.levels.DEBUG,t)}info(...t){this._log(fV.levels.INFO,t)}warn(...t){this._log(fV.levels.WARNING,t)}makeError(t,e,r){if(fQ)return this.makeError("censored error",e,{});e||(e=fV.errors.UNKNOWN_ERROR),r||(r={});let i=[];Object.keys(r).forEach(t=>{let e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t>4],r+=fY[15&e[t]];i.push(t+"=Uint8Array(0x"+r+")")}else i.push(t+"="+JSON.stringify(e))}catch{i.push(t+"="+JSON.stringify(r[t].toString()))}}),i.push(`code=${e}`),i.push(`version=${this.version}`);let n=t,s="";switch(e){case tt.NUMERIC_FAULT:{s="NUMERIC_FAULT";let e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":s+="-"+e;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case tt.CALL_EXCEPTION:case tt.INSUFFICIENT_FUNDS:case tt.MISSING_NEW:case tt.NONCE_EXPIRED:case tt.REPLACEMENT_UNDERPRICED:case tt.TRANSACTION_REPLACED:case tt.UNPREDICTABLE_GAS_LIMIT:s=e}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(t+=" ("+i.join(", ")+")");let o=Error(t);return o.reason=n,o.code=e,Object.keys(r).forEach(function(t){o[t]=r[t]}),o}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,fV.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,i){t||this.throwError(e,r,i)}assertArgument(t,e,r,i){t||this.throwArgumentError(e,r,i)}checkNormalize(t){fG&&this.throwError("platform missing String.prototype.normalize",fV.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:fG})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=0x1fffffffffffff)&&this.throwError(e,fV.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,fV.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,fV.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||null==t)&&this.throwError("missing new",fV.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",fV.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||null==t)&&this.throwError("missing new",fV.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return fJ||(fJ=new fV("logger/5.7.0")),fJ}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",fV.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),fH){if(!t)return;this.globalLogger().throwError("error censorship permanent",fV.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}fQ=!!t,fH=!!e}static setLogLevel(t){let e=fj[t.toLowerCase()];if(null==e){fV.globalLogger().warn("invalid log level - "+t);return}fK=e}static from(t){return new fV(t)}}fV.errors=tt,fV.levels=$;let fW=new fV("bytes/5.7.0");function fX(t){return!!t.toHexString}function fZ(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return fZ(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function f$(t){return"number"==typeof t&&t==t&&t%1==0}function f0(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!f$(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function f1(t,e){if(e||(e={}),"number"==typeof t){fW.checkSafeUint53(t,"invalid arrayify value");let e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),fZ(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),fX(t)&&(t=t.toHexString()),f2(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":fW.throwArgumentError("hex data is odd-length","value",t));let i=[];for(let t=0;t>4]+f3[15&i]}return e}return fW.throwArgumentError("invalid hexlify value","value",t)}function f8(t,e,r){return"string"!=typeof t?t=f6(t):(!f2(t)||t.length%2)&&fW.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function f5(t,e){for("string"!=typeof t?t=f6(t):f2(t)||fW.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&fW.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function f4(t){var e;let r={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(f2(e=t)&&!(e.length%2)||f0(e)){let e=f1(t);64===e.length?(r.v=27+(e[32]>>7),e[32]&=127,r.r=f6(e.slice(0,32)),r.s=f6(e.slice(32,64))):65===e.length?(r.r=f6(e.slice(0,32)),r.s=f6(e.slice(32,64)),r.v=e[64]):fW.throwArgumentError("invalid signature string","signature",t),r.v<27&&(0===r.v||1===r.v?r.v+=27:fW.throwArgumentError("signature invalid v byte","signature",t)),r.recoveryParam=1-r.v%2,r.recoveryParam&&(e[32]|=128),r._vs=f6(e.slice(32,64))}else{if(r.r=t.r,r.s=t.s,r.v=t.v,r.recoveryParam=t.recoveryParam,r._vs=t._vs,null!=r._vs){let e=function(t,e){(t=f1(t)).length>e&&fW.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),fZ(r)}(f1(r._vs),32);r._vs=f6(e);let i=e[0]>=128?1:0;null==r.recoveryParam?r.recoveryParam=i:r.recoveryParam!==i&&fW.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),e[0]&=127;let n=f6(e);null==r.s?r.s=n:r.s!==n&&fW.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==r.recoveryParam)null==r.v?fW.throwArgumentError("signature missing v and recoveryParam","signature",t):0===r.v||1===r.v?r.recoveryParam=r.v:r.recoveryParam=1-r.v%2;else if(null==r.v)r.v=27+r.recoveryParam;else{let e=0===r.v||1===r.v?r.v:1-r.v%2;r.recoveryParam!==e&&fW.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=r.r&&f2(r.r)?r.r=f5(r.r,32):fW.throwArgumentError("signature missing or invalid r","signature",t),null!=r.s&&f2(r.s)?r.s=f5(r.s,32):fW.throwArgumentError("signature missing or invalid s","signature",t);let e=f1(r.s);e[0]>=128&&fW.throwArgumentError("signature s out of range","signature",t),r.recoveryParam&&(e[0]|=128);let i=f6(e);r._vs&&(f2(r._vs)||fW.throwArgumentError("signature invalid _vs","signature",t),r._vs=f5(r._vs,32)),null==r._vs?r._vs=i:r._vs!==i&&fW.throwArgumentError("signature _vs mismatch v and s","signature",t)}return r.yParityAndS=r._vs,r.compact=r.r+r.yParityAndS.substring(2),r}function f9(t){return"0x"+fL.keccak_256(f1(t))}var f7={exports:{}},ht=function(t){var e=t.default;if("function"==typeof e){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}),r}(Object.freeze({__proto__:null,default:{}}));!function(t,e){function r(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{u="u">typeof window&&"u">typeof window.Buffer?window.Buffer:ht.Buffer}catch{}function s(t,e){var i=t.charCodeAt(e);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+t)}function o(t,e,r){var i=s(t,r);return r-1>=e&&(i|=s(t,r-1)<<4),i}function a(t,e,i,n){for(var s=0,o=0,a=Math.min(t.length,i),f=e;f=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&o0?t:e},n.min=function(t,e){return 0>t.cmp(e)?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,s++);return this._strip()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var i=0;i=e;i-=2)n=o(t,e,i)<=18?(s-=18,a+=1,this.words[a]|=n>>>26):s+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(s-=18,a+=1,this.words[a]|=n>>>26):s+=8;this._strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,f=Math.min(s,s-o)+r,h=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"u">typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch{n.prototype.inspect=h}else n.prototype.inspect=h;function h(){return(this.red?""}var u,l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];n.prototype.toString=function(t,e){if(t=t||10,e=0|e||1,16===t||"hex"===t){i="";for(var i,n=0,s=0,o=0;o>>24-n&0xffffff,(n+=2)>=26&&(n-=26,o--),i=0!==s||o!==this.length-1?l[6-f.length]+f+i:f+i}for(0!==s&&(i=s.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],u=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(u).toString(t);i=(p=p.idivn(u)).isZero()?g+i:l[h-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?t+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},u&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(u,t,e)}),n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};n.prototype.toArrayLike=function(t,e,i){this._strip();var n,s,o=this.byteLength(),a=i||Math.max(1,o);r(o<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0");var f=(n=t,s=a,n.allocUnsafe?n.allocUnsafe(s):new n(s));return this["_toArrayLike"+("le"===e?"LE":"BE")](f,o),f},n.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,s=0;n>8&255),r>16&255),6===s?(r>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===s?(r>=0&&(t[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e};function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=0x3ffffff&o,f=o/0x4000000|0;r.words[0]=a;for(var h=1;h>>26,l=0x3ffffff&f,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;n=0|t.words[p],u+=(o=n*(s=0|e.words[d])+l)/0x4000000|0,l=0x3ffffff&o}r.words[h]=0|l,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r._strip()}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i),this._strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),e?this.words[i]=this.words[i]|1<t.length?(r=this,i=t):(r=t,i=this);for(var e,r,i,n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;st.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(e=this,r=t):(e=t,r=this);for(var s=0,o=0;o>26,this.words[o]=0x3ffffff&i;for(;0!==s&&o>26,this.words[o]=0x3ffffff&i;if(0===s&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,m=0|o[2],v=8191&m,y=m>>>13,b=0|o[3],A=8191&b,w=b>>>13,x=0|o[4],M=8191&x,E=x>>>13,I=0|o[5],S=8191&I,_=I>>>13,N=0|o[6],C=8191&N,B=N>>>13,R=0|o[7],P=8191&R,O=R>>>13,T=0|o[8],D=8191&T,U=T>>>13,k=0|o[9],q=8191&k,F=k>>>13,z=0|a[0],L=8191&z,H=z>>>13,Q=0|a[1],j=8191&Q,K=Q>>>13,J=0|a[2],G=8191&J,Y=J>>>13,V=0|a[3],W=8191&V,X=V>>>13,Z=0|a[4],$=8191&Z,tt=Z>>>13,te=0|a[5],tr=8191&te,ti=te>>>13,tn=0|a[6],ts=8191&tn,to=tn>>>13,ta=0|a[7],tf=8191&ta,th=ta>>>13,tu=0|a[8],tl=8191&tu,tc=tu>>>13,td=0|a[9],tp=8191&td,tg=td>>>13;r.negative=t.negative^e.negative,r.length=19,i=Math.imul(l,L),n=(n=Math.imul(l,H))+Math.imul(c,L)|0,s=Math.imul(c,H);var tm=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tm>>>26)|0,tm&=0x3ffffff,i=Math.imul(p,L),n=(n=Math.imul(p,H))+Math.imul(g,L)|0,s=Math.imul(g,H),i=i+Math.imul(l,j)|0,n=(n=n+Math.imul(l,K)|0)+Math.imul(c,j)|0,s=s+Math.imul(c,K)|0;var tv=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tv>>>26)|0,tv&=0x3ffffff,i=Math.imul(v,L),n=(n=Math.imul(v,H))+Math.imul(y,L)|0,s=Math.imul(y,H),i=i+Math.imul(p,j)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(g,j)|0,s=s+Math.imul(g,K)|0,i=i+Math.imul(l,G)|0,n=(n=n+Math.imul(l,Y)|0)+Math.imul(c,G)|0,s=s+Math.imul(c,Y)|0;var ty=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(ty>>>26)|0,ty&=0x3ffffff,i=Math.imul(A,L),n=(n=Math.imul(A,H))+Math.imul(w,L)|0,s=Math.imul(w,H),i=i+Math.imul(v,j)|0,n=(n=n+Math.imul(v,K)|0)+Math.imul(y,j)|0,s=s+Math.imul(y,K)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,G)|0,s=s+Math.imul(g,Y)|0,i=i+Math.imul(l,W)|0,n=(n=n+Math.imul(l,X)|0)+Math.imul(c,W)|0,s=s+Math.imul(c,X)|0;var tb=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tb>>>26)|0,tb&=0x3ffffff,i=Math.imul(M,L),n=(n=Math.imul(M,H))+Math.imul(E,L)|0,s=Math.imul(E,H),i=i+Math.imul(A,j)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(w,j)|0,s=s+Math.imul(w,K)|0,i=i+Math.imul(v,G)|0,n=(n=n+Math.imul(v,Y)|0)+Math.imul(y,G)|0,s=s+Math.imul(y,Y)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,X)|0,i=i+Math.imul(l,$)|0,n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,$)|0,s=s+Math.imul(c,tt)|0;var tA=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tA>>>26)|0,tA&=0x3ffffff,i=Math.imul(S,L),n=(n=Math.imul(S,H))+Math.imul(_,L)|0,s=Math.imul(_,H),i=i+Math.imul(M,j)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(E,j)|0,s=s+Math.imul(E,K)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(w,G)|0,s=s+Math.imul(w,Y)|0,i=i+Math.imul(v,W)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(y,W)|0,s=s+Math.imul(y,X)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,$)|0,s=s+Math.imul(g,tt)|0,i=i+Math.imul(l,tr)|0,n=(n=n+Math.imul(l,ti)|0)+Math.imul(c,tr)|0,s=s+Math.imul(c,ti)|0;var tw=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tw>>>26)|0,tw&=0x3ffffff,i=Math.imul(C,L),n=(n=Math.imul(C,H))+Math.imul(B,L)|0,s=Math.imul(B,H),i=i+Math.imul(S,j)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(_,j)|0,s=s+Math.imul(_,K)|0,i=i+Math.imul(M,G)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(E,G)|0,s=s+Math.imul(E,Y)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(w,W)|0,s=s+Math.imul(w,X)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(y,$)|0,s=s+Math.imul(y,tt)|0,i=i+Math.imul(p,tr)|0,n=(n=n+Math.imul(p,ti)|0)+Math.imul(g,tr)|0,s=s+Math.imul(g,ti)|0,i=i+Math.imul(l,ts)|0,n=(n=n+Math.imul(l,to)|0)+Math.imul(c,ts)|0,s=s+Math.imul(c,to)|0;var tx=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tx>>>26)|0,tx&=0x3ffffff,i=Math.imul(P,L),n=(n=Math.imul(P,H))+Math.imul(O,L)|0,s=Math.imul(O,H),i=i+Math.imul(C,j)|0,n=(n=n+Math.imul(C,K)|0)+Math.imul(B,j)|0,s=s+Math.imul(B,K)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,Y)|0,i=i+Math.imul(M,W)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(E,W)|0,s=s+Math.imul(E,X)|0,i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(w,$)|0,s=s+Math.imul(w,tt)|0,i=i+Math.imul(v,tr)|0,n=(n=n+Math.imul(v,ti)|0)+Math.imul(y,tr)|0,s=s+Math.imul(y,ti)|0,i=i+Math.imul(p,ts)|0,n=(n=n+Math.imul(p,to)|0)+Math.imul(g,ts)|0,s=s+Math.imul(g,to)|0,i=i+Math.imul(l,tf)|0,n=(n=n+Math.imul(l,th)|0)+Math.imul(c,tf)|0,s=s+Math.imul(c,th)|0;var tM=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tM>>>26)|0,tM&=0x3ffffff,i=Math.imul(D,L),n=(n=Math.imul(D,H))+Math.imul(U,L)|0,s=Math.imul(U,H),i=i+Math.imul(P,j)|0,n=(n=n+Math.imul(P,K)|0)+Math.imul(O,j)|0,s=s+Math.imul(O,K)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(B,G)|0,s=s+Math.imul(B,Y)|0,i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(M,$)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(E,$)|0,s=s+Math.imul(E,tt)|0,i=i+Math.imul(A,tr)|0,n=(n=n+Math.imul(A,ti)|0)+Math.imul(w,tr)|0,s=s+Math.imul(w,ti)|0,i=i+Math.imul(v,ts)|0,n=(n=n+Math.imul(v,to)|0)+Math.imul(y,ts)|0,s=s+Math.imul(y,to)|0,i=i+Math.imul(p,tf)|0,n=(n=n+Math.imul(p,th)|0)+Math.imul(g,tf)|0,s=s+Math.imul(g,th)|0,i=i+Math.imul(l,tl)|0,n=(n=n+Math.imul(l,tc)|0)+Math.imul(c,tl)|0,s=s+Math.imul(c,tc)|0;var tE=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tE>>>26)|0,tE&=0x3ffffff,i=Math.imul(q,L),n=(n=Math.imul(q,H))+Math.imul(F,L)|0,s=Math.imul(F,H),i=i+Math.imul(D,j)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(U,j)|0,s=s+Math.imul(U,K)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(O,G)|0,s=s+Math.imul(O,Y)|0,i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(B,W)|0,s=s+Math.imul(B,X)|0,i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(_,$)|0,s=s+Math.imul(_,tt)|0,i=i+Math.imul(M,tr)|0,n=(n=n+Math.imul(M,ti)|0)+Math.imul(E,tr)|0,s=s+Math.imul(E,ti)|0,i=i+Math.imul(A,ts)|0,n=(n=n+Math.imul(A,to)|0)+Math.imul(w,ts)|0,s=s+Math.imul(w,to)|0,i=i+Math.imul(v,tf)|0,n=(n=n+Math.imul(v,th)|0)+Math.imul(y,tf)|0,s=s+Math.imul(y,th)|0,i=i+Math.imul(p,tl)|0,n=(n=n+Math.imul(p,tc)|0)+Math.imul(g,tl)|0,s=s+Math.imul(g,tc)|0,i=i+Math.imul(l,tp)|0,n=(n=n+Math.imul(l,tg)|0)+Math.imul(c,tp)|0,s=s+Math.imul(c,tg)|0;var tI=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tI>>>26)|0,tI&=0x3ffffff,i=Math.imul(q,j),n=(n=Math.imul(q,K))+Math.imul(F,j)|0,s=Math.imul(F,K),i=i+Math.imul(D,G)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(U,G)|0,s=s+Math.imul(U,Y)|0,i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,W)|0,s=s+Math.imul(O,X)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(B,$)|0,s=s+Math.imul(B,tt)|0,i=i+Math.imul(S,tr)|0,n=(n=n+Math.imul(S,ti)|0)+Math.imul(_,tr)|0,s=s+Math.imul(_,ti)|0,i=i+Math.imul(M,ts)|0,n=(n=n+Math.imul(M,to)|0)+Math.imul(E,ts)|0,s=s+Math.imul(E,to)|0,i=i+Math.imul(A,tf)|0,n=(n=n+Math.imul(A,th)|0)+Math.imul(w,tf)|0,s=s+Math.imul(w,th)|0,i=i+Math.imul(v,tl)|0,n=(n=n+Math.imul(v,tc)|0)+Math.imul(y,tl)|0,s=s+Math.imul(y,tc)|0,i=i+Math.imul(p,tp)|0,n=(n=n+Math.imul(p,tg)|0)+Math.imul(g,tp)|0,s=s+Math.imul(g,tg)|0;var tS=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tS>>>26)|0,tS&=0x3ffffff,i=Math.imul(q,G),n=(n=Math.imul(q,Y))+Math.imul(F,G)|0,s=Math.imul(F,Y),i=i+Math.imul(D,W)|0,n=(n=n+Math.imul(D,X)|0)+Math.imul(U,W)|0,s=s+Math.imul(U,X)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(O,$)|0,s=s+Math.imul(O,tt)|0,i=i+Math.imul(C,tr)|0,n=(n=n+Math.imul(C,ti)|0)+Math.imul(B,tr)|0,s=s+Math.imul(B,ti)|0,i=i+Math.imul(S,ts)|0,n=(n=n+Math.imul(S,to)|0)+Math.imul(_,ts)|0,s=s+Math.imul(_,to)|0,i=i+Math.imul(M,tf)|0,n=(n=n+Math.imul(M,th)|0)+Math.imul(E,tf)|0,s=s+Math.imul(E,th)|0,i=i+Math.imul(A,tl)|0,n=(n=n+Math.imul(A,tc)|0)+Math.imul(w,tl)|0,s=s+Math.imul(w,tc)|0,i=i+Math.imul(v,tp)|0,n=(n=n+Math.imul(v,tg)|0)+Math.imul(y,tp)|0,s=s+Math.imul(y,tg)|0;var t_=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(t_>>>26)|0,t_&=0x3ffffff,i=Math.imul(q,W),n=(n=Math.imul(q,X))+Math.imul(F,W)|0,s=Math.imul(F,X),i=i+Math.imul(D,$)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(U,$)|0,s=s+Math.imul(U,tt)|0,i=i+Math.imul(P,tr)|0,n=(n=n+Math.imul(P,ti)|0)+Math.imul(O,tr)|0,s=s+Math.imul(O,ti)|0,i=i+Math.imul(C,ts)|0,n=(n=n+Math.imul(C,to)|0)+Math.imul(B,ts)|0,s=s+Math.imul(B,to)|0,i=i+Math.imul(S,tf)|0,n=(n=n+Math.imul(S,th)|0)+Math.imul(_,tf)|0,s=s+Math.imul(_,th)|0,i=i+Math.imul(M,tl)|0,n=(n=n+Math.imul(M,tc)|0)+Math.imul(E,tl)|0,s=s+Math.imul(E,tc)|0,i=i+Math.imul(A,tp)|0,n=(n=n+Math.imul(A,tg)|0)+Math.imul(w,tp)|0,s=s+Math.imul(w,tg)|0;var tN=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tN>>>26)|0,tN&=0x3ffffff,i=Math.imul(q,$),n=(n=Math.imul(q,tt))+Math.imul(F,$)|0,s=Math.imul(F,tt),i=i+Math.imul(D,tr)|0,n=(n=n+Math.imul(D,ti)|0)+Math.imul(U,tr)|0,s=s+Math.imul(U,ti)|0,i=i+Math.imul(P,ts)|0,n=(n=n+Math.imul(P,to)|0)+Math.imul(O,ts)|0,s=s+Math.imul(O,to)|0,i=i+Math.imul(C,tf)|0,n=(n=n+Math.imul(C,th)|0)+Math.imul(B,tf)|0,s=s+Math.imul(B,th)|0,i=i+Math.imul(S,tl)|0,n=(n=n+Math.imul(S,tc)|0)+Math.imul(_,tl)|0,s=s+Math.imul(_,tc)|0,i=i+Math.imul(M,tp)|0,n=(n=n+Math.imul(M,tg)|0)+Math.imul(E,tp)|0,s=s+Math.imul(E,tg)|0;var tC=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tC>>>26)|0,tC&=0x3ffffff,i=Math.imul(q,tr),n=(n=Math.imul(q,ti))+Math.imul(F,tr)|0,s=Math.imul(F,ti),i=i+Math.imul(D,ts)|0,n=(n=n+Math.imul(D,to)|0)+Math.imul(U,ts)|0,s=s+Math.imul(U,to)|0,i=i+Math.imul(P,tf)|0,n=(n=n+Math.imul(P,th)|0)+Math.imul(O,tf)|0,s=s+Math.imul(O,th)|0,i=i+Math.imul(C,tl)|0,n=(n=n+Math.imul(C,tc)|0)+Math.imul(B,tl)|0,s=s+Math.imul(B,tc)|0,i=i+Math.imul(S,tp)|0,n=(n=n+Math.imul(S,tg)|0)+Math.imul(_,tp)|0,s=s+Math.imul(_,tg)|0;var tB=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tB>>>26)|0,tB&=0x3ffffff,i=Math.imul(q,ts),n=(n=Math.imul(q,to))+Math.imul(F,ts)|0,s=Math.imul(F,to),i=i+Math.imul(D,tf)|0,n=(n=n+Math.imul(D,th)|0)+Math.imul(U,tf)|0,s=s+Math.imul(U,th)|0,i=i+Math.imul(P,tl)|0,n=(n=n+Math.imul(P,tc)|0)+Math.imul(O,tl)|0,s=s+Math.imul(O,tc)|0,i=i+Math.imul(C,tp)|0,n=(n=n+Math.imul(C,tg)|0)+Math.imul(B,tp)|0,s=s+Math.imul(B,tg)|0;var tR=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tR>>>26)|0,tR&=0x3ffffff,i=Math.imul(q,tf),n=(n=Math.imul(q,th))+Math.imul(F,tf)|0,s=Math.imul(F,th),i=i+Math.imul(D,tl)|0,n=(n=n+Math.imul(D,tc)|0)+Math.imul(U,tl)|0,s=s+Math.imul(U,tc)|0,i=i+Math.imul(P,tp)|0,n=(n=n+Math.imul(P,tg)|0)+Math.imul(O,tp)|0,s=s+Math.imul(O,tg)|0;var tP=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tP>>>26)|0,tP&=0x3ffffff,i=Math.imul(q,tl),n=(n=Math.imul(q,tc))+Math.imul(F,tl)|0,s=Math.imul(F,tc),i=i+Math.imul(D,tp)|0,n=(n=n+Math.imul(D,tg)|0)+Math.imul(U,tp)|0,s=s+Math.imul(U,tg)|0;var tO=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tO>>>26)|0,tO&=0x3ffffff,i=Math.imul(q,tp),n=(n=Math.imul(q,tg))+Math.imul(F,tp)|0,s=Math.imul(F,tg);var tT=(h+i|0)+((8191&n)<<13)|0;return h=(s+(n>>>13)|0)+(tT>>>26)|0,tT&=0x3ffffff,f[0]=tm,f[1]=tv,f[2]=ty,f[3]=tb,f[4]=tA,f[5]=tw,f[6]=tx,f[7]=tM,f[8]=tE,f[9]=tI,f[10]=tS,f[11]=t_,f[12]=tN,f[13]=tC,f[14]=tB,f[15]=tR,f[16]=tP,f[17]=tO,f[18]=tT,0!==h&&(f[19]=h,r.length++),r};function m(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=0x3ffffff}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function v(t,e,r){return m(t,e,r)}Math.imul||(g=p),n.prototype.mulTo=function(t,e){var r,i,n=this.length+t.length;return 10===this.length&&10===t.length?i=g(this,t,e):n<63?i=p(this,t,e):n<1024?i=m(this,t,e):(r=this,i=m(r,t,e)),i},n.prototype.mul=function(t){var e=new n(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e,r=new n(null);return r.words=Array(this.length+t.length),e=this,m(e,t,r)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<0x4000000);for(var i=0,n=0;n>=26,i+=(s/0x4000000|0)+(o>>>26),this.words[n]=0x3ffffff&o}return 0!==i&&(this.words[n]=i,this.length++),e?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i=0);var e,i=t%26,n=(t-i)/26,s=0x3ffffff>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var n,s=t%26,o=Math.min((t-s)/26,this.length),a=0x3ffffff^0x3ffffff>>>s<o)for(this.length-=o,f=0;f=0&&(0!==h||f>=n);f--){var u=0|this.words[f];this.words[f]=h<<26-s|u>>>s,h=u&a}return i&&0!==h&&(i.words[i.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;return!(this.length<=i)&&!!(this.words[i]&1<=0);var e=t%26,i=(t-e)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==e&&i++,this.length=Math.min(i,this.length),0!==e&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>e<=0x4000000;e++)this.words[e]-=0x4000000,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<0x4000000),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(f/0x4000000|0),this.words[n+i]=0x3ffffff&o}for(;n>26,this.words[n+i]=0x3ffffff&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n>26,this.words[n]=0x3ffffff&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(t,e){var r=this.length-t.length,i=this.clone(),s=t,o=0|s.words[s.length-1];0!=(r=26-this._countBits(o))&&(s=s.ushln(r),i.iushln(r),o=0|s.words[s.length-1]);var a,f=i.length-s.length;if("mod"!==e){(a=new n(null)).length=f+1,a.words=Array(a.length);for(var h=0;h=0;l--){var c=(0|i.words[s.length+l])*0x4000000+(0|i.words[s.length+l-1]);for(c=Math.min(c/o|0,0x3ffffff),i._ishlnsubmul(s,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(s,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(t,e,i){var s,o,a;return(r(!t.isZero()),this.isZero())?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(s=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:s,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(s=a.div.neg()),{div:s,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||0>this.cmp(t)?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this._wordDiv(t,e)},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var i=0x4000000%t,n=0,s=this.length-1;s>=0;s--)n=(i*n+(0|this.words[s]))%t;return e?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var i=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+0x4000000*i;this.words[n]=s/t|0,i=s%t}return this._strip(),e?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var s=new n(1),o=new n(0),a=new n(0),f=new n(1),h=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;!(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(s.isOdd()||o.isOdd())&&(s.iadd(u),o.isub(l)),s.iushrn(1),o.iushrn(1);for(var p=0,g=1;!(i.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(u),f.isub(l)),a.iushrn(1),f.iushrn(1);e.cmp(i)>=0?(e.isub(i),s.isub(a),o.isub(f)):(i.isub(e),a.isub(s),f.isub(o))}return{a:a,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e,i=this,s=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var o=new n(1),a=new n(0),f=s.clone();i.cmpn(1)>0&&s.cmpn(1)>0;){for(var h=0,u=1;!(i.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(i.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);for(var l=0,c=1;!(s.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(s.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);i.cmp(s)>=0?(i.isub(s),o.isub(a)):(s.isub(i),a.isub(o))}return 0>(e=0===i.cmpn(1)?o:a).cmpn(0)&&e.iadd(t),e},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return(1&this.words[0])==0},n.prototype.isOdd=function(){return(1&this.words[0])==1},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,a&=0x3ffffff,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=0x3ffffff,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return -1===this.cmpn(t)},n.prototype.lt=function(t){return -1===this.cmp(t)},n.prototype.lten=function(t){return 0>=this.cmpn(t)},n.prototype.lte=function(t){return 0>=this.cmp(t)},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new E(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function I(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new n(null);return t.words=Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(A,b),A.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=s}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){var e;if(y[t])return y[t];if("k256"===t)e=new A;else if("p224"===t)e=new w;else if("p192"===t)e=new x;else if("p25519"===t)e=new M;else throw Error("Unknown prime "+t);return y[t]=e,e},E.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){r((t.negative|e.negative)==0,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(f(t,t.umod(this.m)._forceRed(this)),t)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var s=this.m.subn(1),o=0;!s.isZero()&&0===s.andln(1);)o++,s.iushrn(1);r(!s.isZero());var a=new n(1).toRed(this),f=a.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var l=this.pow(u,s),c=this.pow(t,s.addn(1).iushrn(1)),d=this.pow(t,s),p=o;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();r(m=0;i--){for(var h=e.words[i],u=f-1;u>=0;u--){var l=h>>u&1;if(s!==r[0]&&(s=this.sqr(s)),0===l&&0===o){a=0;continue}o<<=1,o|=l,4!=++a&&(0!==i||0!==u)||(s=this.mul(s,r[o]),a=0,o=0)}f=26}return s},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new I(t)},i(I,E),I.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},I.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},I.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},I.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=r.isub(i).iushrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):0>s.cmpn(0)&&(o=s.iadd(this.m)),o._forceRed(this)},I.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(f7,fF);var he=f7.exports;let hr="bignumber/5.7.0";var hi=he.BN;let hn=new fV(hr),hs={},ho=!1;class ha{constructor(t,e){t!==hs&&hn.throwError("cannot call constructor directly; use BigNumber.from",fV.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return hh(hu(this).fromTwos(t))}toTwos(t){return hh(hu(this).toTwos(t))}abs(){return"-"===this._hex[0]?ha.from(this._hex.substring(1)):this}add(t){return hh(hu(this).add(hu(t)))}sub(t){return hh(hu(this).sub(hu(t)))}div(t){return ha.from(t).isZero()&&hl("division-by-zero","div"),hh(hu(this).div(hu(t)))}mul(t){return hh(hu(this).mul(hu(t)))}mod(t){let e=hu(t);return e.isNeg()&&hl("division-by-zero","mod"),hh(hu(this).umod(e))}pow(t){let e=hu(t);return e.isNeg()&&hl("negative-power","pow"),hh(hu(this).pow(e))}and(t){let e=hu(t);return(this.isNegative()||e.isNeg())&&hl("unbound-bitwise-result","and"),hh(hu(this).and(e))}or(t){let e=hu(t);return(this.isNegative()||e.isNeg())&&hl("unbound-bitwise-result","or"),hh(hu(this).or(e))}xor(t){let e=hu(t);return(this.isNegative()||e.isNeg())&&hl("unbound-bitwise-result","xor"),hh(hu(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&hl("negative-width","mask"),hh(hu(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&hl("negative-width","shl"),hh(hu(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&hl("negative-width","shr"),hh(hu(this).shrn(t))}eq(t){return hu(this).eq(hu(t))}lt(t){return hu(this).lt(hu(t))}lte(t){return hu(this).lte(hu(t))}gt(t){return hu(this).gt(hu(t))}gte(t){return hu(this).gte(hu(t))}isNegative(){return"-"===this._hex[0]}isZero(){return hu(this).isZero()}toNumber(){try{return hu(this).toNumber()}catch{hl("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return hn.throwError("this platform does not support BigInt",fV.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?ho||(ho=!0,hn.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?hn.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",fV.errors.UNEXPECTED_ARGUMENT,{}):hn.throwError("BigNumber.toString does not accept parameters",fV.errors.UNEXPECTED_ARGUMENT,{})),hu(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof ha)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new ha(hs,hf(t)):t.match(/^-?[0-9]+$/)?new ha(hs,hf(new hi(t))):hn.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&hl("underflow","BigNumber.from",t),(t>=0x1fffffffffffff||t<=-0x1fffffffffffff)&&hl("overflow","BigNumber.from",t),ha.from(String(t));if("bigint"==typeof t)return ha.from(t.toString());if(f0(t))return ha.from(f6(t));if(t){if(t.toHexString){let e=t.toHexString();if("string"==typeof e)return ha.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(f2(e)||"-"===e[0]&&f2(e.substring(1))))return ha.from(e)}}return hn.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function hf(t){if("string"!=typeof t)return hf(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&hn.throwArgumentError("invalid hex","value",t),"0x00"===(t=hf(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function hh(t){return ha.from(hf(t))}function hu(t){let e=ha.from(t).toHexString();return"-"===e[0]?new hi("-"+e.substring(3),16):new hi(e.substring(2),16)}function hl(t,e,r){let i={fault:t,operation:e};return null!=r&&(i.value=r),hn.throwError(t,fV.errors.NUMERIC_FAULT,i)}let hc=new fV(hr),hd={},hp=ha.from(0),hg=ha.from(-1);function hm(t,e,r,i){let n={fault:e,operation:r};return void 0!==i&&(n.value=i),hc.throwError(t,fV.errors.NUMERIC_FAULT,n)}let hv="0";for(;hv.length<256;)hv+=hv;function hy(t){if("number"!=typeof t)try{t=ha.from(t).toNumber()}catch{}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+hv.substring(0,t):hc.throwArgumentError("invalid decimal size","decimals",t)}function hb(t,e){null==e&&(e=0);let r=hy(e),i=(t=ha.from(t)).lt(hp);i&&(t=t.mul(hg));let n=t.mod(r).toString();for(;n.length2&&hc.throwArgumentError("too many decimal points","value",t);let s=n[0],o=n[1];for(s||(s="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>r.length-1&&hm("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.lengthnull==t[e]?i:(typeof t[e]!==r&&hc.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=n("signed","boolean",e),r=n("width","number",r),i=n("decimals","number",i)}return r%8&&hc.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&hc.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new hw(hd,e,r,i)}}class hx{constructor(t,e,r,i){t!==hd&&hc.throwError("cannot use FixedNumber constructor; use FixedNumber.from",fV.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&hc.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);let e=hA(this._value,this.format.decimals),r=hA(t._value,t.format.decimals);return hx.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);let e=hA(this._value,this.format.decimals),r=hA(t._value,t.format.decimals);return hx.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);let e=hA(this._value,this.format.decimals),r=hA(t._value,t.format.decimals);return hx.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);let e=hA(this._value,this.format.decimals),r=hA(t._value,t.format.decimals);return hx.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=hx.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(hM.toFormat(e.format))),e}ceiling(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=hx.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(hM.toFormat(e.format))),e}round(t){null==t&&(t=0);let e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&hc.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;let r=hx.from("1"+hv.substring(0,t),this.format),i=hE.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){return null==t?this._hex:(t%8&&hc.throwArgumentError("invalid byte width","width",t),f5(ha.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return hx.fromString(this._value,t)}static fromValue(t,e,r){var i;return null!=r||null==e||null!=(i=e)&&(ha.isBigNumber(i)||"number"==typeof i&&i%1==0||"string"==typeof i&&i.match(/^-?[0-9]+$/)||f2(i)||"bigint"==typeof i||f0(i))||(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),hx.fromString(hb(t,e),hw.from(r))}static fromString(t,e){null==e&&(e="fixed");let r=hw.from(e),i=hA(t,r.decimals);!r.signed&&i.lt(hp)&&hm("unsigned value cannot be negative","overflow","value",t);let n=null;return n=r.signed?i.toTwos(r.width).toHexString():f5(n=i.toHexString(),r.width/8),new hx(hd,n,hb(i,r.decimals),r)}static fromBytes(t,e){null==e&&(e="fixed");let r=hw.from(e);if(f1(t).length>r.width/8)throw Error("overflow");let i=ha.from(t);r.signed&&(i=i.fromTwos(r.width));let n=i.toTwos((r.signed?0:1)+r.width).toHexString();return new hx(hd,n,hb(i,r.decimals),r)}static from(t,e){if("string"==typeof t)return hx.fromString(t,e);if(f0(t))return hx.fromBytes(t,e);try{return hx.fromValue(t,0,e)}catch(t){if(t.code!==fV.errors.INVALID_ARGUMENT)throw t}return hc.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!!(t&&t._isFixedNumber)}}let hM=hx.from(1),hE=hx.from("0.5"),hI=new fV("strings/5.7.0");(N=te||(te={})).current="",N.NFC="NFC",N.NFD="NFD",N.NFKC="NFKC",N.NFKD="NFKD",(C=tr||(tr={})).UNEXPECTED_CONTINUE="unexpected continuation byte",C.BAD_PREFIX="bad codepoint prefix",C.OVERRUN="string overrun",C.MISSING_CONTINUE="missing continuation byte",C.OUT_OF_RANGE="out of UTF-8 range",C.UTF16_SURROGATE="UTF-16 surrogate",C.OVERLONG="overlong representation";function hS(t,e,r,i,n){if(t===tr.BAD_PREFIX||t===tr.UNEXPECTED_CONTINUE){let t=0;for(let i=e+1;i>6==2;i++)t++;return t}return t===tr.OVERRUN?r.length-e-1:0}function h_(t,e=te.current){e!=te.current&&(hI.checkNormalize(),t=t.normalize(e));let r=[];for(let e=0;e>6|192),r.push(63&i|128);else if((64512&i)==55296){e++;let n=t.charCodeAt(e);if(e>=t.length||(64512&n)!=56320)throw Error("invalid utf-8 string");let s=65536+((1023&i)<<10)+(1023&n);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return f1(r)}Object.freeze({error:function(t,e,r,i,n){return hI.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:hS,replace:function(t,e,r,i,n){return t===tr.OVERLONG?(i.push(n),0):(i.push(65533),hS(t,e,r))}});function hN(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,i={};return t.split(",").forEach(t=>{let n=t.split(":");i[r+=parseInt(n[0],16)]=e(n[1])}),i}function hC(t){let e=0;return t.split(",").map(t=>{let r=t.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:e+parseInt(r[0],16),h:e=parseInt(r[1],16)}})}hC("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),hN("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),hN("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),hN("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",function(t){if(t.length%4!=0)throw Error("bad data");let e=[];for(let r=0;r0&&Array.isArray(t)?n(t,e-1):r.push(t)})};return n(t,e),r}function hP(t,e){let r=Array(t);for(let i=0,n=-1;ie[t]):r}function hT(t,e,r){let i=Array(t).fill(void 0).map(()=>[]);for(let n=0;n>1:i>>1}return r})(t,r).forEach((t,e)=>i[e].push(t));return i}let hD=function(){var t;let e;return t=function(t){let e=0;function r(){return t[e++]<<8|t[e++]}let i=r(),n=1,s=[0,1];for(let t=1;t>--f&1}let l=0x40000000,c=0x20000000,d=0x7fffffff,p=0;for(let t=0;t<31;t++)p=p<<1|u();let g=[],m=0,v=0x80000000;for(;;){let t=Math.floor(((p-m+1)*n-1)/v),e=0,r=i;for(;r-e>1;){let i=e+r>>>1;t>>1|u(),o=o<<1^l,a=(a^l)<<1|l|1;m=o,v=1+a-o}let y=i-4;return g.map(e=>{switch(e-y){case 3:return y+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return y+256+(t[a++]<<8|t[a++]);case 1:return y+t[a++];default:return e-1}})}(function(t){t=atob(t);let e=[];for(let r=0;rt[e++]}();hO(hD),hO(hD),function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(function(t,e){let r=1+e(),i=e(),n=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(r)}return e}(e);return hR(hT(n.length,1+t,e).map((t,e)=>{let s=t[0],o=t.slice(1);return Array(n[e]).fill(void 0).map((t,e)=>{let n=e*i;return[s+e*r,o.map(t=>t+n)]})}))}(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(function(t,e){return hT(1+e(),1+t,e).map(t=>[t[0],t.slice(1)])}(r,t))}(function(t){let e={};for(let r=0;rt-e),function t(){let e=[];for(;;){let r=hO(B,s);if(0==r.length)break;e.push({set:new Set(r),node:t()})}e.sort((t,e)=>e.set.size-t.set.size);let r=B();return{branches:e,valid:r%3,fe0f:!!(1&(r=r/3|0)),save:1==(r>>=1),check:2==r}}(),new fV(hB),new Uint8Array(32).fill(0);let hU=`Ethereum Signed Message: +`;function hk(t){return"string"==typeof t&&(t=h_(t)),f9(function(t){let e=t.map(t=>f1(t)),r=new Uint8Array(e.reduce((t,e)=>t+e.length,0));return e.reduce((t,e)=>(r.set(e,t),t+e.length),0),fZ(r)}([h_(hU),h_(String(t.length)),t]))}new fV("rlp/5.7.0");let hq=new fV("address/5.7.0");function hF(t){f2(t,20)||hq.throwArgumentError("invalid address","address",t);let e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let t=0;t<40;t++)r[t]=e[t].charCodeAt(0);let i=f1(f9(r));for(let t=0;t<40;t+=2)i[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&i[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}let hz={};for(let t=0;t<10;t++)hz[String(t)]=String(t);for(let t=0;t<26;t++)hz[String.fromCharCode(65+t)]=String(10+t);let hL=Math.floor((R=0x1fffffffffffff,Math.log10?Math.log10(0x1fffffffffffff):Math.log(R)/Math.LN10));function hH(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}new fV("properties/5.7.0"),new fV(hB),new Uint8Array(32).fill(0),ha.from(-1);let hQ=ha.from(0),hj=ha.from(1);ha.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),f5(hj.toHexString(),32),f5(hQ.toHexString(),32);var hK={},hJ={};function hG(t,e){if(!t)throw Error(e||"Assertion failed")}hG.equal=function(t,e,r){if(t!=e)throw Error(r||"Assertion failed: "+t+" != "+e)};var hY={exports:{}};"function"==typeof Object.create?hY.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:hY.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var hV=hY.exports;hJ.inherits=hV;hJ.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t){if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(t="0"+t),n=0;n>6|192:((s=t,o=n,(64512&s.charCodeAt(o))!=55296||o<0||o+1>=s.length||(64512&s.charCodeAt(o+1))!=56320)?r[i++]=a>>12|224:(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++n)),r[i++]=a>>18|240,r[i++]=a>>12&63|128),r[i++]=a>>6&63|128),r[i++]=63&a|128)}}else for(n=0;n>>24|t>>>8&65280|t<<8&0xff0000|(255&t)<<24)>>>0}hJ.toHex=function(t){for(var e="",r=0;r>>0;return o};hJ.split32=function(t,e){for(var r=Array(4*t.length),i=0,n=0;i>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r};hJ.rotr32=function(t,e){return t>>>e|t<<32-e};hJ.rotl32=function(t,e){return t<>>32-e};hJ.sum32=function(t,e){return t+e>>>0};hJ.sum32_3=function(t,e,r){return t+e+r>>>0};hJ.sum32_4=function(t,e,r,i){return t+e+r+i>>>0};hJ.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0};hJ.sum64=function(t,e,r,i){var n=t[e],s=i+t[e+1]>>>0;t[e]=(s>>0,t[e+1]=s};hJ.sum64_hi=function(t,e,r,i){return(e+i>>>0>>0};hJ.sum64_lo=function(t,e,r,i){return e+i>>>0};hJ.sum64_4_hi=function(t,e,r,i,n,s,o,a){var f,h=e;return f=0+((h=h+i>>>0)>>0)>>0)>>0};hJ.sum64_4_lo=function(t,e,r,i,n,s,o,a){return e+i+s+a>>>0};hJ.sum64_5_hi=function(t,e,r,i,n,s,o,a,f,h){var u,l=e;return u=0+((l=l+i>>>0)>>0)>>0)>>0)>>0};hJ.sum64_5_lo=function(t,e,r,i,n,s,o,a,f,h){return e+i+s+a+h>>>0};hJ.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0};hJ.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};hJ.shr64_hi=function(t,e,r){return t>>>r};hJ.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};var h$={};function h0(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}h$.BlockHash=h0,h0.prototype.update=function(t,e){if(t=hJ.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=hJ.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s>>3};h2.g1_256=function(t){return h3(t,17)^h3(t,19)^t>>>10};var h4=hJ.rotl32,h9=hJ.sum32,h7=hJ.sum32_5,ut=h2.ft_1,ue=h$.BlockHash,ur=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6];function ui(){if(!(this instanceof ui))return new ui;ue.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.W=Array(80)}hJ.inherits(ui,ue);ui.blockSize=512,ui.outSize=160,ui.hmacStrength=80,ui.padLength=64,ui.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;ithis.blockSize&&(t=new this.Hash().update(t).digest()),hG(t.length<=this.blockSize);for(var e=t.length;e>8,o=255&n;s?r.push(s,o):r.push(o)}return r},e.zero2=r,e.toHex=i,e.encode=function(t,e){return"hex"===e?i(t):t}}),uV=uK(function(t,e){e.assert=uJ,e.toArray=uY.toArray,e.zero2=uY.zero2,e.toHex=uY.toHex,e.encode=uY.encode;e.getNAF=function(t,e,r){var i=Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-f:f,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i};e.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,s=0;t.cmpn(-n)>0||e.cmpn(-s)>0;){var o,a,f=t.andln(3)+n&3,h=e.andln(3)+s&3;3===f&&(f=-1),3===h&&(h=-1),o=1&f?(3==(i=t.andln(7)+n&7)||5===i)&&2===h?-f:f:0,r[0].push(o),a=1&h?(3==(i=e.andln(7)+s&7)||5===i)&&2===f?-h:h:0,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r};e.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}};e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t};e.intFromLE=function(t){return new he(t,"hex","le")}}),uW=uV.getNAF,uX=uV.getJSF,uZ=uV.assert;function u$(t,e){this.type=t,this.p=new he(e.p,16),this.red=e.prime?he.red(e.prime):he.mont(this.p),this.zero=new he(0).toRed(this.red),this.one=new he(1).toRed(this.red),this.two=new he(2).toRed(this.red),this.n=e.n&&new he(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u0(t,e){this.curve=t,this.type=e,this.precomputed=null}u$.prototype.point=function(){throw Error("Not implemented")},u$.prototype.validate=function(){throw Error("Not implemented")},u$.prototype._fixedNafMul=function(t,e){uZ(t.precomputed);var r=t._getDoubles(),i=uW(e,1,this._bitLength),n=(1<=s;f--)o=(o<<1)+i[f];a.push(o)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=n;l>0;l--){for(s=0;s=0;a--){for(var f=0;a>=0&&0===s[a];a--)f++;if(a>=0&&f++,o=o.dblp(f),a<0)break;var h=s[a];uZ(0!==h),o="affine"===t.type?h>0?o.mixedAdd(n[h-1>>1]):o.mixedAdd(n[-h-1>>1].neg()):h>0?o.add(n[h-1>>1]):o.add(n[-h-1>>1].neg())}return"affine"===t.type?o.toP():o},u$.prototype._wnafMulAdd=function(t,e,r,i,n){var s,o,a,f=this._wnafT1,h=this._wnafT2,u=this._wnafT3,l=0;for(s=0;s=1;s-=2){var d=s-1,p=s;if(1!==f[d]||1!==f[p]){u[d]=uW(r[d],f[d],this._bitLength),u[p]=uW(r[p],f[p],this._bitLength),l=Math.max(u[d].length,l),l=Math.max(u[p].length,l);continue}var g=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(g[1]=e[d].add(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].add(e[p].neg())):(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=uX(r[d],r[p]);for(l=Math.max(v[0].length,l),u[d]=Array(l),u[p]=Array(l),o=0;o=0;s--){for(var x=0;s>=0;){var M=!0;for(o=0;o=0&&x++,A=A.dblp(x),s<0)break;for(o=0;o0?a=h[o][E-1>>1]:E<0&&(a=h[o][-E-1>>1].neg()),A="affine"===a.type?A.mixedAdd(a):A.add(a))}}for(s=0;s=Math.ceil((t.bitLength()+1)/e.step)},u0.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;nn[0].cmp(n[1])?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new he(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))?r=s[0]:(r=s[1],u2(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return i=t.basis?t.basis.map(function(t){return{a:new he(t.a,16),b:new he(t.b,16)}}):this._getEndoBasis(r),{beta:e,lambda:r,basis:i}}},u3.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:he.mont(t),r=new he(2).toRed(e).redInvm(),i=r.redNeg(),n=new he(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},u3.prototype._getEndoBasis=function(t){for(var e,r,i,n,s,o,a,f,h,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,c=this.n.clone(),d=new he(1),p=new he(0),g=new he(0),m=new he(1),v=0;0!==l.cmpn(0);){var y=c.div(l);f=c.sub(y.mul(l)),h=g.sub(y.mul(d));var b=m.sub(y.mul(p));if(!i&&0>f.cmp(u))e=a.neg(),r=d,i=f.neg(),n=h;else if(i&&2==++v)break;a=f,c=l,l=f,g=d,d=h,m=p,p=b}s=f.neg(),o=h;var A=i.sqr().add(n.sqr());return s.sqr().add(o.sqr()).cmp(A)>=0&&(s=e,o=r),i.negative&&(i=i.neg(),n=n.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:i,b:n},{a:s,b:o}]},u3.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),f=n.mul(r.b),h=s.mul(i.b);return{k1:t.sub(o).sub(a),k2:f.add(h).neg()}},u3.prototype.pointFromX=function(t,e){(t=new he(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},u3.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},u3.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s":""},u6.prototype.isInfinity=function(){return this.inf},u6.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t)||0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},u6.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},u6.prototype.getX=function(){return this.x.fromRed()},u6.prototype.getY=function(){return this.y.fromRed()},u6.prototype.mul=function(t){return t=new he(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u6.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},u6.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},u6.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u6.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},u6.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},u1(u8,u$.BasePoint),u3.prototype.jpoint=function(t,e,r){return new u8(this,t,e,r)},u8.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},u8.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u8.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),f=s.redSub(o);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),u=h.redMul(a),l=i.redMul(h),c=f.redSqr().redIAdd(u).redISub(l).redISub(l),d=f.redMul(l.redISub(c)).redISub(s.redMul(u)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(c,d,p)},u8.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),h=f.redMul(o),u=r.redMul(f),l=a.redSqr().redIAdd(h).redISub(u).redISub(u),c=a.redMul(u.redISub(l)).redISub(n.redMul(h)),d=this.z.redMul(o);return this.curve.jpoint(l,c,d)},u8.prototype.dblp=function(t){if(0===t||this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var e,r=this;for(e=0;e=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},u8.prototype.inspect=function(){return this.isInfinity()?"":""},u8.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var u5=uK(function(t,e){e.base=u$,e.short=u3,e.mont=null,e.edwards=null}),u4=uK(function(t,e){var r,i=uV.assert;function n(t){"short"===t.type?this.curve=new u5.short(t):"edwards"===t.type?this.curve=new u5.edwards(t):this.curve=new u5.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var i=new n(r);return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:i}),i}})}e.PresetCurve=n,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hK.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hK.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hK.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hK.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hK.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hK.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hK.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch{r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hK.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function u9(t){if(!(this instanceof u9))return new u9(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=uY.toArray(t.entropy,t.entropyEnc||"hex"),r=uY.toArray(t.nonce,t.nonceEnc||"hex"),i=uY.toArray(t.pers,t.persEnc||"hex");uJ(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}u9.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},u9.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=uY.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length"};var le=uV.assert;function lr(t,e){if(t instanceof lr)return t;this._importDER(t,e)||(le(t.r&&t.s,"Signature without r or s"),this.r=new he(t.r,16),this.s=new he(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function li(){this.place=0}function ln(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=e.place;s>>=0;return!(n<=127)&&(e.place=o,n)}function ls(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}lr.prototype._importDER=function(t,e){t=uV.toArray(t,e);var r=new li;if(48!==t[r.place++])return!1;var i=ln(t,r);if(!1===i||i+r.place!==t.length||2!==t[r.place++])return!1;var n=ln(t,r);if(!1===n)return!1;var s=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var o=ln(t,r);if(!1===o||t.length!==o+r.place)return!1;var a=t.slice(r.place,o+r.place);if(0===s[0]){if(!(128&s[1]))return!1;else s=s.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;else a=a.slice(1)}return this.r=new he(s),this.s=new he(a),this.recoveryParam=null,!0},lr.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=ls(e),r=ls(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var i=[2];lo(i,e.length),(i=i.concat(e)).push(2),lo(i,r.length);var n=i.concat(r),s=[48];return lo(s,n.length),s=s.concat(n),uV.encode(s,t)};var la=function(){throw Error("unsupported")},lf=uV.assert;function lh(t){if(!(this instanceof lh))return new lh(t);"string"==typeof t&&(lf(Object.prototype.hasOwnProperty.call(u4,t),"Unknown curve "+t),t=u4[t]),t instanceof u4.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}lh.prototype.keyPair=function(t){return new lt(this,t)},lh.prototype.keyFromPrivate=function(t,e){return lt.fromPrivate(this,t,e)},lh.prototype.keyFromPublic=function(t,e){return lt.fromPublic(this,t,e)},lh.prototype.genKeyPair=function(t){t||(t={});for(var e=new u9({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||la(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new he(2));;){var n=new he(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},lh.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},lh.prototype.sign=function(t,e,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new he(t,16));for(var n=this.n.byteLength(),s=e.getPrivate().toArray("be",n),o=t.toArray("be",n),a=new u9({hash:this.hash,entropy:s,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),f=this.n.sub(new he(1)),h=0;;h++){var u=i.k?i.k(h):new he(a.generate(this.n.byteLength()));if(!(0>=(u=this._truncateToN(u,!0)).cmpn(1)||u.cmp(f)>=0)){var l=this.g.mul(u);if(!l.isInfinity()){var c=l.getX(),d=c.umod(this.n);if(0!==d.cmpn(0)){var p=u.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(l.getY().isOdd()?1:0)|(0!==c.cmp(d)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new lr({r:d,s:p,recoveryParam:g})}}}}}},lh.prototype.verify=function(t,e,r,i){t=this._truncateToN(new he(t,16)),r=this.keyFromPublic(r,i);var n=(e=new lr(e,"hex")).r,s=e.s;if(0>n.cmpn(1)||n.cmp(this.n)>=0||0>s.cmpn(1)||s.cmp(this.n)>=0)return!1;var o,a=s.invm(this.n),f=a.mul(t).umod(this.n),h=a.mul(n).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(f,r.getPublic(),h)).isInfinity()&&o.eqXToP(n):!(o=this.g.mulAdd(f,r.getPublic(),h)).isInfinity()&&0===o.getX().umod(this.n).cmp(n)},lh.prototype.recoverPubKey=function(t,e,r,i){lf((3&r)===r,"The recovery param is more than two bits"),e=new lr(e,i);var n=this.n,s=new he(t),o=e.r,a=e.s,f=1&r,h=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw Error("Unable to find sencond key candinate");o=h?this.curve.pointFromX(o.add(this.curve.n),f):this.curve.pointFromX(o,f);var u=e.r.invm(n),l=n.sub(s).mul(u).umod(n),c=a.mul(u).umod(n);return this.g.mulAdd(l,o,c)},lh.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new lr(e,i)).recoveryParam)return e.recoveryParam;for(var n,s=0;s<4;s++){try{n=this.recoverPubKey(t,e,s)}catch{continue}if(n.eq(r))return s}throw Error("Unable to find valid recovery factor")};var lu=uK(function(t,e){e.version="6.5.4",e.utils=uV,e.rand=function(){throw Error("unsupported")},e.curve=u5,e.curves=u4,e.ec=lh,e.eddsa=null}).ec;let ll=new fV("signing-key/5.7.0"),lc=null;function ld(){return lc||(lc=new lu("secp256k1")),lc}class lp{constructor(t){hH(this,"curve","secp256k1"),hH(this,"privateKey",f6(t)),32!==function(t){if("string"!=typeof t)t=f6(t);else if(!f2(t)||t.length%2)return null;return(t.length-2)/2}(this.privateKey)&&ll.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let e=ld().keyFromPrivate(f1(this.privateKey));hH(this,"publicKey","0x"+e.getPublic(!1,"hex")),hH(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),hH(this,"_isSigningKey",!0)}_addPoint(t){let e=ld().keyFromPublic(f1(this.publicKey)),r=ld().keyFromPublic(f1(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}signDigest(t){let e=ld().keyFromPrivate(f1(this.privateKey)),r=f1(t);32!==r.length&&ll.throwArgumentError("bad digest length","digest",t);let i=e.sign(r,{canonical:!0});return f4({recoveryParam:i.recoveryParam,r:f5("0x"+i.r.toString(16),32),s:f5("0x"+i.s.toString(16),32)})}computeSharedSecret(t){let e=ld().keyFromPrivate(f1(this.privateKey)),r=ld().keyFromPublic(f1(lg(t)));return f5("0x"+e.derive(r.getPublic()).toString(16),32)}static isSigningKey(t){return!!(t&&t._isSigningKey)}}function lg(t,e){let r=f1(t);if(32===r.length){let t=new lp(r);return e?"0x"+ld().keyFromPrivate(r).getPublic(!0,"hex"):t.publicKey}if(33===r.length)return e?f6(r):"0x"+ld().keyFromPublic(r).getPublic(!1,"hex");if(65===r.length)return e?"0x"+ld().keyFromPublic(r).getPublic(!0,"hex"):f6(r);return ll.throwArgumentError("invalid public or private key","key","[REDACTED]")}new fV("transactions/5.7.0"),(O=ti||(ti={}))[O.legacy=0]="legacy",O[O.eip2930=1]="eip2930",O[O.eip1559=2]="eip1559";async function lm(t,e,r,i,n,s){switch(r.t){case"eip191":return function(t,e,r){return(function(t,e){return function(t){let e=null;if("string"!=typeof t&&hq.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=hF(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&hq.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map(t=>hz[t]).join("");for(;e.length>=hL;){let t=e.substring(0,hL);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}(t)&&hq.throwArgumentError("bad icap checksum","address",t),e=new hi(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=hF("0x"+e)}else hq.throwArgumentError("invalid address","address",t);return e}(f8(f9(f8(lg(function(t,e){let r=f4(e),i={r:f1(r.r),s:f1(r.s)};return"0x"+ld().recoverPubKey(f1(t),i,r.recoveryParam).encode("hex",!1)}(f1(t),e)),1)),12))})(hk(e),r).toLowerCase()===t.toLowerCase()}(t,e,r.s);case"eip1271":return await lv(t,e,r.s,i,n,s);default:throw Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}async function lv(t,e,r,i,n,s){try{let o="0x1626ba7e",a=r.substring(2),f=hk(e).substring(2),h=o+f+"00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000041"+a,u=await fetch(`${s||"https://rpc.walletconnect.com/v1"}/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:function(){return Date.now()+Math.floor(1e3*Math.random())}(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:h},"latest"]})}),{result:l}=await u.json();return!!l&&l.slice(0,o.length).toLowerCase()===o.toLowerCase()}catch(t){return console.error("isValidEip1271Signature: ",t),!1}}var ly=Object.defineProperty,lb=Object.defineProperties,lA=Object.getOwnPropertyDescriptors,lw=Object.getOwnPropertySymbols,lx=Object.prototype.hasOwnProperty,lM=Object.prototype.propertyIsEnumerable,lE=(t,e,r)=>e in t?ly(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lI=(t,e)=>{for(var r in e||(e={}))lx.call(e,r)&&lE(t,r,e[r]);if(lw)for(var r of lw(e))lM.call(e,r)&&lE(t,r,e[r]);return t},lS=(t,e)=>lb(t,lA(e));let l_=t=>t?.split(":"),lN=t=>{let e=t&&l_(t);if(e)return t.includes("did:pkh:")?e[3]:e[1]},lC=t=>{let e=t&&l_(t);if(e)return e[2]+":"+e[3]},lB=t=>{let e=t&&l_(t);if(e)return e.pop()};async function lR(t){let{cacao:e,projectId:r}=t,{s:i,p:n}=e,s=lP(n,n.iss),o=lB(n.iss);return await lm(o,s,i,lN(n.iss),r)}let lP=(t,e)=>{let r=`${t.domain} wants you to sign in with your Ethereum account:`,i=lB(e);if(!t.aud&&!t.uri)throw Error("Either `aud` or `uri` is required to construct the message");let n=t.statement||void 0,s=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,a=`Chain ID: ${lN(e)}`,f=`Nonce: ${t.nonce}`,h=`Issued At: ${t.iat}`,u=t.resources?`Resources:${t.resources.map(t=>` +- ${t}`).join("")}`:void 0,l=lq(t.resources);return l&&(n=function(t="",e){lO(e);let r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;let i=[],n=0;Object.keys(e.att).forEach(t=>{let r=Object.keys(e.att[t]).map(t=>({ability:t.split("/")[0],action:t.split("/")[1]}));r.sort((t,e)=>t.action.localeCompare(e.action));let s={};r.forEach(t=>{s[t.ability]||(s[t.ability]=[]),s[t.ability].push(t.action)});let o=Object.keys(s).map(e=>(n++,`(${n}) '${e}': '${s[e].join("', '")}' for '${t}'.`));i.push(o.join(", ").replace(".,","."))});let s=i.join(" "),o=`${r}${s}`;return`${t?t+" ":""}${o}`}(n,lD(l))),[r,i,"",n,"",s,o,a,f,h,u].filter(t=>null!=t).join(` +`)};function lO(t){if(!t)throw Error("No recap provided, value is undefined");if(!t.att)throw Error("No `att` property found");let e=Object.keys(t.att);if(!(null!=e&&e.length))throw Error("No resources found in `att` property");e.forEach(e=>{let r=t.att[e];if(Array.isArray(r)||"object"!=typeof r)throw Error(`Resource must be an object: ${e}`);if(!Object.keys(r).length)throw Error(`Resource object is empty: ${e}`);Object.keys(r).forEach(t=>{let e=r[t];if(!Array.isArray(e))throw Error(`Ability limits ${t} must be an array of objects, found: ${e}`);if(!e.length)throw Error(`Value of ${t} is empty array, must be an array with objects`);e.forEach(e=>{if("object"!=typeof e)throw Error(`Ability limits (${t}) must be an array of objects, found: ${e}`)})})})}function lT(t){var e;return lO(t),`urn:recap:${(e=t,fS.from(JSON.stringify(e)).toString("base64")).replace(/=/g,"")}`}function lD(t){var e;let r=(e=t.replace("urn:recap:",""),JSON.parse(fS.from(e,"base64").toString("utf-8")));return lO(r),r}function lU(t){var e;let r=lD(t);lO(r);let i=null==(e=r.att)?void 0:e.eip155;return i?Object.keys(i).map(t=>t.split("/")[1]):[]}function lk(t){let e=lD(t);lO(e);let r=[];return Object.values(e.att).forEach(t=>{Object.values(t).forEach(t=>{var e;null!=(e=t?.[0])&&e.chains&&r.push(t[0].chains)})}),[...new Set(r.flat())]}function lq(t){var e;if(!t)return;let r=t?.[t.length-1];return(e=r)&&e.includes("urn:recap:")?r:void 0}let lF="base16";function lz(t){let e=(0,ty.hash)((0,tA.mL)(t,lF));return(0,tA.BB)(e,lF)}function lL(t){let e=(0,ty.hash)((0,tA.mL)(t,"utf8"));return(0,tA.BB)(e,lF)}function lH(t){let e=[];return t.forEach(t=>{let[r,i]=t.split(":");e.push(`${r}:${i}`)}),e}Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function lQ(t,e){let r=function(t){let e={};return t?.forEach(t=>{let[r,i]=t.split(":");e[r]||(e[r]={accounts:[],chains:[],events:[]}),e[r].accounts.push(t),e[r].chains.push(`${r}:${i}`)}),e}(e=e.map(t=>t.replace("did:pkh:","")));for(let[e,i]of Object.entries(r))i.methods?i.methods=function(t=[],e=[]){return[...new Set([...t,...e])]}(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}let lj={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},lK={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function lJ(t,e){let{message:r,code:i}=lK[t];return{message:e?`${r} ${e}`:r,code:i}}function lG(t,e){let{message:r,code:i}=lj[t];return{message:e?`${r} ${e}`:r,code:i}}function lY(t,e){return!!Array.isArray(t)&&(!("u">typeof e)||!t.length||t.every(e))}function lV(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function lW(t){return typeof t>"u"}function lX(t,e){return!!(e&&lW(t))||"string"==typeof t&&!!t.trim().length}function lZ(t,e){return!!(e&&lW(t))||"number"==typeof t&&!isNaN(t)}function l$(t){return!!(lX(t,!1)&&t.includes(":"))&&2===t.split(":").length}function l0(t){let e=!0;return lY(t)?t.length&&(e=t.every(t=>lX(t,!1))):e=!1,e}function l1(t,e){let r=null;return Object.values(t).forEach(t=>{var i,n;let s;if(r)return;let o=(i=t,n=`${e}, namespace`,s=null,l0(i?.methods)?l0(i?.events)||(s=lG("UNSUPPORTED_EVENTS",`${n}, events should be an array of strings or empty array for no events`)):s=lG("UNSUPPORTED_METHODS",`${n}, methods should be an array of strings or empty array for no methods`),s);o&&(r=o)}),r}function l2(t,e){let r=null;if(t&&lV(t)){var i,n;let s,o=l1(t,e);o&&(r=o);let a=(i=t,n=e,s=null,Object.values(i).forEach(t=>{var e,r;let i;if(s)return;let o=(e=t?.accounts,r=`${n} namespace`,i=null,lY(e)?e.forEach(t=>{i||function(t){if(lX(t,!1)&&t.includes(":")){let e=t.split(":");if(3===e.length){let t=e[0]+":"+e[1];return!!e[2]&&l$(t)}}return!1}(t)||(i=lG("UNSUPPORTED_ACCOUNTS",`${r}, account ${t} should be a string and conform to "namespace:chainId:address" format`))}):i=lG("UNSUPPORTED_ACCOUNTS",`${r}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),i);o&&(s=o)}),s);a&&(r=a)}else r=lJ("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function l3(t){return lX(t.protocol,!0)}function l6(t){return"u">typeof t}function l8(t,e){return!(!l$(e)||!(function(t){let e=[];return Object.values(t).forEach(t=>{e.push(...lH(t.accounts))}),e})(t).includes(e))}function l5(t,e,r){let i=null,n=function(t){let e={};return Object.keys(t).forEach(r=>{var i;r.includes(":")?e[r]=t[r]:null==(i=t[r].chains)||i.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}(t),s=function(t){let e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{let i=lH(t[r].accounts);i?.forEach(i=>{e[i]={accounts:t[r].accounts.filter(t=>t.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}(e),o=Object.keys(n),a=Object.keys(s),f=l4(Object.keys(t)),h=l4(Object.keys(e)),u=f.filter(t=>!h.includes(t));return u.length&&(i=lJ("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. + Required: ${u.toString()} + Received: ${Object.keys(e).toString()}`)),fP(o,a)||(i=lJ("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. + Required: ${o.toString()} + Approved: ${a.toString()}`)),Object.keys(e).forEach(t=>{if(!t.includes(":")||i)return;let n=lH(e[t].accounts);n.includes(t)||(i=lJ("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${t} + Required: ${t} + Approved: ${n.toString()}`))}),o.forEach(t=>{i||(fP(n[t].methods,s[t].methods)?fP(n[t].events,s[t].events)||(i=lJ("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${t}`)):i=lJ("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${t}`))}),i}function l4(t){return[...new Set(t.map(t=>t.includes(":")?t.split(":")[0]:t))]}let l9={};class l7{static get(t){return l9[t]}static set(t,e){l9[t]=e}static delete(t){delete l9[t]}}let ct="client",ce=`wc@2:${ct}:`,cr={name:ct,logger:"error"},ci="WALLETCONNECT_DEEPLINK_CHOICE",cn="Proposal expired",cs=tl.SEVEN_DAYS,co={wc_sessionPropose:{req:{ttl:tl.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:tl.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:tl.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:tl.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:tl.ONE_DAY,prompt:!1,tag:1104},res:{ttl:tl.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:tl.ONE_DAY,prompt:!1,tag:1106},res:{ttl:tl.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:tl.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:tl.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:tl.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:tl.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:tl.ONE_DAY,prompt:!1,tag:1112},res:{ttl:tl.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:tl.ONE_DAY,prompt:!1,tag:1114},res:{ttl:tl.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:tl.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:tl.ONE_HOUR,prompt:!1,tag:1117}}},ca={min:tl.FIVE_MINUTES,max:tl.SEVEN_DAYS},cf={idle:"IDLE",active:"ACTIVE"},ch=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"],cu="wc@1.5:auth:",cl=`${cu}:PUB_KEY`;var cc=Object.defineProperty,cd=Object.defineProperties,cp=Object.getOwnPropertyDescriptors,cg=Object.getOwnPropertySymbols,cm=Object.prototype.hasOwnProperty,cv=Object.prototype.propertyIsEnumerable,cy=(t,e,r)=>e in t?cc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cb=(t,e)=>{for(var r in e||(e={}))cm.call(e,r)&&cy(t,r,e[r]);if(cg)for(var r of cg(e))cv.call(e,r)&&cy(t,r,e[r]);return t},cA=(t,e)=>cd(t,cp(e));class cw extends fE{constructor(t){super(t),this.name="engine",this.events=new(tu()),this.initialized=!1,this.requestQueue={state:cf.idle,queue:[]},this.sessionRequestQueue={state:cf.idle,queue:[]},this.requestQueueDelay=tl.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(co)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,tl.toMiliseconds)(this.requestQueueDelay)))},this.connect=async t=>{await this.isInitialized();let e=cA(cb({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(e);let{pairingTopic:r,requiredNamespaces:i,optionalNamespaces:n,sessionProperties:s,relays:o}=e,a=r,f,h=!1;try{a&&(h=this.client.core.pairing.pairings.get(a).active)}catch(t){throw this.client.logger.error(`connect() -> pairing.get(${a}) failed`),t}if(!a||!h){let{topic:t,uri:e}=await this.client.core.pairing.create();a=t,f=e}if(!a){let{message:t}=lJ("NO_MATCHING_KEY",`connect() pairing topic: ${a}`);throw Error(t)}let u=await this.client.core.crypto.generateKeyPair(),l=co.wc_sessionPropose.req.ttl||tl.FIVE_MINUTES,c=fT(l),d=cb({requiredNamespaces:i,optionalNamespaces:n,relays:o??[{protocol:"irn"}],proposer:{publicKey:u,metadata:this.client.metadata},expiryTimestamp:c},s&&{sessionProperties:s}),{reject:p,resolve:g,done:m}=fO(l,cn);this.events.once(fU("session_connect"),async({error:t,session:e})=>{if(t)p(t);else if(e){e.self.publicKey=u;let t=cA(cb({},e),{requiredNamespaces:d.requiredNamespaces,optionalNamespaces:d.optionalNamespaces});await this.client.session.set(e.topic,t),await this.setExpiry(e.topic,e.expiry),a&&await this.client.core.pairing.updateMetadata({topic:a,metadata:e.peer.metadata}),g(t)}});let v=await this.sendRequest({topic:a,method:"wc_sessionPropose",params:d,throwOnFailedPublish:!0});return await this.setProposal(v,cb({id:v},d)),{uri:f,approval:m}},this.pair=async t=>{await this.isInitialized();try{return await this.client.core.pairing.pair(t)}catch(t){throw this.client.logger.error("pair() failed"),t}},this.approve=async t=>{let e;await this.isInitialized();try{await this.isValidApprove(t)}catch(t){throw this.client.logger.error("approve() -> isValidApprove() failed"),t}let{id:r,relayProtocol:i,namespaces:n,sessionProperties:s,sessionConfig:o}=t;try{e=this.client.proposal.get(r)}catch(t){throw this.client.logger.error(`approve() -> proposal.get(${r}) failed`),t}let{pairingTopic:a,proposer:f,requiredNamespaces:h,optionalNamespaces:u}=e;a=a||"";let l=await this.client.core.crypto.generateKeyPair(),c=f.publicKey,d=await this.client.core.crypto.generateSharedKey(l,c),p=cb(cb({relay:{protocol:i??"irn"},namespaces:n,pairingTopic:a,controller:{publicKey:l,metadata:this.client.metadata},expiry:fT(cs)},s&&{sessionProperties:s}),o&&{sessionConfig:o});await this.client.core.relayer.subscribe(d);let g=cA(cb({},p),{topic:d,requiredNamespaces:h,optionalNamespaces:u,pairingTopic:a,acknowledged:!1,self:p.controller,peer:{publicKey:f.publicKey,metadata:f.metadata},controller:l});await this.client.session.set(d,g);try{await this.sendResult({id:r,topic:a,result:{relay:{protocol:i??"irn"},responderPublicKey:l},throwOnFailedPublish:!0}),await this.sendRequest({topic:d,method:"wc_sessionSettle",params:p,throwOnFailedPublish:!0})}catch(t){throw this.client.logger.error(t),this.client.session.delete(d,lG("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(d),t}return await this.client.core.pairing.updateMetadata({topic:a,metadata:f.metadata}),await this.client.proposal.delete(r,lG("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:a}),await this.setExpiry(d,fT(cs)),{topic:d,acknowledged:()=>new Promise(t=>setTimeout(()=>t(this.client.session.get(d)),500))}},this.reject=async t=>{let e;await this.isInitialized();try{await this.isValidReject(t)}catch(t){throw this.client.logger.error("reject() -> isValidReject() failed"),t}let{id:r,reason:i}=t;try{e=this.client.proposal.get(r).pairingTopic}catch(t){throw this.client.logger.error(`reject() -> proposal.get(${r}) failed`),t}e&&(await this.sendError({id:r,topic:e,error:i}),await this.client.proposal.delete(r,lG("USER_DISCONNECTED")))},this.update=async t=>{await this.isInitialized();try{await this.isValidUpdate(t)}catch(t){throw this.client.logger.error("update() -> isValidUpdate() failed"),t}let{topic:e,namespaces:r}=t,{done:i,resolve:n,reject:s}=fO(),o=(0,om.payloadId)(),a=(0,om.getBigIntRpcId)().toString(),f=this.client.session.get(e).namespaces;return this.events.once(fU("session_update",o),({error:t})=>{t?s(t):n()}),await this.client.session.update(e,{namespaces:r}),this.sendRequest({topic:e,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:a}).catch(t=>{this.client.logger.error(t),this.client.session.update(e,{namespaces:f}),s(t)}),{acknowledged:i}},this.extend=async t=>{await this.isInitialized();try{await this.isValidExtend(t)}catch(t){throw this.client.logger.error("extend() -> isValidExtend() failed"),t}let{topic:e}=t,r=(0,om.payloadId)(),{done:i,resolve:n,reject:s}=fO();return this.events.once(fU("session_extend",r),({error:t})=>{t?s(t):n()}),await this.setExpiry(e,fT(cs)),this.sendRequest({topic:e,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch(t=>{s(t)}),{acknowledged:i}},this.request=async t=>{await this.isInitialized();try{await this.isValidRequest(t)}catch(t){throw this.client.logger.error("request() -> isValidRequest() failed"),t}let{chainId:e,request:r,topic:i,expiry:n=co.wc_sessionRequest.req.ttl}=t,s=this.client.session.get(i),o=(0,om.payloadId)(),a=(0,om.getBigIntRpcId)().toString(),{done:f,resolve:h,reject:u}=fO(n,"Request expired. Please try again.");return this.events.once(fU("session_request",o),({error:t,result:e})=>{t?u(t):h(e)}),await Promise.all([new Promise(async t=>{await this.sendRequest({clientRpcId:o,relayRpcId:a,topic:i,method:"wc_sessionRequest",params:{request:cA(cb({},r),{expiryTimestamp:fT(n)}),chainId:e},expiry:n,throwOnFailedPublish:!0}).catch(t=>u(t)),this.client.events.emit("session_request_sent",{topic:i,request:r,chainId:e,id:o}),t()}),new Promise(async t=>{var e;!(null!=(e=s.sessionConfig)&&e.disableDeepLink)&&fk({id:o,topic:i,wcDeepLink:await fq(this.client.core.storage,ci)}),t()}),f()]).then(t=>t[2])},this.respond=async t=>{await this.isInitialized(),await this.isValidRespond(t);let{topic:e,response:r}=t,{id:i}=r;(0,om.isJsonRpcResult)(r)?await this.sendResult({id:i,topic:e,result:r.result,throwOnFailedPublish:!0}):(0,om.isJsonRpcError)(r)&&await this.sendError({id:i,topic:e,error:r.error}),this.cleanupAfterResponse(t)},this.ping=async t=>{await this.isInitialized();try{await this.isValidPing(t)}catch(t){throw this.client.logger.error("ping() -> isValidPing() failed"),t}let{topic:e}=t;if(this.client.session.keys.includes(e)){let t=(0,om.payloadId)(),r=(0,om.getBigIntRpcId)().toString(),{done:i,resolve:n,reject:s}=fO();this.events.once(fU("session_ping",t),({error:t})=>{t?s(t):n()}),await Promise.all([this.sendRequest({topic:e,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:t,relayRpcId:r}),i()])}else this.client.core.pairing.pairings.keys.includes(e)&&await this.client.core.pairing.ping({topic:e})},this.emit=async t=>{await this.isInitialized(),await this.isValidEmit(t);let{topic:e,event:r,chainId:i}=t,n=(0,om.getBigIntRpcId)().toString();await this.sendRequest({topic:e,method:"wc_sessionEvent",params:{event:r,chainId:i},throwOnFailedPublish:!0,relayRpcId:n})},this.disconnect=async t=>{await this.isInitialized(),await this.isValidDisconnect(t);let{topic:e}=t;if(this.client.session.keys.includes(e))await this.sendRequest({topic:e,method:"wc_sessionDelete",params:lG("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:e,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(e))await this.client.core.pairing.disconnect({topic:e});else{let{message:t}=lJ("MISMATCHED_TOPIC",`Session or pairing topic not found: ${e}`);throw Error(t)}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(e=>(function(t,e){let{requiredNamespaces:r}=e,i=Object.keys(t.namespaces),n=Object.keys(r),s=!0;return!!fP(n,i)&&(i.forEach(e=>{let{accounts:i,methods:n,events:o}=t.namespaces[e],a=lH(i),f=r[e];fP(fN(e,f),a)&&fP(f.methods,n)&&fP(f.events,o)||(s=!1)}),s)})(e,t))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async t=>{this.isInitialized(),this.isValidAuthenticate(t);let{chains:e,statement:r="",uri:i,domain:n,nonce:s,type:o,exp:a,nbf:f,methods:h=[]}=t,u=[...t.resources||[]],{topic:l,uri:c}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"]});this.client.logger.info({message:"Generated new pairing",pairing:{topic:l,uri:c}});let d=await this.client.core.crypto.generateKeyPair(),p=lz(d);if(await Promise.all([this.client.auth.authKeys.set(cl,{responseTopic:p,publicKey:d}),this.client.auth.pairingTopics.set(p,{topic:p,pairingTopic:l})]),await this.client.core.relayer.subscribe(p),this.client.logger.info(`sending request to new pairing topic: ${l}`),h.length>0){let{namespace:t}=f_(e[0]),r=lT(function(t,e,r,i={}){return r?.sort((t,e)=>t.localeCompare(e)),{att:{[t]:function(t,e,r={}){return Object.assign({},...(e=e?.sort((t,e)=>t.localeCompare(e))).map(e=>({[`${t}/${e}`]:[r]})))}(e,r,i)}}}(t,"request",h));lq(u)&&(r=function(t,e){let r=lD(t);return lT(function(t,e){lO(t),lO(e);let r=Object.keys(t.att).concat(Object.keys(e.att)).sort((t,e)=>t.localeCompare(e)),i={att:{}};return r.forEach(r=>{var n,s;Object.keys((null==(n=t.att)?void 0:n[r])||{}).concat(Object.keys((null==(s=e.att)?void 0:s[r])||{})).sort((t,e)=>t.localeCompare(e)).forEach(n=>{var s,o;i.att[r]=lS(lI({},i.att[r]),{[n]:(null==(s=t.att[r])?void 0:s[n])||(null==(o=e.att[r])?void 0:o[n])})})}),i}(r,lD(e)))}(r,u.pop())),u.push(r)}let g=fT(co.wc_sessionPropose.req.ttl),m={authPayload:{type:o??"caip122",chains:e,statement:r,aud:i,domain:n,version:"1",nonce:s,iat:new Date().toISOString(),exp:a,nbf:f,resources:u},requester:{publicKey:d,metadata:this.client.metadata},expiryTimestamp:g},v={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:e,methods:[...new Set(["personal_sign",...h])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],proposer:{publicKey:d,metadata:this.client.metadata},expiryTimestamp:g},{done:y,resolve:b,reject:A}=fO(co.wc_sessionAuthenticate.req.ttl,"Request expired"),w=async({error:t,session:e})=>{(this.events.off(fU("session_request",M),x),t)?A(t):e&&(e.self.publicKey=d,await this.client.session.set(e.topic,e),await this.setExpiry(e.topic,e.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:e.peer.metadata}),b({session:this.client.session.get(e.topic)}))},x=async t=>{let e;if(t.error){let e=lG("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return t.error.code===e.code?void 0:(this.events.off(fU("session_connect"),w),A(t.error.message))}this.events.off(fU("session_connect"),w);let{cacaos:r,responder:i}=t.result,n=[],s=[];for(let t of r){await lR({cacao:t,projectId:this.client.core.projectId})||(this.client.logger.error(t,"Signature verification failed"),A(lG("SESSION_SETTLEMENT_FAILED","Signature verification failed")));let{p:e}=t,r=lq(e.resources),i=[lC(e.iss)],o=lB(e.iss);if(r){let t=lU(r),e=lk(r);n.push(...t),i.push(...e)}for(let t of i)s.push(`${t}:${o}`)}let o=await this.client.core.crypto.generateSharedKey(d,i.publicKey);n.length>0&&(e={topic:o,acknowledged:!0,self:{publicKey:d,metadata:this.client.metadata},peer:i,controller:i.publicKey,expiry:fT(cs),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:l,namespaces:lQ([...new Set(n)],[...new Set(s)])},await this.client.core.relayer.subscribe(o),await this.client.session.set(o,e),e=this.client.session.get(o)),b({auths:r,session:e})},M=(0,om.payloadId)(),E=(0,om.payloadId)();this.events.once(fU("session_connect"),w),this.events.once(fU("session_request",M),x);try{await Promise.all([this.sendRequest({topic:l,method:"wc_sessionAuthenticate",params:m,expiry:t.expiry,throwOnFailedPublish:!0,clientRpcId:M}),this.sendRequest({topic:l,method:"wc_sessionPropose",params:v,expiry:co.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:E})])}catch(t){throw this.events.off(fU("session_connect"),w),this.events.off(fU("session_request",M),x),t}return await this.setProposal(E,cb({id:E},v)),await this.client.auth.requests.set(M,{authPayload:m.authPayload,requester:m.requester,expiryTimestamp:g,id:M,pairingTopic:l,verifyContext:{}}),{uri:c,response:y}},this.approveSessionAuthenticate=async t=>{let e;this.isInitialized();let{id:r,auths:i}=t,n=this.getPendingAuthRequest(r);if(!n)throw Error(`Could not find pending auth request with id ${r}`);let s=n.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),a=lz(s),f={type:1,receiverPublicKey:s,senderPublicKey:o},h=[],u=[];for(let t of i){if(!await lR({cacao:t,projectId:this.client.core.projectId})){let t=lG("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:r,topic:a,error:t,encodeOpts:f}),Error(t.message)}let{p:e}=t,i=lq(e.resources),n=[lC(e.iss)],s=lB(e.iss);if(i){let t=lU(i),e=lk(i);h.push(...t),n.push(...e)}for(let t of n)u.push(`${t}:${s}`)}let l=await this.client.core.crypto.generateSharedKey(o,s);return h?.length>0&&(e={topic:l,acknowledged:!0,self:{publicKey:o,metadata:this.client.metadata},peer:{publicKey:s,metadata:n.requester.metadata},controller:s,expiry:fT(cs),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:"",namespaces:lQ([...new Set(h)],[...new Set(u)])},await this.client.core.relayer.subscribe(l),await this.client.session.set(l,e)),await this.sendResult({topic:a,id:r,result:{cacaos:i,responder:{publicKey:o,metadata:this.client.metadata}},encodeOpts:f,throwOnFailedPublish:!0}),await this.client.auth.requests.delete(r,{message:"fullfilled",code:0}),await this.client.core.pairing.activate({topic:n.pairingTopic}),{session:e}},this.rejectSessionAuthenticate=async t=>{await this.isInitialized();let{id:e,reason:r}=t,i=this.getPendingAuthRequest(e);if(!i)throw Error(`Could not find pending auth request with id ${e}`);let n=i.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),o=lz(n);await this.sendError({id:e,topic:o,error:r,encodeOpts:{type:1,receiverPublicKey:n,senderPublicKey:s}}),await this.client.auth.requests.delete(e,{message:"rejected",code:0}),await this.client.proposal.delete(e,lG("USER_DISCONNECTED"))},this.formatAuthMessage=t=>{this.isInitialized();let{request:e,iss:r}=t;return lP(e,r)},this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{let e=this.client.core.pairing.pairings.get(t.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter(r=>{var i,n;return(null==(i=r.peerMetadata)?void 0:i.url)&&(null==(n=r.peerMetadata)?void 0:n.url)===t.peer.metadata.url&&r.topic&&r.topic!==e.topic});if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map(t=>this.client.core.pairing.disconnect({topic:t.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(t){this.client.logger.error(t)}},this.deleteSession=async t=>{let{topic:e,expirerHasDeleted:r=!1,emitEvent:i=!0,id:n=0}=t,{self:s}=this.client.session.get(e);await this.client.core.relayer.unsubscribe(e),await this.client.session.delete(e,lG("USER_DISCONNECTED")),this.addToRecentlyDeleted(e,"session"),this.client.core.crypto.keychain.has(s.publicKey)&&await this.client.core.crypto.deleteKeyPair(s.publicKey),this.client.core.crypto.keychain.has(e)&&await this.client.core.crypto.deleteSymKey(e),r||this.client.core.expirer.del(e),this.client.core.storage.removeItem(ci).catch(t=>this.client.logger.warn(t)),this.getPendingSessionRequests().forEach(t=>{t.topic===e&&this.deletePendingSessionRequest(t.id,lG("USER_DISCONNECTED"))}),i&&this.client.events.emit("session_delete",{id:n,topic:e})},this.deleteProposal=async(t,e)=>{await Promise.all([this.client.proposal.delete(t,lG("USER_DISCONNECTED")),e?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"proposal")},this.deletePendingSessionRequest=async(t,e,r=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,e),r?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(e=>e.id!==t),r&&(this.sessionRequestQueue.state=cf.idle,this.client.events.emit("session_request_expire",{id:t}))},this.setExpiry=async(t,e)=>{this.client.session.keys.includes(t)&&await this.client.session.update(t,{expiry:e}),this.client.core.expirer.set(t,e)},this.setProposal=async(t,e)=>{await this.client.proposal.set(t,e),this.client.core.expirer.set(t,fT(co.wc_sessionPropose.req.ttl))},this.setPendingSessionRequest=async t=>{let{id:e,topic:r,params:i,verifyContext:n}=t,s=i.request.expiryTimestamp||fT(co.wc_sessionRequest.req.ttl);await this.client.pendingRequest.set(e,{id:e,topic:r,params:i,verifyContext:n}),s&&this.client.core.expirer.set(e,s)},this.sendRequest=async t=>{let e;let{topic:r,method:i,params:n,expiry:s,relayRpcId:o,clientRpcId:a,throwOnFailedPublish:f}=t,h=(0,om.formatJsonRpcRequest)(i,n,a);if(fR()&&ch.includes(i)){let t=lL(JSON.stringify(h));this.client.core.verify.register({attestationId:t})}try{e=await this.client.core.crypto.encode(r,h)}catch(t){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${r} failed`),t}let u=co[i].req;return s&&(u.ttl=s),o&&(u.id=o),this.client.core.history.set(r,h),f?(u.internal=cA(cb({},u.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(r,e,u)):this.client.core.relayer.publish(r,e,u).catch(t=>this.client.logger.error(t)),h.id},this.sendResult=async t=>{let e,r;let{id:i,topic:n,result:s,throwOnFailedPublish:o,encodeOpts:a}=t,f=(0,om.formatJsonRpcResult)(i,s);try{e=await this.client.core.crypto.encode(n,f,a)}catch(t){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${n} failed`),t}try{r=await this.client.core.history.get(n,i)}catch(t){throw this.client.logger.error(`sendResult() -> history.get(${n}, ${i}) failed`),t}let h=co[r.request.method].res;o?(h.internal=cA(cb({},h.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,e,h)):this.client.core.relayer.publish(n,e,h).catch(t=>this.client.logger.error(t)),await this.client.core.history.resolve(f)},this.sendError=async t=>{let e,r;let{id:i,topic:n,error:s,encodeOpts:o}=t,a=(0,om.formatJsonRpcError)(i,s);try{e=await this.client.core.crypto.encode(n,a,o)}catch(t){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),t}try{r=await this.client.core.history.get(n,i)}catch(t){throw this.client.logger.error(`sendError() -> history.get(${n}, ${i}) failed`),t}let f=co[r.request.method].res;this.client.core.relayer.publish(n,e,f),await this.client.core.history.resolve(a)},this.cleanup=async()=>{let t=[],e=[];this.client.session.getAll().forEach(e=>{let r=!1;fD(e.expiry)&&(r=!0),this.client.core.crypto.keychain.has(e.topic)||(r=!0),r&&t.push(e.topic)}),this.client.proposal.getAll().forEach(t=>{fD(t.expiryTimestamp)&&e.push(t.id)}),await Promise.all([...t.map(t=>this.deleteSession({topic:t})),...e.map(t=>this.deleteProposal(t))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===cf.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=cf.active;let t=this.requestQueue.queue.shift();if(t)try{this.processRequest(t),await new Promise(t=>setTimeout(t,300))}catch(t){this.client.logger.warn(t)}}this.requestQueue.state=cf.idle},this.processRequest=t=>{let{topic:e,payload:r}=t,i=r.method;if(!this.shouldIgnorePairingRequest({topic:e,requestMethod:i}))switch(i){case"wc_sessionPropose":return this.onSessionProposeRequest(e,r);case"wc_sessionSettle":return this.onSessionSettleRequest(e,r);case"wc_sessionUpdate":return this.onSessionUpdateRequest(e,r);case"wc_sessionExtend":return this.onSessionExtendRequest(e,r);case"wc_sessionPing":return this.onSessionPingRequest(e,r);case"wc_sessionDelete":return this.onSessionDeleteRequest(e,r);case"wc_sessionRequest":return this.onSessionRequest(e,r);case"wc_sessionEvent":return this.onSessionEventRequest(e,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateRequest(e,r);default:return this.client.logger.info(`Unsupported request method ${i}`)}},this.onRelayEventResponse=async t=>{let{topic:e,payload:r}=t,i=(await this.client.core.history.get(e,r.id)).request.method;switch(i){case"wc_sessionPropose":return this.onSessionProposeResponse(e,r);case"wc_sessionSettle":return this.onSessionSettleResponse(e,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(e,r);case"wc_sessionExtend":return this.onSessionExtendResponse(e,r);case"wc_sessionPing":return this.onSessionPingResponse(e,r);case"wc_sessionRequest":return this.onSessionRequestResponse(e,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(e,r);default:return this.client.logger.info(`Unsupported response method ${i}`)}},this.onRelayEventUnknownPayload=t=>{let{topic:e}=t,{message:r}=lJ("MISSING_OR_INVALID",`Decoded payload on topic ${e} is not identifiable as a JSON-RPC request or a response.`);throw Error(r)},this.shouldIgnorePairingRequest=t=>{let{topic:e,requestMethod:r}=t,i=this.expectedPairingMethodMap.get(e);return!(!i||i.includes(r))&&!!(i.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async(t,e)=>{let{params:r,id:i}=e;try{this.isValidConnect(cb({},e.params));let n=r.expiryTimestamp||fT(co.wc_sessionPropose.req.ttl),s=cb({id:i,pairingTopic:t,expiryTimestamp:n},r);await this.setProposal(i,s);let o=lL(JSON.stringify(e)),a=await this.getVerifyContext(o,s.proposer.metadata);this.client.events.emit("session_proposal",{id:i,params:s,verifyContext:a})}catch(e){await this.sendError({id:i,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionProposeResponse=async(t,e)=>{let{id:r}=e;if((0,om.isJsonRpcResult)(e)){let{result:i}=e;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:i});let n=this.client.proposal.get(r);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:n});let s=n.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:s});let o=i.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:o});let a=await this.client.core.crypto.generateSharedKey(s,o);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:a});let f=await this.client.core.relayer.subscribe(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:f}),await this.client.core.pairing.activate({topic:t})}else if((0,om.isJsonRpcError)(e)){await this.client.proposal.delete(r,lG("USER_DISCONNECTED"));let t=fU("session_connect");if(0===this.events.listenerCount(t))throw Error(`emitting ${t} without any listeners, 954`);this.events.emit(fU("session_connect"),{error:e.error})}},this.onSessionSettleRequest=async(t,e)=>{let{id:r,params:i}=e;try{this.isValidSessionSettleRequest(i);let{relay:r,controller:n,expiry:s,namespaces:o,sessionProperties:a,pairingTopic:f,sessionConfig:h}=e.params,u=cb(cb({topic:t,relay:r,expiry:s,namespaces:o,acknowledged:!0,pairingTopic:f,requiredNamespaces:{},optionalNamespaces:{},controller:n.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:n.publicKey,metadata:n.metadata}},a&&{sessionProperties:a}),h&&{sessionConfig:h});await this.sendResult({id:e.id,topic:t,result:!0,throwOnFailedPublish:!0});let l=fU("session_connect");if(0===this.events.listenerCount(l))throw Error(`emitting ${l} without any listeners 997`);this.events.emit(fU("session_connect"),{session:u}),this.cleanupDuplicatePairings(u)}catch(e){await this.sendError({id:r,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionSettleResponse=async(t,e)=>{let{id:r}=e;(0,om.isJsonRpcResult)(e)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(fU("session_approve",r),{})):(0,om.isJsonRpcError)(e)&&(await this.client.session.delete(t,lG("USER_DISCONNECTED")),this.events.emit(fU("session_approve",r),{error:e.error}))},this.onSessionUpdateRequest=async(t,e)=>{let{params:r,id:i}=e;try{let e=`${t}_session_update`,n=l7.get(e);if(n&&this.isRequestOutOfSync(n,i)){this.client.logger.info(`Discarding out of sync request - ${i}`),this.sendError({id:i,topic:t,error:lG("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(cb({topic:t},r));try{l7.set(e,i),await this.client.session.update(t,{namespaces:r.namespaces}),await this.sendResult({id:i,topic:t,result:!0,throwOnFailedPublish:!0})}catch(t){throw l7.delete(e),t}this.client.events.emit("session_update",{id:i,topic:t,params:r})}catch(e){await this.sendError({id:i,topic:t,error:e}),this.client.logger.error(e)}},this.isRequestOutOfSync=(t,e)=>parseInt(e.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,e)=>{let{id:r}=e,i=fU("session_update",r);if(0===this.events.listenerCount(i))throw Error(`emitting ${i} without any listeners`);(0,om.isJsonRpcResult)(e)?this.events.emit(fU("session_update",r),{}):(0,om.isJsonRpcError)(e)&&this.events.emit(fU("session_update",r),{error:e.error})},this.onSessionExtendRequest=async(t,e)=>{let{id:r}=e;try{this.isValidExtend({topic:t}),await this.setExpiry(t,fT(cs)),await this.sendResult({id:r,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:r,topic:t})}catch(e){await this.sendError({id:r,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionExtendResponse=(t,e)=>{let{id:r}=e,i=fU("session_extend",r);if(0===this.events.listenerCount(i))throw Error(`emitting ${i} without any listeners`);(0,om.isJsonRpcResult)(e)?this.events.emit(fU("session_extend",r),{}):(0,om.isJsonRpcError)(e)&&this.events.emit(fU("session_extend",r),{error:e.error})},this.onSessionPingRequest=async(t,e)=>{let{id:r}=e;try{this.isValidPing({topic:t}),await this.sendResult({id:r,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:t})}catch(e){await this.sendError({id:r,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionPingResponse=(t,e)=>{let{id:r}=e,i=fU("session_ping",r);if(0===this.events.listenerCount(i))throw Error(`emitting ${i} without any listeners`);setTimeout(()=>{(0,om.isJsonRpcResult)(e)?this.events.emit(fU("session_ping",r),{}):(0,om.isJsonRpcError)(e)&&this.events.emit(fU("session_ping",r),{error:e.error})},500)},this.onSessionDeleteRequest=async(t,e)=>{let{id:r}=e;try{this.isValidDisconnect({topic:t,reason:e.params}),await Promise.all([new Promise(e=>{this.client.core.relayer.once(aO.publish,async()=>{e(await this.deleteSession({topic:t,id:r}))})}),this.sendResult({id:r,topic:t,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:lG("USER_DISCONNECTED")})])}catch(t){this.client.logger.error(t)}},this.onSessionRequest=async(t,e)=>{let{id:r,params:i}=e;try{await this.isValidRequest(cb({topic:t},i));let e=lL(JSON.stringify((0,om.formatJsonRpcRequest)("wc_sessionRequest",i,r))),n=this.client.session.get(t),s=await this.getVerifyContext(e,n.peer.metadata),o={id:r,topic:t,params:i,verifyContext:s};await this.setPendingSessionRequest(o),this.addSessionRequestToSessionRequestQueue(o),this.processSessionRequestQueue()}catch(e){await this.sendError({id:r,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionRequestResponse=(t,e)=>{let{id:r}=e,i=fU("session_request",r);if(0===this.events.listenerCount(i))throw Error(`emitting ${i} without any listeners`);(0,om.isJsonRpcResult)(e)?this.events.emit(fU("session_request",r),{result:e.result}):(0,om.isJsonRpcError)(e)&&this.events.emit(fU("session_request",r),{error:e.error})},this.onSessionEventRequest=async(t,e)=>{let{id:r,params:i}=e;try{let e=`${t}_session_event_${i.event.name}`,n=l7.get(e);if(n&&this.isRequestOutOfSync(n,r)){this.client.logger.info(`Discarding out of sync request - ${r}`);return}this.isValidEmit(cb({topic:t},i)),this.client.events.emit("session_event",{id:r,topic:t,params:i}),l7.set(e,r)}catch(e){await this.sendError({id:r,topic:t,error:e}),this.client.logger.error(e)}},this.onSessionAuthenticateResponse=(t,e)=>{let{id:r}=e;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:t,payload:e}),(0,om.isJsonRpcResult)(e)?this.events.emit(fU("session_request",r),{result:e.result}):(0,om.isJsonRpcError)(e)&&this.events.emit(fU("session_request",r),{error:e.error})},this.onSessionAuthenticateRequest=async(t,e)=>{let{requester:r,authPayload:i,expiryTimestamp:n}=e.params,s=lL(JSON.stringify(e)),o=await this.getVerifyContext(s,this.client.metadata),a={requester:r,pairingTopic:t,id:e.id,authPayload:i,verifyContext:o,expiryTimestamp:n};await this.client.auth.requests.set(e.id,a),this.client.events.emit("session_authenticate",{topic:t,params:e.params,id:e.id})},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=cf.idle,this.processSessionRequestQueue()},(0,tl.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:e})=>{let r=this.client.core.history.pending;r.length>0&&r.filter(e=>e.topic===t&&"wc_sessionRequest"===e.request.method).forEach(t=>{let r=fU("session_request",t.request.id);if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners`);this.events.emit(fU("session_request",t.request.id),{error:e})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===cf.active){this.client.logger.info("session request queue is already active.");return}let t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=cf.active,this.client.events.emit("session_request",t)}catch(t){this.client.logger.error(t)}},this.onPairingCreated=t=>{if(t.methods&&this.expectedPairingMethodMap.set(t.topic,t.methods),t.active)return;let e=this.client.proposal.getAll().find(e=>e.pairingTopic===t.topic);e&&this.onSessionProposeRequest(t.topic,(0,om.formatJsonRpcRequest)("wc_sessionPropose",{requiredNamespaces:e.requiredNamespaces,optionalNamespaces:e.optionalNamespaces,relays:e.relays,proposer:e.proposer,sessionProperties:e.sessionProperties},e.id))},this.isValidConnect=async t=>{var e;let r;if(!l6(t)){let{message:e}=lJ("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw Error(e)}let{pairingTopic:i,requiredNamespaces:n,optionalNamespaces:s,sessionProperties:o,relays:a}=t;if(lW(i)||await this.isValidPairingTopic(i),e=a,r=!1,e?e&&lY(e)&&e.length&&e.forEach(t=>{r=l3(t)}):r=!0,!r){let{message:t}=lJ("MISSING_OR_INVALID",`connect() relays: ${a}`);throw Error(t)}lW(n)||0===lV(n)||this.validateNamespaces(n,"requiredNamespaces"),lW(s)||0===lV(s)||this.validateNamespaces(s,"optionalNamespaces"),lW(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(t,e)=>{let r=function(t,e,r){let i=null;if(t&&lV(t)){var n,s,o;let a,f=l1(t,e);f&&(i=f);let h=(n=t,s=e,o=r,a=null,Object.entries(n).forEach(([t,e])=>{var r,i,n;let f;if(a)return;let h=(r=t,i=fN(t,e),n=`${s} ${o}`,f=null,lY(i)&&i.length?i.forEach(t=>{f||l$(t)||(f=lG("UNSUPPORTED_CHAINS",`${n}, chain ${t} should be a string and conform to "namespace:chainId" format`))}):l$(r)||(f=lG("UNSUPPORTED_CHAINS",`${n}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),f);h&&(a=h)}),a);h&&(i=h)}else i=lJ("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return i}(t,"connect()",e);if(r)throw Error(r.message)},this.isValidApprove=async t=>{if(!l6(t))throw Error(lJ("MISSING_OR_INVALID",`approve() params: ${t}`).message);let{id:e,namespaces:r,relayProtocol:i,sessionProperties:n}=t;this.checkRecentlyDeleted(e),await this.isValidProposalId(e);let s=this.client.proposal.get(e),o=l2(r,"approve()");if(o)throw Error(o.message);let a=l5(s.requiredNamespaces,r,"approve()");if(a)throw Error(a.message);if(!lX(i,!0)){let{message:t}=lJ("MISSING_OR_INVALID",`approve() relayProtocol: ${i}`);throw Error(t)}lW(n)||this.validateSessionProps(n,"sessionProperties")},this.isValidReject=async t=>{var e;if(!l6(t)){let{message:e}=lJ("MISSING_OR_INVALID",`reject() params: ${t}`);throw Error(e)}let{id:r,reason:i}=t;if(this.checkRecentlyDeleted(r),await this.isValidProposalId(r),!(e=i)||"object"!=typeof e||!e.code||!lZ(e.code,!1)||!e.message||!lX(e.message,!1)){let{message:t}=lJ("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw Error(t)}},this.isValidSessionSettleRequest=t=>{var e;let r;if(!l6(t)){let{message:e}=lJ("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw Error(e)}let{relay:i,controller:n,namespaces:s,expiry:o}=t;if(!l3(i)){let{message:t}=lJ("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw Error(t)}let a=(e=n,r=null,lX(e?.publicKey,!1)||(r=lJ("MISSING_OR_INVALID","onSessionSettleRequest() controller public key should be a string")),r);if(a)throw Error(a.message);let f=l2(s,"onSessionSettleRequest()");if(f)throw Error(f.message);if(fD(o)){let{message:t}=lJ("EXPIRED","onSessionSettleRequest()");throw Error(t)}},this.isValidUpdate=async t=>{if(!l6(t)){let{message:e}=lJ("MISSING_OR_INVALID",`update() params: ${t}`);throw Error(e)}let{topic:e,namespaces:r}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e);let i=this.client.session.get(e),n=l2(r,"update()");if(n)throw Error(n.message);let s=l5(i.requiredNamespaces,r,"update()");if(s)throw Error(s.message)},this.isValidExtend=async t=>{if(!l6(t)){let{message:e}=lJ("MISSING_OR_INVALID",`extend() params: ${t}`);throw Error(e)}let{topic:e}=t;this.checkRecentlyDeleted(e),await this.isValidSessionTopic(e)},this.isValidRequest=async t=>{var e,r,i,n,s,o;if(!l6(t)){let{message:e}=lJ("MISSING_OR_INVALID",`request() params: ${t}`);throw Error(e)}let{topic:a,request:f,chainId:h,expiry:u}=t;this.checkRecentlyDeleted(a),await this.isValidSessionTopic(a);let{namespaces:l}=this.client.session.get(a);if(!l8(l,h)){let{message:t}=lJ("MISSING_OR_INVALID",`request() chainId: ${h}`);throw Error(t)}if(lW(e=f)||!lX(e.method,!1)){let{message:t}=lJ("MISSING_OR_INVALID",`request() ${JSON.stringify(f)}`);throw Error(t)}if(r=l,i=h,!(lX(n=f.method,!1)&&(function(t,e){let r=[];return Object.values(t).forEach(t=>{lH(t.accounts).includes(e)&&r.push(...t.methods)}),r})(r,i).includes(n))){let{message:t}=lJ("MISSING_OR_INVALID",`request() method: ${f.method}`);throw Error(t)}if(u&&(s=u,o=ca,!lZ(s,!1)||!(s<=o.max)||!(s>=o.min))){let{message:t}=lJ("MISSING_OR_INVALID",`request() expiry: ${u}. Expiry must be a number (in seconds) between ${ca.min} and ${ca.max}`);throw Error(t)}},this.isValidRespond=async t=>{var e,r;if(!l6(t)){let{message:e}=lJ("MISSING_OR_INVALID",`respond() params: ${t}`);throw Error(e)}let{topic:i,response:n}=t;try{await this.isValidSessionTopic(i)}catch(r){throw null!=(e=t?.response)&&e.id&&this.cleanupAfterResponse(t),r}if(lW(r=n)||lW(r.result)&&lW(r.error)||!lZ(r.id,!1)||!lX(r.jsonrpc,!1)){let{message:t}=lJ("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(n)}`);throw Error(t)}},this.isValidPing=async t=>{if(!l6(t)){let{message:e}=lJ("MISSING_OR_INVALID",`ping() params: ${t}`);throw Error(e)}let{topic:e}=t;await this.isValidSessionOrPairingTopic(e)},this.isValidEmit=async t=>{var e,r,i,n;if(!l6(t)){let{message:e}=lJ("MISSING_OR_INVALID",`emit() params: ${t}`);throw Error(e)}let{topic:s,event:o,chainId:a}=t;await this.isValidSessionTopic(s);let{namespaces:f}=this.client.session.get(s);if(!l8(f,a)){let{message:t}=lJ("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw Error(t)}if(lW(e=o)||!lX(e.name,!1)){let{message:t}=lJ("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw Error(t)}if(r=f,i=a,!(lX(n=o.name,!1)&&(function(t,e){let r=[];return Object.values(t).forEach(t=>{lH(t.accounts).includes(e)&&r.push(...t.events)}),r})(r,i).includes(n))){let{message:t}=lJ("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw Error(t)}},this.isValidDisconnect=async t=>{if(!l6(t)){let{message:e}=lJ("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw Error(e)}let{topic:e}=t;await this.isValidSessionOrPairingTopic(e)},this.isValidAuthenticate=t=>{let{chains:e,uri:r,domain:i,nonce:n}=t;if(!Array.isArray(e)||0===e.length)throw Error("chains is required and must be a non-empty array");if(!lX(r,!1))throw Error("uri is required parameter");if(!lX(i,!1))throw Error("domain is required parameter");if(!lX(n,!1))throw Error("nonce is required parameter");if([...new Set(e.map(t=>f_(t).namespace))].length>1)throw Error("Multi-namespace requests are not supported. Please request single namespace only.");let{namespace:s}=f_(e[0]);if("eip155"!==s)throw Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async(t,e)=>{let r={verified:{verifyUrl:e.verifyUrl||aQ,validation:"UNKNOWN",origin:e.url||""}};try{let i=await this.client.core.verify.resolve({attestationId:t,verifyUrl:e.verifyUrl});i&&(r.verified.origin=i.origin,r.verified.isScam=i.isScam,r.verified.validation=i.origin===new URL(e.url).origin?"VALID":"INVALID")}catch(t){this.client.logger.info(t)}return this.client.logger.info(`Verify context: ${JSON.stringify(r)}`),r},this.validateSessionProps=(t,e)=>{Object.values(t).forEach(t=>{if(!lX(t,!1)){let{message:r}=lJ("MISSING_OR_INVALID",`${e} must be in Record format. Received: ${JSON.stringify(t)}`);throw Error(r)}})},this.getPendingAuthRequest=t=>{let e=this.client.auth.requests.get(t);return"object"==typeof e?e:void 0},this.addToRecentlyDeleted=(t,e)=>{if(this.recentlyDeletedMap.set(t,e),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let t=0,e=this.recentlyDeletedLimit/2;for(let r of this.recentlyDeletedMap.keys()){if(t++>=e)break;this.recentlyDeletedMap.delete(r)}}},this.checkRecentlyDeleted=t=>{let e=this.recentlyDeletedMap.get(t);if(e){let{message:r}=lJ("MISSING_OR_INVALID",`Record was recently deleted - ${e}: ${t}`);throw Error(r)}}}async isInitialized(){if(!this.initialized){let{message:t}=lJ("NOT_INITIALIZED",this.name);throw Error(t)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(aO.message,async t=>{let{topic:e,message:r}=t,{publicKey:i}=this.client.auth.authKeys.keys.includes(cl)?this.client.auth.authKeys.get(cl):{responseTopic:void 0,publicKey:void 0},n=await this.client.core.crypto.decode(e,r,{receiverPublicKey:i});try{(0,om.isJsonRpcRequest)(n)?(this.client.core.history.set(e,n),this.onRelayEventRequest({topic:e,payload:n})):(0,om.isJsonRpcResponse)(n)?(await this.client.core.history.resolve(n),await this.onRelayEventResponse({topic:e,payload:n}),this.client.core.history.delete(e,n.id)):this.onRelayEventUnknownPayload({topic:e,payload:n})}catch(t){this.client.logger.error(t)}})}registerExpirerEvents(){this.client.core.expirer.on(aL.expired,async t=>{let{topic:e,id:r}=function(t){let[e,r]=t.split(":"),i={id:void 0,topic:void 0};if("topic"===e&&"string"==typeof r)i.topic=r;else if("id"===e&&Number.isInteger(Number(r)))i.id=Number(r);else throw Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return i}(t.target);if(r&&this.client.pendingRequest.keys.includes(r))return await this.deletePendingSessionRequest(r,lJ("EXPIRED"),!0);e?this.client.session.keys.includes(e)&&(await this.deleteSession({topic:e,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:e})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r}))})}registerPairingEvents(){this.client.core.pairing.events.on(aF.create,t=>this.onPairingCreated(t)),this.client.core.pairing.events.on(aF.delete,t=>{this.addToRecentlyDeleted(t.topic,"pairing")})}isValidPairingTopic(t){if(!lX(t,!1)){let{message:e}=lJ("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw Error(e)}if(!this.client.core.pairing.pairings.keys.includes(t)){let{message:e}=lJ("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw Error(e)}if(fD(this.client.core.pairing.pairings.get(t).expiry)){let{message:e}=lJ("EXPIRED",`pairing topic: ${t}`);throw Error(e)}}async isValidSessionTopic(t){if(!lX(t,!1)){let{message:e}=lJ("MISSING_OR_INVALID",`session topic should be a string: ${t}`);throw Error(e)}if(this.checkRecentlyDeleted(t),!this.client.session.keys.includes(t)){let{message:e}=lJ("NO_MATCHING_KEY",`session topic doesn't exist: ${t}`);throw Error(e)}if(fD(this.client.session.get(t).expiry)){await this.deleteSession({topic:t});let{message:e}=lJ("EXPIRED",`session topic: ${t}`);throw Error(e)}if(!this.client.core.crypto.keychain.has(t)){let{message:e}=lJ("MISSING_OR_INVALID",`session topic does not exist in keychain: ${t}`);throw await this.deleteSession({topic:t}),Error(e)}}async isValidSessionOrPairingTopic(t){if(this.checkRecentlyDeleted(t),this.client.session.keys.includes(t))await this.isValidSessionTopic(t);else if(this.client.core.pairing.pairings.keys.includes(t))this.isValidPairingTopic(t);else if(lX(t,!1)){let{message:e}=lJ("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${t}`);throw Error(e)}else{let{message:e}=lJ("MISSING_OR_INVALID",`session or pairing topic should be a string: ${t}`);throw Error(e)}}async isValidProposalId(t){if("number"!=typeof t){let{message:e}=lJ("MISSING_OR_INVALID",`proposal id should be a number: ${t}`);throw Error(e)}if(!this.client.proposal.keys.includes(t)){let{message:e}=lJ("NO_MATCHING_KEY",`proposal id doesn't exist: ${t}`);throw Error(e)}if(fD(this.client.proposal.get(t).expiryTimestamp)){await this.deleteProposal(t);let{message:e}=lJ("EXPIRED",`proposal id: ${t}`);throw Error(e)}}}class cx extends fu{constructor(t,e){super(t,e,"proposal",ce),this.core=t,this.logger=e}}class cM extends fu{constructor(t,e){super(t,e,"session",ce),this.core=t,this.logger=e}}class cE extends fu{constructor(t,e){super(t,e,"request",ce,t=>t.id),this.core=t,this.logger=e}}class cI extends fu{constructor(t,e){super(t,e,"authKeys",cu,()=>cl),this.core=t,this.logger=e}}class cS extends fu{constructor(t,e){super(t,e,"pairingTopics",cu),this.core=t,this.logger=e}}class c_ extends fu{constructor(t,e){super(t,e,"requests",cu,t=>t.id),this.core=t,this.logger=e}}class cN{constructor(t,e){this.core=t,this.logger=e,this.authKeys=new cI(this.core,this.logger),this.pairingTopics=new cS(this.core,this.logger),this.requests=new c_(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class cC extends fM{constructor(t){super(t),this.protocol="wc",this.version=2,this.name=cr.name,this.events=new th.EventEmitter,this.on=(t,e)=>this.events.on(t,e),this.once=(t,e)=>this.events.once(t,e),this.off=(t,e)=>this.events.off(t,e),this.removeListener=(t,e)=>this.events.removeListener(t,e),this.removeAllListeners=t=>this.events.removeAllListeners(t),this.connect=async t=>{try{return await this.engine.connect(t)}catch(t){throw this.logger.error(t.message),t}},this.pair=async t=>{try{return await this.engine.pair(t)}catch(t){throw this.logger.error(t.message),t}},this.approve=async t=>{try{return await this.engine.approve(t)}catch(t){throw this.logger.error(t.message),t}},this.reject=async t=>{try{return await this.engine.reject(t)}catch(t){throw this.logger.error(t.message),t}},this.update=async t=>{try{return await this.engine.update(t)}catch(t){throw this.logger.error(t.message),t}},this.extend=async t=>{try{return await this.engine.extend(t)}catch(t){throw this.logger.error(t.message),t}},this.request=async t=>{try{return await this.engine.request(t)}catch(t){throw this.logger.error(t.message),t}},this.respond=async t=>{try{return await this.engine.respond(t)}catch(t){throw this.logger.error(t.message),t}},this.ping=async t=>{try{return await this.engine.ping(t)}catch(t){throw this.logger.error(t.message),t}},this.emit=async t=>{try{return await this.engine.emit(t)}catch(t){throw this.logger.error(t.message),t}},this.disconnect=async t=>{try{return await this.engine.disconnect(t)}catch(t){throw this.logger.error(t.message),t}},this.find=t=>{try{return this.engine.find(t)}catch(t){throw this.logger.error(t.message),t}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(t){throw this.logger.error(t.message),t}},this.authenticate=async t=>{try{return await this.engine.authenticate(t)}catch(t){throw this.logger.error(t.message),t}},this.formatAuthMessage=t=>{try{return this.engine.formatAuthMessage(t)}catch(t){throw this.logger.error(t.message),t}},this.approveSessionAuthenticate=async t=>{try{return await this.engine.approveSessionAuthenticate(t)}catch(t){throw this.logger.error(t.message),t}},this.rejectSessionAuthenticate=async t=>{try{return await this.engine.rejectSessionAuthenticate(t)}catch(t){throw this.logger.error(t.message),t}},this.name=t?.name||cr.name,this.metadata=t?.metadata||(0,td.getWindowMetadata)()||{name:"",description:"",url:"",icons:[""]};let e="u">typeof t?.logger&&"string"!=typeof t?.logger?t.logger:(0,rX.gw)((0,rX.jI)({level:t?.logger||cr.logger}));this.core=t?.core||new fx(t),this.logger=(0,rX.Ep)(e,this.name),this.session=new cM(this.core,this.logger),this.proposal=new cx(this.core,this.logger),this.pendingRequest=new cE(this.core,this.logger),this.engine=new cw(this),this.auth=new cN(this.core,this.logger)}static async init(t){let e=new cC(t);return await e.initialize(),e}get context(){return(0,rX.Fd)(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),await this.auth.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(t){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(t.message),t}}}var cB=r(34155);r(48764).Buffer;function cR(t=[],e=[]){return[...new Set([...t,...e])]}Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var cP="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},cO={exports:{}};T=cO,function(){var t="input is invalid type",e="object"==typeof window,r=e?window:{};r.JS_SHA3_NO_WINDOW&&(e=!1);var i=!e&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof cB&&cB.versions&&cB.versions.node?r=cP:i&&(r=self);var n=!r.JS_SHA3_NO_COMMON_JS&&T.exports,s=!r.JS_SHA3_NO_ARRAY_BUFFER&&"u">typeof ArrayBuffer,o="0123456789abcdef".split(""),a=[4,1024,262144,0x4000000],f=[0,8,16,24],h=[1,0,32898,0,32906,0x80000000,0x80008000,0x80000000,32907,0,0x80000001,0,0x80008081,0x80000000,32777,0x80000000,138,0,136,0,0x80008009,0,0x8000000a,0,0x8000808b,0,139,0x80000000,32905,0x80000000,32771,0x80000000,32770,0x80000000,128,0x80000000,32778,0,0x8000000a,0x80000000,0x80008081,0x80000000,32896,0x80000000,0x80000001,0,0x80008008,0x80000000],u=[224,256,384,512],l=[128,256],c=["hex","buffer","arrayBuffer","array","digest"],d={128:168,256:136};(r.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),s&&(r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var p=function(t,e,r){return function(i){return new C(t,e,t).update(i)[r]()}},g=function(t,e,r){return function(i,n){return new C(t,e,n).update(i)[r]()}},m=function(t,e,r){return function(e,i,n,s){return w["cshake"+t].update(e,i,n,s)[r]()}},v=function(t,e,r){return function(e,i,n,s){return w["kmac"+t].update(e,i,n,s)[r]()}},y=function(t,e,r,i){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function B(t,e,r){C.call(this,t,e,r)}C.prototype.update=function(e){if(this.finalized)throw Error("finalize already called");var r,i=typeof e;if("string"!==i){if("object"===i){if(null===e)throw Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!s||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}for(var n,o,a=this.blocks,h=this.byteCount,u=e.length,l=this.blockCount,c=0,d=this.s;c>2]|=e[c]<>2]|=o<>2]|=(192|o>>6)<=57344?a[n>>2]|=(224|o>>12)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(this.start=n-h,this.block=a[l],n=0;n>=8,r=255&t;r>0;)n.unshift(r),t>>=8,r=255&t,++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},C.prototype.encodeString=function(e){var r,i=typeof e;if("string"!==i){if("object"===i){if(null===e)throw Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!s||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}var n=0,o=e.length;if(r)n=o;else for(var a=0;a=57344?n+=3:(f=65536+((1023&f)<<10|1023&e.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(e),n},C.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];a%e==0&&(R(r),s=0)}return n&&(f+=o[(t=r[s])>>4&15]+o[15&t],n>1&&(f+=o[t>>12&15]+o[t>>8&15]),n>2&&(f+=o[t>>20&15]+o[t>>16&15])),f},C.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,s=0,o=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var f=new Uint32Array(t);o>8&255,f[t+2]=e>>16&255,f[t+3]=e>>24&255;a%r==0&&R(i)}return s&&(t=a<<2,e=i[o],f[t]=255&e,s>1&&(f[t+1]=e>>8&255),s>2&&(f[t+2]=e>>16&255)),f},B.prototype=new C,B.prototype.finalize=function(){return this.encode(this.outputBits,!0),C.prototype.finalize.call(this)};var R=function(t){var e,r,i,n,s,o,a,f,u,l,c,d,p,g,m,v,y,b,A,w,x,M,E,I,S,_,N,C,B,R,P,O,T,D,U,k,q,F,z,L,H,Q,j,K,J,G,Y,V,W,X,Z,$,tt,te,tr,ti,tn,ts,to,ta,tf,th,tu;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],f=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],d=t[8]^t[18]^t[28]^t[38]^t[48],p=t[9]^t[19]^t[29]^t[39]^t[49],e=d^(o<<1|a>>>31),r=p^(a<<1|o>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(f<<1|u>>>31),r=s^(u<<1|f>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=o^(l<<1|c>>>31),r=a^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=f^(d<<1|p>>>31),r=u^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(n<<1|s>>>31),r=c^(s<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,g=t[0],m=t[1],G=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,C=t[20]<<3|t[21]>>>29,B=t[21]<<3|t[20]>>>29,ta=t[31]<<9|t[30]>>>23,tf=t[30]<<9|t[31]>>>23,Q=t[40]<<18|t[41]>>>14,j=t[41]<<18|t[40]>>>14,D=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,V=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,R=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,th=t[42]<<2|t[43]>>>30,tu=t[43]<<2|t[42]>>>30,te=t[5]<<30|t[4]>>>2,tr=t[4]<<30|t[5]>>>2,k=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,O=t[45]<<29|t[44]>>>3,T=t[44]<<29|t[45]>>>3,I=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,ti=t[17]<<23|t[16]>>>9,tn=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,x=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,J=t[9]<<27|t[8]>>>5,_=t[18]<<20|t[19]>>>12,N=t[19]<<20|t[18]>>>12,ts=t[29]<<7|t[28]>>>25,to=t[28]<<7|t[29]>>>25,L=t[38]<<8|t[39]>>>24,H=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=g^~v&b,t[1]=m^~y&A,t[10]=I^~_&C,t[11]=S^~N&B,t[20]=D^~k&F,t[21]=U^~q&z,t[30]=K^~G&V,t[31]=J^~Y&W,t[40]=te^~ti&ts,t[41]=tr^~tn&to,t[2]=v^~b&w,t[3]=y^~A&x,t[12]=_^~C&R,t[13]=N^~B&P,t[22]=k^~F&L,t[23]=q^~z&H,t[32]=G^~V&X,t[33]=Y^~W&Z,t[42]=ti^~ts&ta,t[43]=tn^~to&tf,t[4]=b^~w&M,t[5]=A^~x&E,t[14]=C^~R&O,t[15]=B^~P&T,t[24]=F^~L&Q,t[25]=z^~H&j,t[34]=V^~X&$,t[35]=W^~Z&tt,t[44]=ts^~ta&th,t[45]=to^~tf&tu,t[6]=w^~M&g,t[7]=x^~E&m,t[16]=R^~O&I,t[17]=P^~T&S,t[26]=L^~Q&D,t[27]=H^~j&U,t[36]=X^~$&K,t[37]=Z^~tt&J,t[46]=ta^~th&te,t[47]=tf^~tu&tr,t[8]=M^~g&v,t[9]=E^~m&y,t[18]=O^~I&_,t[19]=T^~S&N,t[28]=Q^~D&k,t[29]=j^~U&q,t[38]=$^~K&G,t[39]=tt^~J&Y,t[48]=th^~te&ti,t[49]=tu^~tr&tn,t[0]^=h[i],t[1]^=h[i+1]};if(n)T.exports=w;else for(M=0;M{try{if("test"!=="test".normalize(e))throw Error("bad normalize")}catch{t.push(e)}}),t.length)throw Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw Error("broken implementation")}catch(t){return t.message}return null}();(D=tn||(tn={})).DEBUG="DEBUG",D.INFO="INFO",D.WARNING="WARNING",D.ERROR="ERROR",D.OFF="OFF",(U=ts||(ts={})).UNKNOWN_ERROR="UNKNOWN_ERROR",U.NOT_IMPLEMENTED="NOT_IMPLEMENTED",U.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",U.NETWORK_ERROR="NETWORK_ERROR",U.SERVER_ERROR="SERVER_ERROR",U.TIMEOUT="TIMEOUT",U.BUFFER_OVERRUN="BUFFER_OVERRUN",U.NUMERIC_FAULT="NUMERIC_FAULT",U.MISSING_NEW="MISSING_NEW",U.INVALID_ARGUMENT="INVALID_ARGUMENT",U.MISSING_ARGUMENT="MISSING_ARGUMENT",U.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",U.CALL_EXCEPTION="CALL_EXCEPTION",U.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",U.NONCE_EXPIRED="NONCE_EXPIRED",U.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",U.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",U.TRANSACTION_REPLACED="TRANSACTION_REPLACED",U.ACTION_REJECTED="ACTION_REJECTED";let cz="0123456789abcdef";class cL{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){let r=t.toLowerCase();null==cU[r]&&this.throwArgumentError("invalid log level name","logLevel",t),ck>cU[r]||console.log.apply(console,e)}debug(...t){this._log(cL.levels.DEBUG,t)}info(...t){this._log(cL.levels.INFO,t)}warn(...t){this._log(cL.levels.WARNING,t)}makeError(t,e,r){if(cD)return this.makeError("censored error",e,{});e||(e=cL.errors.UNKNOWN_ERROR),r||(r={});let i=[];Object.keys(r).forEach(t=>{let e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t>4],r+=cz[15&e[t]];i.push(t+"=Uint8Array(0x"+r+")")}else i.push(t+"="+JSON.stringify(e))}catch{i.push(t+"="+JSON.stringify(r[t].toString()))}}),i.push(`code=${e}`),i.push(`version=${this.version}`);let n=t,s="";switch(e){case ts.NUMERIC_FAULT:{s="NUMERIC_FAULT";let e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":s+="-"+e;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case ts.CALL_EXCEPTION:case ts.INSUFFICIENT_FUNDS:case ts.MISSING_NEW:case ts.NONCE_EXPIRED:case ts.REPLACEMENT_UNDERPRICED:case ts.TRANSACTION_REPLACED:case ts.UNPREDICTABLE_GAS_LIMIT:s=e}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(t+=" ("+i.join(", ")+")");let o=Error(t);return o.reason=n,o.code=e,Object.keys(r).forEach(function(t){o[t]=r[t]}),o}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,cL.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,i){t||this.throwError(e,r,i)}assertArgument(t,e,r,i){t||this.throwArgumentError(e,r,i)}checkNormalize(t){cF&&this.throwError("platform missing String.prototype.normalize",cL.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:cF})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=0x1fffffffffffff)&&this.throwError(e,cL.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,cL.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,cL.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||null==t)&&this.throwError("missing new",cL.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",cL.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||null==t)&&this.throwError("missing new",cL.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return cq||(cq=new cL("logger/5.7.0")),cq}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",cL.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),cT){if(!t)return;this.globalLogger().throwError("error censorship permanent",cL.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}cD=!!t,cT=!!e}static setLogLevel(t){let e=cU[t.toLowerCase()];if(null==e){cL.globalLogger().warn("invalid log level - "+t);return}ck=e}static from(t){return new cL(t)}}cL.errors=ts,cL.levels=tn;let cH=new cL("bytes/5.7.0");function cQ(t){return!!t.toHexString}function cj(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return cj(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function cK(t){return"number"==typeof t&&t==t&&t%1==0}function cJ(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!cK(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function cG(t,e){if(e||(e={}),"number"==typeof t){cH.checkSafeUint53(t,"invalid arrayify value");let e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),cj(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),cQ(t)&&(t=t.toHexString()),cY(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":cH.throwArgumentError("hex data is odd-length","value",t));let i=[];for(let t=0;t>4]+cV[15&i]}return e}return cH.throwArgumentError("invalid hexlify value","value",t)}function cX(t,e){for("string"!=typeof t?t=cW(t):cY(t)||cH.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&cH.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}var cZ={exports:{}},c$=function(t){var e=t.default;if("function"==typeof e){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}),r}(Object.freeze({__proto__:null,default:{}}));!function(t,e){function r(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{u="u">typeof window&&"u">typeof window.Buffer?window.Buffer:c$.Buffer}catch{}function s(t,e){var i=t.charCodeAt(e);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+t)}function o(t,e,r){var i=s(t,r);return r-1>=e&&(i|=s(t,r-1)<<4),i}function a(t,e,i,n){for(var s=0,o=0,a=Math.min(t.length,i),f=e;f=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&o0?t:e},n.min=function(t,e){return 0>t.cmp(e)?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[s]|=o<>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,s++);else if("le"===i)for(n=0,s=0;n>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,s++);return this._strip()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var i=0;i=e;i-=2)n=o(t,e,i)<=18?(s-=18,a+=1,this.words[a]|=n>>>26):s+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(s-=18,a+=1,this.words[a]|=n>>>26):s+=8;this._strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,f=Math.min(s,s-o)+r,h=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"u">typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch{n.prototype.inspect=h}else n.prototype.inspect=h;function h(){return(this.red?""}var u,l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];n.prototype.toString=function(t,e){if(t=t||10,e=0|e||1,16===t||"hex"===t){i="";for(var i,n=0,s=0,o=0;o>>24-n&0xffffff,(n+=2)>=26&&(n-=26,o--),i=0!==s||o!==this.length-1?l[6-f.length]+f+i:f+i}for(0!==s&&(i=s.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],u=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(u).toString(t);i=(p=p.idivn(u)).isZero()?g+i:l[h-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?t+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},u&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(u,t,e)}),n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};n.prototype.toArrayLike=function(t,e,i){this._strip();var n,s,o=this.byteLength(),a=i||Math.max(1,o);r(o<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0");var f=(n=t,s=a,n.allocUnsafe?n.allocUnsafe(s):new n(s));return this["_toArrayLike"+("le"===e?"LE":"BE")](f,o),f},n.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,s=0;n>8&255),r>16&255),6===s?(r>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===s?(r>=0&&(t[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e};function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=0x3ffffff&o,f=o/0x4000000|0;r.words[0]=a;for(var h=1;h>>26,l=0x3ffffff&f,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;n=0|t.words[p],u+=(o=n*(s=0|e.words[d])+l)/0x4000000|0,l=0x3ffffff&o}r.words[h]=0|l,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r._strip()}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i),this._strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),e?this.words[i]=this.words[i]|1<t.length?(r=this,i=t):(r=t,i=this);for(var e,r,i,n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;st.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(e=this,r=t):(e=t,r=this);for(var s=0,o=0;o>26,this.words[o]=0x3ffffff&i;for(;0!==s&&o>26,this.words[o]=0x3ffffff&i;if(0===s&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,m=0|o[2],v=8191&m,y=m>>>13,b=0|o[3],A=8191&b,w=b>>>13,x=0|o[4],M=8191&x,E=x>>>13,I=0|o[5],S=8191&I,_=I>>>13,N=0|o[6],C=8191&N,B=N>>>13,R=0|o[7],P=8191&R,O=R>>>13,T=0|o[8],D=8191&T,U=T>>>13,k=0|o[9],q=8191&k,F=k>>>13,z=0|a[0],L=8191&z,H=z>>>13,Q=0|a[1],j=8191&Q,K=Q>>>13,J=0|a[2],G=8191&J,Y=J>>>13,V=0|a[3],W=8191&V,X=V>>>13,Z=0|a[4],$=8191&Z,tt=Z>>>13,te=0|a[5],tr=8191&te,ti=te>>>13,tn=0|a[6],ts=8191&tn,to=tn>>>13,ta=0|a[7],tf=8191&ta,th=ta>>>13,tu=0|a[8],tl=8191&tu,tc=tu>>>13,td=0|a[9],tp=8191&td,tg=td>>>13;r.negative=t.negative^e.negative,r.length=19,i=Math.imul(l,L),n=(n=Math.imul(l,H))+Math.imul(c,L)|0,s=Math.imul(c,H);var tm=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tm>>>26)|0,tm&=0x3ffffff,i=Math.imul(p,L),n=(n=Math.imul(p,H))+Math.imul(g,L)|0,s=Math.imul(g,H),i=i+Math.imul(l,j)|0,n=(n=n+Math.imul(l,K)|0)+Math.imul(c,j)|0,s=s+Math.imul(c,K)|0;var tv=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tv>>>26)|0,tv&=0x3ffffff,i=Math.imul(v,L),n=(n=Math.imul(v,H))+Math.imul(y,L)|0,s=Math.imul(y,H),i=i+Math.imul(p,j)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(g,j)|0,s=s+Math.imul(g,K)|0,i=i+Math.imul(l,G)|0,n=(n=n+Math.imul(l,Y)|0)+Math.imul(c,G)|0,s=s+Math.imul(c,Y)|0;var ty=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(ty>>>26)|0,ty&=0x3ffffff,i=Math.imul(A,L),n=(n=Math.imul(A,H))+Math.imul(w,L)|0,s=Math.imul(w,H),i=i+Math.imul(v,j)|0,n=(n=n+Math.imul(v,K)|0)+Math.imul(y,j)|0,s=s+Math.imul(y,K)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,G)|0,s=s+Math.imul(g,Y)|0,i=i+Math.imul(l,W)|0,n=(n=n+Math.imul(l,X)|0)+Math.imul(c,W)|0,s=s+Math.imul(c,X)|0;var tb=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tb>>>26)|0,tb&=0x3ffffff,i=Math.imul(M,L),n=(n=Math.imul(M,H))+Math.imul(E,L)|0,s=Math.imul(E,H),i=i+Math.imul(A,j)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(w,j)|0,s=s+Math.imul(w,K)|0,i=i+Math.imul(v,G)|0,n=(n=n+Math.imul(v,Y)|0)+Math.imul(y,G)|0,s=s+Math.imul(y,Y)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,X)|0,i=i+Math.imul(l,$)|0,n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,$)|0,s=s+Math.imul(c,tt)|0;var tA=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tA>>>26)|0,tA&=0x3ffffff,i=Math.imul(S,L),n=(n=Math.imul(S,H))+Math.imul(_,L)|0,s=Math.imul(_,H),i=i+Math.imul(M,j)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(E,j)|0,s=s+Math.imul(E,K)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(w,G)|0,s=s+Math.imul(w,Y)|0,i=i+Math.imul(v,W)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(y,W)|0,s=s+Math.imul(y,X)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,$)|0,s=s+Math.imul(g,tt)|0,i=i+Math.imul(l,tr)|0,n=(n=n+Math.imul(l,ti)|0)+Math.imul(c,tr)|0,s=s+Math.imul(c,ti)|0;var tw=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tw>>>26)|0,tw&=0x3ffffff,i=Math.imul(C,L),n=(n=Math.imul(C,H))+Math.imul(B,L)|0,s=Math.imul(B,H),i=i+Math.imul(S,j)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(_,j)|0,s=s+Math.imul(_,K)|0,i=i+Math.imul(M,G)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(E,G)|0,s=s+Math.imul(E,Y)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(w,W)|0,s=s+Math.imul(w,X)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(y,$)|0,s=s+Math.imul(y,tt)|0,i=i+Math.imul(p,tr)|0,n=(n=n+Math.imul(p,ti)|0)+Math.imul(g,tr)|0,s=s+Math.imul(g,ti)|0,i=i+Math.imul(l,ts)|0,n=(n=n+Math.imul(l,to)|0)+Math.imul(c,ts)|0,s=s+Math.imul(c,to)|0;var tx=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tx>>>26)|0,tx&=0x3ffffff,i=Math.imul(P,L),n=(n=Math.imul(P,H))+Math.imul(O,L)|0,s=Math.imul(O,H),i=i+Math.imul(C,j)|0,n=(n=n+Math.imul(C,K)|0)+Math.imul(B,j)|0,s=s+Math.imul(B,K)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,Y)|0,i=i+Math.imul(M,W)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(E,W)|0,s=s+Math.imul(E,X)|0,i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(w,$)|0,s=s+Math.imul(w,tt)|0,i=i+Math.imul(v,tr)|0,n=(n=n+Math.imul(v,ti)|0)+Math.imul(y,tr)|0,s=s+Math.imul(y,ti)|0,i=i+Math.imul(p,ts)|0,n=(n=n+Math.imul(p,to)|0)+Math.imul(g,ts)|0,s=s+Math.imul(g,to)|0,i=i+Math.imul(l,tf)|0,n=(n=n+Math.imul(l,th)|0)+Math.imul(c,tf)|0,s=s+Math.imul(c,th)|0;var tM=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tM>>>26)|0,tM&=0x3ffffff,i=Math.imul(D,L),n=(n=Math.imul(D,H))+Math.imul(U,L)|0,s=Math.imul(U,H),i=i+Math.imul(P,j)|0,n=(n=n+Math.imul(P,K)|0)+Math.imul(O,j)|0,s=s+Math.imul(O,K)|0,i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(B,G)|0,s=s+Math.imul(B,Y)|0,i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(M,$)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(E,$)|0,s=s+Math.imul(E,tt)|0,i=i+Math.imul(A,tr)|0,n=(n=n+Math.imul(A,ti)|0)+Math.imul(w,tr)|0,s=s+Math.imul(w,ti)|0,i=i+Math.imul(v,ts)|0,n=(n=n+Math.imul(v,to)|0)+Math.imul(y,ts)|0,s=s+Math.imul(y,to)|0,i=i+Math.imul(p,tf)|0,n=(n=n+Math.imul(p,th)|0)+Math.imul(g,tf)|0,s=s+Math.imul(g,th)|0,i=i+Math.imul(l,tl)|0,n=(n=n+Math.imul(l,tc)|0)+Math.imul(c,tl)|0,s=s+Math.imul(c,tc)|0;var tE=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tE>>>26)|0,tE&=0x3ffffff,i=Math.imul(q,L),n=(n=Math.imul(q,H))+Math.imul(F,L)|0,s=Math.imul(F,H),i=i+Math.imul(D,j)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(U,j)|0,s=s+Math.imul(U,K)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(O,G)|0,s=s+Math.imul(O,Y)|0,i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(B,W)|0,s=s+Math.imul(B,X)|0,i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(_,$)|0,s=s+Math.imul(_,tt)|0,i=i+Math.imul(M,tr)|0,n=(n=n+Math.imul(M,ti)|0)+Math.imul(E,tr)|0,s=s+Math.imul(E,ti)|0,i=i+Math.imul(A,ts)|0,n=(n=n+Math.imul(A,to)|0)+Math.imul(w,ts)|0,s=s+Math.imul(w,to)|0,i=i+Math.imul(v,tf)|0,n=(n=n+Math.imul(v,th)|0)+Math.imul(y,tf)|0,s=s+Math.imul(y,th)|0,i=i+Math.imul(p,tl)|0,n=(n=n+Math.imul(p,tc)|0)+Math.imul(g,tl)|0,s=s+Math.imul(g,tc)|0,i=i+Math.imul(l,tp)|0,n=(n=n+Math.imul(l,tg)|0)+Math.imul(c,tp)|0,s=s+Math.imul(c,tg)|0;var tI=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tI>>>26)|0,tI&=0x3ffffff,i=Math.imul(q,j),n=(n=Math.imul(q,K))+Math.imul(F,j)|0,s=Math.imul(F,K),i=i+Math.imul(D,G)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(U,G)|0,s=s+Math.imul(U,Y)|0,i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(O,W)|0,s=s+Math.imul(O,X)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(B,$)|0,s=s+Math.imul(B,tt)|0,i=i+Math.imul(S,tr)|0,n=(n=n+Math.imul(S,ti)|0)+Math.imul(_,tr)|0,s=s+Math.imul(_,ti)|0,i=i+Math.imul(M,ts)|0,n=(n=n+Math.imul(M,to)|0)+Math.imul(E,ts)|0,s=s+Math.imul(E,to)|0,i=i+Math.imul(A,tf)|0,n=(n=n+Math.imul(A,th)|0)+Math.imul(w,tf)|0,s=s+Math.imul(w,th)|0,i=i+Math.imul(v,tl)|0,n=(n=n+Math.imul(v,tc)|0)+Math.imul(y,tl)|0,s=s+Math.imul(y,tc)|0,i=i+Math.imul(p,tp)|0,n=(n=n+Math.imul(p,tg)|0)+Math.imul(g,tp)|0,s=s+Math.imul(g,tg)|0;var tS=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tS>>>26)|0,tS&=0x3ffffff,i=Math.imul(q,G),n=(n=Math.imul(q,Y))+Math.imul(F,G)|0,s=Math.imul(F,Y),i=i+Math.imul(D,W)|0,n=(n=n+Math.imul(D,X)|0)+Math.imul(U,W)|0,s=s+Math.imul(U,X)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(O,$)|0,s=s+Math.imul(O,tt)|0,i=i+Math.imul(C,tr)|0,n=(n=n+Math.imul(C,ti)|0)+Math.imul(B,tr)|0,s=s+Math.imul(B,ti)|0,i=i+Math.imul(S,ts)|0,n=(n=n+Math.imul(S,to)|0)+Math.imul(_,ts)|0,s=s+Math.imul(_,to)|0,i=i+Math.imul(M,tf)|0,n=(n=n+Math.imul(M,th)|0)+Math.imul(E,tf)|0,s=s+Math.imul(E,th)|0,i=i+Math.imul(A,tl)|0,n=(n=n+Math.imul(A,tc)|0)+Math.imul(w,tl)|0,s=s+Math.imul(w,tc)|0,i=i+Math.imul(v,tp)|0,n=(n=n+Math.imul(v,tg)|0)+Math.imul(y,tp)|0,s=s+Math.imul(y,tg)|0;var t_=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(t_>>>26)|0,t_&=0x3ffffff,i=Math.imul(q,W),n=(n=Math.imul(q,X))+Math.imul(F,W)|0,s=Math.imul(F,X),i=i+Math.imul(D,$)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(U,$)|0,s=s+Math.imul(U,tt)|0,i=i+Math.imul(P,tr)|0,n=(n=n+Math.imul(P,ti)|0)+Math.imul(O,tr)|0,s=s+Math.imul(O,ti)|0,i=i+Math.imul(C,ts)|0,n=(n=n+Math.imul(C,to)|0)+Math.imul(B,ts)|0,s=s+Math.imul(B,to)|0,i=i+Math.imul(S,tf)|0,n=(n=n+Math.imul(S,th)|0)+Math.imul(_,tf)|0,s=s+Math.imul(_,th)|0,i=i+Math.imul(M,tl)|0,n=(n=n+Math.imul(M,tc)|0)+Math.imul(E,tl)|0,s=s+Math.imul(E,tc)|0,i=i+Math.imul(A,tp)|0,n=(n=n+Math.imul(A,tg)|0)+Math.imul(w,tp)|0,s=s+Math.imul(w,tg)|0;var tN=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tN>>>26)|0,tN&=0x3ffffff,i=Math.imul(q,$),n=(n=Math.imul(q,tt))+Math.imul(F,$)|0,s=Math.imul(F,tt),i=i+Math.imul(D,tr)|0,n=(n=n+Math.imul(D,ti)|0)+Math.imul(U,tr)|0,s=s+Math.imul(U,ti)|0,i=i+Math.imul(P,ts)|0,n=(n=n+Math.imul(P,to)|0)+Math.imul(O,ts)|0,s=s+Math.imul(O,to)|0,i=i+Math.imul(C,tf)|0,n=(n=n+Math.imul(C,th)|0)+Math.imul(B,tf)|0,s=s+Math.imul(B,th)|0,i=i+Math.imul(S,tl)|0,n=(n=n+Math.imul(S,tc)|0)+Math.imul(_,tl)|0,s=s+Math.imul(_,tc)|0,i=i+Math.imul(M,tp)|0,n=(n=n+Math.imul(M,tg)|0)+Math.imul(E,tp)|0,s=s+Math.imul(E,tg)|0;var tC=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tC>>>26)|0,tC&=0x3ffffff,i=Math.imul(q,tr),n=(n=Math.imul(q,ti))+Math.imul(F,tr)|0,s=Math.imul(F,ti),i=i+Math.imul(D,ts)|0,n=(n=n+Math.imul(D,to)|0)+Math.imul(U,ts)|0,s=s+Math.imul(U,to)|0,i=i+Math.imul(P,tf)|0,n=(n=n+Math.imul(P,th)|0)+Math.imul(O,tf)|0,s=s+Math.imul(O,th)|0,i=i+Math.imul(C,tl)|0,n=(n=n+Math.imul(C,tc)|0)+Math.imul(B,tl)|0,s=s+Math.imul(B,tc)|0,i=i+Math.imul(S,tp)|0,n=(n=n+Math.imul(S,tg)|0)+Math.imul(_,tp)|0,s=s+Math.imul(_,tg)|0;var tB=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tB>>>26)|0,tB&=0x3ffffff,i=Math.imul(q,ts),n=(n=Math.imul(q,to))+Math.imul(F,ts)|0,s=Math.imul(F,to),i=i+Math.imul(D,tf)|0,n=(n=n+Math.imul(D,th)|0)+Math.imul(U,tf)|0,s=s+Math.imul(U,th)|0,i=i+Math.imul(P,tl)|0,n=(n=n+Math.imul(P,tc)|0)+Math.imul(O,tl)|0,s=s+Math.imul(O,tc)|0,i=i+Math.imul(C,tp)|0,n=(n=n+Math.imul(C,tg)|0)+Math.imul(B,tp)|0,s=s+Math.imul(B,tg)|0;var tR=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tR>>>26)|0,tR&=0x3ffffff,i=Math.imul(q,tf),n=(n=Math.imul(q,th))+Math.imul(F,tf)|0,s=Math.imul(F,th),i=i+Math.imul(D,tl)|0,n=(n=n+Math.imul(D,tc)|0)+Math.imul(U,tl)|0,s=s+Math.imul(U,tc)|0,i=i+Math.imul(P,tp)|0,n=(n=n+Math.imul(P,tg)|0)+Math.imul(O,tp)|0,s=s+Math.imul(O,tg)|0;var tP=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tP>>>26)|0,tP&=0x3ffffff,i=Math.imul(q,tl),n=(n=Math.imul(q,tc))+Math.imul(F,tl)|0,s=Math.imul(F,tc),i=i+Math.imul(D,tp)|0,n=(n=n+Math.imul(D,tg)|0)+Math.imul(U,tp)|0,s=s+Math.imul(U,tg)|0;var tO=(h+i|0)+((8191&n)<<13)|0;h=(s+(n>>>13)|0)+(tO>>>26)|0,tO&=0x3ffffff,i=Math.imul(q,tp),n=(n=Math.imul(q,tg))+Math.imul(F,tp)|0,s=Math.imul(F,tg);var tT=(h+i|0)+((8191&n)<<13)|0;return h=(s+(n>>>13)|0)+(tT>>>26)|0,tT&=0x3ffffff,f[0]=tm,f[1]=tv,f[2]=ty,f[3]=tb,f[4]=tA,f[5]=tw,f[6]=tx,f[7]=tM,f[8]=tE,f[9]=tI,f[10]=tS,f[11]=t_,f[12]=tN,f[13]=tC,f[14]=tB,f[15]=tR,f[16]=tP,f[17]=tO,f[18]=tT,0!==h&&(f[19]=h,r.length++),r};function m(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=0x3ffffff}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function v(t,e,r){return m(t,e,r)}Math.imul||(g=p),n.prototype.mulTo=function(t,e){var r,i,n=this.length+t.length;return 10===this.length&&10===t.length?i=g(this,t,e):n<63?i=p(this,t,e):n<1024?i=m(this,t,e):(r=this,i=m(r,t,e)),i},n.prototype.mul=function(t){var e=new n(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e,r=new n(null);return r.words=Array(this.length+t.length),e=this,m(e,t,r)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<0x4000000);for(var i=0,n=0;n>=26,i+=(s/0x4000000|0)+(o>>>26),this.words[n]=0x3ffffff&o}return 0!==i&&(this.words[n]=i,this.length++),e?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i=0);var e,i=t%26,n=(t-i)/26,s=0x3ffffff>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var n,s=t%26,o=Math.min((t-s)/26,this.length),a=0x3ffffff^0x3ffffff>>>s<o)for(this.length-=o,f=0;f=0&&(0!==h||f>=n);f--){var u=0|this.words[f];this.words[f]=h<<26-s|u>>>s,h=u&a}return i&&0!==h&&(i.words[i.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;return!(this.length<=i)&&!!(this.words[i]&1<=0);var e=t%26,i=(t-e)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==e&&i++,this.length=Math.min(i,this.length),0!==e&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>e<=0x4000000;e++)this.words[e]-=0x4000000,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<0x4000000),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(f/0x4000000|0),this.words[n+i]=0x3ffffff&o}for(;n>26,this.words[n+i]=0x3ffffff&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n>26,this.words[n]=0x3ffffff&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(t,e){var r=this.length-t.length,i=this.clone(),s=t,o=0|s.words[s.length-1];0!=(r=26-this._countBits(o))&&(s=s.ushln(r),i.iushln(r),o=0|s.words[s.length-1]);var a,f=i.length-s.length;if("mod"!==e){(a=new n(null)).length=f+1,a.words=Array(a.length);for(var h=0;h=0;l--){var c=(0|i.words[s.length+l])*0x4000000+(0|i.words[s.length+l-1]);for(c=Math.min(c/o|0,0x3ffffff),i._ishlnsubmul(s,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(s,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(t,e,i){var s,o,a;return(r(!t.isZero()),this.isZero())?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(s=a.div.neg()),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:s,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(s=a.div.neg()),{div:s,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||0>this.cmp(t)?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this._wordDiv(t,e)},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var i=0x4000000%t,n=0,s=this.length-1;s>=0;s--)n=(i*n+(0|this.words[s]))%t;return e?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=0x3ffffff);for(var i=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+0x4000000*i;this.words[n]=s/t|0,i=s%t}return this._strip(),e?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var s=new n(1),o=new n(0),a=new n(0),f=new n(1),h=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;!(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(s.isOdd()||o.isOdd())&&(s.iadd(u),o.isub(l)),s.iushrn(1),o.iushrn(1);for(var p=0,g=1;!(i.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||f.isOdd())&&(a.iadd(u),f.isub(l)),a.iushrn(1),f.iushrn(1);e.cmp(i)>=0?(e.isub(i),s.isub(a),o.isub(f)):(i.isub(e),a.isub(s),f.isub(o))}return{a:a,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e,i=this,s=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var o=new n(1),a=new n(0),f=s.clone();i.cmpn(1)>0&&s.cmpn(1)>0;){for(var h=0,u=1;!(i.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(i.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);for(var l=0,c=1;!(s.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(s.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);i.cmp(s)>=0?(i.isub(s),o.isub(a)):(s.isub(i),a.isub(o))}return 0>(e=0===i.cmpn(1)?o:a).cmpn(0)&&e.iadd(t),e},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return(1&this.words[0])==0},n.prototype.isOdd=function(){return(1&this.words[0])==1},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,a&=0x3ffffff,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=0x3ffffff,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return -1===this.cmpn(t)},n.prototype.lt=function(t){return -1===this.cmp(t)},n.prototype.lten=function(t){return 0>=this.cmpn(t)},n.prototype.lte=function(t){return 0>=this.cmp(t)},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new E(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function I(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new n(null);return t.words=Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(A,b),A.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=s}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){var e;if(y[t])return y[t];if("k256"===t)e=new A;else if("p224"===t)e=new w;else if("p192"===t)e=new x;else if("p25519"===t)e=new M;else throw Error("Unknown prime "+t);return y[t]=e,e},E.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){r((t.negative|e.negative)==0,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(f(t,t.umod(this.m)._forceRed(this)),t)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var s=this.m.subn(1),o=0;!s.isZero()&&0===s.andln(1);)o++,s.iushrn(1);r(!s.isZero());var a=new n(1).toRed(this),f=a.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var l=this.pow(u,s),c=this.pow(t,s.addn(1).iushrn(1)),d=this.pow(t,s),p=o;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();r(m=0;i--){for(var h=e.words[i],u=f-1;u>=0;u--){var l=h>>u&1;if(s!==r[0]&&(s=this.sqr(s)),0===l&&0===o){a=0;continue}o<<=1,o|=l,4!=++a&&(0!==i||0!==u)||(s=this.mul(s,r[o]),a=0,o=0)}f=26}return s},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new I(t)},i(I,E),I.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},I.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},I.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},I.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=r.isub(i).iushrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):0>s.cmpn(0)&&(o=s.iadd(this.m)),o._forceRed(this)},I.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(cZ,cP);var c0=cZ.exports;let c1="bignumber/5.7.0";var c2=c0.BN;let c3=new cL(c1),c6={},c8=!1;class c5{constructor(t,e){t!==c6&&c3.throwError("cannot call constructor directly; use BigNumber.from",cL.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return c9(c7(this).fromTwos(t))}toTwos(t){return c9(c7(this).toTwos(t))}abs(){return"-"===this._hex[0]?c5.from(this._hex.substring(1)):this}add(t){return c9(c7(this).add(c7(t)))}sub(t){return c9(c7(this).sub(c7(t)))}div(t){return c5.from(t).isZero()&&dt("division-by-zero","div"),c9(c7(this).div(c7(t)))}mul(t){return c9(c7(this).mul(c7(t)))}mod(t){let e=c7(t);return e.isNeg()&&dt("division-by-zero","mod"),c9(c7(this).umod(e))}pow(t){let e=c7(t);return e.isNeg()&&dt("negative-power","pow"),c9(c7(this).pow(e))}and(t){let e=c7(t);return(this.isNegative()||e.isNeg())&&dt("unbound-bitwise-result","and"),c9(c7(this).and(e))}or(t){let e=c7(t);return(this.isNegative()||e.isNeg())&&dt("unbound-bitwise-result","or"),c9(c7(this).or(e))}xor(t){let e=c7(t);return(this.isNegative()||e.isNeg())&&dt("unbound-bitwise-result","xor"),c9(c7(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&dt("negative-width","mask"),c9(c7(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&dt("negative-width","shl"),c9(c7(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&dt("negative-width","shr"),c9(c7(this).shrn(t))}eq(t){return c7(this).eq(c7(t))}lt(t){return c7(this).lt(c7(t))}lte(t){return c7(this).lte(c7(t))}gt(t){return c7(this).gt(c7(t))}gte(t){return c7(this).gte(c7(t))}isNegative(){return"-"===this._hex[0]}isZero(){return c7(this).isZero()}toNumber(){try{return c7(this).toNumber()}catch{dt("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return c3.throwError("this platform does not support BigInt",cL.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?c8||(c8=!0,c3.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?c3.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",cL.errors.UNEXPECTED_ARGUMENT,{}):c3.throwError("BigNumber.toString does not accept parameters",cL.errors.UNEXPECTED_ARGUMENT,{})),c7(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof c5)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new c5(c6,c4(t)):t.match(/^-?[0-9]+$/)?new c5(c6,c4(new c2(t))):c3.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&dt("underflow","BigNumber.from",t),(t>=0x1fffffffffffff||t<=-0x1fffffffffffff)&&dt("overflow","BigNumber.from",t),c5.from(String(t));if("bigint"==typeof t)return c5.from(t.toString());if(cJ(t))return c5.from(cW(t));if(t){if(t.toHexString){let e=t.toHexString();if("string"==typeof e)return c5.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(cY(e)||"-"===e[0]&&cY(e.substring(1))))return c5.from(e)}}return c3.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function c4(t){if("string"!=typeof t)return c4(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&c3.throwArgumentError("invalid hex","value",t),"0x00"===(t=c4(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function c9(t){return c5.from(c4(t))}function c7(t){let e=c5.from(t).toHexString();return"-"===e[0]?new c2("-"+e.substring(3),16):new c2(e.substring(2),16)}function dt(t,e,r){let i={fault:t,operation:e};return null!=r&&(i.value=r),c3.throwError(t,cL.errors.NUMERIC_FAULT,i)}let de=new cL(c1),dr={},di=c5.from(0),dn=c5.from(-1);function ds(t,e,r,i){let n={fault:e,operation:r};return void 0!==i&&(n.value=i),de.throwError(t,cL.errors.NUMERIC_FAULT,n)}let da="0";for(;da.length<256;)da+=da;function df(t){if("number"!=typeof t)try{t=c5.from(t).toNumber()}catch{}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+da.substring(0,t):de.throwArgumentError("invalid decimal size","decimals",t)}function dh(t,e){null==e&&(e=0);let r=df(e),i=(t=c5.from(t)).lt(di);i&&(t=t.mul(dn));let n=t.mod(r).toString();for(;n.length2&&de.throwArgumentError("too many decimal points","value",t);let s=n[0],o=n[1];for(s||(s="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>r.length-1&&ds("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.lengthnull==t[e]?i:(typeof t[e]!==r&&de.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=n("signed","boolean",e),r=n("width","number",r),i=n("decimals","number",i)}return r%8&&de.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&de.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new dl(dr,e,r,i)}}class dc{constructor(t,e,r,i){t!==dr&&de.throwError("cannot use FixedNumber constructor; use FixedNumber.from",cL.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&de.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);let e=du(this._value,this.format.decimals),r=du(t._value,t.format.decimals);return dc.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);let e=du(this._value,this.format.decimals),r=du(t._value,t.format.decimals);return dc.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);let e=du(this._value,this.format.decimals),r=du(t._value,t.format.decimals);return dc.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);let e=du(this._value,this.format.decimals),r=du(t._value,t.format.decimals);return dc.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=dc.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(dd.toFormat(e.format))),e}ceiling(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=dc.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(dd.toFormat(e.format))),e}round(t){null==t&&(t=0);let e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&de.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;let r=dc.from("1"+da.substring(0,t),this.format),i=dp.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){return null==t?this._hex:(t%8&&de.throwArgumentError("invalid byte width","width",t),cX(c5.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return dc.fromString(this._value,t)}static fromValue(t,e,r){var i;return null!=r||null==e||null!=(i=e)&&(c5.isBigNumber(i)||"number"==typeof i&&i%1==0||"string"==typeof i&&i.match(/^-?[0-9]+$/)||cY(i)||"bigint"==typeof i||cJ(i))||(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),dc.fromString(dh(t,e),dl.from(r))}static fromString(t,e){null==e&&(e="fixed");let r=dl.from(e),i=du(t,r.decimals);!r.signed&&i.lt(di)&&ds("unsigned value cannot be negative","overflow","value",t);let n=null;return n=r.signed?i.toTwos(r.width).toHexString():cX(n=i.toHexString(),r.width/8),new dc(dr,n,dh(i,r.decimals),r)}static fromBytes(t,e){null==e&&(e="fixed");let r=dl.from(e);if(cG(t).length>r.width/8)throw Error("overflow");let i=c5.from(t);r.signed&&(i=i.fromTwos(r.width));let n=i.toTwos((r.signed?0:1)+r.width).toHexString();return new dc(dr,n,dh(i,r.decimals),r)}static from(t,e){if("string"==typeof t)return dc.fromString(t,e);if(cJ(t))return dc.fromBytes(t,e);try{return dc.fromValue(t,0,e)}catch(t){if(t.code!==cL.errors.INVALID_ARGUMENT)throw t}return de.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!!(t&&t._isFixedNumber)}}let dd=dc.from(1),dp=dc.from("0.5"),dg=new cL("strings/5.7.0");(k=to||(to={})).current="",k.NFC="NFC",k.NFD="NFD",k.NFKC="NFKC",k.NFKD="NFKD",(q=ta||(ta={})).UNEXPECTED_CONTINUE="unexpected continuation byte",q.BAD_PREFIX="bad codepoint prefix",q.OVERRUN="string overrun",q.MISSING_CONTINUE="missing continuation byte",q.OUT_OF_RANGE="out of UTF-8 range",q.UTF16_SURROGATE="UTF-16 surrogate",q.OVERLONG="overlong representation";function dm(t,e,r,i,n){if(t===ta.BAD_PREFIX||t===ta.UNEXPECTED_CONTINUE){let t=0;for(let i=e+1;i>6==2;i++)t++;return t}return t===ta.OVERRUN?r.length-e-1:0}Object.freeze({error:function(t,e,r,i,n){return dg.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:dm,replace:function(t,e,r,i,n){return t===ta.OVERLONG?(i.push(n),0):(i.push(65533),dm(t,e,r))}});function dv(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,i={};return t.split(",").forEach(t=>{let n=t.split(":");i[r+=parseInt(n[0],16)]=e(n[1])}),i}function dy(t){let e=0;return t.split(",").map(t=>{let r=t.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:e+parseInt(r[0],16),h:e=parseInt(r[1],16)}})}dy("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),dv("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),dv("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),dv("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",function(t){if(t.length%4!=0)throw Error("bad data");let e=[];for(let r=0;r0&&Array.isArray(t)?n(t,e-1):r.push(t)})};return n(t,e),r}function dw(t,e){let r=Array(t);for(let i=0,n=-1;ie[t]):r}function dM(t,e,r){let i=Array(t).fill(void 0).map(()=>[]);for(let n=0;n>1:i>>1}return r})(t,r).forEach((t,e)=>i[e].push(t));return i}let dE=function(){var t;let e;return t=function(t){let e=0;function r(){return t[e++]<<8|t[e++]}let i=r(),n=1,s=[0,1];for(let t=1;t>--f&1}let l=0x40000000,c=0x20000000,d=0x7fffffff,p=0;for(let t=0;t<31;t++)p=p<<1|u();let g=[],m=0,v=0x80000000;for(;;){let t=Math.floor(((p-m+1)*n-1)/v),e=0,r=i;for(;r-e>1;){let i=e+r>>>1;t>>1|u(),o=o<<1^l,a=(a^l)<<1|l|1;m=o,v=1+a-o}let y=i-4;return g.map(e=>{switch(e-y){case 3:return y+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return y+256+(t[a++]<<8|t[a++]);case 1:return y+t[a++];default:return e-1}})}(function(t){t=atob(t);let e=[];for(let r=0;rt[e++]}();dx(dE),dx(dE),function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(function(t,e){let r=1+e(),i=e(),n=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(r)}return e}(e);return dA(dM(n.length,1+t,e).map((t,e)=>{let s=t[0],o=t.slice(1);return Array(n[e]).fill(void 0).map((t,e)=>{let n=e*i;return[s+e*r,o.map(t=>t+n)]})}))}(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(function(t,e){return dM(1+e(),1+t,e).map(t=>[t[0],t.slice(1)])}(r,t))}(function(t){let e={};for(let r=0;rt-e),function t(){let e=[];for(;;){let r=dx(F,o);if(0==r.length)break;e.push({set:new Set(r),node:t()})}e.sort((t,e)=>e.set.size-t.set.size);let r=F();return{branches:e,valid:r%3,fe0f:!!(1&(r=r/3|0)),save:1==(r>>=1),check:2==r}}(),new cL(db),new Uint8Array(32).fill(0);new cL("rlp/5.7.0"),new cL("address/5.7.0");let dI={};for(let t=0;t<10;t++)dI[String(t)]=String(t);for(let t=0;t<26;t++)dI[String.fromCharCode(65+t)]=String(10+t);z=0x1fffffffffffff,Math.log10;new cL("properties/5.7.0"),new cL(db),new Uint8Array(32).fill(0),c5.from(-1);let dS=c5.from(0),d_=c5.from(1);c5.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),cX(d_.toHexString(),32),cX(dS.toHexString(),32);var dN={},dC={};function dB(t,e){if(!t)throw Error(e||"Assertion failed")}dB.equal=function(t,e,r){if(t!=e)throw Error(r||"Assertion failed: "+t+" != "+e)};var dR={exports:{}};"function"==typeof Object.create?dR.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:dR.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var dP=dR.exports;dC.inherits=dP;dC.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t){if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(t="0"+t),n=0;n>6|192:((s=t,o=n,(64512&s.charCodeAt(o))!=55296||o<0||o+1>=s.length||(64512&s.charCodeAt(o+1))!=56320)?r[i++]=a>>12|224:(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++n)),r[i++]=a>>18|240,r[i++]=a>>12&63|128),r[i++]=a>>6&63|128),r[i++]=63&a|128)}}else for(n=0;n>>24|t>>>8&65280|t<<8&0xff0000|(255&t)<<24)>>>0}dC.toHex=function(t){for(var e="",r=0;r>>0;return o};dC.split32=function(t,e){for(var r=Array(4*t.length),i=0,n=0;i>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r};dC.rotr32=function(t,e){return t>>>e|t<<32-e};dC.rotl32=function(t,e){return t<>>32-e};dC.sum32=function(t,e){return t+e>>>0};dC.sum32_3=function(t,e,r){return t+e+r>>>0};dC.sum32_4=function(t,e,r,i){return t+e+r+i>>>0};dC.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0};dC.sum64=function(t,e,r,i){var n=t[e],s=i+t[e+1]>>>0;t[e]=(s>>0,t[e+1]=s};dC.sum64_hi=function(t,e,r,i){return(e+i>>>0>>0};dC.sum64_lo=function(t,e,r,i){return e+i>>>0};dC.sum64_4_hi=function(t,e,r,i,n,s,o,a){var f,h=e;return f=0+((h=h+i>>>0)>>0)>>0)>>0};dC.sum64_4_lo=function(t,e,r,i,n,s,o,a){return e+i+s+a>>>0};dC.sum64_5_hi=function(t,e,r,i,n,s,o,a,f,h){var u,l=e;return u=0+((l=l+i>>>0)>>0)>>0)>>0)>>0};dC.sum64_5_lo=function(t,e,r,i,n,s,o,a,f,h){return e+i+s+a+h>>>0};dC.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0};dC.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};dC.shr64_hi=function(t,e,r){return t>>>r};dC.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};var dU={};function dk(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}dU.BlockHash=dk,dk.prototype.update=function(t,e){if(t=dC.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=dC.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s>>3};dF.g1_256=function(t){return dz(t,17)^dz(t,19)^t>>>10};var dj=dC.rotl32,dK=dC.sum32,dJ=dC.sum32_5,dG=dF.ft_1,dY=dU.BlockHash,dV=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6];function dW(){if(!(this instanceof dW))return new dW;dY.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.W=Array(80)}dC.inherits(dW,dY);dW.blockSize=512,dW.outSize=160,dW.hmacStrength=80,dW.padLength=64,dW.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;ithis.blockSize&&(t=new this.Hash().update(t).digest()),dB(t.length<=this.blockSize);for(var e=t.length;e>8,o=255&n;s?r.push(s,o):r.push(o)}return r},e.zero2=r,e.toHex=i,e.encode=function(t,e){return"hex"===e?i(t):t}}),pP=pN(function(t,e){e.assert=pC,e.toArray=pR.toArray,e.zero2=pR.zero2,e.toHex=pR.toHex,e.encode=pR.encode;e.getNAF=function(t,e,r){var i=Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-f:f,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i};e.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,s=0;t.cmpn(-n)>0||e.cmpn(-s)>0;){var o,a,f=t.andln(3)+n&3,h=e.andln(3)+s&3;3===f&&(f=-1),3===h&&(h=-1),o=1&f?(3==(i=t.andln(7)+n&7)||5===i)&&2===h?-f:f:0,r[0].push(o),a=1&h?(3==(i=e.andln(7)+s&7)||5===i)&&2===f?-h:h:0,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r};e.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}};e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t};e.intFromLE=function(t){return new c0(t,"hex","le")}}),pO=pP.getNAF,pT=pP.getJSF,pD=pP.assert;function pU(t,e){this.type=t,this.p=new c0(e.p,16),this.red=e.prime?c0.red(e.prime):c0.mont(this.p),this.zero=new c0(0).toRed(this.red),this.one=new c0(1).toRed(this.red),this.two=new c0(2).toRed(this.red),this.n=e.n&&new c0(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function pk(t,e){this.curve=t,this.type=e,this.precomputed=null}pU.prototype.point=function(){throw Error("Not implemented")},pU.prototype.validate=function(){throw Error("Not implemented")},pU.prototype._fixedNafMul=function(t,e){pD(t.precomputed);var r=t._getDoubles(),i=pO(e,1,this._bitLength),n=(1<=s;f--)o=(o<<1)+i[f];a.push(o)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=n;l>0;l--){for(s=0;s=0;a--){for(var f=0;a>=0&&0===s[a];a--)f++;if(a>=0&&f++,o=o.dblp(f),a<0)break;var h=s[a];pD(0!==h),o="affine"===t.type?h>0?o.mixedAdd(n[h-1>>1]):o.mixedAdd(n[-h-1>>1].neg()):h>0?o.add(n[h-1>>1]):o.add(n[-h-1>>1].neg())}return"affine"===t.type?o.toP():o},pU.prototype._wnafMulAdd=function(t,e,r,i,n){var s,o,a,f=this._wnafT1,h=this._wnafT2,u=this._wnafT3,l=0;for(s=0;s=1;s-=2){var d=s-1,p=s;if(1!==f[d]||1!==f[p]){u[d]=pO(r[d],f[d],this._bitLength),u[p]=pO(r[p],f[p],this._bitLength),l=Math.max(u[d].length,l),l=Math.max(u[p].length,l);continue}var g=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(g[1]=e[d].add(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].add(e[p].neg())):(g[1]=e[d].toJ().mixedAdd(e[p]),g[2]=e[d].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=pT(r[d],r[p]);for(l=Math.max(v[0].length,l),u[d]=Array(l),u[p]=Array(l),o=0;o=0;s--){for(var x=0;s>=0;){var M=!0;for(o=0;o=0&&x++,A=A.dblp(x),s<0)break;for(o=0;o0?a=h[o][E-1>>1]:E<0&&(a=h[o][-E-1>>1].neg()),A="affine"===a.type?A.mixedAdd(a):A.add(a))}}for(s=0;s=Math.ceil((t.bitLength()+1)/e.step)},pk.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;nn[0].cmp(n[1])?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new c0(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))?r=s[0]:(r=s[1],pF(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return i=t.basis?t.basis.map(function(t){return{a:new c0(t.a,16),b:new c0(t.b,16)}}):this._getEndoBasis(r),{beta:e,lambda:r,basis:i}}},pz.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:c0.mont(t),r=new c0(2).toRed(e).redInvm(),i=r.redNeg(),n=new c0(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},pz.prototype._getEndoBasis=function(t){for(var e,r,i,n,s,o,a,f,h,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,c=this.n.clone(),d=new c0(1),p=new c0(0),g=new c0(0),m=new c0(1),v=0;0!==l.cmpn(0);){var y=c.div(l);f=c.sub(y.mul(l)),h=g.sub(y.mul(d));var b=m.sub(y.mul(p));if(!i&&0>f.cmp(u))e=a.neg(),r=d,i=f.neg(),n=h;else if(i&&2==++v)break;a=f,c=l,l=f,g=d,d=h,m=p,p=b}s=f.neg(),o=h;var A=i.sqr().add(n.sqr());return s.sqr().add(o.sqr()).cmp(A)>=0&&(s=e,o=r),i.negative&&(i=i.neg(),n=n.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:i,b:n},{a:s,b:o}]},pz.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),f=n.mul(r.b),h=s.mul(i.b);return{k1:t.sub(o).sub(a),k2:f.add(h).neg()}},pz.prototype.pointFromX=function(t,e){(t=new c0(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},pz.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},pz.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s":""},pL.prototype.isInfinity=function(){return this.inf},pL.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t)||0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},pL.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},pL.prototype.getX=function(){return this.x.fromRed()},pL.prototype.getY=function(){return this.y.fromRed()},pL.prototype.mul=function(t){return t=new c0(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},pL.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},pL.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},pL.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},pL.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},pL.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},pq(pH,pU.BasePoint),pz.prototype.jpoint=function(t,e,r){return new pH(this,t,e,r)},pH.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},pH.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},pH.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),f=s.redSub(o);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),u=h.redMul(a),l=i.redMul(h),c=f.redSqr().redIAdd(u).redISub(l).redISub(l),d=f.redMul(l.redISub(c)).redISub(s.redMul(u)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(c,d,p)},pH.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),h=f.redMul(o),u=r.redMul(f),l=a.redSqr().redIAdd(h).redISub(u).redISub(u),c=a.redMul(u.redISub(l)).redISub(n.redMul(h)),d=this.z.redMul(o);return this.curve.jpoint(l,c,d)},pH.prototype.dblp=function(t){if(0===t||this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var e,r=this;for(e=0;e=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},pH.prototype.inspect=function(){return this.isInfinity()?"":""},pH.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var pQ=pN(function(t,e){e.base=pU,e.short=pz,e.mont=null,e.edwards=null}),pj=pN(function(t,e){var r,i=pP.assert;function n(t){"short"===t.type?this.curve=new pQ.short(t):"edwards"===t.type?this.curve=new pQ.edwards(t):this.curve=new pQ.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var i=new n(r);return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:i}),i}})}e.PresetCurve=n,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:dN.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:dN.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:dN.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:dN.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:dN.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:dN.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:dN.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch{r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:dN.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function pK(t){if(!(this instanceof pK))return new pK(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=pR.toArray(t.entropy,t.entropyEnc||"hex"),r=pR.toArray(t.nonce,t.nonceEnc||"hex"),i=pR.toArray(t.pers,t.persEnc||"hex");pC(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}pK.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},pK.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=pR.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length"};var pY=pP.assert;function pV(t,e){if(t instanceof pV)return t;this._importDER(t,e)||(pY(t.r&&t.s,"Signature without r or s"),this.r=new c0(t.r,16),this.s=new c0(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function pW(){this.place=0}function pX(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=e.place;s>>=0;return!(n<=127)&&(e.place=o,n)}function pZ(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}pV.prototype._importDER=function(t,e){t=pP.toArray(t,e);var r=new pW;if(48!==t[r.place++])return!1;var i=pX(t,r);if(!1===i||i+r.place!==t.length||2!==t[r.place++])return!1;var n=pX(t,r);if(!1===n)return!1;var s=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var o=pX(t,r);if(!1===o||t.length!==o+r.place)return!1;var a=t.slice(r.place,o+r.place);if(0===s[0]){if(!(128&s[1]))return!1;else s=s.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;else a=a.slice(1)}return this.r=new c0(s),this.s=new c0(a),this.recoveryParam=null,!0},pV.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=pZ(e),r=pZ(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var i=[2];p$(i,e.length),(i=i.concat(e)).push(2),p$(i,r.length);var n=i.concat(r),s=[48];return p$(s,n.length),s=s.concat(n),pP.encode(s,t)};var p0=function(){throw Error("unsupported")},p1=pP.assert;function p2(t){if(!(this instanceof p2))return new p2(t);"string"==typeof t&&(p1(Object.prototype.hasOwnProperty.call(pj,t),"Unknown curve "+t),t=pj[t]),t instanceof pj.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}p2.prototype.keyPair=function(t){return new pG(this,t)},p2.prototype.keyFromPrivate=function(t,e){return pG.fromPrivate(this,t,e)},p2.prototype.keyFromPublic=function(t,e){return pG.fromPublic(this,t,e)},p2.prototype.genKeyPair=function(t){t||(t={});for(var e=new pK({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||p0(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new c0(2));;){var n=new c0(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},p2.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},p2.prototype.sign=function(t,e,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new c0(t,16));for(var n=this.n.byteLength(),s=e.getPrivate().toArray("be",n),o=t.toArray("be",n),a=new pK({hash:this.hash,entropy:s,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),f=this.n.sub(new c0(1)),h=0;;h++){var u=i.k?i.k(h):new c0(a.generate(this.n.byteLength()));if(!(0>=(u=this._truncateToN(u,!0)).cmpn(1)||u.cmp(f)>=0)){var l=this.g.mul(u);if(!l.isInfinity()){var c=l.getX(),d=c.umod(this.n);if(0!==d.cmpn(0)){var p=u.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(l.getY().isOdd()?1:0)|(0!==c.cmp(d)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new pV({r:d,s:p,recoveryParam:g})}}}}}},p2.prototype.verify=function(t,e,r,i){t=this._truncateToN(new c0(t,16)),r=this.keyFromPublic(r,i);var n=(e=new pV(e,"hex")).r,s=e.s;if(0>n.cmpn(1)||n.cmp(this.n)>=0||0>s.cmpn(1)||s.cmp(this.n)>=0)return!1;var o,a=s.invm(this.n),f=a.mul(t).umod(this.n),h=a.mul(n).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(f,r.getPublic(),h)).isInfinity()&&o.eqXToP(n):!(o=this.g.mulAdd(f,r.getPublic(),h)).isInfinity()&&0===o.getX().umod(this.n).cmp(n)},p2.prototype.recoverPubKey=function(t,e,r,i){p1((3&r)===r,"The recovery param is more than two bits"),e=new pV(e,i);var n=this.n,s=new c0(t),o=e.r,a=e.s,f=1&r,h=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw Error("Unable to find sencond key candinate");o=h?this.curve.pointFromX(o.add(this.curve.n),f):this.curve.pointFromX(o,f);var u=e.r.invm(n),l=n.sub(s).mul(u).umod(n),c=a.mul(u).umod(n);return this.g.mulAdd(l,o,c)},p2.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new pV(e,i)).recoveryParam)return e.recoveryParam;for(var n,s=0;s<4;s++){try{n=this.recoverPubKey(t,e,s)}catch{continue}if(n.eq(r))return s}throw Error("Unable to find valid recovery factor")},pN(function(t,e){e.version="6.5.4",e.utils=pP,e.rand=function(){throw Error("unsupported")},e.curve=pQ,e.curves=pj,e.ec=p2,e.eddsa=null}).ec,new cL("signing-key/5.7.0");function p3(t){return t.includes(":")}function p6(t){return p3(t)?t.split(":")[0]:t}new cL("transactions/5.7.0"),(H=tf||(tf={}))[H.legacy=0]="legacy",H[H.eip2930=1]="eip2930",H[H.eip1559=2]="eip1559",Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;let p8={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}};function p5(t,e){let{message:r,code:i}=p8[t];return{message:e?`${r} ${e}`:r,code:i}}function p4(t,e){return!!Array.isArray(t)&&(!("u">typeof e)||!t.length||t.every(e))}var p9=r("6794");let p7="error",gt="wc@2:universal_provider:",ge="default_chain_changed";var gr="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},gi={exports:{}};!function(t,e){(function(){var r,i="Expected a function",n="__lodash_hash_undefined__",s="__lodash_placeholder__",o=1/0,a=0/0,f=0xfffffffe,h=0x7fffffff,u=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],l="[object Arguments]",c="[object Array]",d="[object Boolean]",p="[object Date]",g="[object Error]",m="[object Function]",v="[object GeneratorFunction]",y="[object Map]",b="[object Number]",A="[object Object]",w="[object Promise]",x="[object RegExp]",M="[object Set]",E="[object String]",I="[object Symbol]",S="[object WeakMap]",_="[object ArrayBuffer]",N="[object DataView]",C="[object Float32Array]",B="[object Float64Array]",R="[object Int8Array]",P="[object Int16Array]",O="[object Int32Array]",T="[object Uint8Array]",D="[object Uint8ClampedArray]",U="[object Uint16Array]",k="[object Uint32Array]",q=/\b__p \+= '';/g,F=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,Q=RegExp(L.source),j=RegExp(H.source),K=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,G=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V=/^\w*$/,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,X=/[\\^$.*+?()[\]{}|]/g,Z=RegExp(X.source),$=/^\s+/,tt=/\s/,te=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,tr=/\{\n\/\* \[wrapped with (.+)\] \*/,ti=/,? & /,tn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ts=/[()=,{}\[\]\/\s]/,to=/\\(\\)?/g,ta=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tf=/\w*$/,th=/^[-+]0x[0-9a-f]+$/i,tu=/^0b[01]+$/i,tl=/^\[object .+?Constructor\]$/,tc=/^0o[0-7]+$/i,td=/^(?:0|[1-9]\d*)$/,tp=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,tg=/($^)/,tm=/['\n\r\u2028\u2029\\]/g,tv="\ud800-\udfff",ty="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",tb="\\u2700-\\u27bf",tA="a-z\\xdf-\\xf6\\xf8-\\xff",tw="A-Z\\xc0-\\xd6\\xd8-\\xde",tx="\\ufe0e\\ufe0f",tM="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",tE="['’]",tI="["+tM+"]",tS="["+ty+"]",t_="["+tA+"]",tN="[^"+tv+tM+"\\d+"+tb+tA+tw+"]",tC="\ud83c[\udffb-\udfff]",tB="[^"+tv+"]",tR="(?:\ud83c[\udde6-\uddff]){2}",tP="[\ud800-\udbff][\udc00-\udfff]",tO="["+tw+"]",tT="\\u200d",tD="(?:"+t_+"|"+tN+")",tU="(?:"+tO+"|"+tN+")",tk="(?:"+tE+"(?:d|ll|m|re|s|t|ve))?",tq="(?:"+tE+"(?:D|LL|M|RE|S|T|VE))?",tF="(?:"+tS+"|"+tC+")?",tz="["+tx+"]?",tL="(?:"+tT+"(?:"+[tB,tR,tP].join("|")+")"+tz+tF+")*",tH=tz+tF+tL,tQ="(?:"+["["+tb+"]",tR,tP].join("|")+")"+tH,tj="(?:"+[tB+tS+"?",tS,tR,tP,"["+tv+"]"].join("|")+")",tK=RegExp(tE,"g"),tJ=RegExp(tS,"g"),tG=RegExp(tC+"(?="+tC+")|"+tj+tH,"g"),tY=RegExp([tO+"?"+t_+"+"+tk+"(?="+[tI,tO,"$"].join("|")+")",tU+"+"+tq+"(?="+[tI,tO+tD,"$"].join("|")+")",tO+"?"+tD+"+"+tk,tO+"+"+tq,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",tQ].join("|"),"g"),tV=RegExp("["+tT+tv+ty+tx+"]"),tW=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tX=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tZ=-1,t$={};t$[C]=t$[B]=t$[R]=t$[P]=t$[O]=t$[T]=t$[D]=t$[U]=t$[k]=!0,t$[l]=t$[c]=t$[_]=t$[d]=t$[N]=t$[p]=t$[g]=t$[m]=t$[y]=t$[b]=t$[A]=t$[x]=t$[M]=t$[E]=t$[S]=!1;var t0={};t0[l]=t0[c]=t0[_]=t0[N]=t0[d]=t0[p]=t0[C]=t0[B]=t0[R]=t0[P]=t0[O]=t0[y]=t0[b]=t0[A]=t0[x]=t0[M]=t0[E]=t0[I]=t0[T]=t0[D]=t0[U]=t0[k]=!0,t0[g]=t0[m]=t0[S]=!1;var t1={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},t2=parseFloat,t3=parseInt,t6="object"==typeof gr&&gr&&gr.Object===Object&&gr,t8="object"==typeof self&&self&&self.Object===Object&&self,t5=t6||t8||Function("return this")(),t4=e&&!e.nodeType&&e,t9=t4&&t&&!t.nodeType&&t,t7=t9&&t9.exports===t4,et=t7&&t6.process,ee=function(){try{return t9&&t9.require&&t9.require("util").types||et&&et.binding&&et.binding("util")}catch{}}(),er=ee&&ee.isArrayBuffer,ei=ee&&ee.isDate,en=ee&&ee.isMap,es=ee&&ee.isRegExp,eo=ee&&ee.isSet,ea=ee&&ee.isTypedArray;function ef(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function eh(t,e,r,i){for(var n=-1,s=null==t?0:t.length;++n-1}function eg(t,e,r){for(var i=-1,n=null==t?0:t.length;++i-1;);return r}function eq(t,e){for(var r=t.length;r--&&eE(e,t[r],0)>-1;);return r}var eF=eC({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),ez=eC({"&":"&","<":"<",">":">",'"':""","'":"'"});function eL(t){return"\\"+t1[t]}function eH(t){return tV.test(t)}function eQ(t){var e=-1,r=Array(t.size);return t.forEach(function(t,i){r[++e]=[i,t]}),r}function ej(t,e){return function(r){return t(e(r))}}function eK(t,e){for(var r=-1,i=t.length,n=0,o=[];++r",""":'"',"'":"'"}),eX=function t(e){var tt,tv,ty,tb,tA=(e=null==e?t5:eX.defaults(t5.Object(),e,eX.pick(t5,tX))).Array,tw=e.Date,tx=e.Error,tM=e.Function,tE=e.Math,tI=e.Object,tS=e.RegExp,t_=e.String,tN=e.TypeError,tC=tA.prototype,tB=tM.prototype,tR=tI.prototype,tP=e["__core-js_shared__"],tO=tB.toString,tT=tR.hasOwnProperty,tD=0,tU=(tt=/[^.]+$/.exec(tP&&tP.keys&&tP.keys.IE_PROTO||""))?"Symbol(src)_1."+tt:"",tk=tR.toString,tq=tO.call(tI),tF=t5._,tz=tS("^"+tO.call(tT).replace(X,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tL=t7?e.Buffer:r,tH=e.Symbol,tQ=e.Uint8Array,tj=tL?tL.allocUnsafe:r,tG=ej(tI.getPrototypeOf,tI),tV=tI.create,t1=tR.propertyIsEnumerable,t6=tC.splice,t8=tH?tH.isConcatSpreadable:r,t4=tH?tH.iterator:r,t9=tH?tH.toStringTag:r,et=function(){try{var t=nx(tI,"defineProperty");return t({},"",{}),t}catch{}}(),ee=e.clearTimeout!==t5.clearTimeout&&e.clearTimeout,ew=tw&&tw.now!==t5.Date.now&&tw.now,eC=e.setTimeout!==t5.setTimeout&&e.setTimeout,eZ=tE.ceil,e$=tE.floor,e0=tI.getOwnPropertySymbols,e1=tL?tL.isBuffer:r,e2=e.isFinite,e3=tC.join,e6=ej(tI.keys,tI),e8=tE.max,e5=tE.min,e4=tw.now,e9=e.parseInt,e7=tE.random,rt=tC.reverse,re=nx(e,"DataView"),rr=nx(e,"Map"),ri=nx(e,"Promise"),rn=nx(e,"Set"),rs=nx(e,"WeakMap"),ro=nx(tI,"create"),ra=rs&&new rs,rf={},rh=nY(re),ru=nY(rr),rl=nY(ri),rc=nY(rn),rd=nY(rs),rp=tH?tH.prototype:r,rg=rp?rp.valueOf:r,rm=rp?rp.toString:r;function rv(t){if(s1(t)&&!sj(t)&&!(t instanceof rw)){if(t instanceof rA)return t;if(tT.call(t,"__wrapped__"))return nV(t)}return new rA(t)}var ry=function(){function t(){}return function(e){if(!s0(e))return{};if(tV)return tV(e);t.prototype=e;var i=new t;return t.prototype=r,i}}();function rb(){}function rA(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function rw(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=0xffffffff,this.__views__=[]}rv.templateSettings={escape:K,evaluate:J,interpolate:G,variable:"",imports:{_:rv}},rv.prototype=rb.prototype,rv.prototype.constructor=rv,rA.prototype=ry(rb.prototype),rA.prototype.constructor=rA;function rx(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1},rM.prototype.set=function(t,e){var r=this.__data__,i=rO(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this};function rI(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new rE;++e=e?t:e)),t}function rF(t,e,i,n,s,o){var a,f=1&e,h=2&e,u=4&e;if(i&&(a=s?i(t,n,s,o):i(t)),a!==r)return a;if(!s0(t))return t;var c=sj(t);if(c){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&tT.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!f)return iW(t,a)}else{var g,w,S=nI(t),q=S==m||S==v;if(sY(t))return ij(t,f);if(S==A||S==l||q&&!s){if(a=h||q?{}:n_(t),!f){;return h?function(t,e){return iX(t,nE(t),e)}(t,(g=a,w=t,g&&iX(w,ox(w),g))):function(t,e){return iX(t,nM(t),e)}(t,rD(a,t))}}else{if(!t0[S])return s?t:{};a=function(t,e,r){var i,n,s,o,a,f=t.constructor;switch(e){case _:return iK(t);case d:case p:return new f(+t);case N:;return i=t,n=r?iK(i.buffer):i.buffer,new i.constructor(n,i.byteOffset,i.byteLength);case C:case B:case R:case P:case O:case T:case D:case U:case k:return iJ(t,r);case y:return new f;case b:case E:return new f(t);case x:;return(o=new(s=t).constructor(s.source,tf.exec(s))).lastIndex=s.lastIndex,o;case M:return new f;case I:;return a=t,rg?tI(rg.call(a)):{}}}(t,S,f)}}o||(o=new rS);var F=o.get(t);if(F)return F;o.set(t,a),s5(t)?t.forEach(function(r){a.add(rF(r,e,i,r,t,o))}):s2(t)&&t.forEach(function(r,n){a.set(n,rF(r,e,i,n,t,o))});var z=u?h?ng:np:h?ox:ow,L=c?r:z(t);return eu(L||t,function(r,n){L&&(r=t[n=r]),rP(a,n,rF(r,e,i,n,t,o))}),a}function rz(t,e,i){var n=i.length;if(null==t)return!n;for(t=tI(t);n--;){var s=i[n],o=e[s],a=t[s];if(a===r&&!(s in t)||!o(a))return!1}return!0}function rL(t,e,n){if("function"!=typeof t)throw new tN(i);return nL(function(){t.apply(r,n)},e)}function rH(t,e,r,i){var n=-1,s=ep,o=!0,a=t.length,f=[],h=e.length;if(!a)return f;r&&(e=em(e,eT(r))),i?(s=eg,o=!1):e.length>=200&&(s=eU,o=!1,e=new rI(e));t:for(;++n0&&r(a)?e>1?rY(a,e-1,r,i,n):ev(n,a):i||(n[n.length]=a)}return n}var rV=i1(),rW=i1(!0);function rX(t,e){return t&&rV(t,e,ow)}function rZ(t,e){return t&&rW(t,e,ow)}function r$(t,e){return ed(e,function(e){return sX(t[e])})}function r0(t,e){e=iL(e,t);for(var i=0,n=e.length;null!=t&&ie}function r6(t,e){return null!=t&&tT.call(t,e)}function r8(t,e){return null!=t&&e in tI(t)}function r5(t,e,i){for(var n=i?eg:ep,s=t[0].length,o=t.length,a=o,f=tA(o),h=1/0,u=[];a--;){var l=t[a];a&&e&&(l=em(l,eT(e))),h=e5(l.length,h),f[a]=!i&&(e||s>=120&&l.length>=120)?new rI(a&&l):r}l=t[0];var c=-1,d=f[0];t:for(;++c=a)return f;return f*("desc"==r[i]?-1:1)}}return t.index-e.index}(t,e,r)})}function id(t,e,r){for(var i=-1,n=e.length,s={};++i-1;)a!==t&&t6.call(a,f,1),t6.call(t,f,1);return t}function ig(t,e){for(var r=t?e.length:0,i=r-1;r--;){var n=e[r];if(r==i||n!==s){var s=n;nC(n)?t6.call(t,n,1):iO(t,n)}}return t}function im(t,e){return t+e$(e7()*(e-t+1))}function iv(t,e){var r="";if(!t||e<1||e>0x1fffffffffffff)return r;do e%2&&(r+=t),(e=e$(e/2))&&(t+=t);while(e);return r}function iy(t,e){return nH(nk(t,e,oG),t+"")}function ib(t){return rN(oB(t))}function iA(t,e){var r=oB(t);return nK(r,rq(e,0,r.length))}function iw(t,e,i,n){if(!s0(t))return t;e=iL(e,t);for(var s=-1,o=e.length,a=o-1,f=t;null!=f&&++sn?0:n+e),(r=r>n?n:r)<0&&(r+=n),n=e>r?0:r-e>>>0,e>>>=0;for(var s=tA(n);++i>>1,o=t[s];null!==o&&!s9(o)&&(r?o<=e:o=200){var h=e?null:no(t);if(h)return eJ(h);o=!1,n=eU,f=new rI}else f=e?[]:a;t:for(;++i=n?t:iI(t,e,i)}var iQ=ee||function(t){return t5.clearTimeout(t)};function ij(t,e){if(e)return t.slice();var r=t.length,i=tj?tj(r):new t.constructor(r);return t.copy(i),i}function iK(t){var e=new t.constructor(t.byteLength);return new tQ(e).set(new tQ(t)),e}function iJ(t,e){var r=e?iK(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function iG(t,e){if(t!==e){var i=t!==r,n=null===t,s=t==t,o=s9(t),a=e!==r,f=null===e,h=e==e,u=s9(e);if(!f&&!u&&!o&&t>e||o&&a&&h&&!f&&!u||n&&a&&h||!i&&h||!s)return 1;if(!n&&!o&&!u&&t1?i[s-1]:r,a=s>2?i[2]:r;for(o=t.length>3&&"function"==typeof o?(s--,o):r,a&&nB(i[0],i[1],a)&&(o=s<3?r:o,s=1),e=tI(e);++n-1?s[o?e[a]:a]:r}}function i5(t){return nd(function(e){var n=e.length,s=n,o=rA.prototype.thru;for(t&&e.reverse();s--;){var a=e[s];if("function"!=typeof a)throw new tN(i);if(o&&!f&&"wrapper"==nv(a))var f=new rA([],!0)}for(s=f?s:n;++s1&&b.reverse(),l&&hf))return!1;var u=o.get(t),l=o.get(e);if(u&&l)return u==e&&l==t;var c=-1,d=!0,p=2&i?new rI:r;for(o.set(t,e),o.set(e,t);++c-1&&t%1==0&&t1?"& ":"")+e[i],e=e.join(r>2?", ":" "),t.replace(te,`{ +/* [wrapped with `+e+`] */ +`)}(n,function(t,e){return eu(u,function(r){var i="_."+r[0];e&r[1]&&!ep(t,i)&&t.push(i)}),t.sort()}((i=n.match(tr))?i[1].split(ti):[],r)))}function nj(t){var e=0,i=0;return function(){var n=e4(),s=16-(n-i);if(i=n,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function nK(t,e){var i=-1,n=t.length,s=n-1;for(e=e===r?n:e;++i1?t[e-1]:r;return i="function"==typeof i?(t.pop(),i):r,ss(t,i)});function sc(t){var e=rv(t);return e.__chain__=!0,e}function sd(t,e){return e(t)}var sp=nd(function(t){var e=t.length,i=e?t[0]:0,n=this.__wrapped__,s=function(e){return rk(e,t)};return!(e>1)&&!this.__actions__.length&&n instanceof rw&&nC(i)?((n=n.slice(i,+i+(e?1:0))).__actions__.push({func:sd,args:[s],thisArg:r}),new rA(n,this.__chain__).thru(function(t){return e&&!t.length&&t.push(r),t})):this.thru(s)}),sg=iZ(function(t,e,r){tT.call(t,r)?++t[r]:rU(t,r,1)}),sm=i8(n$),sv=i8(n0);function sy(t,e){return(sj(t)?eu:rQ)(t,nb(e,3))}function sb(t,e){return(sj(t)?el:rj)(t,nb(e,3))}var sA=iZ(function(t,e,r){tT.call(t,r)?t[r].push(e):rU(t,r,[e])}),sw=iy(function(t,e,r){var i=-1,n="function"==typeof e,s=sJ(t)?tA(t.length):[];return rQ(t,function(t){s[++i]=n?ef(e,t,r):r4(t,e,r)}),s}),sx=iZ(function(t,e,r){rU(t,r,e)});function sM(t,e){return(sj(t)?em:io)(t,nb(e,3))}var sE=iZ(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]}),sI=iy(function(t,e){if(null==t)return[];var r=e.length;return r>1&&nB(t,e[0],e[1])?e=[]:r>2&&nB(e[0],e[1],e[2])&&(e=[e[0]]),ic(t,rY(e,1),[])}),sS=ew||function(){return t5.Date.now()};function s_(t,e,i){return e=i?r:e,e=t&&null==e?t.length:e,nf(t,128,r,r,r,r,e)}function sN(t,e){var n;if("function"!=typeof e)throw new tN(i);return t=on(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=r),n}}var sC=iy(function(t,e,r){var i=1;if(r.length){var n=eK(r,ny(sC));i|=32}return nf(t,i,e,r,n)}),sB=iy(function(t,e,r){var i=3;if(r.length){var n=eK(r,ny(sB));i|=32}return nf(e,i,t,r,n)});function sR(t,e,n){var s,o,a,f,h,u,l=0,c=!1,d=!1,p=!0;if("function"!=typeof t)throw new tN(i);function g(e){var i=s,n=o;return s=o=r,l=e,f=t.apply(n,i)}e=oo(e)||0,s0(n)&&(c=!!n.leading,a=(d="maxWait"in n)?e8(oo(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p);function m(t){var i=t-u,n=t-l;return u===r||i>=e||i<0||d&&n>=a}function v(){var t,r,i,n,s=sS();if(m(s))return y(s);h=nL(v,(r=(t=s)-u,i=t-l,n=e-r,d?e5(n,a-i):n))}function y(t){return h=r,p&&s?g(t):(s=o=r,f)}function b(){var t,i=sS(),n=m(i);if(s=arguments,o=this,u=i,n){if(h===r){;return l=t=u,h=nL(v,e),c?g(t):f}if(d)return iQ(h),h=nL(v,e),g(u)}return h===r&&(h=nL(v,e)),f}return b.cancel=function(){h!==r&&iQ(h),l=0,s=u=o=h=r},b.flush=function(){return h===r?f:y(sS())},b}var sP=iy(function(t,e){return rL(t,1,e)}),sO=iy(function(t,e,r){return rL(t,oo(e)||0,r)});function sT(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new tN(i);var r=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=r.cache;if(s.has(n))return s.get(n);var o=t.apply(this,i);return r.cache=s.set(n,o)||s,o};return r.cache=new(sT.Cache||rE),r}function sD(t){if("function"!=typeof t)throw new tN(i);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}sT.Cache=rE;var sU=iy(function(t,e){var r=(e=1==e.length&&sj(e[0])?em(e[0],eT(nb())):em(rY(e,1),eT(nb()))).length;return iy(function(i){for(var n=-1,s=e5(i.length,r);++n=e}),sQ=r9(function(){return arguments}())?r9:function(t){return s1(t)&&tT.call(t,"callee")&&!t1.call(t,"callee")},sj=tA.isArray,sK=er?eT(er):function(t){return s1(t)&&r2(t)==_};function sJ(t){return null!=t&&s$(t.length)&&!sX(t)}function sG(t){return s1(t)&&sJ(t)}var sY=e1||o5,sV=ei?eT(ei):function(t){return s1(t)&&r2(t)==p};function sW(t){if(!s1(t))return!1;var e=r2(t);return e==g||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!s6(t)}function sX(t){if(!s0(t))return!1;var e=r2(t);return e==m||e==v||"[object AsyncFunction]"==e||"[object Proxy]"==e}function sZ(t){return"number"==typeof t&&t==on(t)}function s$(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=0x1fffffffffffff}function s0(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function s1(t){return null!=t&&"object"==typeof t}var s2=en?eT(en):function(t){return s1(t)&&nI(t)==y};function s3(t){return"number"==typeof t||s1(t)&&r2(t)==b}function s6(t){if(!s1(t)||r2(t)!=A)return!1;var e=tG(t);if(null===e)return!0;var r=tT.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&tO.call(r)==tq}var s8=es?eT(es):function(t){return s1(t)&&r2(t)==x},s5=eo?eT(eo):function(t){return s1(t)&&nI(t)==M};function s4(t){return"string"==typeof t||!sj(t)&&s1(t)&&r2(t)==E}function s9(t){return"symbol"==typeof t||s1(t)&&r2(t)==I}var s7=ea?eT(ea):function(t){return s1(t)&&s$(t.length)&&!!t$[r2(t)]},ot=ni(is),oe=ni(function(t,e){return t<=e});function or(t){if(!t)return[];if(sJ(t))return s4(t)?eY(t):iW(t);if(t4&&t[t4])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[t4]());var e=nI(t);return(e==y?eQ:e==M?eJ:oB)(t)}function oi(t){return t?(t=oo(t))===o||t===-o?(t<0?-1:1)*17976931348623157e292:t==t?t:0:0===t?t:0}function on(t){var e=oi(t),r=e%1;return e==e?r?e-r:e:0}function os(t){return t?rq(on(t),0,0xffffffff):0}function oo(t){if("number"==typeof t)return t;if(s9(t))return a;if(s0(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=s0(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=eO(t);var r=tu.test(t);return r||tc.test(t)?t3(t.slice(2),r?2:8):th.test(t)?a:+t}function oa(t){return iX(t,ox(t))}function of(t){return null==t?"":iR(t)}var oh=i$(function(t,e){if(nT(e)||sJ(e)){iX(e,ow(e),t);return}for(var r in e)tT.call(e,r)&&rP(t,r,e[r])}),ou=i$(function(t,e){iX(e,ox(e),t)}),ol=i$(function(t,e,r,i){iX(e,ox(e),t,i)}),oc=i$(function(t,e,r,i){iX(e,ow(e),t,i)}),od=nd(rk),op=iy(function(t,e){t=tI(t);var i=-1,n=e.length,s=n>2?e[2]:r;for(s&&nB(e[0],e[1],s)&&(n=1);++i1),e}),iX(t,ng(t),r),i&&(r=rF(r,7,nl));for(var n=e.length;n--;)iO(r,e[n]);return r}),oS=nd(function(t,e){var r;return null==t?{}:id(r=t,e,function(t,e){return ov(r,e)})});function o_(t,e){if(null==t)return{};var r=em(ng(t),function(t){return[t]});return e=nb(e),id(t,r,function(t,r){return e(t,r[0])})}var oN=na(ow),oC=na(ox);function oB(t){return null==t?[]:eD(t,ow(t))}var oR=i3(function(t,e,r){return e=e.toLowerCase(),t+(r?oP(e):e)});function oP(t){return oz(of(t).toLowerCase())}function oO(t){return(t=of(t))&&t.replace(tp,eF).replace(tJ,"")}var oT=i3(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),oD=i3(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),oU=i2("toLowerCase"),ok=i3(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}),oq=i3(function(t,e,r){return t+(r?" ":"")+oz(e)}),oF=i3(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),oz=i2("toUpperCase");function oL(t,e,i){var n;return t=of(t),(e=i?r:e)===r?(n=t,tW.test(n))?t.match(tY)||[]:t.match(tn)||[]:t.match(e)||[]}var oH=iy(function(t,e){try{return ef(t,r,e)}catch(t){return sW(t)?t:new tx(t)}}),oQ=nd(function(t,e){return eu(e,function(e){rU(t,e=nG(e),sC(t[e],t))}),t});function oj(t){return function(){return t}}var oK=i5(),oJ=i5(!0);function oG(t){return t}function oY(t){return ir("function"==typeof t?t:rF(t,1))}var oV=iy(function(t,e){return function(r){return r4(r,t,e)}}),oW=iy(function(t,e){return function(r){return r4(t,r,e)}});function oX(t,e,r){var i=ow(e),n=r$(e,i);null!=r||s0(e)&&(n.length||!i.length)||(r=e,e=t,t=this,n=r$(e,ow(e)));var s=!(s0(r)&&"chain"in r)||!!r.chain,o=sX(t);return eu(n,function(r){var i=e[r];t[r]=i,o&&(t.prototype[r]=function(){var e=this.__chain__;if(s||e){var r=t(this.__wrapped__);return(r.__actions__=iW(this.__actions__)).push({func:i,args:arguments,thisArg:t}),r.__chain__=e,r}return i.apply(t,ev([this.value()],arguments))})}),t}function oZ(){}var o$=nt(em),o0=nt(ec),o1=nt(eA);function o2(t){var e;return nR(t)?eN(nG(t)):(e=t,function(t){return r0(t,e)})}var o3=nr(),o6=nr(!0);function o8(){return[]}function o5(){return!1}var o4=i7(function(t,e){return t+e},0),o9=ns("ceil"),o7=i7(function(t,e){return t/e},1),at=ns("floor"),ae=i7(function(t,e){return t*e},1),ar=ns("round"),ai=i7(function(t,e){return t-e},0);return rv.after=function(t,e){if("function"!=typeof e)throw new tN(i);return t=on(t),function(){if(--t<1)return e.apply(this,arguments)}},rv.ary=s_,rv.assign=oh,rv.assignIn=ou,rv.assignInWith=ol,rv.assignWith=oc,rv.at=od,rv.before=sN,rv.bind=sC,rv.bindAll=oQ,rv.bindKey=sB,rv.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return sj(t)?t:[t]},rv.chain=sc,rv.chunk=function(t,e,i){e=(i?nB(t,e,i):e===r)?1:e8(on(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var s=0,o=0,a=tA(eZ(n/e));ss?0:s+i),(n=n===r||n>s?s:on(n))<0&&(n+=s),n=i>n?0:os(n);i>>0)?(t=of(t))&&("string"==typeof e||null!=e&&!s8(e))&&!(e=iR(e))&&eH(t)?iH(eY(t),0,i):t.split(e,i):[]},rv.spread=function(t,e){if("function"!=typeof t)throw new tN(i);return e=null==e?0:e8(on(e),0),iy(function(r){var i=r[e],n=iH(r,0,e);return i&&ev(n,i),ef(t,this,n)})},rv.tail=function(t){var e=null==t?0:t.length;return e?iI(t,1,e):[]},rv.take=function(t,e,i){return t&&t.length?iI(t,0,(e=i||e===r?1:on(e))<0?0:e):[]},rv.takeRight=function(t,e,i){var n=null==t?0:t.length;return n?iI(t,(e=n-(e=i||e===r?1:on(e)))<0?0:e,n):[]},rv.takeRightWhile=function(t,e){return t&&t.length?iD(t,nb(e,3),!1,!0):[]},rv.takeWhile=function(t,e){return t&&t.length?iD(t,nb(e,3)):[]},rv.tap=function(t,e){return e(t),t},rv.throttle=function(t,e,r){var n=!0,s=!0;if("function"!=typeof t)throw new tN(i);return s0(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),sR(t,e,{leading:n,maxWait:e,trailing:s})},rv.thru=sd,rv.toArray=or,rv.toPairs=oN,rv.toPairsIn=oC,rv.toPath=function(t){return sj(t)?em(t,nG):s9(t)?[t]:iW(nJ(of(t)))},rv.toPlainObject=oa,rv.transform=function(t,e,r){var i=sj(t),n=i||sY(t)||s7(t);if(e=nb(e,4),null==r){var s=t&&t.constructor;r=n?i?new s:[]:s0(t)?sX(s)?ry(tG(t)):{}:{}}return(n?eu:rX)(t,function(t,i,n){return e(r,t,i,n)}),r},rv.unary=function(t){return s_(t,1)},rv.union=se,rv.unionBy=sr,rv.unionWith=si,rv.uniq=function(t){return t&&t.length?iP(t):[]},rv.uniqBy=function(t,e){return t&&t.length?iP(t,nb(e,2)):[]},rv.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?iP(t,r,e):[]},rv.unset=function(t,e){return null==t||iO(t,e)},rv.unzip=sn,rv.unzipWith=ss,rv.update=function(t,e,r){return null==t?t:iT(t,e,iz(r))},rv.updateWith=function(t,e,i,n){return n="function"==typeof n?n:r,null==t?t:iT(t,e,iz(i),n)},rv.values=oB,rv.valuesIn=function(t){return null==t?[]:eD(t,ox(t))},rv.without=so,rv.words=oL,rv.wrap=function(t,e){return sk(iz(e),t)},rv.xor=sa,rv.xorBy=sf,rv.xorWith=sh,rv.zip=su,rv.zipObject=function(t,e){return iq(t||[],e||[],rP)},rv.zipObjectDeep=function(t,e){return iq(t||[],e||[],iw)},rv.zipWith=sl,rv.entries=oN,rv.entriesIn=oC,rv.extend=ou,rv.extendWith=ol,oX(rv,rv),rv.add=o4,rv.attempt=oH,rv.camelCase=oR,rv.capitalize=oP,rv.ceil=o9,rv.clamp=function(t,e,i){return i===r&&(i=e,e=r),i!==r&&(i=(i=oo(i))==i?i:0),e!==r&&(e=(e=oo(e))==e?e:0),rq(oo(t),e,i)},rv.clone=function(t){return rF(t,4)},rv.cloneDeep=function(t){return rF(t,5)},rv.cloneDeepWith=function(t,e){return rF(t,5,e="function"==typeof e?e:r)},rv.cloneWith=function(t,e){return rF(t,4,e="function"==typeof e?e:r)},rv.conformsTo=function(t,e){return null==e||rz(t,e,ow(e))},rv.deburr=oO,rv.defaultTo=function(t,e){return null==t||t!=t?e:t},rv.divide=o7,rv.endsWith=function(t,e,i){t=of(t),e=iR(e);var n=t.length,s=i=i===r?n:rq(on(i),0,n);return(i-=e.length)>=0&&t.slice(i,s)==e},rv.eq=sz,rv.escape=function(t){return(t=of(t))&&j.test(t)?t.replace(H,ez):t},rv.escapeRegExp=function(t){return(t=of(t))&&Z.test(t)?t.replace(X,"\\$&"):t},rv.every=function(t,e,i){var n=sj(t)?ec:rK;return i&&nB(t,e,i)&&(e=r),n(t,nb(e,3))},rv.find=sm,rv.findIndex=n$,rv.findKey=function(t,e){return ex(t,nb(e,3),rX)},rv.findLast=sv,rv.findLastIndex=n0,rv.findLastKey=function(t,e){return ex(t,nb(e,3),rZ)},rv.floor=at,rv.forEach=sy,rv.forEachRight=sb,rv.forIn=function(t,e){return null==t?t:rV(t,nb(e,3),ox)},rv.forInRight=function(t,e){return null==t?t:rW(t,nb(e,3),ox)},rv.forOwn=function(t,e){return t&&rX(t,nb(e,3))},rv.forOwnRight=function(t,e){return t&&rZ(t,nb(e,3))},rv.get=om,rv.gt=sL,rv.gte=sH,rv.has=function(t,e){return null!=t&&nS(t,e,r6)},rv.hasIn=ov,rv.head=n2,rv.identity=oG,rv.includes=function(t,e,r,i){t=sJ(t)?t:oB(t),r=r&&!i?on(r):0;var n=t.length;return r<0&&(r=e8(n+r,0)),s4(t)?r<=n&&t.indexOf(e,r)>-1:!!n&&eE(t,e,r)>-1},rv.indexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return -1;var n=null==r?0:on(r);return n<0&&(n=e8(i+n,0)),eE(t,e,n)},rv.inRange=function(t,e,i){var n,s,o;return e=oi(e),i===r?(i=e,e=0):i=oi(i),(n=t=oo(t))>=e5(s=e,o=i)&&n=-0x1fffffffffffff&&t<=0x1fffffffffffff},rv.isSet=s5,rv.isString=s4,rv.isSymbol=s9,rv.isTypedArray=s7,rv.isUndefined=function(t){return t===r},rv.isWeakMap=function(t){return s1(t)&&nI(t)==S},rv.isWeakSet=function(t){return s1(t)&&"[object WeakSet]"==r2(t)},rv.join=function(t,e){return null==t?"":e3.call(t,e)},rv.kebabCase=oT,rv.last=n5,rv.lastIndexOf=function(t,e,i){var n=null==t?0:t.length;if(!n)return -1;var s=n;return i!==r&&(s=(s=on(i))<0?e8(n+s,0):e5(s,n-1)),e==e?function(t,e,r){for(var i=r+1;i--&&t[i]!==e;);return i}(t,e,s):eM(t,eS,s,!0)},rv.lowerCase=oD,rv.lowerFirst=oU,rv.lt=ot,rv.lte=oe,rv.max=function(t){return t&&t.length?rJ(t,oG,r3):r},rv.maxBy=function(t,e){return t&&t.length?rJ(t,nb(e,2),r3):r},rv.mean=function(t){return e_(t,oG)},rv.meanBy=function(t,e){return e_(t,nb(e,2))},rv.min=function(t){return t&&t.length?rJ(t,oG,is):r},rv.minBy=function(t,e){return t&&t.length?rJ(t,nb(e,2),is):r},rv.stubArray=o8,rv.stubFalse=o5,rv.stubObject=function(){return{}},rv.stubString=function(){return""},rv.stubTrue=function(){return!0},rv.multiply=ae,rv.nth=function(t,e){return t&&t.length?il(t,on(e)):r},rv.noConflict=function(){return t5._===this&&(t5._=tF),this},rv.noop=oZ,rv.now=sS,rv.pad=function(t,e,r){t=of(t);var i=(e=on(e))?eG(t):0;if(!e||i>=e)return t;var n=(e-i)/2;return ne(e$(n),r)+t+ne(eZ(n),r)},rv.padEnd=function(t,e,r){t=of(t);var i=(e=on(e))?eG(t):0;return e&&ie){var n=t;t=e,e=n}if(i||t%1||e%1){var s=e7();return e5(t+s*(e-t+t2("1e-"+((s+"").length-1))),e)}return im(t,e)},rv.reduce=function(t,e,r){var i=sj(t)?ey:eB,n=arguments.length<3;return i(t,nb(e,4),r,n,rQ)},rv.reduceRight=function(t,e,r){var i=sj(t)?eb:eB,n=arguments.length<3;return i(t,nb(e,4),r,n,rj)},rv.repeat=function(t,e,i){return e=(i?nB(t,e,i):e===r)?1:on(e),iv(of(t),e)},rv.replace=function(){var t=arguments,e=of(t[0]);return t.length<3?e:e.replace(t[1],t[2])},rv.result=function(t,e,i){e=iL(e,t);var n=-1,s=e.length;for(s||(s=1,t=r);++n0x1fffffffffffff)return[];var r=0xffffffff,i=e5(t,0xffffffff);e=nb(e),t-=0xffffffff;for(var n=eP(i,e);++r=o)return t;var f=i-eG(n);if(f<1)return n;var h=a?iH(a,0,f).join(""):t.slice(0,f);if(s===r)return h+n;if(a&&(f+=h.length-f),s8(s)){if(t.slice(f).search(s)){var u,l=h;for(s.global||(s=tS(s.source,of(tf.exec(s))+"g")),s.lastIndex=0;u=s.exec(l);)var c=u.index;h=h.slice(0,c===r?f:c)}}else if(t.indexOf(iR(s),f)!=f){var d=h.lastIndexOf(s);d>-1&&(h=h.slice(0,d))}return h+n},rv.unescape=function(t){return(t=of(t))&&Q.test(t)?t.replace(L,eW):t},rv.uniqueId=function(t){var e=++tD;return of(t)+e},rv.upperCase=oF,rv.upperFirst=oz,rv.each=sy,rv.eachRight=sb,rv.first=n2,oX(rv,(tb={},rX(rv,function(t,e){tT.call(rv.prototype,e)||(tb[e]=t)}),tb),{chain:!1}),rv.VERSION="4.17.21",eu(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){rv[t].placeholder=rv}),eu(["drop","take"],function(t,e){rw.prototype[t]=function(i){i=i===r?1:e8(on(i),0);var n=this.__filtered__&&!e?new rw(this):this.clone();return n.__filtered__?n.__takeCount__=e5(i,n.__takeCount__):n.__views__.push({size:e5(i,0xffffffff),type:t+(n.__dir__<0?"Right":"")}),n},rw.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),eu(["filter","map","takeWhile"],function(t,e){var r=e+1,i=1==r||3==r;rw.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:nb(t,3),type:r}),e.__filtered__=e.__filtered__||i,e}}),eu(["head","last"],function(t,e){var r="take"+(e?"Right":"");rw.prototype[t]=function(){return this[r](1).value()[0]}}),eu(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");rw.prototype[t]=function(){return this.__filtered__?new rw(this):this[r](1)}}),rw.prototype.compact=function(){return this.filter(oG)},rw.prototype.find=function(t){return this.filter(t).head()},rw.prototype.findLast=function(t){return this.reverse().find(t)},rw.prototype.invokeMap=iy(function(t,e){return"function"==typeof t?new rw(this):this.map(function(r){return r4(r,t,e)})}),rw.prototype.reject=function(t){return this.filter(sD(nb(t)))},rw.prototype.slice=function(t,e){t=on(t);var i=this;return i.__filtered__&&(t>0||e<0)?new rw(i):(t<0?i=i.takeRight(-t):t&&(i=i.drop(t)),e!==r&&(i=(e=on(e))<0?i.dropRight(-e):i.take(e-t)),i)},rw.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},rw.prototype.toArray=function(){return this.take(0xffffffff)},rX(rw.prototype,function(t,e){var i=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),s=rv[n?"take"+("last"==e?"Right":""):e],o=n||/^find/.test(e);s&&(rv.prototype[e]=function(){var e=this.__wrapped__,a=n?[1]:arguments,f=e instanceof rw,h=a[0],u=f||sj(e),l=function(t){var e=s.apply(rv,ev([t],a));return n&&c?e[0]:e};u&&i&&"function"==typeof h&&1!=h.length&&(f=u=!1);var c=this.__chain__,d=!!this.__actions__.length,p=o&&!c,g=f&&!d;if(!o&&u){e=g?e:new rw(this);var m=t.apply(e,a);return m.__actions__.push({func:sd,args:[l],thisArg:r}),new rA(m,c)}return p&&g?t.apply(this,a):(m=this.thru(l),p?n?m.value()[0]:m.value():m)})}),eu(["pop","push","shift","sort","splice","unshift"],function(t){var e=tC[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);rv.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var n=this.value();return e.apply(sj(n)?n:[],t)}return this[r](function(r){return e.apply(sj(r)?r:[],t)})}}),rX(rw.prototype,function(t,e){var r=rv[e];if(r){var i=r.name+"";tT.call(rf,i)||(rf[i]=[]),rf[i].push({name:e,func:r})}}),rf[i4(r,2).name]=[{name:"wrapper",func:r}],rw.prototype.clone=function(){var t=new rw(this.__wrapped__);return t.__actions__=iW(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=iW(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=iW(this.__views__),t},rw.prototype.reverse=function(){if(this.__filtered__){var t=new rw(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t},rw.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=sj(t),i=e<0,n=r?t.length:0,s=function(t,e,r){for(var i=-1,n=r.length;++i=this.__values__.length,e=t?r:this.__values__[this.__index__++];return{done:t,value:e}},rv.prototype.plant=function(t){for(var e,i=this;i instanceof rb;){var n=nV(i);n.__index__=0,n.__values__=r,e?s.__wrapped__=n:e=n;var s=n;i=i.__wrapped__}return s.__wrapped__=t,e},rv.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof rw){var e=t;return this.__actions__.length&&(e=new rw(this)),(e=e.reverse()).__actions__.push({func:sd,args:[st],thisArg:r}),new rA(e,this.__chain__)}return this.thru(st)},rv.prototype.toJSON=rv.prototype.valueOf=rv.prototype.value=function(){return iU(this.__wrapped__,this.__actions__)},rv.prototype.first=rv.prototype.head,t4&&(rv.prototype[t4]=function(){return this}),rv}();t9?((t9.exports=eX)._=eX,t4._=eX):t5._=eX}).call(gr)}(gi,gi.exports);var gn=Object.defineProperty,gs=Object.defineProperties,go=Object.getOwnPropertyDescriptors,ga=Object.getOwnPropertySymbols,gf=Object.prototype.hasOwnProperty,gh=Object.prototype.propertyIsEnumerable,gu=(t,e,r)=>e in t?gn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gl=(t,e)=>{for(var r in e||(e={}))gf.call(e,r)&&gu(t,r,e[r]);if(ga)for(var r of ga(e))gh.call(e,r)&&gu(t,r,e[r]);return t},gc=(t,e)=>gs(t,go(e));function gd(t,e,r){var i;let n=function(t){let[e,r]=t.split(":");return{namespace:e,reference:r}}(t);return(null==(i=e.rpcMap)?void 0:i[n.reference])||`https://rpc.walletconnect.com/v1/?chainId=${n.namespace}:${n.reference}&projectId=${r}`}function gp(t){return t.includes(":")?t.split(":")[1]:t}function gg(t){return t.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function gm(t={},e={}){let r=gv(t),i=gv(e);return gi.exports.merge(r,i)}function gv(t){var e,r,i,n,s;let o={};if(!(Object.getPrototypeOf(s=t)===Object.prototype&&Object.keys(s).length))return o;for(let[s,a]of Object.entries(t)){let t=p3(s)?[s]:a.chains,f=a.methods||[],h=a.events||[],u=a.rpcMap||{},l=p6(s);o[l]=gc(gl(gl({},o[l]),a),{chains:cR(t,null==(e=o[l])?void 0:e.chains),methods:cR(f,null==(r=o[l])?void 0:r.methods),events:cR(h,null==(i=o[l])?void 0:i.events),rpcMap:gl(gl({},u),null==(n=o[l])?void 0:n.rpcMap)})}return o}function gy(t){return t.includes(":")?t.split(":")[2]:t}function gb(t){let e={};for(let[r,i]of Object.entries(t)){let t=i.methods||[],n=i.events||[],s=i.accounts||[],o=p3(r)?[r]:i.chains?i.chains:gg(i.accounts);e[r]={chains:o,methods:t,events:n,accounts:s}}return e}function gA(t){return"number"==typeof t?t:t.includes("0x")?parseInt(t,16):isNaN(Number(t=t.includes(":")?t.split(":")[1]:t))?t:Number(t)}let gw={},gx=t=>gw[t],gM=(t,e)=>{gw[t]=e};class gE{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=gx("events"),this.client=gx("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let t=this.namespace.chains[0];if(!t)throw Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(ge,`${this.name}:${t}`)}getAccounts(){let t=this.namespace.accounts;return t&&t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]}createHttpProviders(){let t={};return this.namespace.chains.forEach(e=>{var r;let i=gp(e);t[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[e])}),t}getHttpProvider(){let t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){let r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){let r=e||gd(t,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${t}`);return new og.r(new p9.Z(r,gx("disableProviderPing")))}}class gI{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=gx("events"),this.client=gx("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(parseInt(t),e),this.chainId=parseInt(t),this.events.emit(ge,`${this.name}:${t}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;let t=this.namespace.chains[0];if(!t)throw Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,e){let r=e||gd(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${t}`);return new og.r(new p9.k(r,gx("disableProviderPing")))}setHttpProvider(t,e){let r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProviders(){let t={};return this.namespace.chains.forEach(e=>{var r;let i=parseInt(gp(e));t[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[e])}),t}getAccounts(){let t=this.namespace.accounts;return t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){let t=this.chainId,e=this.httpProviders[t];if(typeof e>"u")throw Error(`JSON-RPC provider for ${t} not found`);return e}async handleSwitchChain(t){var e,r;let i=t.request.params?null==(e=t.request.params[0])?void 0:e.chainId:"0x0",n=parseInt(i=i.startsWith("0x")?i:`0x${i}`,16);if(this.isChainApproved(n))this.setDefaultChain(`${n}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:i}]},chainId:null==(r=this.namespace.chains)?void 0:r[0]}),this.setDefaultChain(`${n}`);else throw Error(`Failed to switch to chain 'eip155:${n}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}}class gS{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=gx("events"),this.client=gx("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(ge,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let t=this.namespace.chains[0];if(!t)throw Error("ChainId not found");return t.split(":")[1]}getAccounts(){let t=this.namespace.accounts;return t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){let t={};return this.namespace.chains.forEach(e=>{var r;let i=gp(e);t[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[e])}),t}getHttpProvider(){let t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){let r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){let r=e||gd(t,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${t}`);return new og.r(new p9.Z(r,gx("disableProviderPing")))}}class g_{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=gx("events"),this.client=gx("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let t=this.namespace.chains[0];if(!t)throw Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(ge,`${this.name}:${this.chainId}`)}getAccounts(){let t=this.namespace.accounts;return t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){let t={};return this.namespace.chains.forEach(e=>{var r;let i=gp(e);t[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[e])}),t}getHttpProvider(){let t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){let r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){let r=e||gd(t,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${t}`);return new og.r(new p9.Z(r,gx("disableProviderPing")))}}class gN{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=gx("events"),this.client=gx("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let t=this.namespace.chains[0];if(!t)throw Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(ge,`${this.name}:${this.chainId}`)}getAccounts(){let t=this.namespace.accounts;return t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){let t={};return this.namespace.chains.forEach(e=>{let r=this.getCardanoRPCUrl(e),i=gp(e);t[i]=this.createHttpProvider(i,r)}),t}getHttpProvider(){let t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw Error(`JSON-RPC provider for ${t} not found`);return e}getCardanoRPCUrl(t){let e=this.namespace.rpcMap;if(e)return e[t]}setHttpProvider(t,e){let r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){let r=e||this.getCardanoRPCUrl(t);if(!r)throw Error(`No RPC url provided for chainId: ${t}`);return new og.r(new p9.Z(r,gx("disableProviderPing")))}}class gC{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=gx("events"),this.client=gx("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(ge,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let t=this.namespace.chains[0];if(!t)throw Error("ChainId not found");return t.split(":")[1]}getAccounts(){let t=this.namespace.accounts;return t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){let t={};return this.namespace.chains.forEach(e=>{var r;let i=gp(e);t[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[e])}),t}getHttpProvider(){let t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){let r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){let r=e||gd(t,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${t}`);return new og.r(new p9.Z(r,gx("disableProviderPing")))}}class gB{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=gx("events"),this.client=gx("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(ge,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let t=this.namespace.chains[0];if(!t)throw Error("ChainId not found");return t.split(":")[1]}getAccounts(){let t=this.namespace.accounts;return t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){let t={};return this.namespace.chains.forEach(e=>{var r;let i=gp(e);t[i]=this.createHttpProvider(i,null==(r=this.namespace.rpcMap)?void 0:r[e])}),t}getHttpProvider(){let t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){let r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){let r=e||gd(t,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${t}`);return new og.r(new p9.Z(r,gx("disableProviderPing")))}}class gR{constructor(t){this.name="near",this.namespace=t.namespace,this.events=gx("events"),this.client=gx("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let t=this.namespace.chains[0];if(!t)throw Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){if(this.chainId=t,!this.httpProviders[t]){let r=e||gd(`${this.name}:${t}`,this.namespace);if(!r)throw Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,r)}this.events.emit(ge,`${this.name}:${this.chainId}`)}getAccounts(){let t=this.namespace.accounts;return t&&t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]}createHttpProviders(){let t={};return this.namespace.chains.forEach(e=>{var r;t[e]=this.createHttpProvider(e,null==(r=this.namespace.rpcMap)?void 0:r[e])}),t}getHttpProvider(){let t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){let r=this.createHttpProvider(t,e);r&&(this.httpProviders[t]=r)}createHttpProvider(t,e){let r=e||gd(t,this.namespace);return typeof r>"u"?void 0:new og.r(new p9.Z(r,gx("disableProviderPing")))}}var gP=Object.defineProperty,gO=Object.defineProperties,gT=Object.getOwnPropertyDescriptors,gD=Object.getOwnPropertySymbols,gU=Object.prototype.hasOwnProperty,gk=Object.prototype.propertyIsEnumerable,gq=(t,e,r)=>e in t?gP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gF=(t,e)=>{for(var r in e||(e={}))gU.call(e,r)&&gq(t,r,e[r]);if(gD)for(var r of gD(e))gk.call(e,r)&&gq(t,r,e[r]);return t},gz=(t,e)=>gO(t,gT(e));class gL{constructor(t){this.events=new(tu()),this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger="u">typeof t?.logger&&"string"!=typeof t?.logger?t.logger:(0,rX.gw)((0,rX.jI)({level:t?.logger||p7})),this.disableProviderPing=t?.disableProviderPing||!1}static async init(t){let e=new gL(t);return await e.initialize(),e}async request(t,e,r){let[i,n]=this.validateChain(e);if(!this.session)throw Error("Please call connect() before request()");return await this.getProvider(i).request({request:gF({},t),chainId:`${i}:${n}`,topic:this.session.topic,expiry:r})}sendAsync(t,e,r,i){let n=new Date().getTime();this.request(t,r,i).then(t=>e(null,(0,om.formatJsonRpcResult)(n,t))).catch(t=>e(t,void 0))}async enable(){if(!this.client)throw Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(t=this.session)?void 0:t.topic,reason:p5("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}async authenticate(t){if(!this.client)throw Error("Sign Client not initialized");this.setNamespaces(t),await this.cleanupPendingPairings();let{uri:e,response:r}=await this.client.authenticate(t);e&&(this.uri=e,this.events.emit("display_uri",e));let i=await r();if(this.session=i.session,this.session){let t=gb(this.session.namespaces);this.namespaces=gm(this.namespaces,t),this.persist("namespaces",this.namespaces),this.onConnect()}return i}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}removeListener(t,e){this.events.removeListener(t,e)}off(t,e){this.events.off(t,e)}get isWalletConnect(){return!0}async pair(t){this.shouldAbortPairingAttempt=!1;let e=0;do{if(this.shouldAbortPairingAttempt)throw Error("Pairing aborted");if(e>=this.maxPairingAttempts)throw Error("Max auto pairing attempts reached");let{uri:r,approval:i}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});r&&(this.uri=r,this.events.emit("display_uri",r)),await i().then(t=>{this.session=t;let e=gb(t.namespaces);this.namespaces=gm(this.namespaces,e),this.persist("namespaces",this.namespaces)}).catch(t=>{if(t.message!==cn)throw t;e++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,e){try{if(!this.session)return;let[r,i]=this.validateChain(t);this.getProvider(r).setDefaultChain(i,e)}catch(t){if(!/Please call connect/.test(t.message))throw t}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");let e=this.client.pairing.getAll();if(p4(e)){for(let r of e)t.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${e.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){let t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await cC.init({logger:this.providerOpts.logger||p7,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.com",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw Error("Sign Client not initialized");if(!this.session)throw Error("Session not initialized. Please call connect() before enable()");let t=[...new Set(Object.keys(this.session.namespaces).map(t=>p6(t)))];gM("client",this.client),gM("events",this.events),gM("disableProviderPing",this.disableProviderPing),t.forEach(t=>{if(!this.session)return;let e=function(t,e){let r=Object.keys(e.namespaces).filter(e=>e.includes(t));if(!r.length)return[];let i=[];return r.forEach(t=>{let r=e.namespaces[t].accounts;i.push(...r)}),i}(t,this.session),r=gg(e),i=gz(gF({},gm(this.namespaces,this.optionalNamespaces)[t]),{accounts:e,chains:r});switch(t){case"eip155":this.rpcProviders[t]=new gI({namespace:i});break;case"solana":this.rpcProviders[t]=new gS({namespace:i});break;case"cosmos":this.rpcProviders[t]=new g_({namespace:i});break;case"polkadot":this.rpcProviders[t]=new gE({namespace:i});break;case"cip34":this.rpcProviders[t]=new gN({namespace:i});break;case"elrond":this.rpcProviders[t]=new gC({namespace:i});break;case"multiversx":this.rpcProviders[t]=new gB({namespace:i});break;case"near":this.rpcProviders[t]=new gR({namespace:i})}})}registerEventListeners(){if(typeof this.client>"u")throw Error("Sign Client is not initialized");this.client.on("session_ping",t=>{this.events.emit("session_ping",t)}),this.client.on("session_event",t=>{let{params:e}=t,{event:r}=e;if("accountsChanged"===r.name){let t=r.data;t&&p4(t)&&this.events.emit("accountsChanged",t.map(gy))}else if("chainChanged"===r.name){let t=e.chainId,r=e.event.data,i=p6(t),n=gA(t)!==gA(r)?`${i}:${gA(r)}`:t;this.onChainChanged(n)}else this.events.emit(r.name,r.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:e})=>{var r;let{namespaces:i}=e,n=null==(r=this.client)?void 0:r.session.get(t);this.session=gz(gF({},n),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:e})}),this.client.on("session_delete",async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",gz(gF({},p5("USER_DISCONNECTED")),{data:t.topic}))}),this.on(ge,t=>{this.onChainChanged(t,!0)})}getProvider(t){if(!this.rpcProviders[t])throw Error(`Provider not found: ${t}`);return this.rpcProviders[t]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var e;this.getProvider(t).updateNamespace(null==(e=this.session)?void 0:e.namespaces[t])})}setNamespaces(t){let{namespaces:e,optionalNamespaces:r,sessionProperties:i}=t;e&&Object.keys(e).length&&(this.namespaces=e),r&&Object.keys(r).length&&(this.optionalNamespaces=r),this.sessionProperties=i,this.persist("namespaces",e),this.persist("optionalNamespaces",r)}validateChain(t){let[e,r]=t?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[e,r];if(e&&!Object.keys(this.namespaces||{}).map(t=>p6(t)).includes(e))throw Error(`Namespace '${e}' is not configured. Please call connect() first with namespace config.`);if(e&&r)return[e,r];let i=p6(Object.keys(this.namespaces)[0]),n=this.rpcProviders[i].getDefaultChain();return[i,n]}async requestAccounts(){let[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t,e=!1){if(!this.namespaces)return;let[r,i]=this.validateChain(t);i&&(e||this.getProvider(r).setDefaultChain(i),this.namespaces[r]?this.namespaces[r].defaultChain=i:this.namespaces[`${r}:${i}`]?this.namespaces[`${r}:${i}`].defaultChain=i:this.namespaces[`${r}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(t,e){this.client.core.storage.setItem(`${gt}/${t}`,e)}async getFromStore(t){return await this.client.core.storage.getItem(`${gt}/${t}`)}}let gH="wc@2:ethereum_provider:",gQ=["eth_sendTransaction","personal_sign"],gj=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],gK=["chainChanged","accountsChanged"],gJ=["chainChanged","accountsChanged","message","disconnect","connect"];var gG=Object.defineProperty,gY=Object.defineProperties,gV=Object.getOwnPropertyDescriptors,gW=Object.getOwnPropertySymbols,gX=Object.prototype.hasOwnProperty,gZ=Object.prototype.propertyIsEnumerable,g$=(t,e,r)=>e in t?gG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,g0=(t,e)=>{for(var r in e||(e={}))gX.call(e,r)&&g$(t,r,e[r]);if(gW)for(var r of gW(e))gZ.call(e,r)&&g$(t,r,e[r]);return t},g1=(t,e)=>gY(t,gV(e));function g2(t){return Number(t[0].split(":")[1])}function g3(t){return`0x${t.toString(16)}`}class g6{constructor(){this.events=new th.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=gH,this.on=(t,e)=>(this.events.on(t,e),this),this.once=(t,e)=>(this.events.once(t,e),this),this.removeListener=(t,e)=>(this.events.removeListener(t,e),this),this.off=(t,e)=>(this.events.off(t,e),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){let e=new g6;return await e.initialize(t),e}async request(t,e){return await this.signer.request(t,this.formatChainId(this.chainId),e)}sendAsync(t,e,r){this.signer.sendAsync(t,e,this.formatChainId(this.chainId),r)}get connected(){return!!this.signer.client&&this.signer.client.core.relayer.connected}get connecting(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);let{required:e,optional:r}=function(t){let{chains:e,optionalChains:r,methods:i,optionalMethods:n,events:s,optionalEvents:o,rpcMap:a}=t;if(!rY(e))throw Error("Invalid chains");let f={chains:e,methods:i||gQ,events:s||gK,rpcMap:g0({},e.length?{[g2(e)]:a[g2(e)]}:{})},h=s?.filter(t=>!gK.includes(t)),u=i?.filter(t=>!gQ.includes(t));if(!r&&!o&&!n&&!(null!=h&&h.length)&&!(null!=u&&u.length))return{required:e.length?f:void 0};let l={chains:[...new Set(h?.length&&u?.length||!r?f.chains.concat(r||[]):r)],methods:[...new Set(f.methods.concat(null!=n&&n.length?n:gj))],events:[...new Set(f.events.concat(null!=o&&o.length?o:gJ))],rpcMap:a};return{required:e.length?f:void 0,optional:r.length?l:void 0}}(this.rpc);try{let i=await new Promise(async(i,n)=>{var s;this.rpc.showQrModal&&(null==(s=this.modal)||s.subscribeModal(t=>{t.open||this.signer.session||(this.signer.abortPairingAttempt(),n(Error("Connection request reset. Please try again.")))})),await this.signer.connect(g1(g0({namespaces:g0({},e&&{[this.namespace]:e})},r&&{optionalNamespaces:{[this.namespace]:r}}),{pairingTopic:t?.pairingTopic})).then(t=>{i(t)}).catch(t=>{n(Error(t.message))})});if(!i)return;let n=tx(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:n),this.setAccounts(n),this.events.emit("connect",{chainId:g3(this.chainId)})}catch(t){throw this.signer.logger.error(t),t}finally{this.modal&&this.modal.closeModal()}}async authenticate(t){if(!this.signer.client)throw Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:t?.chains});try{let e=await new Promise(async(e,r)=>{var i;this.rpc.showQrModal&&(null==(i=this.modal)||i.subscribeModal(t=>{t.open||this.signer.session||(this.signer.abortPairingAttempt(),r(Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(g1(g0({},t),{chains:this.rpc.chains})).then(t=>{e(t)}).catch(t=>{r(Error(t.message))})}),r=e.session;if(r){let t=tx(r.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:t),this.setAccounts(t),this.events.emit("connect",{chainId:g3(this.chainId)})}return e}catch(t){throw this.signer.logger.error(t),t}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",t=>{let{params:e}=t,{event:r}=e;"accountsChanged"===r.name?(this.accounts=this.parseAccounts(r.data),this.events.emit("accountsChanged",this.accounts)):"chainChanged"===r.name?this.setChainId(this.formatChainId(r.data)):this.events.emit(r.name,r.data),this.events.emit("session_event",t)}),this.signer.on("chainChanged",t=>{let e=parseInt(t);this.chainId=e,this.events.emit("chainChanged",g3(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",g1(g0({},function(t,e){let{message:r,code:i}=rG[t];return{message:r,code:i}}("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",t=>{var e,r;this.rpc.showQrModal&&(null==(e=this.modal)||e.closeModal(),null==(r=this.modal)||r.openModal({uri:t})),this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return"string"==typeof t&&t.startsWith(`${this.namespace}:`)}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){let e=t.filter(t=>this.isCompatibleChainId(t)).map(t=>this.parseChainId(t));e.length&&(this.chainId=e[0],this.events.emit("chainChanged",g3(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){let e=this.parseChainId(t);this.chainId=e,this.switchEthereumChain(e)}}parseAccountId(t){let[e,r,i]=t.split(":");return{chainId:`${e}:${r}`,address:i}}setAccounts(t){this.accounts=t.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var e,r;let i=null!=(e=t?.chains)?e:[],n=null!=(r=t?.optionalChains)?r:[],s=i.concat(n);if(!s.length)throw Error("No chains specified in either `chains` or `optionalChains`");let o=i.length?t?.methods||gQ:[],a=i.length?t?.events||gK:[],f=t?.optionalMethods||[],h=t?.optionalEvents||[],u=t?.rpcMap||this.buildRpcMap(s,t.projectId),l=t?.qrModalOptions||void 0;return{chains:i?.map(t=>this.formatChainId(t)),optionalChains:n.map(t=>this.formatChainId(t)),methods:o,events:a,optionalMethods:f,optionalEvents:h,rpcMap:u,showQrModal:!!(null!=t&&t.showQrModal),qrModalOptions:l,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,e){let r={};return t.forEach(t=>{r[t]=this.getRpcUrl(t,e)}),r}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?g2(this.rpc.chains):g2(this.rpc.optionalChains),this.signer=await gL.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{let{WalletConnectModal:e}=await r.e("6220").then(r.bind(r,91381));t=e}catch{throw Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(g0({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(t){throw this.signer.logger.error(t),Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;let{chains:e,optionalChains:r,rpcMap:i}=t;e&&rY(e)&&(this.rpc.chains=e.map(t=>this.formatChainId(t)),e.forEach(t=>{this.rpc.rpcMap[t]=i?.[t]||this.getRpcUrl(t)})),r&&rY(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=r?.map(t=>this.formatChainId(t)),r.forEach(t=>{this.rpc.rpcMap[t]=i?.[t]||this.getRpcUrl(t)}))}getRpcUrl(t,e){var r;return(null==(r=this.rpc.rpcMap)?void 0:r[t])||`https://rpc.walletconnect.com/v1/?chainId=eip155:${t}&projectId=${e||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{let t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),e=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:e?.accounts),this.setAccounts(e?.accounts)}catch(t){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(t),await this.disconnect().catch(t=>this.signer.logger.warn(t))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return"string"==typeof t||t instanceof String?[this.parseAccount(t)]:t.map(t=>this.parseAccount(t))}}},72030:function(t){"use strict";t.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},80204:function(t,e,r){t.exports=self.fetch||(self.fetch=r(25869).default||r(25869))},25869:function(t,e,r){"use strict";function i(t,e){return e=e||{},new Promise(function(r,i){var n=new XMLHttpRequest,s=[],o=[],a={},f=function(){return{ok:2==(n.status/100|0),statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(n.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:f,headers:{keys:function(){return s},entries:function(){return o},get:function(t){return a[t.toLowerCase()]},has:function(t){return t.toLowerCase() in a}}}};for(var h in n.open(e.method||"get",t,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(t,e,r){s.push(e=e.toLowerCase()),o.push([e,r]),a[e]=a[e]?a[e]+","+r:r}),r(f())},n.onerror=i,n.withCredentials="include"==e.credentials,e.headers)n.setRequestHeader(h,e.headers[h]);n.send(e.body||null)})}r.r(e),r.d(e,{default:function(){return i}})}}]); \ No newline at end of file diff --git a/gateway/dist/1948.9d9d13821d34fb44e6a9.bundle.js b/gateway/dist/1948.9d9d13821d34fb44e6a9.bundle.js deleted file mode 100644 index cefae21d..00000000 --- a/gateway/dist/1948.9d9d13821d34fb44e6a9.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([[1948],{31948:(e,a,t)=>{t.r(a),t.d(a,{default:()=>i});const i='\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'}}]); \ No newline at end of file diff --git a/gateway/dist/2003.728e563e769e331b1e91.bundle.js b/gateway/dist/2003.728e563e769e331b1e91.bundle.js new file mode 100644 index 00000000..88bed7c0 --- /dev/null +++ b/gateway/dist/2003.728e563e769e331b1e91.bundle.js @@ -0,0 +1,24 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["2003"],{43703:function(t,e,o){o.r(e),o.d(e,{default:function(){return s}});let s=` + + + + + + + + + + + + + + + + + + + + + + +`}}]); \ No newline at end of file diff --git a/gateway/dist/2131.cac4250904cbb3352b7e.bundle.js b/gateway/dist/2131.cac4250904cbb3352b7e.bundle.js deleted file mode 100644 index 9f2e6572..00000000 --- a/gateway/dist/2131.cac4250904cbb3352b7e.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([[2131],{42131:(e,l,o)=>{o.r(l),o.d(l,{default:()=>n});const n='\n\n\n\n\n\n\n\n\n\n\n\n\n'}}]); \ No newline at end of file diff --git a/gateway/dist/2193.1ebee688a2fd529ab36a.bundle.js b/gateway/dist/2193.1ebee688a2fd529ab36a.bundle.js new file mode 100644 index 00000000..bfc17186 --- /dev/null +++ b/gateway/dist/2193.1ebee688a2fd529ab36a.bundle.js @@ -0,0 +1,17 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["2193"],{46840:function(c,e,s){s.r(e),s.d(e,{default:function(){return t}});let t=` + + + + + + + +`}}]); \ No newline at end of file diff --git a/gateway/dist/220.e3f35d30ea038871d3a2.bundle.js b/gateway/dist/220.e3f35d30ea038871d3a2.bundle.js new file mode 100644 index 00000000..d07368f3 --- /dev/null +++ b/gateway/dist/220.e3f35d30ea038871d3a2.bundle.js @@ -0,0 +1 @@ +(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["220"],{40957:function(t,e){"use strict";function r(t){let e;return"undefined"!=typeof window&&void 0!==window[t]&&(e=window[t]),e}function i(t){let e=r(t);if(!e)throw Error(`${t} is not defined in Window`);return e}e.getLocalStorage=e.getLocalStorageOrThrow=e.getCrypto=e.getCryptoOrThrow=e.getLocation=e.getLocationOrThrow=e.getNavigator=e.getNavigatorOrThrow=e.getDocument=e.getDocumentOrThrow=e.getFromWindowOrThrow=e.getFromWindow=void 0,e.getFromWindow=r,e.getFromWindowOrThrow=i;e.getDocumentOrThrow=function(){return i("document")};e.getDocument=function(){return r("document")};e.getNavigatorOrThrow=function(){return i("navigator")};e.getNavigator=function(){return r("navigator")};e.getLocationOrThrow=function(){return i("location")};e.getLocation=function(){return r("location")};e.getCryptoOrThrow=function(){return i("crypto")};e.getCrypto=function(){return r("crypto")};e.getLocalStorageOrThrow=function(){return i("localStorage")};e.getLocalStorage=function(){return r("localStorage")}},68364:function(t,e,r){"use strict";e.getWindowMetadata=void 0;let i=r(58205);e.getWindowMetadata=function(){let t,e,r;try{t=i.getDocumentOrThrow(),e=i.getLocationOrThrow()}catch(t){return null}function n(...e){let r=t.getElementsByTagName("meta");for(let t=0;ti.getAttribute(t)).filter(t=>!!t&&e.includes(t));if(n.length&&n){let t=i.getAttribute("content");if(t)return t}}return""}let o=(!(r=n("name","og:site_name","og:title","twitter:title"))&&(r=t.title),r),s=n("description","og:description","twitter:description","keywords"),a=e.origin,h=function(){let r=t.getElementsByTagName("link"),i=[];for(let t=0;t-1){let t=n.getAttribute("href");if(t){if(-1===t.toLowerCase().indexOf("https:")&&-1===t.toLowerCase().indexOf("http:")&&0!==t.indexOf("//")){let r=e.protocol+"//"+e.host;if(0===t.indexOf("/"))r+=t;else{let i=e.pathname.split("/");i.pop(),r+=i.join("/")+"/"+t}i.push(r)}else if(0===t.indexOf("//")){let r=e.protocol+t;i.push(r)}else i.push(t)}}}return i}();return{description:s,url:a,icons:h,name:o}}},58205:function(t,e){"use strict";function r(t){let e;return"undefined"!=typeof window&&void 0!==window[t]&&(e=window[t]),e}function i(t){let e=r(t);if(!e)throw Error(`${t} is not defined in Window`);return e}Object.defineProperty(e,"__esModule",{value:!0}),e.getLocalStorage=e.getLocalStorageOrThrow=e.getCrypto=e.getCryptoOrThrow=e.getLocation=e.getLocationOrThrow=e.getNavigator=e.getNavigatorOrThrow=e.getDocument=e.getDocumentOrThrow=e.getFromWindowOrThrow=e.getFromWindow=void 0,e.getFromWindow=r,e.getFromWindowOrThrow=i;e.getDocumentOrThrow=function(){return i("document")};e.getDocument=function(){return r("document")};e.getNavigatorOrThrow=function(){return i("navigator")};e.getNavigator=function(){return r("navigator")};e.getLocationOrThrow=function(){return i("location")};e.getLocation=function(){return r("location")};e.getCryptoOrThrow=function(){return i("crypto")};e.getCrypto=function(){return r("crypto")};e.getLocalStorageOrThrow=function(){return i("localStorage")};e.getLocalStorage=function(){return r("localStorage")}},81009:function(t,e,r){"use strict";r.d(e,{default:()=>tq});var i={};r.r(i),r.d(i,{decrypt:()=>tT,encrypt:()=>tE,generateKey:()=>tI,verifyHmac:()=>tO});var n=r("68364"),o=r("40957"),s=r(34155),a=function(){for(var t=0,e=0,r=arguments.length;ee=e.concat(Array.from(t))),new Uint8Array([...e])}function F(t){return t.replace(/^0x/,"")}function D(t){return t.startsWith("0x")?t:`0x${t}`}function $(t){return(t=function(t,e=8,r="0"){return function(t,e,r="0"){return function(t,e,r,i="0"){let n=e-t.length,o=t;if(n>0){let e=i.repeat(n);o=r?e+t:t+e}return o}(t,e,!0,r)}(t,function(t,e=8){let r=t%e;return r?(t-r)/e*e+e:t}(t.length,e),r)}(t=F(t),2))&&(t=D(t)),t}function Z(t){var e;return e=new Uint8Array(t),A()(e)}function K(t,e){let r=F($(new(T())(t).toString(16)));return e?r:D(r)}var H=r("91094"),V=r("56186");function Q(t){return $(t)}let z=V.payloadId;function X(){return((t,e)=>{for(e=t="";t++<36;e+=51*t&52?(15^t?8^Math.random()*(20^t?16:4):4).toString(16):"-");return e})()}function G(t,e){var r,i;return r=t,i=e,"string"==typeof r&&!!r.match(/^0x[0-9A-Fa-f]*$/)&&(!i||r.length===2+2*i)&&!0}function Y(t){return void 0!==t.result}function tt(t){return void 0!==t.error}function te(t){return void 0!==t.event}let tr=t=>{if(!t)return!1;if("0x"!==t.toLowerCase().substring(0,2))return!1;if(!/^(0x)?[0-9a-f]{40}$/i.test(t))return!1;else if(/^(0x)?[0-9a-f]{40}$/.test(t)||/^(0x)?[0-9A-F]{40}$/.test(t))return!0;else return t===function(t){t=F(t.toLowerCase());let e=F((0,H.keccak_256)(W(t))),r="";for(let i=0;i7?r+=t[i].toUpperCase():r+=t[i];return D(r)}(t)};function ti(t){var e,r;if((e=t)&&e.length&&!G(t[0])){;t[0]=function(t,e=!1){return L(W(t),e)}(t[0],true)}return t}function tn(t){if(void 0!==t.type&&"0"!==t.type)return t;if(void 0===t.from||!tr(t.from))throw Error("Transaction object must include a valid 'from' value.");function e(t){var e;let r=t;if("number"==typeof t||"string"==typeof t&&!(""===(e=t)||"string"==typeof e&&""===e.trim())){if(G(t)){if("string"==typeof t)r=$(t)}else r=K(t)}if("string"==typeof r)r=function(t){let e=t.startsWith("0x");return t=(t=F(t)).startsWith("0")?t.substring(1):t,e?D(t):t}(D(r));return r}let r={from:$(t.from),to:void 0===t.to?void 0:$(t.to),gasPrice:void 0===t.gasPrice?"":e(t.gasPrice),gas:void 0===t.gas?void 0===t.gasLimit?"":e(t.gasLimit):e(t.gas),value:void 0===t.value?"":e(t.value),nonce:void 0===t.nonce?"":e(t.nonce),data:void 0===t.data?"":$(t.data)||"0x"},i=["gasPrice","gas","value","nonce"];return Object.keys(r).forEach(t=>{(void 0===r[t]||"string"==typeof r[t]&&!r[t].trim().length)&&i.includes(t)&&delete r[t]}),r}var to=r("66151");function ts(t){return to.parse(t)}let ta=class t{constructor(){this._eventEmitters=[],"undefined"!=typeof window&&void 0!==window.addEventListener&&(window.addEventListener("online",()=>this.trigger("online")),window.addEventListener("offline",()=>this.trigger("offline")))}on(t,e){this._eventEmitters.push({event:t,callback:e})}trigger(t){let e=[];t&&(e=this._eventEmitters.filter(e=>e.event===t)),e.forEach(t=>{t.callback()})}},th=void 0!==r.g.WebSocket?r.g.WebSocket:r(68007),tu=class t{constructor(t){if(this.opts=t,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=t.protocol,this._version=t.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=t.subscriptions||[],this._netMonitor=t.netMonitor||new ta,!t.url||"string"!=typeof t.url)throw Error("Missing or invalid WebSocket url");this._url=t.url,this._netMonitor.on("online",()=>this._socketCreate())}set readyState(t){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(t){}get connecting(){return 0===this.readyState}set connected(t){}get connected(){return 1===this.readyState}set closing(t){}get closing(){return 2===this.readyState}set closed(t){}get closed(){return 3===this.readyState}open(){this._socketCreate()}close(){this._socketClose()}send(t,e,r){if(!e||"string"!=typeof e)throw Error("Missing or invalid topic field");this._socketSend({topic:e,type:"pub",payload:t,silent:!!r})}subscribe(t){this._socketSend({topic:t,type:"sub",payload:"",silent:!0})}on(t,e){this._events.push({event:t,callback:e})}_socketCreate(){if(this._nextSocket)return;let t=function(t,e,r){var i,n,o,s;let a;let h=(t.startsWith("https")?t.replace("https","wss"):t.startsWith("http")?t.replace("http","ws"):t).split("?"),u=!function(){let t=v();return!!t&&!!t.name&&"node"===t.name.toLowerCase()}()&&w()?{protocol:e,version:r,env:"browser",host:(null===(i=M())||void 0===i?void 0:i.host)||""}:{protocol:e,version:r,env:(null===(n=v())||void 0===n?void 0:n.name)||""};let l=(o=function(t){let e=-1!==t.indexOf("?")?t.indexOf("?"):void 0;return void 0!==e?t.substr(e):""}(h[1]||""),s=u,o=function(t){return to.stringify(t)}(a=Object.assign(Object.assign({},a=function(t){return to.parse(t)}(o)),s)));return h[0]+"?"+l}(this._url,this._protocol,this._version);if(this._nextSocket=new th(t),!this._nextSocket)throw Error("Failed to create socket");this._nextSocket.onmessage=t=>this._socketReceive(t),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=t=>this._socketError(t),this._nextSocket.onclose=()=>{setTimeout(()=>{this._nextSocket=null,this._socketCreate()},1e3)}}_socketOpen(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}_socketClose(){this._socket&&(this._socket.onclose=()=>{},this._socket.close())}_socketSend(t){let e=JSON.stringify(t);this._socket&&1===this._socket.readyState?this._socket.send(e):(this._setToQueue(t),this._socketCreate())}async _socketReceive(t){let e;try{e=JSON.parse(t.data)}catch(t){return}if(this._socketSend({topic:e.topic,type:"ack",payload:"",silent:!0}),this._socket&&1===this._socket.readyState){let t=this._events.filter(t=>"message"===t.event);t&&t.length&&t.forEach(t=>t.callback(e))}}_socketError(t){let e=this._events.filter(t=>"error"===t.event);e&&e.length&&e.forEach(e=>e.callback(t))}_queueSubscriptions(){this._subscriptions.forEach(t=>this._queue.push({topic:t,type:"sub",payload:"",silent:!0})),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(t){this._queue.push(t)}_pushQueue(){this._queue.forEach(t=>this._socketSend(t)),this._queue=[]}},tl="Session currently connected",tf="Session currently disconnected",tc="JSON RPC response format is invalid",td="User close QRCode Modal",tp=class t{constructor(){this._eventEmitters=[]}subscribe(t){this._eventEmitters.push(t)}unsubscribe(t){this._eventEmitters=this._eventEmitters.filter(e=>e.event!==t)}trigger(t){var e;let r,i=[];if(void 0!==t.method)r=t.method;else r=Y(t)||tt(t)?`response:${t.id}`:te(t)?t.event:"";if(r&&(i=this._eventEmitters.filter(t=>t.event===r)),(!i||!i.length)&&(e=r,!(I.includes(e)||e.startsWith("wc_")))&&!te(r))i=this._eventEmitters.filter(t=>"call_request"===t.event);i.forEach(e=>{if(tt(t)){let r=Error(t.error.message);e.callback(r,null)}else e.callback(null,t)})}},tm=class t{constructor(t="walletconnect"){this.storageId=t}getSession(){let t=null,e=R(this.storageId);if(e&&void 0!==e.bridge)t=e;return t}setSession(t){return!function(t,e){var r;let i="string"==typeof(r=e)?r:JSON.stringify(r),n=_();n&&n.setItem(t,i)}(this.storageId,t),t}removeSession(){x(this.storageId)}},tg="abcdefghijklmnopqrstuvwxyz0123456789".split("").map(t=>`https://${t}.bridge.walletconnect.org`),tv=class t{constructor(t){if(this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new tp,this._clientMeta=b()||t.connectorOpts.clientMeta||null,this._cryptoLib=t.cryptoLib,this._sessionStorage=t.sessionStorage||new tm(t.connectorOpts.storageId),this._qrcodeModal=t.connectorOpts.qrcodeModal,this._qrcodeModalOptions=t.connectorOpts.qrcodeModalOptions,this._signingMethods=[...O,...t.connectorOpts.signingMethods||[]],!t.connectorOpts.bridge&&!t.connectorOpts.uri&&!t.connectorOpts.session)throw Error("Missing one of the required parameters: bridge / uri / session");if(t.connectorOpts.bridge){var e;this.bridge=function(t){var e;let r;return"walletconnect.org"===(r=(r=(r=(e=t).indexOf("//")>-1?e.split("/")[2]:e.split("/")[0]).split(":")[0]).split("?")[0]).split(".").slice(-2).join(".")}(e=t.connectorOpts.bridge)?tg[Math.floor(Math.random()*tg.length)]:e}t.connectorOpts.uri&&(this.uri=t.connectorOpts.uri);let r=t.connectorOpts.session||this._getStorageSession();r&&(this.session=r),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=t.transport||new tu({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),t.connectorOpts.uri&&this._subscribeToSessionRequest(),t.pushServerOpts&&this._registerPushServer(t.pushServerOpts)}set bridge(t){if(!!t)this._bridge=t}get bridge(){return this._bridge}set key(t){if(!t)return;let e=P(t).buffer;this._key=e}get key(){if(this._key){var t,e;return t=this._key,e=!0,U(new Uint8Array(t),!e)}return""}set clientId(t){if(!!t)this._clientId=t}get clientId(){let t=this._clientId;return!t&&(t=this._clientId=X()),this._clientId}set peerId(t){if(!!t)this._peerId=t}get peerId(){return this._peerId}set clientMeta(t){}get clientMeta(){let t=this._clientMeta;return!t&&(t=this._clientMeta=b()),t}set peerMeta(t){this._peerMeta=t}get peerMeta(){return this._peerMeta}set handshakeTopic(t){if(!!t)this._handshakeTopic=t}get handshakeTopic(){return this._handshakeTopic}set handshakeId(t){if(!!t)this._handshakeId=t}get handshakeId(){return this._handshakeId}get uri(){return this._formatUri()}set uri(t){if(!t)return;let{handshakeTopic:e,bridge:r,key:i}=this._parseUri(t);this.handshakeTopic=e,this.bridge=r,this.key=i}set chainId(t){this._chainId=t}get chainId(){return this._chainId}set networkId(t){this._networkId=t}get networkId(){return this._networkId}set accounts(t){this._accounts=t}get accounts(){return this._accounts}set rpcUrl(t){this._rpcUrl=t}get rpcUrl(){return this._rpcUrl}set connected(t){}get connected(){return this._connected}set pending(t){}get pending(){return!!this._handshakeTopic}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(t){if(!!t)this._connected=t.connected,this.accounts=t.accounts,this.chainId=t.chainId,this.bridge=t.bridge,this.key=t.key,this.clientId=t.clientId,this.clientMeta=t.clientMeta,this.peerId=t.peerId,this.peerMeta=t.peerMeta,this.handshakeId=t.handshakeId,this.handshakeTopic=t.handshakeTopic}on(t,e){this._eventManager.subscribe({event:t,callback:e})}off(t){this._eventManager.unsubscribe(t)}async createInstantRequest(t){this._key=await this._generateKey();let e=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(t)}]});this.handshakeId=e.id,this.handshakeTopic=X(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",()=>{throw Error(td)});let r=()=>{this.killSession()};try{let t=await this._sendCallRequest(e);return t&&r(),t}catch(t){throw r(),t}}async connect(t){if(!this._qrcodeModal)throw Error("QRCode Modal not provided");return this.connected?{chainId:this.chainId,accounts:this.accounts}:(await this.createSession(t),new Promise(async(t,e)=>{this.on("modal_closed",()=>e(Error(td))),this.on("connect",(r,i)=>{if(r)return e(r);t(i.params[0])})}))}async createSession(t){if(this._connected)throw Error(tl);if(this.pending)return;this._key=await this._generateKey();let e=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:t&&t.chainId?t.chainId:null}]});this.handshakeId=e.id,this.handshakeTopic=X(),this._sendSessionRequest(e,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]})}approveSession(t){if(this._connected)throw Error(tl);this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";let e={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},r={id:this.handshakeId,jsonrpc:"2.0",result:e};this._sendResponse(r),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(t){if(this._connected)throw Error(tl);let e=t&&t.message?t.message:"Session Rejected",r=this._formatResponse({id:this.handshakeId,error:{message:e}});this._sendResponse(r),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:e}]}),this._removeStorageSession()}updateSession(t){if(!this._connected)throw Error(tf);this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";let e={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},r=this._formatRequest({method:"wc_sessionUpdate",params:[e]});this._sendSessionRequest(r,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}async killSession(t){let e=t?t.message:"Session Disconnected",r=this._formatRequest({method:"wc_sessionUpdate",params:[{approved:!1,chainId:null,networkId:null,accounts:null}]});await this._sendRequest(r),this._handleSessionDisconnect(e)}async sendTransaction(t){if(!this._connected)throw Error(tf);let e=tn(t),r=this._formatRequest({method:"eth_sendTransaction",params:[e]});return await this._sendCallRequest(r)}async signTransaction(t){if(!this._connected)throw Error(tf);let e=tn(t),r=this._formatRequest({method:"eth_signTransaction",params:[e]});return await this._sendCallRequest(r)}async signMessage(t){if(!this._connected)throw Error(tf);let e=this._formatRequest({method:"eth_sign",params:t});return await this._sendCallRequest(e)}async signPersonalMessage(t){if(!this._connected)throw Error(tf);t=ti(t);let e=this._formatRequest({method:"personal_sign",params:t});return await this._sendCallRequest(e)}async signTypedData(t){if(!this._connected)throw Error(tf);let e=this._formatRequest({method:"eth_signTypedData",params:t});return await this._sendCallRequest(e)}async updateChain(t){if(!this._connected)throw Error("Session currently disconnected");let e=this._formatRequest({method:"wallet_updateChain",params:[t]});return await this._sendCallRequest(e)}unsafeSend(t,e){return this._sendRequest(t,e),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:e}]}),new Promise((e,r)=>{this._subscribeToResponse(t.id,(t,i)=>{if(t){r(t);return}if(!i)throw Error("Missing JSON RPC response");e(i)})})}async sendCustomRequest(t,e){if(!this._connected)throw Error(tf);switch(t.method){case"eth_accounts":return this.accounts;case"eth_chainId":return K(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":t.params&&(t.params[0]=tn(t.params[0]));break;case"personal_sign":t.params&&(t.params=ti(t.params))}let r=this._formatRequest(t);return await this._sendCallRequest(r,e)}approveRequest(t){if(Y(t)){let e=this._formatResponse(t);this._sendResponse(e)}else throw Error('JSON-RPC success response must include "result" field')}rejectRequest(t){if(tt(t)){let e=this._formatResponse(t);this._sendResponse(e)}else throw Error('JSON-RPC error response must include "error" field')}transportClose(){this._transport.close()}async _sendRequest(t,e){var r;let i=this._formatRequest(t),n=await this._encrypt(i),o=void 0!==(null==e?void 0:e.topic)?e.topic:this.peerId,s=JSON.stringify(n);let a=void 0!==(null==e?void 0:e.forcePushNotification)?!e.forcePushNotification:!!(r=i).method.startsWith("wc_")||!O.includes(r.method)&&!0;this._transport.send(s,o,a)}async _sendResponse(t){let e=await this._encrypt(t),r=this.peerId,i=JSON.stringify(e);this._transport.send(i,r,!0)}async _sendSessionRequest(t,e,r){this._sendRequest(t,r),this._subscribeToSessionResponse(t.id,e)}_sendCallRequest(t,e){return this._sendRequest(t,e),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:e}]}),this._subscribeToCallResponse(t.id)}_formatRequest(t){if(void 0===t.method)throw Error('JSON RPC request must have valid "method" value');return{id:void 0===t.id?z():t.id,jsonrpc:"2.0",method:t.method,params:void 0===t.params?[]:t.params}}_formatResponse(t){if(void 0===t.id)throw Error('JSON RPC request must have valid "id" value');let e={id:t.id,jsonrpc:"2.0"};if(tt(t)){let r=function(t){let e=t.message||"Failed or Rejected Request",r=-32e3;if(t&&!t.code)switch(e){case"Parse error":r=-32700;break;case"Invalid request":r=-32600;break;case"Method not found":r=-32601;break;case"Invalid params":r=-32602;break;case"Internal error":r=-32603;break;default:r=-32e3}let i={code:r,message:e};return t.data&&(i.data=t.data),i}(t.error);return Object.assign(Object.assign(Object.assign({},e),t),{error:r})}if(Y(t))return Object.assign(Object.assign({},e),t);throw Error(tc)}_handleSessionDisconnect(t){!this._connected&&(this._qrcodeModal&&this._qrcodeModal.close(),x(k)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:t||"Session Disconnected"}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(t,e){e&&e.approved?(this._connected?(e.chainId&&(this.chainId=e.chainId),e.accounts&&(this.accounts=e.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,e.chainId&&(this.chainId=e.chainId),e.accounts&&(this.accounts=e.accounts),e.peerId&&!this.peerId&&(this.peerId=e.peerId),e.peerMeta&&!this.peerMeta&&(this.peerMeta=e.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(t)}async _handleIncomingMessages(t){let e;if(![this.clientId,this.handshakeTopic].includes(t.topic))return;try{e=JSON.parse(t.payload)}catch(t){return}let r=await this._decrypt(e);r&&this._eventManager.trigger(r)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(t,e){this.on(`response:${t}`,e)}_subscribeToSessionResponse(t,e){this._subscribeToResponse(t,(t,r)=>{if(t){this._handleSessionResponse(t.message);return}Y(r)?this._handleSessionResponse(e,r.result):r.error&&r.error.message?this._handleSessionResponse(r.error.message):this._handleSessionResponse(e)})}_subscribeToCallResponse(t){return new Promise((e,r)=>{this._subscribeToResponse(t,(t,i)=>{if(t){r(t);return}Y(i)?e(i.result):i.error&&i.error.message?r(i.error):r(Error(tc))})})}_subscribeToInternalEvents(){this.on("display_uri",()=>{this._qrcodeModal&&this._qrcodeModal.open(this.uri,()=>{this._eventManager.trigger({event:"modal_closed",params:[]})},this._qrcodeModalOptions)}),this.on("connect",()=>{this._qrcodeModal&&this._qrcodeModal.close()}),this.on("call_request_sent",(t,e)=>{let{request:r}=e.params[0];if(y()&&(function(){let t=y();return!!t&&t.toLowerCase().includes("android")}()||function(){let t=y();return!!t&&(t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1)}())&&this._signingMethods.includes(r.method)){let t=R(k);t&&(window.location.href=t.href)}}),this.on("wc_sessionRequest",(t,e)=>{t&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:t.toString()}]}),this.handshakeId=e.id,this.peerId=e.params[0].peerId,this.peerMeta=e.params[0].peerMeta;let r=Object.assign(Object.assign({},e),{method:"session_request"});this._eventManager.trigger(r)}),this.on("wc_sessionUpdate",(t,e)=>{t&&this._handleSessionResponse(t.message),this._handleSessionResponse("Session disconnected",e.params[0])})}_initTransport(){this._transport.on("message",t=>this._handleIncomingMessages(t)),this._transport.on("open",()=>this._eventManager.trigger({event:"transport_open",params:[]})),this._transport.on("close",()=>this._eventManager.trigger({event:"transport_close",params:[]})),this._transport.on("error",()=>this._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]})),this._transport.open()}_formatUri(){let t=this.protocol,e=this.handshakeTopic,r=this.version,i=encodeURIComponent(this.bridge),n=this.key;return`${t}:${e}@${r}?bridge=${i}&key=${n}`}_parseUri(t){let e=function(t){let e=t.indexOf(":"),r=-1!==t.indexOf("?")?t.indexOf("?"):void 0,i=t.substring(0,e),n=t.substring(e+1,r),o=function(t){let e=t.split("@");return{handshakeTopic:e[0],version:parseInt(e[1],10)}}(n),s=void 0!==r?t.substr(r):"",a=function(t){var e;let r=(e=t,to.parse(e));return{key:r.key||"",bridge:r.bridge||""}}(s);return Object.assign(Object.assign({protocol:i},o),a)}(t);if(e.protocol===this.protocol){if(!e.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");let t=e.handshakeTopic;if(!e.bridge)throw Error("Invalid or missing bridge url parameter value");let r=decodeURIComponent(e.bridge);if(!e.key)throw Error("Invalid or missing key parameter value");return{handshakeTopic:t,bridge:r,key:e.key}}throw Error("URI format is invalid")}async _generateKey(){return this._cryptoLib?await this._cryptoLib.generateKey():null}async _encrypt(t){let e=this._key;return this._cryptoLib&&e?await this._cryptoLib.encrypt(t,e):null}async _decrypt(t){let e=this._key;return this._cryptoLib&&e?await this._cryptoLib.decrypt(t,e):null}_getStorageSession(){let t=null;return this._sessionStorage&&(t=this._sessionStorage.getSession()),t}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(t){if(!t.url||"string"!=typeof t.url)throw Error("Invalid or missing pushServerOpts.url parameter value");if(!t.type||"string"!=typeof t.type)throw Error("Invalid or missing pushServerOpts.type parameter value");if(!t.token||"string"!=typeof t.token)throw Error("Invalid or missing pushServerOpts.token parameter value");let e={bridge:this.bridge,topic:this.clientId,type:t.type,token:t.token,peerName:"",language:t.language||""};this.on("connect",async(r,i)=>{if(r)throw r;if(t.peerMeta){let t=i.params[0].peerMeta.name;e.peerName=t}try{let r=await fetch(`${t.url}/new`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)});if(!(await r.json()).success)throw Error("Failed to register in Push Server")}catch(t){throw Error("Failed to register in Push Server")}})}};var ty=r("1468");let tw="AES-CBC",tM="SHA-256",t_="HMAC";async function tb(t,e=tw){return ty.getSubtleCrypto().importKey("raw",t,e===tw?{length:256,name:tw}:{hash:{name:tM},name:t_},!0,e===tw?["encrypt","decrypt"]:["sign","verify"])}async function tS(t,e,r){let i=ty.getSubtleCrypto(),n=await tb(e,tw);return new Uint8Array(await i.encrypt({iv:t,name:tw},n,r))}async function tR(t,e,r){let i=ty.getSubtleCrypto(),n=await tb(e,tw);return new Uint8Array(await i.decrypt({iv:t,name:tw},n,r))}async function tx(t,e){let r=ty.getSubtleCrypto(),i=await tb(t,t_);return new Uint8Array(await r.sign({length:256,name:t_},i,e))}async function tk(t,e){return await tx(t,e)}async function tI(t){var e,r;return N((r=(e=(t||256)/8,ty.getBrowerCrypto().getRandomValues(new Uint8Array(e))),A()(r))).buffer}async function tO(t,e){let r=P(t.data),i=P(t.iv),n=U(P(t.hmac),!1),o=B(r,i),s=U(await tk(e,o),!1);return F(n)===F(s)||!1}async function tE(t,e,r){let i=N(Z(e)),n=N(Z(r||await tI(128))),o=U(n,!1),s=N(W(JSON.stringify(t))),a=await tS(n,i,s),h=U(a,!1),u=B(a,n);return{data:h,hmac:U(await tk(i,u),!1),iv:o}}async function tT(t,e){let r;let i=N(Z(e));if(!i)throw Error("Missing key: required for decryption");if(!await tO(t,i))return null;let n=P(t.data),o=P(t.iv),s=function(t){var e;return(e=t,A()(e)).toString(C)}(await tR(o,i,n));try{r=JSON.parse(s)}catch(t){return null}return r}let tq=class t extends tv{constructor(t,e){super({cryptoLib:i,connectorOpts:t,pushServerOpts:e})}}},40926:function(t,e,r){"use strict";function i(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function n(){let t=i();return t.subtle||t.webkitSubtle}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowserCryptoAvailable=e.getSubtleCrypto=e.getBrowerCrypto=void 0,e.getBrowerCrypto=i,e.getSubtleCrypto=n;e.isBrowserCryptoAvailable=function(){return!!i()&&!!n()}},88618:function(t,e,r){"use strict";var i=r(34155);function n(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function o(){return void 0!==i&&void 0!==i.versions&&void 0!==i.versions.node}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowser=e.isNode=e.isReactNative=void 0,e.isReactNative=n,e.isNode=o;e.isBrowser=function(){return!n()&&!o()}},1468:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});let i=r(34308);i.__exportStar(r(40926),e),i.__exportStar(r(88618),e)},34308:function(t,e,r){"use strict";r.r(e),r.d(e,{__assign:function(){return o},__asyncDelegator:function(){return M},__asyncGenerator:function(){return w},__asyncValues:function(){return _},__await:function(){return y},__awaiter:function(){return l},__classPrivateFieldGet:function(){return x},__classPrivateFieldSet:function(){return k},__createBinding:function(){return c},__decorate:function(){return a},__exportStar:function(){return d},__extends:function(){return n},__generator:function(){return f},__importDefault:function(){return R},__importStar:function(){return S},__makeTemplateObject:function(){return b},__metadata:function(){return u},__param:function(){return h},__read:function(){return m},__rest:function(){return s},__spread:function(){return g},__spreadArrays:function(){return v},__values:function(){return p}});var i=function(t,e){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function n(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o=function(){return(o=Object.assign||function(t){for(var e,r=1,i=arguments.length;re.indexOf(i)&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(t);ne.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function a(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function h(t,e){return function(r,i){e(r,i,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,r,i){return new(r||(r=Promise))(function(n,o){function s(t){try{h(i.next(t))}catch(t){o(t)}}function a(t){try{h(i.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?n(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}h((i=i.apply(t,e||[])).next())})}function f(t,e){var r,i,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=(n=s.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s}function g(){for(var t=[],e=0;e1||a(t,e)})})}function a(t,e){try{(function(t){t.value instanceof y?Promise.resolve(t.value.v).then(h,u):l(o[0][2],t)})(n[t](e))}catch(t){l(o[0][3],t)}}function h(t){a("next",t)}function u(t){a("throw",t)}function l(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}}function M(t){var e,r;return e={},i("next"),i("throw",function(t){throw t}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(i,n){e[i]=t[i]?function(e){return(r=!r)?{value:y(t[i](e)),done:"return"===i}:n?n(e):e}:n}}function _(t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=p(t),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(r){e[r]=t[r]&&function(e){return new Promise(function(i,n){(function(t,e,r,i){Promise.resolve(i).then(function(e){t({value:e,done:r})},e)})(i,n,(e=t[r](e)).done,e.value)})}}}function b(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function S(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function R(t){return t&&t.__esModule?t:{default:t}}function x(t,e){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return e.get(t)}function k(t,e,r){if(!e.has(t))throw TypeError("attempted to set private field on non-instance");return e.set(t,r),r}},79806:function(t,e,r){"use strict";r.d(e,{CA:function(){return n},JV:function(){return a},O4:function(){return i},dQ:function(){return o},xK:function(){return s}});let i="INTERNAL_ERROR",n="SERVER_ERROR",o=[-32700,-32600,-32601,-32602,-32603],s={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[i]:{code:-32603,message:"Internal error"},[n]:{code:-32e3,message:"Server error"}},a=n},9698:function(t,e,r){"use strict";var i=r(1468);r.o(i,"isJsonRpcRequest")&&r.d(e,{isJsonRpcRequest:function(){return i.isJsonRpcRequest}}),r.o(i,"isJsonRpcResponse")&&r.d(e,{isJsonRpcResponse:function(){return i.isJsonRpcResponse}}),r.o(i,"isJsonRpcError")&&r.d(e,{isJsonRpcError:function(){return i.isJsonRpcError}}),r.o(i,"isWsUrl")&&r.d(e,{isWsUrl:function(){return i.isWsUrl}}),r.o(i,"payloadId")&&r.d(e,{payloadId:function(){return i.payloadId}}),r.o(i,"formatJsonRpcRequest")&&r.d(e,{formatJsonRpcRequest:function(){return i.formatJsonRpcRequest}}),r.o(i,"isJsonRpcResult")&&r.d(e,{isJsonRpcResult:function(){return i.isJsonRpcResult}}),r.o(i,"formatJsonRpcResult")&&r.d(e,{formatJsonRpcResult:function(){return i.formatJsonRpcResult}}),r.o(i,"formatJsonRpcError")&&r.d(e,{formatJsonRpcError:function(){return i.formatJsonRpcError}}),r.o(i,"getBigIntRpcId")&&r.d(e,{getBigIntRpcId:function(){return i.getBigIntRpcId}}),r.o(i,"isLocalhostUrl")&&r.d(e,{isLocalhostUrl:function(){return i.isLocalhostUrl}}),r.o(i,"isHttpUrl")&&r.d(e,{isHttpUrl:function(){return i.isHttpUrl}}),r.o(i,"IJsonRpcProvider")&&r.d(e,{IJsonRpcProvider:function(){return i.IJsonRpcProvider}}),r.o(i,"isReactNative")&&r.d(e,{isReactNative:function(){return i.isReactNative}})},90110:function(t,e,r){"use strict";r.d(e,{CX:function(){return a},L2:function(){return s},by:function(){return o},i5:function(){return n}});var i=r(79806);function n(t){return i.dQ.includes(t)}function o(t){return Object.keys(i.xK).includes(t)?i.xK[t]:i.xK[i.JV]}function s(t){let e=Object.values(i.xK).find(e=>e.code===t);return e?e:i.xK[i.JV]}function a(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?Error(`Unavailable ${r} RPC url at ${e}`):t}},71937:function(t,e,r){"use strict";r.d(e,{CS:function(){return s},RI:function(){return u},o0:function(){return o},sT:function(){return a},tm:function(){return h}});var i=r(90110),n=r(79806);function o(t=3){let e=Date.now()*Math.pow(10,t);return e+Math.floor(Math.random()*Math.pow(10,t))}function s(t=6){return BigInt(o(t))}function a(t,e,r){return{id:r||o(),jsonrpc:"2.0",method:t,params:e}}function h(t,e){return{id:t,jsonrpc:"2.0",result:e}}function u(t,e,r){return{id:t,jsonrpc:"2.0",error:function(t,e){return void 0===t?(0,i.by)(n.O4):("string"==typeof t&&(t=Object.assign(Object.assign({},(0,i.by)(n.CA)),{message:t})),void 0!==e&&(t.data=e),(0,i.i5)(t.code)&&(t=(0,i.L2)(t.code)),t)}(e,r)}}},56186:function(t,e,r){"use strict";r.d(e,{IJsonRpcProvider:function(){return s.x0},formatJsonRpcError:function(){return o.RI},formatJsonRpcRequest:function(){return o.sT},formatJsonRpcResult:function(){return o.tm},getBigIntRpcId:function(){return o.CS},isHttpUrl:function(){return a.jK},isJsonRpcError:function(){return h.jg},isJsonRpcRequest:function(){return h.DW},isJsonRpcResponse:function(){return h.u},isJsonRpcResult:function(){return h.k4},isLocalhostUrl:function(){return a.JF},isWsUrl:function(){return a.UZ},parseConnectionError:function(){return i.CX},payloadId:function(){return o.o0}});var i=r(90110),n=r(9698);r.o(n,"isJsonRpcRequest")&&r.d(e,{isJsonRpcRequest:function(){return n.isJsonRpcRequest}}),r.o(n,"isJsonRpcResponse")&&r.d(e,{isJsonRpcResponse:function(){return n.isJsonRpcResponse}}),r.o(n,"isJsonRpcError")&&r.d(e,{isJsonRpcError:function(){return n.isJsonRpcError}}),r.o(n,"isWsUrl")&&r.d(e,{isWsUrl:function(){return n.isWsUrl}}),r.o(n,"payloadId")&&r.d(e,{payloadId:function(){return n.payloadId}}),r.o(n,"formatJsonRpcRequest")&&r.d(e,{formatJsonRpcRequest:function(){return n.formatJsonRpcRequest}}),r.o(n,"isJsonRpcResult")&&r.d(e,{isJsonRpcResult:function(){return n.isJsonRpcResult}}),r.o(n,"formatJsonRpcResult")&&r.d(e,{formatJsonRpcResult:function(){return n.formatJsonRpcResult}}),r.o(n,"formatJsonRpcError")&&r.d(e,{formatJsonRpcError:function(){return n.formatJsonRpcError}}),r.o(n,"getBigIntRpcId")&&r.d(e,{getBigIntRpcId:function(){return n.getBigIntRpcId}}),r.o(n,"isLocalhostUrl")&&r.d(e,{isLocalhostUrl:function(){return n.isLocalhostUrl}}),r.o(n,"isHttpUrl")&&r.d(e,{isHttpUrl:function(){return n.isHttpUrl}}),r.o(n,"IJsonRpcProvider")&&r.d(e,{IJsonRpcProvider:function(){return n.IJsonRpcProvider}}),r.o(n,"isReactNative")&&r.d(e,{isReactNative:function(){return n.isReactNative}});var o=r(71937),s=r(79981),a=r(46119),h=r(84733)},79981:function(t,e,r){"use strict";r.d(e,{x0:()=>o});class i{}class n extends i{constructor(){super()}}class o extends n{constructor(t){super()}}},46119:function(t,e,r){"use strict";r.d(e,{JF:function(){return s},UZ:function(){return o},jK:function(){return n}});function i(t,e){let r=function(t){let e=t.match(RegExp(/^\w+:/,"gi"));if(e&&e.length)return e[0]}(t);return void 0!==r&&new RegExp(e).test(r)}function n(t){return i(t,"^https?:")}function o(t){return i(t,"^wss?:")}function s(t){return RegExp("wss?://localhost(:d{2,5})?").test(t)}},84733:function(t,e,r){"use strict";function i(t){return"object"==typeof t&&"id"in t&&"jsonrpc"in t&&"2.0"===t.jsonrpc}function n(t){return i(t)&&"method"in t}function o(t){return i(t)&&(s(t)||a(t))}function s(t){return"result"in t}function a(t){return"error"in t}r.d(e,{DW:function(){return n},jg:function(){return a},k4:function(){return s},u:function(){return o}})},68007:function(t){"use strict";t.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},11460:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{h=r(76303).Buffer}catch(t){}function s(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&s<=54?i|=s-49+10:s>=17&&s<=22?i|=s-17+10:i|=15&s}return i}function a(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?n+=a-49+10:a>=17?n+=a-17+10:n+=a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return 0>t.cmp(e)?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36),t=t.toString().replace(/\s+/g,"");var n=0;"-"===t[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<0x4000000?(this.words=[0x3ffffff&t],this.length=1):t<0x10000000000000?(this.words=[0x3ffffff&t,t/0x4000000&0x3ffffff],this.length=2):(i(t<0x20000000000000),this.words=[0x3ffffff&t,t/0x4000000&0x3ffffff,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var n,o,s=0;s=0;s-=3)o=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[n]|=o<>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,n++);else if("le"===r)for(s=0,n=0;s>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,n++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var r,i,n=0;n=e;n-=6)i=s(t,n,n+6),this.words[r]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==e&&(i=s(t,e,n+6),this.words[r]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,h=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var h,u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];o.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var r,n=0,o=0,s=0;s>>24-n&0xffffff)||s!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=l[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?t+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==h),this.toArrayLike(h,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n,o,s=this.byteLength(),a=r||Math.max(1,s);i(s<=a,"byte array longer than desired length"),i(a>0,"Requested array length <= 0"),this.strip();var h=new t(a),u=this.clone();if("le"===e){for(o=0;!u.isZero();o++)n=u.andln(255),u.iushrn(8),h[o]=n;for(;o=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return(8191&e)==0&&(r+=13,e>>>=13),(127&e)==0&&(r+=7,e>>>=7),(15&e)==0&&(r+=4,e>>>=4),(3&e)==0&&(r+=2,e>>>=2),(1&e)==0&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e};function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=0x3ffffff&s,h=s/0x4000000|0;r.words[0]=a;for(var u=1;u>>26,f=0x3ffffff&h,c=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=c;d++){var p=u-d|0;n=0|t.words[p],l+=(s=n*(o=0|e.words[d])+f)/0x4000000|0,f=0x3ffffff&s}r.words[u]=0|f,h=0|l}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){this.length>t.length?(e=this,r=t):(e=t,r=this);for(var e,r,i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),e?this.words[r]=this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var e,r,i,n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(e=this,r=t):(e=t,r=this);for(var o=0,s=0;s>26,this.words[s]=0x3ffffff&i;for(;0!==o&&s>26,this.words[s]=0x3ffffff&i;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],v=8191&g,y=g>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],S=8191&b,R=b>>>13,x=0|s[5],k=8191&x,I=x>>>13,O=0|s[6],E=8191&O,T=O>>>13,q=0|s[7],A=8191&q,j=q>>>13,C=0|s[8],N=8191&C,L=C>>>13,J=0|s[9],U=8191&J,P=J>>>13,W=0|a[0],B=8191&W,F=W>>>13,D=0|a[1],$=8191&D,Z=D>>>13,K=0|a[2],H=8191&K,V=K>>>13,Q=0|a[3],z=8191&Q,X=Q>>>13,G=0|a[4],Y=8191&G,tt=G>>>13,te=0|a[5],tr=8191&te,ti=te>>>13,tn=0|a[6],to=8191&tn,ts=tn>>>13,ta=0|a[7],th=8191&ta,tu=ta>>>13,tl=0|a[8],tf=8191&tl,tc=tl>>>13,td=0|a[9],tp=8191&td,tm=td>>>13;r.negative=t.negative^e.negative,r.length=19,i=Math.imul(f,B),n=(n=Math.imul(f,F))+Math.imul(c,B)|0;var tg=(u+i|0)+((8191&n)<<13)|0;u=((o=Math.imul(c,F))+(n>>>13)|0)+(tg>>>26)|0,tg&=0x3ffffff,i=Math.imul(p,B),n=(n=Math.imul(p,F))+Math.imul(m,B)|0,o=Math.imul(m,F),i=i+Math.imul(f,$)|0,n=(n=n+Math.imul(f,Z)|0)+Math.imul(c,$)|0;var tv=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(tv>>>26)|0,tv&=0x3ffffff,i=Math.imul(v,B),n=(n=Math.imul(v,F))+Math.imul(y,B)|0,o=Math.imul(y,F),i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,Z)|0,i=i+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(c,H)|0;var ty=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(c,V)|0)+(n>>>13)|0)+(ty>>>26)|0,ty&=0x3ffffff,i=Math.imul(M,B),n=(n=Math.imul(M,F))+Math.imul(_,B)|0,o=Math.imul(_,F),i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,Z)|0,i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0,i=i+Math.imul(f,z)|0,n=(n=n+Math.imul(f,X)|0)+Math.imul(c,z)|0;var tw=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(tw>>>26)|0,tw&=0x3ffffff,i=Math.imul(S,B),n=(n=Math.imul(S,F))+Math.imul(R,B)|0,o=Math.imul(R,F),i=i+Math.imul(M,$)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(v,H)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,V)|0,i=i+Math.imul(p,z)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,X)|0,i=i+Math.imul(f,Y)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(c,Y)|0;var tM=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(tM>>>26)|0,tM&=0x3ffffff,i=Math.imul(k,B),n=(n=Math.imul(k,F))+Math.imul(I,B)|0,o=Math.imul(I,F),i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,V)|0,i=i+Math.imul(v,z)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(f,tr)|0,n=(n=n+Math.imul(f,ti)|0)+Math.imul(c,tr)|0;var t_=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(c,ti)|0)+(n>>>13)|0)+(t_>>>26)|0,t_&=0x3ffffff,i=Math.imul(E,B),n=(n=Math.imul(E,F))+Math.imul(T,B)|0,o=Math.imul(T,F),i=i+Math.imul(k,$)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,Z)|0,i=i+Math.imul(S,H)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,V)|0,i=i+Math.imul(M,z)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,X)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,tr)|0,n=(n=n+Math.imul(p,ti)|0)+Math.imul(m,tr)|0,o=o+Math.imul(m,ti)|0,i=i+Math.imul(f,to)|0,n=(n=n+Math.imul(f,ts)|0)+Math.imul(c,to)|0;var tb=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(c,ts)|0)+(n>>>13)|0)+(tb>>>26)|0,tb&=0x3ffffff,i=Math.imul(A,B),n=(n=Math.imul(A,F))+Math.imul(j,B)|0,o=Math.imul(j,F),i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,Z)|0,i=i+Math.imul(k,H)|0,n=(n=n+Math.imul(k,V)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,V)|0,i=i+Math.imul(S,z)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,X)|0,i=i+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(v,tr)|0,n=(n=n+Math.imul(v,ti)|0)+Math.imul(y,tr)|0,o=o+Math.imul(y,ti)|0,i=i+Math.imul(p,to)|0,n=(n=n+Math.imul(p,ts)|0)+Math.imul(m,to)|0,o=o+Math.imul(m,ts)|0,i=i+Math.imul(f,th)|0,n=(n=n+Math.imul(f,tu)|0)+Math.imul(c,th)|0;var tS=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(c,tu)|0)+(n>>>13)|0)+(tS>>>26)|0,tS&=0x3ffffff,i=Math.imul(N,B),n=(n=Math.imul(N,F))+Math.imul(L,B)|0,o=Math.imul(L,F),i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,Z)|0,i=i+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,V)|0,i=i+Math.imul(k,z)|0,n=(n=n+Math.imul(k,X)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,X)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(M,tr)|0,n=(n=n+Math.imul(M,ti)|0)+Math.imul(_,tr)|0,o=o+Math.imul(_,ti)|0,i=i+Math.imul(v,to)|0,n=(n=n+Math.imul(v,ts)|0)+Math.imul(y,to)|0,o=o+Math.imul(y,ts)|0,i=i+Math.imul(p,th)|0,n=(n=n+Math.imul(p,tu)|0)+Math.imul(m,th)|0,o=o+Math.imul(m,tu)|0,i=i+Math.imul(f,tf)|0,n=(n=n+Math.imul(f,tc)|0)+Math.imul(c,tf)|0;var tR=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(c,tc)|0)+(n>>>13)|0)+(tR>>>26)|0,tR&=0x3ffffff,i=Math.imul(U,B),n=(n=Math.imul(U,F))+Math.imul(P,B)|0,o=Math.imul(P,F),i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,Z)|0,i=i+Math.imul(A,H)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,V)|0,i=i+Math.imul(E,z)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,X)|0,i=i+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(S,tr)|0,n=(n=n+Math.imul(S,ti)|0)+Math.imul(R,tr)|0,o=o+Math.imul(R,ti)|0,i=i+Math.imul(M,to)|0,n=(n=n+Math.imul(M,ts)|0)+Math.imul(_,to)|0,o=o+Math.imul(_,ts)|0,i=i+Math.imul(v,th)|0,n=(n=n+Math.imul(v,tu)|0)+Math.imul(y,th)|0,o=o+Math.imul(y,tu)|0,i=i+Math.imul(p,tf)|0,n=(n=n+Math.imul(p,tc)|0)+Math.imul(m,tf)|0,o=o+Math.imul(m,tc)|0,i=i+Math.imul(f,tp)|0,n=(n=n+Math.imul(f,tm)|0)+Math.imul(c,tp)|0;var tx=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(c,tm)|0)+(n>>>13)|0)+(tx>>>26)|0,tx&=0x3ffffff,i=Math.imul(U,$),n=(n=Math.imul(U,Z))+Math.imul(P,$)|0,o=Math.imul(P,Z),i=i+Math.imul(N,H)|0,n=(n=n+Math.imul(N,V)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,V)|0,i=i+Math.imul(A,z)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(j,z)|0,o=o+Math.imul(j,X)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,tt)|0,i=i+Math.imul(k,tr)|0,n=(n=n+Math.imul(k,ti)|0)+Math.imul(I,tr)|0,o=o+Math.imul(I,ti)|0,i=i+Math.imul(S,to)|0,n=(n=n+Math.imul(S,ts)|0)+Math.imul(R,to)|0,o=o+Math.imul(R,ts)|0,i=i+Math.imul(M,th)|0,n=(n=n+Math.imul(M,tu)|0)+Math.imul(_,th)|0,o=o+Math.imul(_,tu)|0,i=i+Math.imul(v,tf)|0,n=(n=n+Math.imul(v,tc)|0)+Math.imul(y,tf)|0,o=o+Math.imul(y,tc)|0,i=i+Math.imul(p,tp)|0,n=(n=n+Math.imul(p,tm)|0)+Math.imul(m,tp)|0;var tk=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(m,tm)|0)+(n>>>13)|0)+(tk>>>26)|0,tk&=0x3ffffff,i=Math.imul(U,H),n=(n=Math.imul(U,V))+Math.imul(P,H)|0,o=Math.imul(P,V),i=i+Math.imul(N,z)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,X)|0,i=i+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(E,tr)|0,n=(n=n+Math.imul(E,ti)|0)+Math.imul(T,tr)|0,o=o+Math.imul(T,ti)|0,i=i+Math.imul(k,to)|0,n=(n=n+Math.imul(k,ts)|0)+Math.imul(I,to)|0,o=o+Math.imul(I,ts)|0,i=i+Math.imul(S,th)|0,n=(n=n+Math.imul(S,tu)|0)+Math.imul(R,th)|0,o=o+Math.imul(R,tu)|0,i=i+Math.imul(M,tf)|0,n=(n=n+Math.imul(M,tc)|0)+Math.imul(_,tf)|0,o=o+Math.imul(_,tc)|0,i=i+Math.imul(v,tp)|0,n=(n=n+Math.imul(v,tm)|0)+Math.imul(y,tp)|0;var tI=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(y,tm)|0)+(n>>>13)|0)+(tI>>>26)|0,tI&=0x3ffffff,i=Math.imul(U,z),n=(n=Math.imul(U,X))+Math.imul(P,z)|0,o=Math.imul(P,X),i=i+Math.imul(N,Y)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(A,tr)|0,n=(n=n+Math.imul(A,ti)|0)+Math.imul(j,tr)|0,o=o+Math.imul(j,ti)|0,i=i+Math.imul(E,to)|0,n=(n=n+Math.imul(E,ts)|0)+Math.imul(T,to)|0,o=o+Math.imul(T,ts)|0,i=i+Math.imul(k,th)|0,n=(n=n+Math.imul(k,tu)|0)+Math.imul(I,th)|0,o=o+Math.imul(I,tu)|0,i=i+Math.imul(S,tf)|0,n=(n=n+Math.imul(S,tc)|0)+Math.imul(R,tf)|0,o=o+Math.imul(R,tc)|0,i=i+Math.imul(M,tp)|0,n=(n=n+Math.imul(M,tm)|0)+Math.imul(_,tp)|0;var tO=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(_,tm)|0)+(n>>>13)|0)+(tO>>>26)|0,tO&=0x3ffffff,i=Math.imul(U,Y),n=(n=Math.imul(U,tt))+Math.imul(P,Y)|0,o=Math.imul(P,tt),i=i+Math.imul(N,tr)|0,n=(n=n+Math.imul(N,ti)|0)+Math.imul(L,tr)|0,o=o+Math.imul(L,ti)|0,i=i+Math.imul(A,to)|0,n=(n=n+Math.imul(A,ts)|0)+Math.imul(j,to)|0,o=o+Math.imul(j,ts)|0,i=i+Math.imul(E,th)|0,n=(n=n+Math.imul(E,tu)|0)+Math.imul(T,th)|0,o=o+Math.imul(T,tu)|0,i=i+Math.imul(k,tf)|0,n=(n=n+Math.imul(k,tc)|0)+Math.imul(I,tf)|0,o=o+Math.imul(I,tc)|0,i=i+Math.imul(S,tp)|0,n=(n=n+Math.imul(S,tm)|0)+Math.imul(R,tp)|0;var tE=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(R,tm)|0)+(n>>>13)|0)+(tE>>>26)|0,tE&=0x3ffffff,i=Math.imul(U,tr),n=(n=Math.imul(U,ti))+Math.imul(P,tr)|0,o=Math.imul(P,ti),i=i+Math.imul(N,to)|0,n=(n=n+Math.imul(N,ts)|0)+Math.imul(L,to)|0,o=o+Math.imul(L,ts)|0,i=i+Math.imul(A,th)|0,n=(n=n+Math.imul(A,tu)|0)+Math.imul(j,th)|0,o=o+Math.imul(j,tu)|0,i=i+Math.imul(E,tf)|0,n=(n=n+Math.imul(E,tc)|0)+Math.imul(T,tf)|0,o=o+Math.imul(T,tc)|0,i=i+Math.imul(k,tp)|0,n=(n=n+Math.imul(k,tm)|0)+Math.imul(I,tp)|0;var tT=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(I,tm)|0)+(n>>>13)|0)+(tT>>>26)|0,tT&=0x3ffffff,i=Math.imul(U,to),n=(n=Math.imul(U,ts))+Math.imul(P,to)|0,o=Math.imul(P,ts),i=i+Math.imul(N,th)|0,n=(n=n+Math.imul(N,tu)|0)+Math.imul(L,th)|0,o=o+Math.imul(L,tu)|0,i=i+Math.imul(A,tf)|0,n=(n=n+Math.imul(A,tc)|0)+Math.imul(j,tf)|0,o=o+Math.imul(j,tc)|0,i=i+Math.imul(E,tp)|0,n=(n=n+Math.imul(E,tm)|0)+Math.imul(T,tp)|0;var tq=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(T,tm)|0)+(n>>>13)|0)+(tq>>>26)|0,tq&=0x3ffffff,i=Math.imul(U,th),n=(n=Math.imul(U,tu))+Math.imul(P,th)|0,o=Math.imul(P,tu),i=i+Math.imul(N,tf)|0,n=(n=n+Math.imul(N,tc)|0)+Math.imul(L,tf)|0,o=o+Math.imul(L,tc)|0,i=i+Math.imul(A,tp)|0,n=(n=n+Math.imul(A,tm)|0)+Math.imul(j,tp)|0;var tA=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(j,tm)|0)+(n>>>13)|0)+(tA>>>26)|0,tA&=0x3ffffff,i=Math.imul(U,tf),n=(n=Math.imul(U,tc))+Math.imul(P,tf)|0,o=Math.imul(P,tc),i=i+Math.imul(N,tp)|0,n=(n=n+Math.imul(N,tm)|0)+Math.imul(L,tp)|0;var tj=(u+i|0)+((8191&n)<<13)|0;u=((o=o+Math.imul(L,tm)|0)+(n>>>13)|0)+(tj>>>26)|0,tj&=0x3ffffff,i=Math.imul(U,tp),n=(n=Math.imul(U,tm))+Math.imul(P,tp)|0;var tC=(u+i|0)+((8191&n)<<13)|0;return u=((o=Math.imul(P,tm))+(n>>>13)|0)+(tC>>>26)|0,tC&=0x3ffffff,h[0]=tg,h[1]=tv,h[2]=ty,h[3]=tw,h[4]=tM,h[5]=t_,h[6]=tb,h[7]=tS,h[8]=tR,h[9]=tx,h[10]=tk,h[11]=tI,h[12]=tO,h[13]=tE,h[14]=tT,h[15]=tq,h[16]=tA,h[17]=tj,h[18]=tC,0!==u&&(h[19]=u,r.length++),r};!Math.imul&&(d=c);function p(t,e,r){return new m().mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}o.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?d(this,t,e):i<63?c(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=0x3ffffff}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=(n/0x4000000|0)+(o>>>26),this.words[r]=0x3ffffff&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=0x3ffffff>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var n,o=t%26,s=Math.min((t-o)/26,this.length),a=0x3ffffff^0x3ffffff>>>o<s)for(this.length-=s,h=0;h=0&&(0!==u||h>=n);h--){var l=0|this.words[h];this.words[h]=u<<26-o|l>>>o,u=l&a}return r&&0!==u&&(r.words[r.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;return!(this.length<=r)&&!!(this.words[r]&1<=0);var e=t%26,r=(t-e)/26;return(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==e&&r++,this.length=Math.min(r,this.length),0!==e&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>e<=0x4000000;e++)this.words[e]-=0x4000000,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<0x4000000),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/0x4000000|0),this.words[n+r]=0x3ffffff&o}for(;n>26,this.words[n+r]=0x3ffffff&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=0x3ffffff&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r,i=this.length-t.length,n=this.clone(),s=t,a=0|s.words[s.length-1];0!=(i=26-this._countBits(a))&&(s=s.ushln(i),n.iushln(i),a=0|s.words[s.length-1]);var h=n.length-s.length;if("mod"!==e){(r=new o(null)).length=h+1,r.words=Array(r.length);for(var u=0;u=0;f--){var c=(0|n.words[s.length+f])*0x4000000+(0|n.words[s.length+f-1]);for(c=Math.min(c/a|0,0x3ffffff),n._ishlnsubmul(s,c,f);0!==n.negative;)c--,n.negative=0,n._ishlnsubmul(s,1,f),!n.isZero()&&(n.negative^=1);r&&(r.words[f]=c)}return r&&r.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:r||null,mod:n}},o.prototype.divmod=function(t,e,r){var n,s,a;if(i(!t.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};if(0!==this.negative&&0===t.negative)return a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s};if(0===this.negative&&0!==t.negative)return a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod};if((this.negative&t.negative)!=0)return a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s};if(t.length>this.length||0>this.cmp(t))return{div:new o(0),mod:this};if(1===t.length)return"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))};return this._wordDiv(t,e)},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=0x3ffffff);for(var e=0x4000000%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=0x3ffffff);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+0x4000000*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),f=e.clone();!e.isZero();){for(var c=0,d=1;(e.words[0]&d)==0&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(f)),n.iushrn(1),s.iushrn(1);for(var p=0,m=1;(r.words[0]&m)==0&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(l),h.isub(f)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(h)):(r.isub(e),a.isub(n),h.isub(s))}return{a:a,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e,r=this,n=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var s=new o(1),a=new o(0),h=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;(r.words[0]&l)==0&&u<26;++u,l<<=1);if(u>0)for(r.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);for(var f=0,c=1;(n.words[0]&c)==0&&f<26;++f,c<<=1);if(f>0)for(n.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);r.cmp(n)>=0?(r.isub(n),s.isub(a)):(n.isub(r),a.isub(s))}return 0>(e=0===r.cmpn(1)?s:a).cmpn(0)&&e.iadd(t),e},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return(1&this.words[0])==0},o.prototype.isOdd=function(){return(1&this.words[0])==1},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=0x3ffffff,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=0x3ffffff,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return -1===this.cmpn(t)},o.prototype.lt=function(t){return -1===this.cmp(t)},o.prototype.lten=function(t){return 0>=this.cmpn(t)},o.prototype.lte=function(t){return 0>=this.cmp(t)},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new b(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){b.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(y,v),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){var e;if(g[t])return g[t];if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else if("p25519"===t)e=new _;else throw Error("Unknown prime "+t);return g[t]=e,e},b.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){i((t.negative|e.negative)==0,"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},b.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},b.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(h);)l.redIAdd(h);for(var f=this.pow(l,n),c=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();i(g=0;i--){for(var u=e.words[i],l=h-1;l>=0;l--){var f=u>>l&1;if(n!==r[0]&&(n=this.sqr(n)),0===f&&0===s){a=0;continue}s<<=1,s|=f,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[s]),a=0,s=0)}h=26}return n},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,b),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},66151:function(t,e,r){"use strict";let i=r(70610),n=r(44020),o=r(80500),s=t=>null==t;function a(t){if("string"!=typeof t||1!==t.length)throw TypeError("arrayFormatSeparator must be single character string")}function h(t,e){return e.encode?e.strict?i(t):encodeURIComponent(t):t}function u(t,e){return e.decode?n(t):t}function l(t){let e=t.indexOf("#");return -1!==e&&(t=t.slice(0,e)),t}function f(t){let e=(t=l(t)).indexOf("?");return -1===e?"":t.slice(e+1)}function c(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):e.parseBooleans&&null!==t&&("true"===t.toLowerCase()||"false"===t.toLowerCase())&&(t="true"===t.toLowerCase()),t}function d(t,e){a((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);let r=function(t){let e;switch(t.arrayFormat){case"index":return(t,r,i)=>{if(e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),!e){i[t]=r;return}void 0===i[t]&&(i[t]={}),i[t][e[1]]=r};case"bracket":return(t,r,i)=>{if(e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),!e){i[t]=r;return}if(void 0===i[t]){i[t]=[r];return}i[t]=[].concat(i[t],r)};case"comma":case"separator":return(e,r,i)=>{let n="string"==typeof r&&r.split("").indexOf(t.arrayFormatSeparator)>-1?r.split(t.arrayFormatSeparator).map(e=>u(e,t)):null===r?r:u(r,t);i[e]=n};default:return(t,e,r)=>{if(void 0===r[t]){r[t]=e;return}r[t]=[].concat(r[t],e)}}}(e),i=Object.create(null);if("string"!=typeof t||!(t=t.trim().replace(/^[?#&]/,"")))return i;for(let n of t.split("&")){let[t,s]=o(e.decode?n.replace(/\+/g," "):n,"=");s=void 0===s?null:["comma","separator"].includes(e.arrayFormat)?s:u(s,e),r(u(t,e),s,i)}for(let t of Object.keys(i)){let r=i[t];if("object"==typeof r&&null!==r)for(let t of Object.keys(r))r[t]=c(r[t],e);else i[t]=c(r,e)}return!1===e.sort?i:(!0===e.sort?Object.keys(i).sort():Object.keys(i).sort(e.sort)).reduce((t,e)=>{let r=i[e];return r&&"object"==typeof r&&!Array.isArray(r)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"==typeof e?t(Object.keys(e)).sort((t,e)=>Number(t)-Number(e)).map(t=>e[t]):e}(r):t[e]=r,t},Object.create(null))}e.extract=f,e.parse=d,e.stringify=(t,e)=>{if(!t)return"";a((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);let r=r=>e.skipNull&&s(t[r])||e.skipEmptyString&&""===t[r],i=function(t){switch(t.arrayFormat){case"index":return e=>(r,i)=>{let n=r.length;return void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[h(e,t),"[",n,"]"].join("")]:[...r,[h(e,t),"[",h(n,t),"]=",h(i,t)].join("")]};case"bracket":return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[h(e,t),"[]"].join("")]:[...r,[h(e,t),"[]=",h(i,t)].join("")];case"comma":case"separator":return e=>(r,i)=>null==i||0===i.length?r:0===r.length?[[h(e,t),"=",h(i,t)].join("")]:[[r,h(i,t)].join(t.arrayFormatSeparator)];default:return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,h(e,t)]:[...r,[h(e,t),"=",h(i,t)].join("")]}}(e),n={};for(let e of Object.keys(t))!r(e)&&(n[e]=t[e]);let o=Object.keys(n);return!1!==e.sort&&o.sort(e.sort),o.map(r=>{let n=t[r];return void 0===n?"":null===n?h(r,e):Array.isArray(n)?n.reduce(i(r),[]).join("&"):h(r,e)+"="+h(n,e)}).filter(t=>t.length>0).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);let[r,i]=o(t,"#");return Object.assign({url:r.split("?")[0]||"",query:d(f(t),e)},e&&e.parseFragmentIdentifier&&i?{fragmentIdentifier:u(i,e)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0},r);let i=l(t.url).split("?")[0]||"",n=e.extract(t.url),o=Object.assign(e.parse(n,{sort:!1}),t.query),s=e.stringify(o,r);s&&(s=`?${s}`);let a=function(t){let e="",r=t.indexOf("#");return -1!==r&&(e=t.slice(r)),e}(t.url);return t.fragmentIdentifier&&(a=`#${h(t.fragmentIdentifier,r)}`),`${i}${s}${a}`}},4501:function(t){t.exports=i,i.strict=n,i.loose=o;var e=Object.prototype.toString,r={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function i(t){return n(t)||o(t)}function n(t){return t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array}function o(t){return r[e.call(t)]}},65054:function(t,e,r){var i=r(48764).Buffer,n=r(4501).strict;t.exports=function(t){if(!n(t))return i.from(t);var e=i.from(t.buffer);return t.byteLength!==t.buffer.byteLength&&(e=e.slice(t.byteOffset,t.byteOffset+t.byteLength)),e}}}]); \ No newline at end of file diff --git a/gateway/dist/2367.6a1021887fc8612575dd.bundle.js b/gateway/dist/2367.6a1021887fc8612575dd.bundle.js new file mode 100644 index 00000000..c5bfe3d9 --- /dev/null +++ b/gateway/dist/2367.6a1021887fc8612575dd.bundle.js @@ -0,0 +1,8 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["2367"],{31833:function(c,e,t){t.r(e),t.d(e,{default:function(){return l}});let l=` + +`}}]); \ No newline at end of file diff --git a/gateway/dist/2419.8124d4cee1b8cfe82b37.bundle.js b/gateway/dist/2419.8124d4cee1b8cfe82b37.bundle.js new file mode 100644 index 00000000..14481784 --- /dev/null +++ b/gateway/dist/2419.8124d4cee1b8cfe82b37.bundle.js @@ -0,0 +1,90 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["2419"],{45378:function(e,i,r){r.r(i),r.d(i,{default:function(){return t}});let t=` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`}}]); \ No newline at end of file diff --git a/gateway/dist/2526.5fb06436fd3e9730bc58.bundle.js b/gateway/dist/2526.5fb06436fd3e9730bc58.bundle.js deleted file mode 100644 index 9b96c412..00000000 --- a/gateway/dist/2526.5fb06436fd3e9730bc58.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([[2526],{52526:(n,i,t)=>{t.r(i),t.d(i,{default:()=>e});const e='\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\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\n\n\n\n\n\n\n\n'}}]); \ No newline at end of file diff --git a/gateway/dist/2643.8a0ce44d2108b8ba9766.bundle.js b/gateway/dist/2643.8a0ce44d2108b8ba9766.bundle.js new file mode 100644 index 00000000..5906abae --- /dev/null +++ b/gateway/dist/2643.8a0ce44d2108b8ba9766.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["2643"],{2860:function(M,I,N){N.r(I),N.d(I,{default:function(){return j}});let j="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIyIiBoZWlnaHQ9IjEyNCIgdmlld0JveD0iMCAwIDEyMiAxMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxtYXNrIGlkPSJtYXNrMF8zMF8xMTAiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMjIiIGhlaWdodD0iMTI0Ij4KPHBhdGggZD0iTTEyMS43ODcgMzQuODMzMUw2OS4zODc2IDAuNDc2NTYyVjE5LjY4NTVMMTAzLjAwMiA0MS41Mjg4TDk5LjA0NzQgNTQuMDQySDY5LjM4NzZWNjkuOTU4SDk5LjA0NzRMMTAzLjAwMiA4Mi40NzEyTDY5LjM4NzYgMTA0LjMxNFYxMjMuNTIzTDEyMS43ODcgODkuMjc2N0wxMTMuMjE4IDYyLjA1NDlMMTIxLjc4NyAzNC44MzMxWiIgZmlsbD0iIzFEMUQxQiIvPgo8cGF0aCBkPSJNMjMuNzk5MyA2OS45NThINTMuMzQ5M1Y1NC4wNDJIMjMuNjg5NEwxOS44NDQ2IDQxLjUyODhMNTMuMzQ5MyAxOS42ODU1VjAuNDc2NTYyTDAuOTUwMTk1IDM0LjgzMzFMOS41MTg2IDYyLjA1NDlMMC45NTAxOTUgODkuMjc2N0w1My40NTkxIDEyMy41MjNWMTA0LjMxNEwxOS44NDQ2IDgyLjQ3MTJMMjMuNzk5MyA2OS45NThaIiBmaWxsPSIjMUQxRDFCIi8+CjwvbWFzaz4KPGcgbWFzaz0idXJsKCNtYXNrMF8zMF8xMTApIj4KPHBhdGggZD0iTTEyMS43ODcgMzQuODMzMUw2OS4zODc2IDAuNDc2NTYyVjE5LjY4NTVMMTAzLjAwMiA0MS41Mjg4TDk5LjA0NzQgNTQuMDQySDY5LjM4NzZWNjkuOTU4SDk5LjA0NzRMMTAzLjAwMiA4Mi40NzEyTDY5LjM4NzYgMTA0LjMxNFYxMjMuNTIzTDEyMS43ODcgODkuMjc2N0wxMTMuMjE4IDYyLjA1NDlMMTIxLjc4NyAzNC44MzMxWiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTIzLjc5OTMgNjkuOTU4SDUzLjM0OTNWNTQuMDQySDIzLjY4OTRMMTkuODQ0NiA0MS41Mjg4TDUzLjM0OTMgMTkuNjg1NVYwLjQ3NjU2MkwwLjk1MDE5NSAzNC44MzMxTDkuNTE4NiA2Mi4wNTQ5TDAuOTUwMTk1IDg5LjI3NjdMNTMuNDU5MSAxMjMuNTIzVjEwNC4zMTRMMTkuODQ0NiA4Mi40NzEyTDIzLjc5OTMgNjkuOTU4WiIgZmlsbD0id2hpdGUiLz4KPHJlY3QgeD0iMS4xMDYzMiIgeT0iMC40NzY1NjIiIHdpZHRoPSIxMzMuNzQ0IiBoZWlnaHQ9IjEzNi4wODUiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8zMF8xMTApIi8+CjxlbGxpcHNlIGN4PSI4LjQzMTc2IiBjeT0iMjcuNDYwMiIgcng9IjExNy42MzkiIHJ5PSIxMjcuNTQ1IiB0cmFuc2Zvcm09InJvdGF0ZSgtMzMuOTMwMyA4LjQzMTc2IDI3LjQ2MDIpIiBmaWxsPSJ1cmwoI3BhaW50MV9yYWRpYWxfMzBfMTEwKSIvPgo8L2c+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfMzBfMTEwIiB4MT0iMTA1LjA4NCIgeTE9IjEzMi41OTQiIHgyPSI2OS44NDM5IiB5Mj0iLTEyLjI3NjUiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iIzBCNDZGOSIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNCQkZCRTAiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDFfcmFkaWFsXzMwXzExMCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg4LjQzMTc1IDI3LjQ2MDIpIHJvdGF0ZSg3Mi4yNTU3KSBzY2FsZSg5Ni40OTc5IDkwLjQ1NDMpIj4KPHN0b3Agb2Zmc2V0PSIwLjExOTc5MiIgc3RvcC1jb2xvcj0iIzg5NTJGRiIgc3RvcC1vcGFjaXR5PSIwLjg3Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0RBQkRGRiIgc3RvcC1vcGFjaXR5PSIwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjwvZGVmcz4KPC9zdmc+Cg=="}}]); \ No newline at end of file diff --git a/gateway/dist/268.f32d875bfd317398481f.bundle.js b/gateway/dist/268.f32d875bfd317398481f.bundle.js new file mode 100644 index 00000000..e4de4dcc --- /dev/null +++ b/gateway/dist/268.f32d875bfd317398481f.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["268"],{76303:function(){}}]); \ No newline at end of file diff --git a/gateway/dist/2686.839243715ee705221a5a.bundle.js b/gateway/dist/2686.839243715ee705221a5a.bundle.js new file mode 100644 index 00000000..8b4c7658 --- /dev/null +++ b/gateway/dist/2686.839243715ee705221a5a.bundle.js @@ -0,0 +1,14 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["2686"],{72503:function(e,s,t){t.r(s),t.d(s,{default:function(){return o}});let o=` + + + + + + + + + + + + +`}}]); \ No newline at end of file diff --git a/gateway/dist/2687.854f324ad04dc2a8dc0b.bundle.js b/gateway/dist/2687.854f324ad04dc2a8dc0b.bundle.js deleted file mode 100644 index 11391e4a..00000000 --- a/gateway/dist/2687.854f324ad04dc2a8dc0b.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([[2687],{62687:(c,n,s)=>{s.r(n),s.d(n,{default:()=>l});const l='\n\n\x3c!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n\n'}}]); \ No newline at end of file diff --git a/gateway/dist/2706.c491132f28b88b1dbebf.bundle.js b/gateway/dist/2706.c491132f28b88b1dbebf.bundle.js new file mode 100644 index 00000000..885ee5ab --- /dev/null +++ b/gateway/dist/2706.c491132f28b88b1dbebf.bundle.js @@ -0,0 +1,7 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["2706"],{34740:function(L,e,t){t.r(e),t.d(e,{default:function(){return s}});let s=` + + +`}}]); \ No newline at end of file diff --git a/gateway/dist/2711.34691f88d26d3e342523.bundle.js b/gateway/dist/2711.34691f88d26d3e342523.bundle.js deleted file mode 100644 index 3ac9cf76..00000000 --- a/gateway/dist/2711.34691f88d26d3e342523.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([[2711],{82711:(e,t,H)=>{H.r(t),H.d(t,{default:()=>V});const V='\n\n\n\n'}}]); \ No newline at end of file diff --git a/gateway/dist/2720.f4edb04151cbcbb909a7.bundle.js b/gateway/dist/2720.f4edb04151cbcbb909a7.bundle.js deleted file mode 100644 index f7a4e322..00000000 --- a/gateway/dist/2720.f4edb04151cbcbb909a7.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([[2720],{52720:(t,n,e)=>{e.r(n),e.d(n,{default:()=>Q});var o=e(59444),i=e(88812),r=e(29050),a=e(12115),s=e(38828);function l(t,{from:n,to:e},i={}){const r=getComputedStyle(t),a="none"===r.transform?"":r.transform,[s,l]=r.transformOrigin.split(" ").map(parseFloat),c=n.left+n.width*s/e.width-(e.left+s),d=n.top+n.height*l/e.height-(e.top+l),{delay:f=0,duration:p=(t=>120*Math.sqrt(t)),easing:v=o.an}=i;return{delay:f,duration:(0,o.Z)(p)?p(Math.sqrt(c*c+d*d)):p,easing:v,css:(t,o)=>{const i=o*c,r=o*d,s=t+o*n.width/e.width,l=t+o*n.height/e.height;return`transform: ${a} translate(${i}px, ${r}px) scale(${s}, ${l});`}}}function c(t){(0,o.a)(t,"svelte-13cuwwo","div.svelte-13cuwwo{box-sizing:content-box}.border.svelte-13cuwwo{border:2px solid;border-radius:120px;overflow:hidden}")}function d(t){let n,e;return{c(){n=(0,o.j)("div"),(0,o.k)(n,"class","border svelte-13cuwwo"),(0,o.k)(n,"style",e=`\n width: ${t[2]-2*t[3]}px; \n height: ${t[2]-2*t[3]}px; \n border-color: var(${t[1]}); \n padding: ${t[3]}px; \n background-color: ${t[4]};\n border-radius: 50%;\n display: flex;\n justify-content: center;\n `)},m(e,i){(0,o.b)(e,n,i),n.innerHTML=t[0]},p(t,[i]){1&i&&(n.innerHTML=t[0]),30&i&&e!==(e=`\n width: ${t[2]-2*t[3]}px; \n height: ${t[2]-2*t[3]}px; \n border-color: var(${t[1]}); \n padding: ${t[3]}px; \n background-color: ${t[4]};\n border-radius: 50%;\n display: flex;\n justify-content: center;\n `)&&(0,o.k)(n,"style",e)},i:o.n,o:o.n,d(t){t&&(0,o.d)(n)}}}function f(t,n,e){let{icon:o}=n,{borderColorVar:i}=n,{size:r}=n,{padding:a=0}=n,{background:s="transparent"}=n;return t.$$set=t=>{"icon"in t&&e(0,o=t.icon),"borderColorVar"in t&&e(1,i=t.borderColorVar),"size"in t&&e(2,r=t.size),"padding"in t&&e(3,a=t.padding),"background"in t&&e(4,s=t.background)},[o,i,r,a,s]}e(46880),e(16075),e(54213),e(60346),e(12926),e(63064),e(70182),e(30228);class p extends o.S{constructor(t){super(),(0,o.i)(this,t,f,d,o.s,{icon:0,borderColorVar:1,size:2,padding:3,background:4},c)}}function v(t){(0,o.a)(t,"svelte-jvic9v","div.notification-icons-wrapper.svelte-jvic9v{height:32px;width:32px}.border.svelte-jvic9v{border-radius:8px}div.notification-icon.svelte-jvic9v{padding:6px}div.pending-icon.svelte-jvic9v{animation:svelte-jvic9v-blink 2s ease-in infinite;height:100%;width:100%;padding:7px}@keyframes svelte-jvic9v-blink{from,to{opacity:1}50%{opacity:0.2}}div.border-action.svelte-jvic9v{height:32px;min-width:32px;border-radius:8px;overflow:hidden;will-change:transform}div.border-action.svelte-jvic9v:before{content:'';background-image:conic-gradient(#b1b7f2 20deg, #6370e5 120deg);height:140%;width:140%;position:absolute;left:-25%;top:-25%;animation:svelte-jvic9v-rotate 2s infinite linear}div.chain-icon-container.svelte-jvic9v{left:18px;top:18px}@keyframes svelte-jvic9v-rotate{100%{transform:rotate(-360deg)}}")}function u(t){let n,e,i,r,a,s,l,c,d=o.ao[t[1].type].eventIcon+"",f=!t[1].id.includes("customNotification")&&!t[1].id.includes("preflight"),p="pending"===t[1].type&&y(),v=f&&m(t);return{c(){n=(0,o.j)("div"),p&&p.c(),e=(0,o.G)(),i=(0,o.j)("div"),r=(0,o.j)("div"),l=(0,o.G)(),v&&v.c(),(0,o.k)(r,"class",a=(0,o.l)("notification-icon flex items-center justify-center "+("pending"===t[1].type?"pending-icon":""))+" svelte-jvic9v"),(0,o.k)(i,"class","flex items-center justify-center border relative notification-icons-wrapper svelte-jvic9v"),(0,o.k)(i,"style",s=`background:${o.ao[t[1].type].backgroundColor}; color: ${o.ao[t[1].type].iconColor||""}; ${"pending"===t[1].type?"height: 28px; width: 28px; margin: 2px;":`border: 2px solid ${o.ao[t[1].type].borderColor}`}; `),(0,o.k)(n,"class","relative")},m(t,a){(0,o.b)(t,n,a),p&&p.m(n,null),(0,o.m)(n,e),(0,o.m)(n,i),(0,o.m)(i,r),r.innerHTML=d,(0,o.m)(n,l),v&&v.m(n,null),c=!0},p(t,l){"pending"===t[1].type?p||(p=y(),p.c(),p.m(n,e)):p&&(p.d(1),p=null),(!c||2&l)&&d!==(d=o.ao[t[1].type].eventIcon+"")&&(r.innerHTML=d),(!c||2&l&&a!==(a=(0,o.l)("notification-icon flex items-center justify-center "+("pending"===t[1].type?"pending-icon":""))+" svelte-jvic9v"))&&(0,o.k)(r,"class",a),(!c||2&l&&s!==(s=`background:${o.ao[t[1].type].backgroundColor}; color: ${o.ao[t[1].type].iconColor||""}; ${"pending"===t[1].type?"height: 28px; width: 28px; margin: 2px;":`border: 2px solid ${o.ao[t[1].type].borderColor}`}; `))&&(0,o.k)(i,"style",s),2&l&&(f=!t[1].id.includes("customNotification")&&!t[1].id.includes("preflight")),f?v?(v.p(t,l),2&l&&(0,o.x)(v,1)):(v=m(t),v.c(),(0,o.x)(v,1),v.m(n,null)):v&&((0,o.y)(),(0,o.A)(v,1,1,(()=>{v=null})),(0,o.z)())},i(t){c||((0,o.x)(v),c=!0)},o(t){(0,o.A)(v),c=!1},d(t){t&&(0,o.d)(n),p&&p.d(),v&&v.d()}}}function y(t){let n;return{c(){n=(0,o.j)("div"),(0,o.k)(n,"class","border-action absolute svelte-jvic9v")},m(t,e){(0,o.b)(t,n,e)},d(t){t&&(0,o.d)(n)}}}function m(t){let n,e,i;return e=new p({props:{icon:t[0].icon,size:16,background:t[0].color,borderColorVar:"--notify-onboard-background, var(--onboard-gray-600, var(--gray-600))",padding:3}}),{c(){n=(0,o.j)("div"),(0,o.F)(e.$$.fragment),(0,o.k)(n,"class","absolute chain-icon-container svelte-jvic9v")},m(t,r){(0,o.b)(t,n,r),(0,o.I)(e,n,null),i=!0},p(t,n){const o={};1&n&&(o.icon=t[0].icon),1&n&&(o.background=t[0].color),e.$set(o)},i(t){i||((0,o.x)(e.$$.fragment,t),i=!0)},o(t){(0,o.A)(e.$$.fragment,t),i=!1},d(t){t&&(0,o.d)(n),(0,o.K)(e)}}}function b(t){let n,e,i=t[1].type&&u(t);return{c(){i&&i.c(),n=(0,o.e)()},m(t,r){i&&i.m(t,r),(0,o.b)(t,n,r),e=!0},p(t,[e]){t[1].type?i?(i.p(t,e),2&e&&(0,o.x)(i,1)):(i=u(t),i.c(),(0,o.x)(i,1),i.m(n.parentNode,n)):i&&((0,o.y)(),(0,o.A)(i,1,1,(()=>{i=null})),(0,o.z)())},i(t){e||((0,o.x)(i),e=!0)},o(t){(0,o.A)(i),e=!1},d(t){i&&i.d(t),t&&(0,o.d)(n)}}}function h(t,n,e){let{chainStyles:i=o.a6}=n,{notification:r}=n;return t.$$set=t=>{"chainStyles"in t&&e(0,i=t.chainStyles),"notification"in t&&e(1,r=t.notification)},[i,r]}class g extends o.S{constructor(t){super(),(0,o.i)(this,t,h,b,o.s,{chainStyles:0,notification:1},v)}}function k(t){(0,o.a)(t,"svelte-pm7idu","div.svelte-pm7idu{display:flex;justify-content:center;font-size:inherit;font-family:inherit;margin:0 1.5rem 0 0.75rem}span.svelte-pm7idu{font-family:inherit;display:flex;align-items:center;margin:0 2px}.time.svelte-pm7idu{color:var(\n --notify-onboard-timer-color,\n var(--onboard-gray-300, var(--gray-300))\n );margin-left:4px}")}function x(t){let n,e,i,r,a=t[2](t[1]-t[0])+"";return{c(){n=(0,o.t)("-\n "),e=(0,o.j)("span"),i=(0,o.t)(a),r=(0,o.t)("\n ago"),(0,o.k)(e,"class","svelte-pm7idu")},m(t,a){(0,o.b)(t,n,a),(0,o.b)(t,e,a),(0,o.m)(e,i),(0,o.b)(t,r,a)},p(t,n){3&n&&a!==(a=t[2](t[1]-t[0])+"")&&(0,o.v)(i,a)},d(t){t&&(0,o.d)(n),t&&(0,o.d)(e),t&&(0,o.d)(r)}}}function w(t){let n,e=t[0]&&x(t);return{c(){n=(0,o.j)("div"),e&&e.c(),(0,o.k)(n,"class","time svelte-pm7idu")},m(t,i){(0,o.b)(t,n,i),e&&e.m(n,null)},p(t,[o]){t[0]?e?e.p(t,o):(e=x(t),e.c(),e.m(n,null)):e&&(e.d(1),e=null)},i:o.n,o:o.n,d(t){t&&(0,o.d)(n),e&&e.d()}}}function $(t,n,e){let r,a;(0,o.c)(t,i._,(t=>e(3,r=t))),(0,o.c)(t,i.Hg,(t=>e(4,a=t)));let{startTime:s}=n,l=Date.now();const c=setInterval((()=>{e(1,l=Date.now())}),1e3);return(0,o.al)((()=>{clearInterval(c)})),t.$$set=t=>{"startTime"in t&&e(0,s=t.startTime)},[s,l,function(t){const n=Math.floor(t/1e3),e=n<0?0:n;return e>=60?`${Math.floor(e/60).toLocaleString(a)} ${r("notify.time.minutes")}`:`${e.toLocaleString(a)} ${r("notify.time.seconds")}`}]}class j extends o.S{constructor(t){super(),(0,o.i)(this,t,$,w,o.s,{startTime:0},k)}}function z(t){(0,o.a)(t,"svelte-1otz6tt","div.notify-transaction-data.svelte-1otz6tt{font-size:var(\n --notify-onboard-transaction-font-size,\n var(--onboard-font-size-6, var(--font-size-6))\n );font-family:inherit;margin:0px 20px 0px 8px;justify-content:center}.hash-time.svelte-1otz6tt{display:inline-flex;margin-top:4px;font-size:var(\n --notify-onboard-hash-time-font-size,\n var(--onboard-font-size-7, var(--font-size-7))\n );line-height:var(\n --notify-onboard-hash-time-font-line-height,\n var(--onboard-font-line-height-4, var(--font-line-height-4))\n )}.address-hash.svelte-1otz6tt{color:var(\n --notify-onboard-address-hash-color,\n var(--onboard-primary-200, var(--primary-200))\n )}a.address-hash.svelte-1otz6tt{color:var(\n --notify-onboard-anchor-color,\n var(--onboard-primary-400, var(--primary-400))\n )}a.svelte-1otz6tt{display:flex;text-decoration:none;color:inherit}.transaction-status.svelte-1otz6tt{color:var(--notify-onboard-transaction-status, inherit);line-height:var(\n --notify-onboard-font-size-5,\n var(--onboard-font-size-5, var(--font-size-5))\n );font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}")}function C(t){let n,e,i,r;function a(t,n){return t[0].link?P:L}let s=a(t),l=s(t);return i=new j({props:{startTime:t[0].startTime}}),{c(){n=(0,o.j)("span"),l.c(),e=(0,o.G)(),(0,o.F)(i.$$.fragment),(0,o.k)(n,"class","hash-time svelte-1otz6tt")},m(t,a){(0,o.b)(t,n,a),l.m(n,null),(0,o.m)(n,e),(0,o.I)(i,n,null),r=!0},p(t,o){s===(s=a(t))&&l?l.p(t,o):(l.d(1),l=s(t),l&&(l.c(),l.m(n,e)));const r={};1&o&&(r.startTime=t[0].startTime),i.$set(r)},i(t){r||((0,o.x)(i.$$.fragment,t),r=!0)},o(t){(0,o.A)(i.$$.fragment,t),r=!1},d(t){t&&(0,o.d)(n),l.d(),(0,o.K)(i)}}}function L(t){let n,e,i=(0,o.E)(t[0].id)+"";return{c(){n=(0,o.j)("div"),e=(0,o.t)(i),(0,o.k)(n,"class","address-hash svelte-1otz6tt")},m(t,i){(0,o.b)(t,n,i),(0,o.m)(n,e)},p(t,n){1&n&&i!==(i=(0,o.E)(t[0].id)+"")&&(0,o.v)(e,i)},d(t){t&&(0,o.d)(n)}}}function P(t){let n,e,i,r=(0,o.E)(t[0].id)+"";return{c(){n=(0,o.j)("a"),e=(0,o.t)(r),(0,o.k)(n,"class","address-hash svelte-1otz6tt"),(0,o.k)(n,"href",i=t[0].link),(0,o.k)(n,"target","_blank"),(0,o.k)(n,"rel","noreferrer noopener")},m(t,i){(0,o.b)(t,n,i),(0,o.m)(n,e)},p(t,a){1&a&&r!==(r=(0,o.E)(t[0].id)+"")&&(0,o.v)(e,r),1&a&&i!==(i=t[0].link)&&(0,o.k)(n,"href",i)},d(t){t&&(0,o.d)(n)}}}function T(t){let n,e,i,r,a,s=t[0].message+"",l=t[0].id&&!t[0].id.includes("customNotification")&&!t[0].id.includes("preflight"),c=l&&C(t);return{c(){n=(0,o.j)("div"),e=(0,o.j)("span"),i=(0,o.t)(s),r=(0,o.G)(),c&&c.c(),(0,o.k)(e,"class","transaction-status svelte-1otz6tt"),(0,o.k)(n,"class","flex flex-column notify-transaction-data svelte-1otz6tt")},m(t,s){(0,o.b)(t,n,s),(0,o.m)(n,e),(0,o.m)(e,i),(0,o.m)(n,r),c&&c.m(n,null),a=!0},p(t,[e]){(!a||1&e)&&s!==(s=t[0].message+"")&&(0,o.v)(i,s),1&e&&(l=t[0].id&&!t[0].id.includes("customNotification")&&!t[0].id.includes("preflight")),l?c?(c.p(t,e),1&e&&(0,o.x)(c,1)):(c=C(t),c.c(),(0,o.x)(c,1),c.m(n,null)):c&&((0,o.y)(),(0,o.A)(c,1,1,(()=>{c=null})),(0,o.z)())},i(t){a||((0,o.x)(c),a=!0)},o(t){(0,o.A)(c),a=!1},d(t){t&&(0,o.d)(n),c&&c.d()}}}function S(t,n,e){let{notification:o}=n;return t.$$set=t=>{"notification"in t&&e(0,o=t.notification)},[o]}class A extends o.S{constructor(t){super(),(0,o.i)(this,t,S,T,o.s,{notification:0},z)}}const M=["txPool"],F=["main","matic-main"],G=["Ledger","Trezor","Keystone","KeepKey","D'CENT"],H=t=>M.includes(t),I=t=>F.includes(t),E=t=>t&&G.includes(t.label);async function R({type:t,wallet:n,transaction:e}){const{from:i,input:r,value:a,to:l,nonce:c,gas:d,network:f}=e,p=o.ap[f],{gasPriceProbability:v}=o.a3.get().notify.replacement,{gas:u,apiKey:y}=o.af,[m]=await u.get({chains:[o.ap[f]],endpoint:"blockPrices",apiKey:y}),{maxFeePerGas:b,maxPriorityFeePerGas:h}=m.blockPrices[0].estimatedPrices.find((({confidence:n})=>n===("speedup"===t?v.speedup:v.cancel))),g=(0,o.aq)(b),k=(0,o.aq)(h),x="0x"===r?{}:{data:r};return n.provider.request({method:"eth_sendTransaction",params:[{type:"0x2",from:i,to:"cancel"===t?i:l,chainId:parseInt(p),value:`${s.gH.from(a).toHexString()}`,nonce:(0,o.ar)(c),gasLimit:(0,o.ar)(d),maxFeePerGas:g,maxPriorityFeePerGas:k,...x}]})}function K(t){(0,o.a)(t,"svelte-ftkynd",".bn-notify-notification.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{--backround-color:var(--notify-onboard-background, var(--w3o-backround-color, var(--gray-700)));--foreground-color:var(--w3o-foreground-color, var(--gray-600));--text-color:var(--w3o-text-color, #FFF);--border-color:var(--w3o-border-color);font-family:inherit;transition:background 300ms ease-in-out, color 300ms ease-in-out;pointer-events:all;backdrop-filter:blur(5px);width:100%;min-height:56px;display:flex;flex-direction:column;position:relative;overflow:hidden;border:1px solid transparent;border-radius:var(\n --notify-onboard-border-radius,\n var(--onboard-border-radius-4, var(--border-radius-4))\n );background:var(--foreground-color);color:var(--text-color)}.bn-notify-notification-inner.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{padding:0.75rem}.bn-notify-notification.svelte-ftkynd:hover>div.bn-notify-notification-inner.svelte-ftkynd>div.notify-close-btn-desktop.svelte-ftkynd{visibility:visible;opacity:1}div.notify-close-btn.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{margin-left:auto;margin-bottom:auto;height:24px;width:24px;position:absolute;top:8px;right:8px;justify-content:center;align-items:center}div.notify-close-btn-desktop.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{visibility:hidden;transition:visibility 0.15s linear, opacity 0.15s linear;opacity:0}.notify-close-btn.svelte-ftkynd .close-icon.svelte-ftkynd.svelte-ftkynd{width:20px;margin:auto;color:var(--text-color)}.notify-close-btn.svelte-ftkynd>.close-icon.svelte-ftkynd.svelte-ftkynd{color:var(--notify-onboard-close-icon-color)}.notify-close-btn.svelte-ftkynd:hover>.close-icon.svelte-ftkynd.svelte-ftkynd{color:var(--notify-onboard-close-icon-hover)}.transaction-status.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{color:var(\n --notify-onboard-transaction-status-color,\n var(--onboard-primary-100, var(--primary-100))\n );line-height:14px}.dropdown.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{height:0px;overflow:hidden;transition:height 150ms ease-in-out}.dropdown-visible.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{height:48px}.dropdown-buttons.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{background-color:var(\n --notify-onboard-dropdown-background,\n var(--onboard-gray-700, var(--gray-700))\n );width:100%;padding:8px}.dropdown-button.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd{padding:4px 12px;border-radius:var(\n --notify-onboard-dropdown-border-radius,\n var(--onboard-border-radius-5, var(--border-radius-5))\n );background-color:transparent;font-size:var(\n --notify-onboard-dropdown-font-size,\n var(--onboard-font-size-6, var(--font-size-6))\n );color:var(\n --notify-onboard-dropdown-text-color,\n var(--onboard-primary-400, var(--primary-400))\n );transition:all 150ms ease-in-out;cursor:pointer}.dropdown-button.svelte-ftkynd.svelte-ftkynd.svelte-ftkynd:hover{background:var(\n --notify-onboard-dropdown-btn-hover-background,\n rgba(146, 155, 237, 0.2)\n )}")}function _(t){let n,e,i,r,a,s;return{c(){n=(0,o.j)("div"),e=(0,o.j)("button"),e.textContent="Cancel",i=(0,o.G)(),r=(0,o.j)("button"),r.textContent="Speed-up",(0,o.k)(e,"class","dropdown-button svelte-ftkynd"),(0,o.k)(r,"class","dropdown-button svelte-ftkynd"),(0,o.k)(n,"class","dropdown-buttons flex items-center justify-end svelte-ftkynd")},m(l,c){(0,o.b)(l,n,c),(0,o.m)(n,e),(0,o.m)(n,i),(0,o.m)(n,r),a||(s=[(0,o.p)(e,"click",t[9]),(0,o.p)(r,"click",t[10])],a=!0)},p:o.n,d(t){t&&(0,o.d)(n),a=!1,(0,o.L)(s)}}}function D(t){let n,e,i,r,a,s,l,c,d,f,p,v,u,y;i=new g({props:{notification:t[0],chainStyles:o.as[o.ap[t[0].network]]}}),a=new A({props:{notification:t[0]}});let m="txPool"===t[0].eventCode&&_(t);return{c(){n=(0,o.j)("div"),e=(0,o.j)("div"),(0,o.F)(i.$$.fragment),r=(0,o.G)(),(0,o.F)(a.$$.fragment),s=(0,o.G)(),l=(0,o.j)("div"),c=(0,o.j)("div"),d=(0,o.G)(),f=(0,o.j)("div"),m&&m.c(),(0,o.k)(c,"class","flex items-center close-icon svelte-ftkynd"),(0,o.k)(l,"class","notify-close-btn notify-close-btn-"+t[4].type+" pointer flex svelte-ftkynd"),(0,o.k)(e,"class","flex bn-notify-notification-inner svelte-ftkynd"),(0,o.k)(f,"class","dropdown svelte-ftkynd"),(0,o.H)(f,"dropdown-visible",t[2]&&t[5]&&H(t[0].eventCode)&&I(t[0].network)&&E(t[7])),(0,o.k)(n,"class",p="bn-notify-notification bn-notify-notification-"+t[0].type+"} svelte-ftkynd"),(0,o.H)(n,"bn-notify-clickable",t[0].onClick)},m(p,b){(0,o.b)(p,n,b),(0,o.m)(n,e),(0,o.I)(i,e,null),(0,o.m)(e,r),(0,o.I)(a,e,null),(0,o.m)(e,s),(0,o.m)(e,l),(0,o.m)(l,c),c.innerHTML='\n\n \n\n',(0,o.m)(n,d),(0,o.m)(n,f),m&&m.m(f,null),v=!0,u||(y=[(0,o.p)(l,"click",(0,o.J)(t[8])),(0,o.p)(n,"mouseenter",t[11]),(0,o.p)(n,"mouseleave",t[12]),(0,o.p)(n,"click",t[13])],u=!0)},p(t,[e]){const r={};1&e&&(r.notification=t[0]),1&e&&(r.chainStyles=o.as[o.ap[t[0].network]]),i.$set(r);const s={};1&e&&(s.notification=t[0]),a.$set(s),"txPool"===t[0].eventCode?m?m.p(t,e):(m=_(t),m.c(),m.m(f,null)):m&&(m.d(1),m=null),(!v||165&e)&&(0,o.H)(f,"dropdown-visible",t[2]&&t[5]&&H(t[0].eventCode)&&I(t[0].network)&&E(t[7])),(!v||1&e&&p!==(p="bn-notify-notification bn-notify-notification-"+t[0].type+"} svelte-ftkynd"))&&(0,o.k)(n,"class",p),(!v||1&e)&&(0,o.H)(n,"bn-notify-clickable",t[0].onClick)},i(t){v||((0,o.x)(i.$$.fragment,t),(0,o.x)(a.$$.fragment,t),v=!0)},o(t){(0,o.A)(i.$$.fragment,t),(0,o.A)(a.$$.fragment,t),v=!1},d(t){t&&(0,o.d)(n),(0,o.K)(i),(0,o.K)(a),m&&m.d(),u=!1,(0,o.L)(y)}}}function N(t,n,e){let r,a;(0,o.c)(t,o.w,(t=>e(15,r=t))),(0,o.c)(t,i._,(t=>e(3,a=t)));const{device:s,gas:l}=o.af;let c,{notification:d}=n,{updateParentOnRemove:f}=n,p=!1;const v=o.at.getValue().find((({hash:t})=>t===d.id)),u=v&&r.find((({accounts:t})=>!!t.find((({address:t})=>t.toLowerCase()===v.from.toLowerCase()))));return(0,o.al)((()=>{clearTimeout(c)})),t.$$set=t=>{"notification"in t&&e(0,d=t.notification),"updateParentOnRemove"in t&&e(1,f=t.updateParentOnRemove)},t.$$.update=()=>{1&t.$$.dirty&&d.autoDismiss&&(c=setTimeout((()=>{(0,o.au)(d.id),(0,o.av)(d.id)}),d.autoDismiss))},[d,f,p,a,s,l,v,u,()=>{(0,o.au)(d.id),(0,o.av)(d.id),f()},async()=>{try{await R({type:"cancel",wallet:u,transaction:v})}catch(t){const n=`${v.hash.slice(0,9)}:txReplaceError${v.hash.slice(-5)}`;(0,o.aw)({id:n,type:"hint",eventCode:"txError",message:a("notify.transaction.txReplaceError"),key:n,autoDismiss:4e3})}},async()=>{try{await R({type:"speedup",wallet:u,transaction:v})}catch(t){const n=`${v.hash.slice(0,9)}:txReplaceError${v.hash.slice(-5)}`;(0,o.aw)({id:n,type:"hint",eventCode:"txError",message:a("notify.transaction.txReplaceError"),key:n,autoDismiss:4e3})}},()=>e(2,p=!0),()=>e(2,p=!1),t=>d.onClick&&d.onClick(t)]}class V extends o.S{constructor(t){super(),(0,o.i)(this,t,N,D,o.s,{notification:0,updateParentOnRemove:1},K)}}function O(t){(0,o.a)(t,"svelte-1h8mmo3","ul.svelte-1h8mmo3{padding-left:0;display:flex;flex-flow:column nowrap;font-size:var(\n --notify-onboard-font-size,\n var(--onboard-font-size-5, var(--font-size-5))\n );list-style-type:none;overflow:visible;scrollbar-width:none;box-sizing:border-box;z-index:var(--notify-onboard-z-index, 300);font-family:var(\n --notify-onboard-font-family,\n var(--onboard-font-family-normal, inherit)\n );margin:8px 0;pointer-events:all}.y-scroll.svelte-1h8mmo3{overflow-y:scroll}.y-visible.svelte-1h8mmo3{overflow-y:visible}li.notification-list-top.svelte-1h8mmo3:not(:first-child){margin-top:8px}li.notification-list-bottom.svelte-1h8mmo3:not(:first-child){margin-bottom:8px}ul.bn-notify-bottomLeft.svelte-1h8mmo3,ul.bn-notify-bottomRight.svelte-1h8mmo3{flex-direction:column-reverse}@media only screen and (max-width: 450px){ul.svelte-1h8mmo3{width:100%}}.bn-notify-clickable:hover{cursor:pointer}.svelte-1h8mmo3::-webkit-scrollbar{display:none}")}function q(t,n,e){const o=t.slice();return o[12]=n[e],o}function Z(t){let n,e,i,r,a=[],s=new Map,l=t[2];const c=t=>t[12].key;for(let n=0;n{f&&(c&&c.end(1),s=(0,o.V)(e,o.ab,{duration:1200,delay:300,x:n[3],y:n[4],easing:U}),s.start())})),f=!0)},o(t){(0,o.A)(i.$$.fragment,t),s&&s.invalidate(),c=(0,o.ak)(e,o.X,{duration:300,easing:o.an}),f=!1},d(t){t&&(0,o.d)(e),(0,o.K)(i),t&&c&&c.end(),p=!1,v()}}}function J(t){let n,e,i=t[2].length&&Z(t);return{c(){i&&i.c(),n=(0,o.e)()},m(t,r){i&&i.m(t,r),(0,o.b)(t,n,r),e=!0},p(t,[e]){t[2].length?i?(i.p(t,e),4&e&&(0,o.x)(i,1)):(i=Z(t),i.c(),(0,o.x)(i,1),i.m(n.parentNode,n)):i&&((0,o.y)(),(0,o.A)(i,1,1,(()=>{i=null})),(0,o.z)())},i(t){e||((0,o.x)(i),e=!0)},o(t){(0,o.A)(i),e=!1},d(t){i&&i.d(t),t&&(0,o.d)(n)}}}function U(t){return Math.sin(-13*(t+1)*Math.PI/2)*Math.pow(2,-35*t)+1}function X(t,n,e){let i;const{device:s}=o.af,l=o.a3.select("accountCenter").pipe((0,r.Z)(o.a3.get().accountCenter),(0,a.t)(1));(0,o.c)(t,l,(t=>e(6,i=t)));let c,d,{position:f}=n,{sharedContainer:p}=n,{notifications:v}=n;c=0,d=0;let u="y-scroll";const y=function(){let t=null;return(n,e)=>{clearTimeout(t),t=setTimeout(n,e)}}();return t.$$set=t=>{"position"in t&&e(0,f=t.position),"sharedContainer"in t&&e(1,p=t.sharedContainer),"notifications"in t&&e(2,v=t.notifications)},t.$$.update=()=>{1&t.$$.dirty&&(f.includes("top")?e(4,d=-50):e(4,d=50))},[f,p,v,0,d,u,i,s,l,()=>{"y-visible"!==u&&e(5,u="y-visible"),y((function(){e(5,u="y-scroll")}),1e3)},function(n){o.ai.call(this,t,n)}]}class Q extends o.S{constructor(t){super(),(0,o.i)(this,t,X,J,o.s,{position:0,sharedContainer:1,notifications:2},O)}}}}]); \ No newline at end of file diff --git a/gateway/dist/2813.08972e0adab829ca3fd4.bundle.js b/gateway/dist/2813.08972e0adab829ca3fd4.bundle.js new file mode 100644 index 00000000..2ebda9d6 --- /dev/null +++ b/gateway/dist/2813.08972e0adab829ca3fd4.bundle.js @@ -0,0 +1,13 @@ +"use strict";(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([["2813"],{31010:function(t,e,d){d.r(e),d.d(e,{default:function(){return a}});let a=` + + + + + + + + + + + +`}}]); \ No newline at end of file diff --git a/gateway/dist/2815.fcefde563530f833b75c.bundle.js b/gateway/dist/2815.fcefde563530f833b75c.bundle.js deleted file mode 100644 index d0bdfc69..00000000 --- a/gateway/dist/2815.fcefde563530f833b75c.bundle.js +++ /dev/null @@ -1,190 +0,0 @@ -/*! For license information please see 2815.fcefde563530f833b75c.bundle.js.LICENSE.txt */ -(self.webpackChunkbos_workspace_gateway=self.webpackChunkbos_workspace_gateway||[]).push([[2815],{82815:function(e,t,n){var r=n(65606),i=n(48287).Buffer;!function(e){"use strict";let t=!1;const o=e=>(n,...r)=>{t&&console.debug(`[${e}] ${n}`,...r)},s=e=>(t,...n)=>{console.error(`[${e}] ${t}`,...n)};class a extends Error{constructor(){super(),this.name=this.constructor.name,this.message="The Ledger Extension was not found."}}class c extends Error{constructor(){super(),this.name=this.constructor.name,this.message="The specified provider is not supported."}}class u extends Error{constructor(){super(),this.name=this.constructor.name,this.code=4001,this.message="User rejected request"}}class l extends Error{constructor(){super(),this.message="Connect Kit does not support server side."}}function f(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function p(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var g={exports:{}};!function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=63)}([function(e,t,n){(function(e){n.d(t,"f",(function(){return a})),n.d(t,"g",(function(){return c})),n.d(t,"i",(function(){return u})),n.d(t,"h",(function(){return l})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return h})),n.d(t,"e",(function(){return d})),n.d(t,"d",(function(){return p})),n.d(t,"o",(function(){return g})),n.d(t,"n",(function(){return y})),n.d(t,"q",(function(){return m})),n.d(t,"p",(function(){return v})),n.d(t,"D",(function(){return _})),n.d(t,"C",(function(){return b})),n.d(t,"E",(function(){return w})),n.d(t,"F",(function(){return E})),n.d(t,"w",(function(){return S})),n.d(t,"v",(function(){return O})),n.d(t,"x",(function(){return R})),n.d(t,"y",(function(){return I})),n.d(t,"t",(function(){return P})),n.d(t,"s",(function(){return k})),n.d(t,"u",(function(){return N})),n.d(t,"r",(function(){return A})),n.d(t,"m",(function(){return T})),n.d(t,"l",(function(){return M})),n.d(t,"k",(function(){return L})),n.d(t,"j",(function(){return U})),n.d(t,"A",(function(){return D})),n.d(t,"a",(function(){return z})),n.d(t,"B",(function(){return B})),n.d(t,"z",(function(){return F}));var r=n(22),i=n.n(r),o=n(58),s=n.n(o);function a(e){return new Uint8Array(e)}function c(e,t=!1){const n=e.toString("hex");return t?z(n):n}function u(e){return e.toString("utf8")}function l(e){return e.readUIntBE(0,e.length)}function f(e){return s()(e)}function h(e,t=!1){return c(f(e),t)}function d(e){return u(f(e))}function p(e){return l(f(e))}function g(t){return e.from(D(t),"hex")}function y(e){return a(g(e))}function m(e){return u(g(e))}function v(e){return p(y(e))}function _(t){return e.from(t,"utf8")}function b(e){return a(_(e))}function w(e,t=!1){return c(_(e),t)}function E(e){const t=parseInt(e,10);return function(e,t){if(!e)throw new Error("Number can only safely store up to 53 bits")}(!function(e){return void 0===e}(t)),t}function S(e){return f(C(x(e)))}function O(e){return C(x(e))}function R(e,t){return function(e,t){return h(C(e),t)}(x(e),t)}function I(e){return""+e}function x(e){return j((e>>>0).toString(2))}function C(e){return new Uint8Array(function(e,t=8){const n=j(e).match(new RegExp(`.{${t}}`,"gi"));return Array.from(n||[])}(e).map((e=>parseInt(e,2))))}function P(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function k(t){return e.isBuffer(t)}function N(e){return i.a.strict(e)&&!k(e)}function A(e){return!N(e)&&!k(e)&&void 0!==e.byteLength}function T(e){return k(e)?"buffer":N(e)?"typed-array":A(e)?"array-buffer":Array.isArray(e)?"array":typeof e}function M(e){return function(e){return!("string"!=typeof e||!new RegExp(/^[01]+$/).test(e))&&e.length%8==0}(e)?"binary":P(e)?"hex":"utf8"}function L(...t){return e.concat(t)}function U(...e){let t=[];return e.forEach((e=>t=t.concat(Array.from(e)))),new Uint8Array([...t])}function j(e,t=8,n="0"){return function(e,t,n="0"){return function(e,t,n,r="0"){const i=t-e.length;let o=e;if(i>0){const t=r.repeat(i);o=n?t+e:e+t}return o}(e,t,!0,n)}(e,function(e,t=8){const n=e%t;return n?(e-n)/t*t+t:e}(e.length,t),n)}function D(e){return e.replace(/^0x/,"")}function z(e){return e.startsWith("0x")?e:"0x"+e}function B(e){return(e=j(e=D(e),2))&&(e=z(e)),e}function F(e){const t=e.startsWith("0x");return e=(e=D(e)).startsWith("0")?e.substring(1):e,t?z(e):e}}).call(this,n(44).Buffer)},function(e,t,n){n.r(t),n.d(t,"convertArrayBufferToBuffer",(function(){return i})),n.d(t,"convertArrayBufferToUtf8",(function(){return o})),n.d(t,"convertArrayBufferToHex",(function(){return s})),n.d(t,"convertArrayBufferToNumber",(function(){return a})),n.d(t,"concatArrayBuffers",(function(){return c})),n.d(t,"convertBufferToArrayBuffer",(function(){return u})),n.d(t,"convertBufferToUtf8",(function(){return l})),n.d(t,"convertBufferToHex",(function(){return f})),n.d(t,"convertBufferToNumber",(function(){return h})),n.d(t,"concatBuffers",(function(){return d})),n.d(t,"convertUtf8ToArrayBuffer",(function(){return p})),n.d(t,"convertUtf8ToBuffer",(function(){return g})),n.d(t,"convertUtf8ToHex",(function(){return y})),n.d(t,"convertUtf8ToNumber",(function(){return m})),n.d(t,"convertHexToBuffer",(function(){return v})),n.d(t,"convertHexToArrayBuffer",(function(){return _})),n.d(t,"convertHexToUtf8",(function(){return b})),n.d(t,"convertHexToNumber",(function(){return w})),n.d(t,"convertNumberToBuffer",(function(){return E})),n.d(t,"convertNumberToArrayBuffer",(function(){return S})),n.d(t,"convertNumberToUtf8",(function(){return O})),n.d(t,"convertNumberToHex",(function(){return R})),n.d(t,"detectEnv",(function(){return B})),n.d(t,"detectOS",(function(){return F})),n.d(t,"isAndroid",(function(){return H})),n.d(t,"isIOS",(function(){return q})),n.d(t,"isMobile",(function(){return $})),n.d(t,"isNode",(function(){return V})),n.d(t,"isBrowser",(function(){return W})),n.d(t,"safeJsonParse",(function(){return G})),n.d(t,"safeJsonStringify",(function(){return Y})),n.d(t,"setLocal",(function(){return Q})),n.d(t,"getLocal",(function(){return J})),n.d(t,"removeLocal",(function(){return X})),n.d(t,"getClientMeta",(function(){return ee})),n.d(t,"sanitizeHex",(function(){return re})),n.d(t,"addHexPrefix",(function(){return ie})),n.d(t,"removeHexPrefix",(function(){return oe})),n.d(t,"removeHexLeadingZeros",(function(){return se})),n.d(t,"payloadId",(function(){return ae})),n.d(t,"uuid",(function(){return ce})),n.d(t,"logDeprecationWarning",(function(){return ue})),n.d(t,"getInfuraRpcUrl",(function(){return le})),n.d(t,"getRpcUrl",(function(){return fe})),n.d(t,"formatIOSMobile",(function(){return he})),n.d(t,"saveMobileLinkInfo",(function(){return de})),n.d(t,"getMobileRegistryEntry",(function(){return pe})),n.d(t,"getMobileLinkRegistry",(function(){return ge})),n.d(t,"promisify",(function(){return ye})),n.d(t,"formatRpcError",(function(){return me})),n.d(t,"getWalletRegistryUrl",(function(){return _e})),n.d(t,"getDappRegistryUrl",(function(){return be})),n.d(t,"formatMobileRegistryEntry",(function(){return we})),n.d(t,"formatMobileRegistry",(function(){return Ee})),n.d(t,"isWalletConnectSession",(function(){return Ce})),n.d(t,"parseWalletConnectUri",(function(){return Pe})),n.d(t,"getQueryString",(function(){return Oe})),n.d(t,"appendToQueryString",(function(){return Re})),n.d(t,"parseQueryString",(function(){return Ie})),n.d(t,"formatQueryString",(function(){return xe})),n.d(t,"isEmptyString",(function(){return ke})),n.d(t,"isEmptyArray",(function(){return Ne})),n.d(t,"isBuffer",(function(){return Ae})),n.d(t,"isTypedArray",(function(){return Te})),n.d(t,"isArrayBuffer",(function(){return Me})),n.d(t,"getType",(function(){return Le})),n.d(t,"getEncoding",(function(){return Ue})),n.d(t,"isHexString",(function(){return je})),n.d(t,"isJsonRpcSubscription",(function(){return De})),n.d(t,"isJsonRpcRequest",(function(){return ze})),n.d(t,"isJsonRpcResponseSuccess",(function(){return Be})),n.d(t,"isJsonRpcResponseError",(function(){return Fe})),n.d(t,"isInternalEvent",(function(){return He})),n.d(t,"isReservedEvent",(function(){return qe})),n.d(t,"isSilentPayload",(function(){return $e})),n.d(t,"getFromWindow",(function(){return C})),n.d(t,"getFromWindowOrThrow",(function(){return P})),n.d(t,"getDocumentOrThrow",(function(){return k})),n.d(t,"getDocument",(function(){return N})),n.d(t,"getNavigatorOrThrow",(function(){return A})),n.d(t,"getNavigator",(function(){return T})),n.d(t,"getLocationOrThrow",(function(){return M})),n.d(t,"getLocation",(function(){return L})),n.d(t,"getCryptoOrThrow",(function(){return U})),n.d(t,"getCrypto",(function(){return j})),n.d(t,"getLocalStorageOrThrow",(function(){return D})),n.d(t,"getLocalStorage",(function(){return z}));var r=n(0);function i(e){return r.b(new Uint8Array(e))}function o(e){return r.e(new Uint8Array(e))}function s(e,t){return r.c(new Uint8Array(e),!t)}function a(e){return r.d(new Uint8Array(e))}function c(...e){return r.n(e.map((e=>r.c(new Uint8Array(e)))).join("")).buffer}function u(e){return r.f(e).buffer}function l(e){return r.i(e)}function f(e,t){return r.g(e,!t)}function h(e){return r.h(e)}function d(...e){return r.k(...e)}function p(e){return r.C(e).buffer}function g(e){return r.D(e)}function y(e,t){return r.E(e,!t)}function m(e){return r.F(e)}function v(e){return r.o(e)}function _(e){return r.n(e).buffer}function b(e){return r.q(e)}function w(e){return r.p(e)}function E(e){return r.w(e)}function S(e){return r.v(e).buffer}function O(e){return r.y(e)}function R(e,t){return r.x(Number(e),!t)}var I=n(59),x=n(6);const C=x.getFromWindow,P=x.getFromWindowOrThrow,k=x.getDocumentOrThrow,N=x.getDocument,A=x.getNavigatorOrThrow,T=x.getNavigator,M=x.getLocationOrThrow,L=x.getLocation,U=x.getCryptoOrThrow,j=x.getCrypto,D=x.getLocalStorageOrThrow,z=x.getLocalStorage;function B(e){return Object(I.a)(e)}function F(){const e=B();return e&&e.os?e.os:void 0}function H(){const e=F();return!!e&&e.toLowerCase().includes("android")}function q(){const e=F();return!!e&&(e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1)}function $(){return!!F()&&(H()||q())}function V(){const e=B();return!(!e||!e.name)&&"node"===e.name.toLowerCase()}function W(){return!V()&&!!T()}var K=n(12);const G=K.a,Y=K.b;function Q(e,t){const n=Y(t),r=z();r&&r.setItem(e,n)}function J(e){let t=null,n=null;const r=z();return r&&(n=r.getItem(e)),t=n?G(n):n,t}function X(e){const t=z();t&&t.removeItem(e)}var Z=n(60);function ee(){return Z.getWindowMetadata()}var te=n(7),ne=n(2);function re(e){return r.B(e)}function ie(e){return r.a(e)}function oe(e){return r.A(e)}function se(e){return r.z(r.a(e))}const ae=te.payloadId;function ce(){return((e,t)=>{for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t})()}function ue(){console.warn("DEPRECATION WARNING: This WalletConnect client library will be deprecated in favor of @walletconnect/client. Please check docs.walletconnect.org to learn more about this migration!")}function le(e,t){let n;const r=ne.INFURA_NETWORKS[e];return r&&(n=`https://${r}.infura.io/v3/${t}`),n}function fe(e,t){let n;const r=le(e,t.infuraId);return t.custom&&t.custom[e]?n=t.custom[e]:r&&(n=r),n}function he(e,t){const n=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${n}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${n}`:""}function de(e){const t=e.href.split("?")[0];Q(ne.MOBILE_LINK_CHOICE_KEY,Object.assign(Object.assign({},e),{href:t}))}function pe(e,t){return e.filter((e=>e.name.toLowerCase().includes(t.toLowerCase())))[0]}function ge(e,t){let n=e;return t&&(n=t.map((t=>pe(e,t))).filter(Boolean)),n}function ye(e,t){return async(...n)=>new Promise(((r,i)=>{e.apply(t,[...n,(e,t)=>{null==e&&i(e),r(t)}])}))}function me(e){const t=e.message||"Failed or Rejected Request";let n=-32e3;if(e&&!e.code)switch(t){case"Parse error":n=-32700;break;case"Invalid request":n=-32600;break;case"Method not found":n=-32601;break;case"Invalid params":n=-32602;break;case"Internal error":n=-32603;break;default:n=-32e3}const r={code:n,message:t};return e.data&&(r.data=e.data),r}const ve="https://registry.walletconnect.com";function _e(){return ve+"/api/v2/wallets"}function be(){return ve+"/api/v2/dapps"}function we(e,t="mobile"){var n;return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:null!==(n=e.image_url.sm)&&void 0!==n?n:"",universalLink:e[t].universal||"",deepLink:e[t].native||""}}function Ee(e,t="mobile"){return Object.values(e).filter((e=>!!e[t].universal||!!e[t].native)).map((e=>we(e,t)))}var Se=n(24);function Oe(e){const t=-1!==e.indexOf("?")?e.indexOf("?"):void 0;return void 0!==t?e.substr(t):""}function Re(e,t){let n=Ie(e);return n=Object.assign(Object.assign({},n),t),xe(n)}function Ie(e){return Se.parse(e)}function xe(e){return Se.stringify(e)}function Ce(e){return void 0!==e.bridge}function Pe(e){const t=e.indexOf(":"),n=-1!==e.indexOf("?")?e.indexOf("?"):void 0,r=e.substring(0,t),i=function(e){const t=e.split("@");return{handshakeTopic:t[0],version:parseInt(t[1],10)}}(e.substring(t+1,n)),o=function(e){const t=Ie(e);return{key:t.key||"",bridge:t.bridge||""}}(void 0!==n?e.substr(n):"");return Object.assign(Object.assign({protocol:r},i),o)}function ke(e){return""===e||"string"==typeof e&&""===e.trim()}function Ne(e){return!(e&&e.length)}function Ae(e){return r.s(e)}function Te(e){return r.u(e)}function Me(e){return r.r(e)}function Le(e){return r.m(e)}function Ue(e){return r.l(e)}function je(e,t){return r.t(e,t)}function De(e){return"object"==typeof e.params}function ze(e){return void 0!==e.method}function Be(e){return void 0!==e.result}function Fe(e){return void 0!==e.error}function He(e){return void 0!==e.event}function qe(e){return ne.RESERVED_EVENTS.includes(e)||e.startsWith("wc_")}function $e(e){return!!e.method.startsWith("wc_")||!ne.SIGNING_METHODS.includes(e.method)}},function(e,t,n){n.r(t);var r=n(34);for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i);var o=n(57);n.d(t,"ERROR_SESSION_CONNECTED",(function(){return o.k})),n.d(t,"ERROR_SESSION_DISCONNECTED",(function(){return o.l})),n.d(t,"ERROR_SESSION_REJECTED",(function(){return o.m})),n.d(t,"ERROR_MISSING_JSON_RPC",(function(){return o.e})),n.d(t,"ERROR_MISSING_RESULT",(function(){return o.h})),n.d(t,"ERROR_MISSING_ERROR",(function(){return o.c})),n.d(t,"ERROR_MISSING_METHOD",(function(){return o.f})),n.d(t,"ERROR_MISSING_ID",(function(){return o.d})),n.d(t,"ERROR_MISSING_REQUIRED",(function(){return o.g})),n.d(t,"ERROR_INVALID_RESPONSE",(function(){return o.a})),n.d(t,"ERROR_INVALID_URI",(function(){return o.b})),n.d(t,"ERROR_QRCODE_MODAL_NOT_PROVIDED",(function(){return o.i})),n.d(t,"ERROR_QRCODE_MODAL_USER_CLOSED",(function(){return o.j})),n.d(t,"RESERVED_EVENTS",(function(){return o.p})),n.d(t,"reservedEvents",(function(){return o.v})),n.d(t,"WALLET_METHODS",(function(){return o.s})),n.d(t,"SIGNING_METHODS",(function(){return o.q})),n.d(t,"STATE_METHODS",(function(){return o.r})),n.d(t,"signingMethods",(function(){return o.w})),n.d(t,"stateMethods",(function(){return o.x})),n.d(t,"MOBILE_LINK_CHOICE_KEY",(function(){return o.o})),n.d(t,"mobileLinkChoiceKey",(function(){return o.u})),n.d(t,"INFURA_NETWORKS",(function(){return o.n})),n.d(t,"infuraNetworks",(function(){return o.t}));var s=n(35);for(var i in s)["default","ERROR_SESSION_CONNECTED","ERROR_SESSION_DISCONNECTED","ERROR_SESSION_REJECTED","ERROR_MISSING_JSON_RPC","ERROR_MISSING_RESULT","ERROR_MISSING_ERROR","ERROR_MISSING_METHOD","ERROR_MISSING_ID","ERROR_MISSING_REQUIRED","ERROR_INVALID_RESPONSE","ERROR_INVALID_URI","ERROR_QRCODE_MODAL_NOT_PROVIDED","ERROR_QRCODE_MODAL_USER_CLOSED","RESERVED_EVENTS","reservedEvents","WALLET_METHODS","SIGNING_METHODS","STATE_METHODS","signingMethods","stateMethods","MOBILE_LINK_CHOICE_KEY","mobileLinkChoiceKey","INFURA_NETWORKS","infuraNetworks"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return s[e]}))}(i);var a=n(36);n.d(t,"IEvents",(function(){return a.a}));var c=n(37);for(var i in c)["default","ERROR_SESSION_CONNECTED","ERROR_SESSION_DISCONNECTED","ERROR_SESSION_REJECTED","ERROR_MISSING_JSON_RPC","ERROR_MISSING_RESULT","ERROR_MISSING_ERROR","ERROR_MISSING_METHOD","ERROR_MISSING_ID","ERROR_MISSING_REQUIRED","ERROR_INVALID_RESPONSE","ERROR_INVALID_URI","ERROR_QRCODE_MODAL_NOT_PROVIDED","ERROR_QRCODE_MODAL_USER_CLOSED","RESERVED_EVENTS","reservedEvents","WALLET_METHODS","SIGNING_METHODS","STATE_METHODS","signingMethods","stateMethods","MOBILE_LINK_CHOICE_KEY","mobileLinkChoiceKey","INFURA_NETWORKS","infuraNetworks","IEvents"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return c[e]}))}(i);var u=n(38);for(var i in u)["default","ERROR_SESSION_CONNECTED","ERROR_SESSION_DISCONNECTED","ERROR_SESSION_REJECTED","ERROR_MISSING_JSON_RPC","ERROR_MISSING_RESULT","ERROR_MISSING_ERROR","ERROR_MISSING_METHOD","ERROR_MISSING_ID","ERROR_MISSING_REQUIRED","ERROR_INVALID_RESPONSE","ERROR_INVALID_URI","ERROR_QRCODE_MODAL_NOT_PROVIDED","ERROR_QRCODE_MODAL_USER_CLOSED","RESERVED_EVENTS","reservedEvents","WALLET_METHODS","SIGNING_METHODS","STATE_METHODS","signingMethods","stateMethods","MOBILE_LINK_CHOICE_KEY","mobileLinkChoiceKey","INFURA_NETWORKS","infuraNetworks","IEvents"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return u[e]}))}(i);var l=n(39);for(var i in l)["default","ERROR_SESSION_CONNECTED","ERROR_SESSION_DISCONNECTED","ERROR_SESSION_REJECTED","ERROR_MISSING_JSON_RPC","ERROR_MISSING_RESULT","ERROR_MISSING_ERROR","ERROR_MISSING_METHOD","ERROR_MISSING_ID","ERROR_MISSING_REQUIRED","ERROR_INVALID_RESPONSE","ERROR_INVALID_URI","ERROR_QRCODE_MODAL_NOT_PROVIDED","ERROR_QRCODE_MODAL_USER_CLOSED","RESERVED_EVENTS","reservedEvents","WALLET_METHODS","SIGNING_METHODS","STATE_METHODS","signingMethods","stateMethods","MOBILE_LINK_CHOICE_KEY","mobileLinkChoiceKey","INFURA_NETWORKS","infuraNetworks","IEvents"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return l[e]}))}(i);var f=n(40);for(var i in f)["default","ERROR_SESSION_CONNECTED","ERROR_SESSION_DISCONNECTED","ERROR_SESSION_REJECTED","ERROR_MISSING_JSON_RPC","ERROR_MISSING_RESULT","ERROR_MISSING_ERROR","ERROR_MISSING_METHOD","ERROR_MISSING_ID","ERROR_MISSING_REQUIRED","ERROR_INVALID_RESPONSE","ERROR_INVALID_URI","ERROR_QRCODE_MODAL_NOT_PROVIDED","ERROR_QRCODE_MODAL_USER_CLOSED","RESERVED_EVENTS","reservedEvents","WALLET_METHODS","SIGNING_METHODS","STATE_METHODS","signingMethods","stateMethods","MOBILE_LINK_CHOICE_KEY","mobileLinkChoiceKey","INFURA_NETWORKS","infuraNetworks","IEvents"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return f[e]}))}(i);var h=n(41);for(var i in h)["default","ERROR_SESSION_CONNECTED","ERROR_SESSION_DISCONNECTED","ERROR_SESSION_REJECTED","ERROR_MISSING_JSON_RPC","ERROR_MISSING_RESULT","ERROR_MISSING_ERROR","ERROR_MISSING_METHOD","ERROR_MISSING_ID","ERROR_MISSING_REQUIRED","ERROR_INVALID_RESPONSE","ERROR_INVALID_URI","ERROR_QRCODE_MODAL_NOT_PROVIDED","ERROR_QRCODE_MODAL_USER_CLOSED","RESERVED_EVENTS","reservedEvents","WALLET_METHODS","SIGNING_METHODS","STATE_METHODS","signingMethods","stateMethods","MOBILE_LINK_CHOICE_KEY","mobileLinkChoiceKey","INFURA_NETWORKS","infuraNetworks","IEvents"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return h[e]}))}(i);var d=n(42);for(var i in d)["default","ERROR_SESSION_CONNECTED","ERROR_SESSION_DISCONNECTED","ERROR_SESSION_REJECTED","ERROR_MISSING_JSON_RPC","ERROR_MISSING_RESULT","ERROR_MISSING_ERROR","ERROR_MISSING_METHOD","ERROR_MISSING_ID","ERROR_MISSING_REQUIRED","ERROR_INVALID_RESPONSE","ERROR_INVALID_URI","ERROR_QRCODE_MODAL_NOT_PROVIDED","ERROR_QRCODE_MODAL_USER_CLOSED","RESERVED_EVENTS","reservedEvents","WALLET_METHODS","SIGNING_METHODS","STATE_METHODS","signingMethods","stateMethods","MOBILE_LINK_CHOICE_KEY","mobileLinkChoiceKey","INFURA_NETWORKS","infuraNetworks","IEvents"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return d[e]}))}(i);var p=n(43);for(var i in p)["default","ERROR_SESSION_CONNECTED","ERROR_SESSION_DISCONNECTED","ERROR_SESSION_REJECTED","ERROR_MISSING_JSON_RPC","ERROR_MISSING_RESULT","ERROR_MISSING_ERROR","ERROR_MISSING_METHOD","ERROR_MISSING_ID","ERROR_MISSING_REQUIRED","ERROR_INVALID_RESPONSE","ERROR_INVALID_URI","ERROR_QRCODE_MODAL_NOT_PROVIDED","ERROR_QRCODE_MODAL_USER_CLOSED","RESERVED_EVENTS","reservedEvents","WALLET_METHODS","SIGNING_METHODS","STATE_METHODS","signingMethods","stateMethods","MOBILE_LINK_CHOICE_KEY","mobileLinkChoiceKey","INFURA_NETWORKS","infuraNetworks","IEvents"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return p[e]}))}(i)},function(e,t,n){n.d(t,"b",(function(){return i})),n.d(t,"g",(function(){return o})),n.d(t,"a",(function(){return s})),n.d(t,"f",(function(){return a})),n.d(t,"e",(function(){return c})),n.d(t,"i",(function(){return u})),n.d(t,"j",(function(){return l})),n.d(t,"h",(function(){return r})),n.d(t,"d",(function(){return f})),n.d(t,"c",(function(){return h})),n.d(t,"k",(function(){return d})),n.d(t,"l",(function(){return p}));const r=512,i=256,o=256,s="AES-CBC",a="SHA-"+i,c="HMAC",u="SHA-256",l="SHA-512",f="encrypt",h="decrypt",d="sign",p="verify"},function(e,t,n){n.d(t,"f",(function(){return r})),n.d(t,"d",(function(){return i})),n.d(t,"e",(function(){return o})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return a})),n.d(t,"h",(function(){return c})),n.d(t,"g",(function(){return u})),n.d(t,"i",(function(){return l})),n.d(t,"j",(function(){return f})),n.d(t,"a",(function(){return h}));const r="PARSE_ERROR",i="INVALID_REQUEST",o="METHOD_NOT_FOUND",s="INVALID_PARAMS",a="INTERNAL_ERROR",c="SERVER_ERROR",u=[-32700,-32600,-32601,-32602,-32603],l=[-32e3,-32099],f={[r]:{code:-32700,message:"Parse error"},[i]:{code:-32600,message:"Invalid Request"},[o]:{code:-32601,message:"Method not found"},[s]:{code:-32602,message:"Invalid params"},[a]:{code:-32603,message:"Internal error"},[c]:{code:-32e3,message:"Server error"}},h=c},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(17);r.__exportStar(n(64),t),r.__exportStar(n(65),t)},function(e,t,n){function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function i(e){const t=r(e);if(!t)throw new Error(e+" is not defined in Window");return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=i,t.getDocumentOrThrow=function(){return i("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return i("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return i("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return i("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return i("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},function(e,t,n){n.r(t);var r=n(4);n.d(t,"PARSE_ERROR",(function(){return r.f})),n.d(t,"INVALID_REQUEST",(function(){return r.d})),n.d(t,"METHOD_NOT_FOUND",(function(){return r.e})),n.d(t,"INVALID_PARAMS",(function(){return r.c})),n.d(t,"INTERNAL_ERROR",(function(){return r.b})),n.d(t,"SERVER_ERROR",(function(){return r.h})),n.d(t,"RESERVED_ERROR_CODES",(function(){return r.g})),n.d(t,"SERVER_ERROR_CODE_RANGE",(function(){return r.i})),n.d(t,"STANDARD_ERROR_MAP",(function(){return r.j})),n.d(t,"DEFAULT_ERROR",(function(){return r.a}));var i=n(11);n.d(t,"isServerErrorCode",(function(){return i.d})),n.d(t,"isReservedErrorCode",(function(){return i.c})),n.d(t,"isValidErrorCode",(function(){return i.e})),n.d(t,"getError",(function(){return i.a})),n.d(t,"getErrorByCode",(function(){return i.b})),n.d(t,"validateJsonRpcError",(function(){return i.g})),n.d(t,"parseConnectionError",(function(){return i.f}));var o=n(25);for(var s in o)["default","PARSE_ERROR","INVALID_REQUEST","METHOD_NOT_FOUND","INVALID_PARAMS","INTERNAL_ERROR","SERVER_ERROR","RESERVED_ERROR_CODES","SERVER_ERROR_CODE_RANGE","STANDARD_ERROR_MAP","DEFAULT_ERROR","isServerErrorCode","isReservedErrorCode","isValidErrorCode","getError","getErrorByCode","validateJsonRpcError","parseConnectionError"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(s);var a=n(26);n.d(t,"payloadId",(function(){return a.e})),n.d(t,"formatJsonRpcRequest",(function(){return a.c})),n.d(t,"formatJsonRpcResult",(function(){return a.d})),n.d(t,"formatJsonRpcError",(function(){return a.b})),n.d(t,"formatErrorMessage",(function(){return a.a}));var c=n(27);n.d(t,"isValidRoute",(function(){return c.c})),n.d(t,"isValidDefaultRoute",(function(){return c.a})),n.d(t,"isValidWildcardRoute",(function(){return c.e})),n.d(t,"isValidLeadingWildcardRoute",(function(){return c.b})),n.d(t,"isValidTrailingWildcardRoute",(function(){return c.d}));var u=n(28);for(var s in u)["default","PARSE_ERROR","INVALID_REQUEST","METHOD_NOT_FOUND","INVALID_PARAMS","INTERNAL_ERROR","SERVER_ERROR","RESERVED_ERROR_CODES","SERVER_ERROR_CODE_RANGE","STANDARD_ERROR_MAP","DEFAULT_ERROR","isServerErrorCode","isReservedErrorCode","isValidErrorCode","getError","getErrorByCode","validateJsonRpcError","parseConnectionError","payloadId","formatJsonRpcRequest","formatJsonRpcResult","formatJsonRpcError","formatErrorMessage","isValidRoute","isValidDefaultRoute","isValidWildcardRoute","isValidLeadingWildcardRoute","isValidTrailingWildcardRoute"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return u[e]}))}(s);var l=n(32);n.d(t,"isHttpUrl",(function(){return l.a})),n.d(t,"isWsUrl",(function(){return l.c})),n.d(t,"isLocalhostUrl",(function(){return l.b}));var f=n(33);n.d(t,"isJsonRpcPayload",(function(){return f.b})),n.d(t,"isJsonRpcRequest",(function(){return f.c})),n.d(t,"isJsonRpcResponse",(function(){return f.d})),n.d(t,"isJsonRpcResult",(function(){return f.e})),n.d(t,"isJsonRpcError",(function(){return f.a})),n.d(t,"isJsonRpcValidationInvalid",(function(){return f.f}))},function(e,t,n){n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return u})),n.d(t,"e",(function(){return l})),n.d(t,"f",(function(){return f}));var r=n(5),i=n(3);async function o(e,t=i.a){return r.getSubtleCrypto().importKey("raw",e,function(e){return e===i.a?{length:i.b,name:i.a}:{hash:{name:i.f},name:i.e}}(t),!0,function(e){return e===i.a?[i.d,i.c]:[i.k,i.l]}(t))}async function s(e,t,n){const s=r.getSubtleCrypto(),a=await o(t,i.a),c=await s.encrypt({iv:e,name:i.a},a,n);return new Uint8Array(c)}async function a(e,t,n){const s=r.getSubtleCrypto(),a=await o(t,i.a),c=await s.decrypt({iv:e,name:i.a},a,n);return new Uint8Array(c)}async function c(e,t){const n=r.getSubtleCrypto(),s=await o(e,i.e),a=await n.sign({length:i.g,name:i.e},s,t);return new Uint8Array(a)}async function u(e,t){const n=r.getSubtleCrypto(),s=await o(e,i.e),a=await n.sign({length:i.h,name:i.e},s,t);return new Uint8Array(a)}async function l(e){const t=r.getSubtleCrypto(),n=await t.digest({name:i.i},e);return new Uint8Array(n)}async function f(e){const t=r.getSubtleCrypto(),n=await t.digest({name:i.j},e);return new Uint8Array(n)}},function(e,t){let n;const r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return r[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');n=e},t.isKanjiModeEnabled=function(){return void 0!==n},t.toSJIS=function(e){return n(e)}},function(e,t,n){const r=n(54),i=n(55);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!r.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return i.testNumeric(e)?t.NUMERIC:i.testAlphanumeric(e)?t.ALPHANUMERIC:i.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return n}}},function(e,t,n){n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"e",(function(){return s})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"g",(function(){return u})),n.d(t,"f",(function(){return l}));var r=n(4);function i(e){return e<=r.i[0]&&e>=r.i[1]}function o(e){return r.g.includes(e)}function s(e){return"number"==typeof e}function a(e){return Object.keys(r.j).includes(e)?r.j[e]:r.j[r.a]}function c(e){return Object.values(r.j).find((t=>t.code===e))||r.j[r.a]}function u(e){if(void 0===e.error.code)return{valid:!1,error:"Missing code for JSON-RPC error"};if(void 0===e.error.message)return{valid:!1,error:"Missing message for JSON-RPC error"};if(!s(e.error.code))return{valid:!1,error:"Invalid error code type for JSON-RPC: "+e.error.code};if(o(e.error.code)){const t=c(e.error.code);if(t.message!==r.j[r.a].message&&e.error.message===t.message)return{valid:!1,error:"Invalid error code message for JSON-RPC: "+e.error.code}}return{valid:!0}}function l(e,t,n){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${t}`):e}},function(e,t,n){function r(e){if("string"!=typeof e)throw new Error("Cannot safe json parse value of type "+typeof e);try{return JSON.parse(e)}catch(t){return e}}function i(e){return"string"==typeof e?e:JSON.stringify(e)}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i}))},function(e,t,n){var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,o,s,a;if(u(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)o(c,this,t);else{var u=c.length,l=y(c,u);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){var r=n(45);n.d(t,"randomBytes",(function(){return r.a}));var i=n(46);n.d(t,"aesCbcDecrypt",(function(){return i.a})),n.d(t,"aesCbcEncrypt",(function(){return i.b}));var o=n(47);n.d(t,"hmacSha256Sign",(function(){return o.a})),n(52),n(16),n(3)},function(e,t,n){n.d(t,"a",(function(){return r}));class r{}},function(e,t,n){var r=n(48);n.o(r,"isConstantTime")&&n.d(t,"isConstantTime",(function(){return r.isConstantTime})),n(49);var i=n(50);n.o(i,"isConstantTime")&&n.d(t,"isConstantTime",(function(){return i.isConstantTime}));var o=n(51);n.d(t,"isConstantTime",(function(){return o.a}))},function(e,t,n){n.r(t),n.d(t,"__extends",(function(){return i})),n.d(t,"__assign",(function(){return o})),n.d(t,"__rest",(function(){return s})),n.d(t,"__decorate",(function(){return a})),n.d(t,"__param",(function(){return c})),n.d(t,"__metadata",(function(){return u})),n.d(t,"__awaiter",(function(){return l})),n.d(t,"__generator",(function(){return f})),n.d(t,"__createBinding",(function(){return h})),n.d(t,"__exportStar",(function(){return d})),n.d(t,"__values",(function(){return p})),n.d(t,"__read",(function(){return g})),n.d(t,"__spread",(function(){return y})),n.d(t,"__spreadArrays",(function(){return m})),n.d(t,"__await",(function(){return v})),n.d(t,"__asyncGenerator",(function(){return _})),n.d(t,"__asyncDelegator",(function(){return b})),n.d(t,"__asyncValues",(function(){return w})),n.d(t,"__makeTemplateObject",(function(){return E})),n.d(t,"__importStar",(function(){return S})),n.d(t,"__importDefault",(function(){return O})),n.d(t,"__classPrivateFieldGet",(function(){return R})),n.d(t,"__classPrivateFieldSet",(function(){return I}));var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function c(e,t){return function(n,r){t(n,r,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function y(){for(var e=[],t=0;t1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof v?Promise.resolve(n.value.v).then(c,u):l(o[0][2],n)}catch(e){l(o[0][3],e)}var n}function c(e){a("next",e)}function u(e){a("throw",e)}function l(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function b(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:v(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=p(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function O(e){return e&&e.__esModule?e:{default:e}}function R(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function I(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var c,u=[],l=!1,f=-1;function h(){l&&c&&(l=!1,c.length?u=c.concat(u):f=-1,u.length&&d())}function d(){if(!l){var e=a(h);l=!0;for(var t=u.length;t;){for(c=u,u=[];++f1)for(var n=1;n=0&&e.bit<4},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return n}}},function(e,t){e.exports=i,i.strict=o,i.loose=s;var n=Object.prototype.toString,r={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function i(e){return o(e)||s(e)}function o(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function s(e){return r[n.call(e)]}},function(e,t){var n="undefined"!=typeof self?self:this,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function g(e){var t=new FileReader,n=p(t);return t.readAsArrayBuffer(e),n}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,n,r=d(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=p(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function b(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},m.call(_.prototype),m.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];w.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,n){return new Promise((function(r,o){var s=new _(e,n);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e,t,n={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;r(new w(i,n))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=h,e.Request=_,e.Response=w),t.Headers=h,t.Request=_,t.Response=w,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},function(e,t,n){const r=n(69),i=n(70),o=n(71),s=n(72);function a(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function c(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function u(e,t){return t.decode?i(e):e}function l(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function f(e){const t=(e=l(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function h(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function d(e,t){a((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const i="string"==typeof n&&n.includes(e.arrayFormatSeparator),o="string"==typeof n&&!i&&u(n,e).includes(e.arrayFormatSeparator);n=o?u(n,e):n;const s=i||o?n.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===n?n:u(n,e);r[t]=s};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const i of e.split("&")){if(""===i)continue;let[e,s]=o(t.decode?i.replace(/\+/g," "):i,"=");s=void 0===s?null:["comma","separator"].includes(t.arrayFormat)?s:u(s,t),n(u(e,t),s,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=h(n[e],t);else r[e]=h(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort(((e,t)=>Number(e)-Number(t))).map((e=>t[e])):t}(n):e[t]=n,e}),Object.create(null))}t.extract=f,t.parse=d,t.stringify=(e,t)=>{if(!e)return"";a((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[c(t,e),"[",i,"]"].join("")]:[...n,[c(t,e),"[",c(i,e),"]=",c(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[c(t,e),"[]"].join("")]:[...n,[c(t,e),"[]=",c(r,e)].join("")];case"comma":case"separator":return t=>(n,r)=>null==r||0===r.length?n:0===n.length?[[c(t,e),"=",c(r,e)].join("")]:[[n,c(r,e)].join(e.arrayFormatSeparator)];default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,c(t,e)]:[...n,[c(t,e),"=",c(r,e)].join("")]}}(t),i={};for(const t of Object.keys(e))n(t)||(i[t]=e[t]);const o=Object.keys(i);return!1!==t.sort&&o.sort(t.sort),o.map((n=>{const i=e[n];return void 0===i?"":null===i?c(n,t):Array.isArray(i)?i.reduce(r(n),[]).join("&"):c(n,t)+"="+c(i,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=o(e,"#");return Object.assign({url:n.split("?")[0]||"",query:d(f(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:u(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0},n);const r=l(e.url).split("?")[0]||"",i=t.extract(e.url),o=t.parse(i,{sort:!1}),s=Object.assign(o,e.query);let a=t.stringify(s,n);a&&(a="?"+a);let u=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(u="#"+c(e.fragmentIdentifier,n)),`${r}${a}${u}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0},r);const{url:i,query:o,fragmentIdentifier:a}=t.parseUrl(e,r);return t.stringifyUrl({url:i,query:s(o,n),fragmentIdentifier:a},r)},t.exclude=(e,n,r)=>{const i=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return t.pick(e,i,r)}},function(e,t,n){n.r(t),n.d(t,"isNodeJs",(function(){return o}));var r=n(5);for(var i in r)["default","isNodeJs"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i);const o=r.isNode},function(e,t,n){n.d(t,"e",(function(){return o})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return u}));var r=n(11),i=n(4);function o(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))}function s(e,t,n){return{id:n||o(),jsonrpc:"2.0",method:e,params:t}}function a(e,t){return{id:e,jsonrpc:"2.0",result:t}}function c(e,t,n){return{id:e,jsonrpc:"2.0",error:u(t,n)}}function u(e,t){return void 0===e?Object(r.a)(i.b):("string"==typeof e&&(e=Object.assign(Object.assign({},Object(r.a)(i.h)),{message:e})),void 0!==t&&(e.data=t),Object(r.c)(e.code)&&(e=Object(r.b)(e.code)),e)}},function(e,t,n){function r(e){return e.includes("*")?o(e):!/\W/g.test(e)}function i(e){return"*"===e}function o(e){return!!i(e)||!!e.includes("*")&&2===e.split("*").length&&1===e.split("*").filter((e=>""===e.trim())).length}function s(e){return!i(e)&&o(e)&&!e.split("*")[0].trim()}function a(e){return!i(e)&&o(e)&&!e.split("*")[1].trim()}n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return i})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return a}))},function(e,t,n){n.r(t);var r=n(20);for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},function(e,t){},function(e,t,n){n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return s}));var r=n(15);class i extends r.a{constructor(e){super()}}class o extends r.a{constructor(){super()}}class s extends o{constructor(e){super()}}},function(e,t){},function(e,t,n){function r(e,t){const n=function(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==n&&new RegExp(t).test(n)}function i(e){return r(e,"^https?:")}function o(e){return r(e,"^wss?:")}function s(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return s}))},function(e,t,n){function r(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function i(e){return r(e)&&"method"in e}function o(e){return r(e)&&(s(e)||a(e))}function s(e){return"result"in e}function a(e){return"error"in e}function c(e){return"error"in e&&!1===e.valid}n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return s})),n.d(t,"a",(function(){return a})),n.d(t,"f",(function(){return c}))},function(e,t){},function(e,t){},function(e,t,n){n.d(t,"a",(function(){return r}));class r{}},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){(function(e){var r=n(66),i=n(67),o=n(68);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(e).length;default:if(r)return B(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return x(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return R(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var o,s=1,a=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=n;oa&&(n=a-c),o=n;o>=0;o--){for(var f=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function R(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+f<=n)switch(f){case 1:u<128&&(l=u);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(c=(15&u)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,n,r,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function T(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function M(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function L(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(e,t,n,r,o){return o||L(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function j(e,t,n,r,o){return o||L(e,0,n,8),i.write(e,t,n,r,52,8),n+8}t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,n){return u(null,e,t,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?a(e,t):void 0!==n?"string"==typeof r?a(e,t).fill(n,r):a(e,t).fill(n):a(e,t)}(null,e,t,n)},c.allocUnsafe=function(e){return f(null,e)},c.allocUnsafeSlow=function(e){return f(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},c.prototype.compare=function(e,t,n,r,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,i),l=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):T(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);A(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):T(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function F(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(D,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(18))},function(e,t,n){n.d(t,"a",(function(){return i}));var r=n(5);function i(e){return r.getBrowerCrypto().getRandomValues(new Uint8Array(e))}},function(e,t,n){n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var r=n(8);function i(e,t,n){return Object(r.b)(e,t,n)}function o(e,t,n){return Object(r.a)(e,t,n)}},function(e,t,n){n.d(t,"a",(function(){return i}));var r=n(8);async function i(e,t){return await Object(r.c)(e,t)}n(16)},function(e,t,n){var r=n(5);n.o(r,"isConstantTime")&&n.d(t,"isConstantTime",(function(){return r.isConstantTime}))},function(e,t,n){},function(e,t){},function(e,t,n){function r(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r=1&&e<=40}},function(e,t){let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";t.KANJI=new RegExp(n,"g"),t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=new RegExp(r,"g"),t.NUMERIC=new RegExp("[0-9]+","g"),t.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const i=new RegExp("^"+n+"$"),o=new RegExp("^[0-9]+$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return i.test(e)},t.testNumeric=function(e){return o.test(e)},t.testAlphanumeric=function(e){return s.test(e)}},function(e,t){function n(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:t,color:{dark:n(e.color.dark||"#000000ff"),light:n(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,n){const r=t.getScale(e,n);return Math.floor((e+2*n.margin)*r)},t.qrToImageData=function(e,n,r){const i=n.modules.size,o=n.modules.data,s=t.getScale(i,r),a=Math.floor((i+2*r.margin)*s),c=r.margin*s,u=[r.color.light,r.color.dark];for(let t=0;t=c&&n>=c&&tr.getAttribute(e))).filter((e=>!!e&&t.includes(e)));if(i.length&&i){const e=r.getAttribute("content");if(e)return e}}return""}const i=function(){let t=n("name","og:site_name","og:title","twitter:title");return t||(t=e.title),t}();return{description:n("description","og:description","twitter:description","keywords"),url:t.origin,icons:function(){const n=e.getElementsByTagName("link"),r=[];for(let e=0;e-1){const e=i.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let n=t.protocol+"//"+t.host;if(0===e.indexOf("/"))n+=e;else{const r=t.pathname.split("/");r.pop(),n+=r.join("/")+"/"+e}r.push(n)}else if(0===e.indexOf("//")){const n=t.protocol+e;r.push(n)}else r.push(e)}}return r}(),name:i}}},function(e,t,n){(function(e){var r=n(1),i=n(62);const o=void 0!==e.WebSocket?e.WebSocket:n(74);t.a=class{constructor(e){if(this.opts=e,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=e.protocol,this._version=e.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=e.subscriptions||[],this._netMonitor=e.netMonitor||new i.a,!e.url||"string"!=typeof e.url)throw new Error("Missing or invalid WebSocket url");this._url=e.url,this._netMonitor.on("online",(()=>this._socketCreate()))}set readyState(e){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(e){}get connecting(){return 0===this.readyState}set connected(e){}get connected(){return 1===this.readyState}set closing(e){}get closing(){return 2===this.readyState}set closed(e){}get closed(){return 3===this.readyState}open(){this._socketCreate()}close(){this._socketClose()}send(e,t,n){if(!t||"string"!=typeof t)throw new Error("Missing or invalid topic field");this._socketSend({topic:t,type:"pub",payload:e,silent:!!n})}subscribe(e){this._socketSend({topic:e,type:"sub",payload:"",silent:!0})}on(e,t){this._events.push({event:e,callback:t})}_socketCreate(){if(this._nextSocket)return;const e=function(e,t,n){var i,o;const s=(e.startsWith("https")?e.replace("https","wss"):e.startsWith("http")?e.replace("http","ws"):e).split("?"),a=Object(r.isBrowser)()?{protocol:t,version:n,env:"browser",host:(null===(i=Object(r.getLocation)())||void 0===i?void 0:i.host)||""}:{protocol:t,version:n,env:(null===(o=Object(r.detectEnv)())||void 0===o?void 0:o.name)||""},c=Object(r.appendToQueryString)(Object(r.getQueryString)(s[1]||""),a);return s[0]+"?"+c}(this._url,this._protocol,this._version);if(this._nextSocket=new o(e),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=e=>this._socketReceive(e),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=e=>this._socketError(e),this._nextSocket.onclose=()=>{setTimeout((()=>{this._nextSocket=null,this._socketCreate()}),1e3)}}_socketOpen(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}_socketClose(){this._socket&&(this._socket.onclose=()=>{},this._socket.close())}_socketSend(e){const t=JSON.stringify(e);this._socket&&1===this._socket.readyState?this._socket.send(t):(this._setToQueue(e),this._socketCreate())}async _socketReceive(e){let t;try{t=JSON.parse(e.data)}catch(e){return}if(this._socketSend({topic:t.topic,type:"ack",payload:"",silent:!0}),this._socket&&1===this._socket.readyState){const e=this._events.filter((e=>"message"===e.event));e&&e.length&&e.forEach((e=>e.callback(t)))}}_socketError(e){const t=this._events.filter((e=>"error"===e.event));t&&t.length&&t.forEach((t=>t.callback(e)))}_queueSubscriptions(){this._subscriptions.forEach((e=>this._queue.push({topic:e,type:"sub",payload:"",silent:!0}))),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(e){this._queue.push(e)}_pushQueue(){this._queue.forEach((e=>this._socketSend(e))),this._queue=[]}}}).call(this,n(18))},function(e,t,n){t.a=class{constructor(){this._eventEmitters=[],"undefined"!=typeof window&&void 0!==window.addEventListener&&(window.addEventListener("online",(()=>this.trigger("online"))),window.addEventListener("offline",(()=>this.trigger("offline"))))}on(e,t){this._eventEmitters.push({event:e,callback:t})}trigger(e){let t=[];e&&(t=this._eventEmitters.filter((t=>t.event===e))),t.forEach((e=>{e.callback()}))}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(17),i=r.__importDefault(n(13)),o=n(102),s=n(103),a=n(2),c=n(1),u=n(73);t.default=class{constructor(e){this.events=new i.default,this.rpc={infuraId:null==e?void 0:e.infuraId,custom:null==e?void 0:e.rpc},this.signer=new o.JsonRpcProvider(new u.SignerConnection(e));const t=this.signer.connection.chainId||(null==e?void 0:e.chainId)||1;this.http=this.setHttpProvider(t),this.registerEventListeners()}get connected(){return this.signer.connection.connected}get connector(){return this.signer.connection.connector}get accounts(){return this.signer.connection.accounts}get chainId(){return this.signer.connection.chainId}get rpcUrl(){var e;return(null===(e=this.http)||void 0===e?void 0:e.connection).url||""}request(e){return r.__awaiter(this,void 0,void 0,(function*(){switch(e.method){case"eth_requestAccounts":return yield this.connect(),this.signer.connection.accounts;case"eth_accounts":return this.signer.connection.accounts;case"eth_chainId":return this.signer.connection.chainId}if(a.SIGNING_METHODS.includes(e.method))return this.signer.request(e);if(void 0===this.http)throw new Error(`Cannot request JSON-RPC method (${e.method}) without provided rpc url`);return this.http.request(e)}))}sendAsync(e,t){this.request(e).then((e=>t(null,e))).catch((e=>t(e,void 0)))}enable(){return r.__awaiter(this,void 0,void 0,(function*(){return yield this.request({method:"eth_requestAccounts"})}))}connect(){return r.__awaiter(this,void 0,void 0,(function*(){this.signer.connection.connected||(yield this.signer.connect())}))}disconnect(){return r.__awaiter(this,void 0,void 0,(function*(){this.signer.connection.connected&&(yield this.signer.disconnect())}))}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}registerEventListeners(){this.signer.connection.on("accountsChanged",(e=>{this.events.emit("accountsChanged",e)})),this.signer.connection.on("chainChanged",(e=>{this.http=this.setHttpProvider(e),this.events.emit("chainChanged",e)})),this.signer.on("disconnect",(()=>{this.events.emit("disconnect")}))}setHttpProvider(e){const t=c.getRpcUrl(e,this.rpc);if(void 0!==t)return new o.JsonRpcProvider(new s.HttpConnection(t))}}},function(e,t,n){(function(e){function n(){return(null==e?void 0:e.crypto)||(null==e?void 0:e.msCrypto)||{}}function r(){const e=n();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=n,t.getSubtleCrypto=r,t.isBrowserCryptoAvailable=function(){return!!n()&&!!r()}}).call(this,n(18))},function(e,t,n){(function(e){function n(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function r(){return void 0!==e&&void 0!==e.versions&&void 0!==e.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=n,t.isNode=r,t.isBrowser=function(){return!n()&&!r()}}).call(this,n(19))},function(e,t,n){t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),s=r[0],a=r[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,s,a)),l=0,f=a>0?s-4:s;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===a&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===a&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=0,a=n-i;sa?a:s+16383));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var i,o,s=[],a=t;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,c=(1<>1,l=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=u}return(d?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,c,u=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+f>=1?h/c:h*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*c-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;e[n+d]=255&s,d+=p,s/=256,u-=8);e[n+d-p]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>"%"+e.charCodeAt(0).toString(16).toUpperCase()))},function(e,t,n){var r=new RegExp("(%[a-f0-9]{2})|([^%]+?)","gi"),i=new RegExp("(%[a-f0-9]{2})+","gi");function o(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],o(n),o(r))}function s(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(r)||[],n=1;n{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},function(e,t,n){e.exports=function(e,t){for(var n={},r=Object.keys(e),i=Array.isArray(t),o=0;o{this.on("error",(e=>{n(e)})),this.on("open",(()=>{t()})),this.create(e)}));this.onOpen()}))}close(){return r.__awaiter(this,void 0,void 0,(function*(){void 0!==this.wc&&(this.wc.connected&&this.wc.killSession(),this.onClose())}))}send(e){return r.__awaiter(this,void 0,void 0,(function*(){this.wc=this.register(this.opts),this.connected||(yield this.open()),this.sendPayload(e).then((e=>this.events.emit("payload",e))).catch((t=>this.events.emit("payload",c.formatJsonRpcError(e.id,t.message))))}))}register(e){if(this.wc)return this.wc;this.opts=e||this.opts,this.bridge=(null==e?void 0:e.connector)?e.connector.bridge:(null==e?void 0:e.bridge)||"https://bridge.walletconnect.org",this.qrcode=void 0===(null==e?void 0:e.qrcode)||!1!==e.qrcode,this.chainId=void 0!==(null==e?void 0:e.chainId)?e.chainId:this.chainId,this.qrcodeModalOptions=null==e?void 0:e.qrcodeModalOptions;const t={bridge:this.bridge,qrcodeModal:this.qrcode?s.default:void 0,qrcodeModalOptions:this.qrcodeModalOptions,storageId:null==e?void 0:e.storageId,signingMethods:null==e?void 0:e.signingMethods,clientMeta:null==e?void 0:e.clientMeta};if(this.wc=void 0!==(null==e?void 0:e.connector)?e.connector:new o.default(t),void 0===this.wc)throw new Error("Failed to register WalletConnect connector");return this.wc.accounts.length&&(this.accounts=this.wc.accounts),this.wc.chainId&&(this.chainId=this.wc.chainId),this.registerConnectorEvents(),this.wc}onOpen(e){this.pending=!1,e&&(this.wc=e),this.events.emit("open")}onClose(){this.pending=!1,this.wc&&(this.wc=void 0),this.events.emit("close")}onError(e,t="Failed or Rejected Request",n=-32e3){const r={id:e.id,jsonrpc:e.jsonrpc,error:{code:n,message:t}};return this.events.emit("payload",r),r}create(e){this.wc=this.register(this.opts),this.chainId=e||this.chainId,this.connected||this.pending||(this.pending=!0,this.registerConnectorEvents(),this.wc.createSession({chainId:this.chainId}).then((()=>this.events.emit("created"))).catch((e=>this.events.emit("error",e))))}registerConnectorEvents(){this.wc=this.register(this.opts),this.wc.on("connect",(e=>{var t,n;e?this.events.emit("error",e):(this.accounts=(null===(t=this.wc)||void 0===t?void 0:t.accounts)||[],this.chainId=(null===(n=this.wc)||void 0===n?void 0:n.chainId)||this.chainId,this.onOpen())})),this.wc.on("disconnect",(e=>{e?this.events.emit("error",e):this.onClose()})),this.wc.on("modal_closed",(()=>{this.events.emit("error",new Error("User closed modal"))})),this.wc.on("session_update",((e,t)=>{const{accounts:n,chainId:r}=t.params[0];(!this.accounts||n&&this.accounts!==n)&&(this.accounts=n,this.events.emit("accountsChanged",n)),(!this.chainId||r&&this.chainId!==r)&&(this.chainId=r,this.events.emit("chainChanged",r))}))}sendPayload(e){return r.__awaiter(this,void 0,void 0,(function*(){this.wc=this.register(this.opts);try{const t=yield this.wc.unsafeSend(e);return this.sanitizeResponse(t)}catch(t){return this.onError(e,t.message)}}))}sanitizeResponse(e){return void 0!==e.error&&void 0===e.error.code?c.formatJsonRpcError(e.id,e.error.message,e.error.data):e}}t.SignerConnection=u,t.default=u},function(e,t,n){e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},function(e,t,n){(function(t){function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var i=n(1),o=r(n(76)),s=r(n(98)),a=n(101);function c(e){return a.createElement("div",{className:"walletconnect-modal__header"},a.createElement("img",{src:"data:image/svg+xml,%3C?xml version='1.0' encoding='UTF-8'?%3E %3Csvg width='300px' height='185px' viewBox='0 0 300 185' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E %3C!-- Generator: Sketch 49.3 (51167) - http://www.bohemiancoding.com/sketch --%3E %3Ctitle%3EWalletConnect%3C/title%3E %3Cdesc%3ECreated with Sketch.%3C/desc%3E %3Cdefs%3E%3C/defs%3E %3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E %3Cg id='walletconnect-logo-alt' fill='%233B99FC' fill-rule='nonzero'%3E %3Cpath d='M61.4385429,36.2562612 C110.349767,-11.6319051 189.65053,-11.6319051 238.561752,36.2562612 L244.448297,42.0196786 C246.893858,44.4140867 246.893858,48.2961898 244.448297,50.690599 L224.311602,70.406102 C223.088821,71.6033071 221.106302,71.6033071 219.883521,70.406102 L211.782937,62.4749541 C177.661245,29.0669724 122.339051,29.0669724 88.2173582,62.4749541 L79.542302,70.9685592 C78.3195204,72.1657633 76.337001,72.1657633 75.1142214,70.9685592 L54.9775265,51.2530561 C52.5319653,48.8586469 52.5319653,44.9765439 54.9775265,42.5821357 L61.4385429,36.2562612 Z M280.206339,77.0300061 L298.128036,94.5769031 C300.573585,96.9713 300.573599,100.85338 298.128067,103.247793 L217.317896,182.368927 C214.872352,184.763353 210.907314,184.76338 208.461736,182.368989 C208.461726,182.368979 208.461714,182.368967 208.461704,182.368957 L151.107561,126.214385 C150.496171,125.615783 149.504911,125.615783 148.893521,126.214385 C148.893517,126.214389 148.893514,126.214393 148.89351,126.214396 L91.5405888,182.368927 C89.095052,184.763359 85.1300133,184.763399 82.6844276,182.369014 C82.6844133,182.369 82.684398,182.368986 82.6843827,182.36897 L1.87196327,103.246785 C-0.573596939,100.852377 -0.573596939,96.9702735 1.87196327,94.5758653 L19.7936929,77.028998 C22.2392531,74.6345898 26.2042918,74.6345898 28.6498531,77.028998 L86.0048306,133.184355 C86.6162214,133.782957 87.6074796,133.782957 88.2188704,133.184355 C88.2188796,133.184346 88.2188878,133.184338 88.2188969,133.184331 L145.571,77.028998 C148.016505,74.6345347 151.981544,74.6344449 154.427161,77.028798 C154.427195,77.0288316 154.427229,77.0288653 154.427262,77.028899 L211.782164,133.184331 C212.393554,133.782932 213.384814,133.782932 213.996204,133.184331 L271.350179,77.0300061 C273.79574,74.6355969 277.760778,74.6355969 280.206339,77.0300061 Z' id='WalletConnect'%3E%3C/path%3E %3C/g%3E %3C/g%3E %3C/svg%3E",className:"walletconnect-modal__headerLogo"}),a.createElement("p",null,"WalletConnect"),a.createElement("div",{className:"walletconnect-modal__close__wrapper",onClick:e.onClose},a.createElement("div",{id:"walletconnect-qrcode-close",className:"walletconnect-modal__close__icon"},a.createElement("div",{className:"walletconnect-modal__close__line1"}),a.createElement("div",{className:"walletconnect-modal__close__line2"}))))}function u(e){return a.createElement("a",{className:"walletconnect-connect__button",href:e.href,id:"walletconnect-connect-button-"+e.name,onClick:e.onClick,rel:"noopener noreferrer",style:{backgroundColor:e.color},target:"_blank"},e.name)}function l(e){var t=e.color,n=e.href,r=e.name,i=e.logo,o=e.onClick;return a.createElement("a",{className:"walletconnect-modal__base__row",href:n,onClick:o,rel:"noopener noreferrer",target:"_blank"},a.createElement("h3",{className:"walletconnect-modal__base__row__h3"},r),a.createElement("div",{className:"walletconnect-modal__base__row__right"},a.createElement("div",{className:"walletconnect-modal__base__row__right__app-icon",style:{background:"url('"+i+"') "+t,backgroundSize:"100%"}}),a.createElement("img",{src:"data:image/svg+xml,%3Csvg width='8' height='18' viewBox='0 0 8 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M0.586301 0.213898C0.150354 0.552968 0.0718197 1.18124 0.41089 1.61719L5.2892 7.88931C5.57007 8.25042 5.57007 8.75608 5.2892 9.11719L0.410889 15.3893C0.071819 15.8253 0.150353 16.4535 0.586301 16.7926C1.02225 17.1317 1.65052 17.0531 1.98959 16.6172L6.86791 10.3451C7.7105 9.26174 7.7105 7.74476 6.86791 6.66143L1.98959 0.38931C1.65052 -0.0466374 1.02225 -0.125172 0.586301 0.213898Z' fill='%233C4252'/%3E %3C/svg%3E",className:"walletconnect-modal__base__row__right__caret"})))}function f(e){var t=e.color,n=e.href,r=e.name,i=e.logo,o=e.onClick,s=window.innerWidth<768?(r.length>8?2.5:2.7)+"vw":"inherit";return a.createElement("a",{className:"walletconnect-connect__button__icon_anchor",href:n,onClick:o,rel:"noopener noreferrer",target:"_blank"},a.createElement("div",{className:"walletconnect-connect__button__icon",style:{background:"url('"+i+"') "+t,backgroundSize:"100%"}}),a.createElement("div",{style:{fontSize:s},className:"walletconnect-connect__button__text"},r))}function h(e){var t=i.isAndroid(),n=a.useState(""),r=n[0],o=n[1],s=a.useState(""),c=s[0],h=s[1],d=a.useState(1),p=d[0],g=d[1],y=c?e.links.filter((function(e){return e.name.toLowerCase().includes(c.toLowerCase())})):e.links,m=e.errorMessage,v=c||y.length>5,_=Math.ceil(y.length/12),b=[12*(p-1)+1,12*p],w=y.length?y.filter((function(e,t){return t+1>=b[0]&&t+1<=b[1]})):[],E=!(t||!(_>1)),S=void 0;return a.createElement("div",null,a.createElement("p",{id:"walletconnect-qrcode-text",className:"walletconnect-qrcode__text"},t?e.text.connect_mobile_wallet:e.text.choose_preferred_wallet),!t&&a.createElement("input",{className:"walletconnect-search__input",placeholder:"Search",value:r,onChange:function(e){o(e.target.value),clearTimeout(S),e.target.value?S=setTimeout((function(){h(e.target.value),g(1)}),1e3):(o(""),h(""),g(1))}}),a.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(t?"__android":v&&y.length?"__wrap":"")},t?a.createElement(u,{name:e.text.connect,color:"rgb(64, 153, 255)",href:e.uri,onClick:a.useCallback((function(){i.saveMobileLinkInfo({name:"Unknown",href:e.uri})}),[])}):w.length?w.map((function(t){var n=t.color,r=t.name,o=t.shortName,s=t.logo,c=i.formatIOSMobile(e.uri,t),u=a.useCallback((function(){i.saveMobileLinkInfo({name:r,href:c})}),[w]);return v?a.createElement(f,{color:n,href:c,name:o||r,logo:s,onClick:u}):a.createElement(l,{color:n,href:c,name:r,logo:s,onClick:u})})):a.createElement(a.Fragment,null,a.createElement("p",null,m.length?e.errorMessage:e.links.length&&!y.length?e.text.no_wallets_found:e.text.loading))),E&&a.createElement("div",{className:"walletconnect-modal__footer"},Array(_).fill(0).map((function(e,t){var n=t+1,r=p===n;return a.createElement("a",{style:{margin:"auto 10px",fontWeight:r?"bold":"normal"},onClick:function(){return g(n)}},n)}))))}function d(e){var t=!!e.message.trim();return a.createElement("div",{className:"walletconnect-qrcode__notification"+(t?" notification__show":"")},e.message)}function p(e){var t=a.useState(""),n=t[0],r=t[1],i=a.useState(""),c=i[0],u=i[1];return a.useEffect((function(){try{return Promise.resolve(function(e){try{var t="";return Promise.resolve(o.toString(e,{margin:0,type:"svg"})).then((function(e){return"string"==typeof e&&(t=e.replace("0||a.useEffect((function(){!function(){try{if(t)return Promise.resolve();u(!0);var o=function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){var t=e.qrcodeModalOptions&&e.qrcodeModalOptions.registryUrl?e.qrcodeModalOptions.registryUrl:i.getWalletRegistryUrl();return Promise.resolve(fetch(t)).then((function(t){return Promise.resolve(t.json()).then((function(t){var o=t.listings,s=n?"mobile":"desktop",a=i.getMobileLinkRegistry(i.formatMobileRegistry(o,s),r);u(!1),d(!0),k(a.length?"":e.text.no_supported_wallets),x(a);var c=1===a.length;c&&(w(i.formatIOSMobile(e.uri,a[0])),m(!0)),O(c)}))}))}),(function(t){u(!1),d(!0),k(e.text.something_went_wrong),console.error(t)}));Promise.resolve(o&&o.then?o.then((function(){})):void 0)}catch(e){return Promise.reject(e)}}()}))};N();var A=n?y:!y;return a.createElement("div",{id:"walletconnect-qrcode-modal",className:"walletconnect-qrcode__base animated fadeIn"},a.createElement("div",{className:"walletconnect-modal__base"},a.createElement(c,{onClose:e.onClose}),S&&y?a.createElement("div",{className:"walletconnect-modal__single_wallet"},a.createElement("a",{onClick:function(){return i.saveMobileLinkInfo({name:I[0].name,href:b})},href:b,rel:"noopener noreferrer",target:"_blank"},e.text.connect_with+" "+(S?I[0].name:"")+" ›")):t||s||!s&&I.length?a.createElement("div",{className:"walletconnect-modal__mobile__toggle"+(A?" right__selected":"")},a.createElement("div",{className:"walletconnect-modal__mobile__toggle_selector"}),n?a.createElement(a.Fragment,null,a.createElement("a",{onClick:function(){return m(!1),N()}},e.text.mobile),a.createElement("a",{onClick:function(){return m(!0)}},e.text.qrcode)):a.createElement(a.Fragment,null,a.createElement("a",{onClick:function(){return m(!0)}},e.text.qrcode),a.createElement("a",{onClick:function(){return m(!1),N()}},e.text.desktop))):null,a.createElement("div",null,y||!t&&!s&&!I.length?a.createElement(p,Object.assign({},v)):a.createElement(h,Object.assign({},v,{links:I,errorMessage:P})))))}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var y={de:{choose_preferred_wallet:"Wähle bevorzugte Wallet",connect_mobile_wallet:"Verbinde mit Mobile Wallet",scan_qrcode_with_wallet:"Scanne den QR-code mit einer WalletConnect kompatiblen Wallet",connect:"Verbinden",qrcode:"QR-Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"In die Zwischenablage kopieren",copied_to_clipboard:"In die Zwischenablage kopiert!",connect_with:"Verbinden mit Hilfe von",loading:"Laden...",something_went_wrong:"Etwas ist schief gelaufen",no_supported_wallets:"Es gibt noch keine unterstützten Wallet",no_wallets_found:"keine Wallet gefunden"},en:{choose_preferred_wallet:"Choose your preferred wallet",connect_mobile_wallet:"Connect to Mobile Wallet",scan_qrcode_with_wallet:"Scan QR code with a WalletConnect-compatible wallet",connect:"Connect",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copy to clipboard",copied_to_clipboard:"Copied to clipboard!",connect_with:"Connect with",loading:"Loading...",something_went_wrong:"Something went wrong",no_supported_wallets:"There are no supported wallets yet",no_wallets_found:"No wallets found"},es:{choose_preferred_wallet:"Elige tu billetera preferida",connect_mobile_wallet:"Conectar a billetera móvil",scan_qrcode_with_wallet:"Escanea el código QR con una billetera compatible con WalletConnect",connect:"Conectar",qrcode:"Código QR",mobile:"Móvil",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Conectar mediante",loading:"Cargando...",something_went_wrong:"Algo salió mal",no_supported_wallets:"Todavía no hay billeteras compatibles",no_wallets_found:"No se encontraron billeteras"},fr:{choose_preferred_wallet:"Choisissez votre portefeuille préféré",connect_mobile_wallet:"Se connecter au portefeuille mobile",scan_qrcode_with_wallet:"Scannez le QR code avec un portefeuille compatible WalletConnect",connect:"Se connecter",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copier",copied_to_clipboard:"Copié!",connect_with:"Connectez-vous à l'aide de",loading:"Chargement...",something_went_wrong:"Quelque chose a mal tourné",no_supported_wallets:"Il n'y a pas encore de portefeuilles pris en charge",no_wallets_found:"Aucun portefeuille trouvé"},ko:{choose_preferred_wallet:"원하는 지갑을 선택하세요",connect_mobile_wallet:"모바일 지갑과 연결",scan_qrcode_with_wallet:"WalletConnect 지원 지갑에서 QR코드를 스캔하세요",connect:"연결",qrcode:"QR 코드",mobile:"모바일",desktop:"데스크탑",copy_to_clipboard:"클립보드에 복사",copied_to_clipboard:"클립보드에 복사되었습니다!",connect_with:"와 연결하다",loading:"로드 중...",something_went_wrong:"문제가 발생했습니다.",no_supported_wallets:"아직 지원되는 지갑이 없습니다",no_wallets_found:"지갑을 찾을 수 없습니다"},pt:{choose_preferred_wallet:"Escolha sua carteira preferida",connect_mobile_wallet:"Conectar-se à carteira móvel",scan_qrcode_with_wallet:"Ler o código QR com uma carteira compatível com WalletConnect",connect:"Conectar",qrcode:"Código QR",mobile:"Móvel",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Ligar por meio de",loading:"Carregamento...",something_went_wrong:"Algo correu mal",no_supported_wallets:"Ainda não há carteiras suportadas",no_wallets_found:"Nenhuma carteira encontrada"},zh:{choose_preferred_wallet:"选择你的钱包",connect_mobile_wallet:"连接至移动端钱包",scan_qrcode_with_wallet:"使用兼容 WalletConnect 的钱包扫描二维码",connect:"连接",qrcode:"二维码",mobile:"移动",desktop:"桌面",copy_to_clipboard:"复制到剪贴板",copied_to_clipboard:"复制到剪贴板成功!",connect_with:"通过以下方式连接",loading:"正在加载...",something_went_wrong:"出了问题",no_supported_wallets:"目前还没有支持的钱包",no_wallets_found:"没有找到钱包"},fa:{choose_preferred_wallet:"کیف پول مورد نظر خود را انتخاب کنید",connect_mobile_wallet:"به کیف پول موبایل وصل شوید",scan_qrcode_with_wallet:"کد QR را با یک کیف پول سازگار با WalletConnect اسکن کنید",connect:"اتصال",qrcode:"کد QR",mobile:"سیار",desktop:"دسکتاپ",copy_to_clipboard:"کپی به کلیپ بورد",copied_to_clipboard:"در کلیپ بورد کپی شد!",connect_with:"ارتباط با",loading:"...بارگذاری",something_went_wrong:"مشکلی پیش آمد",no_supported_wallets:"هنوز هیچ کیف پول پشتیبانی شده ای وجود ندارد",no_wallets_found:"هیچ کیف پولی پیدا نشد"}};function m(){var e=i.getDocumentOrThrow(),t=e.getElementById("walletconnect-qrcode-modal");t&&(t.className=t.className.replace("fadeIn","fadeOut"),setTimeout((function(){var t=e.getElementById("walletconnect-wrapper");t&&e.body.removeChild(t)}),300))}function v(e){return function(){m(),e&&e()}}var _=function(){return void 0!==t&&void 0!==t.versions&&void 0!==t.versions.node},b={open:function(e,t,n){console.log(e),_()?function(e){o.toString(e,{type:"terminal"}).then(console.log)}(e):function(e,t,n){!function(){var e=i.getDocumentOrThrow(),t=e.getElementById("walletconnect-style-sheet");t&&e.head.removeChild(t);var n=e.createElement("style");n.setAttribute("id","walletconnect-style-sheet"),n.innerText=':root {\n --animation-duration: 300ms;\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.animated {\n animation-duration: var(--animation-duration);\n animation-fill-mode: both;\n}\n\n.fadeIn {\n animation-name: fadeIn;\n}\n\n.fadeOut {\n animation-name: fadeOut;\n}\n\n#walletconnect-wrapper {\n -webkit-user-select: none;\n align-items: center;\n display: flex;\n height: 100%;\n justify-content: center;\n left: 0;\n pointer-events: none;\n position: fixed;\n top: 0;\n user-select: none;\n width: 100%;\n z-index: 99999999999999;\n}\n\n.walletconnect-modal__headerLogo {\n height: 21px;\n}\n\n.walletconnect-modal__header p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n align-items: flex-start;\n display: flex;\n flex: 1;\n margin-left: 5px;\n}\n\n.walletconnect-modal__close__wrapper {\n position: absolute;\n top: 0px;\n right: 0px;\n z-index: 10000;\n background: white;\n border-radius: 26px;\n padding: 6px;\n box-sizing: border-box;\n width: 26px;\n height: 26px;\n cursor: pointer;\n}\n\n.walletconnect-modal__close__icon {\n position: relative;\n top: 7px;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transform: rotate(45deg);\n}\n\n.walletconnect-modal__close__line1 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n}\n\n.walletconnect-modal__close__line2 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n transform: rotate(90deg);\n}\n\n.walletconnect-qrcode__base {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n background: rgba(37, 41, 46, 0.95);\n height: 100%;\n left: 0;\n pointer-events: auto;\n position: fixed;\n top: 0;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n width: 100%;\n will-change: opacity;\n padding: 40px;\n box-sizing: border-box;\n}\n\n.walletconnect-qrcode__text {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 10px 0 20px 0;\n text-align: center;\n width: 100%;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-qrcode__text {\n font-size: 4vw;\n }\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-qrcode__text {\n font-size: 14px;\n }\n}\n\n.walletconnect-qrcode__image {\n width: calc(100% - 30px);\n box-sizing: border-box;\n cursor: none;\n margin: 0 auto;\n}\n\n.walletconnect-qrcode__notification {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n font-size: 16px;\n padding: 16px 20px;\n border-radius: 16px;\n text-align: center;\n transition: all 0.1s ease-in-out;\n background: white;\n color: black;\n margin-bottom: -60px;\n opacity: 0;\n}\n\n.walletconnect-qrcode__notification.notification__show {\n opacity: 1;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__header {\n height: 130px;\n }\n .walletconnect-modal__base {\n overflow: auto;\n }\n}\n\n@media only screen and (min-device-width: 415px) and (max-width: 768px) {\n #content {\n max-width: 768px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 375px) and (max-width: 415px) {\n #content {\n max-width: 414px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 320px) and (max-width: 375px) {\n #content {\n max-width: 375px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (max-width: 320px) {\n #content {\n max-width: 320px;\n box-sizing: border-box;\n }\n}\n\n.walletconnect-modal__base {\n -webkit-font-smoothing: antialiased;\n background: #ffffff;\n border-radius: 24px;\n box-shadow: 0 10px 50px 5px rgba(0, 0, 0, 0.4);\n font-family: ui-rounded, "SF Pro Rounded", "SF Pro Text", medium-content-sans-serif-font,\n -apple-system, BlinkMacSystemFont, ui-sans-serif, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,\n "Open Sans", "Helvetica Neue", sans-serif;\n margin-top: 41px;\n padding: 24px 24px 22px;\n pointer-events: auto;\n position: relative;\n text-align: center;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n will-change: transform;\n overflow: visible;\n transform: translateY(-50%);\n top: 50%;\n max-width: 500px;\n margin: auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__base {\n padding: 24px 12px;\n }\n}\n\n.walletconnect-modal__base .hidden {\n transform: translateY(150%);\n transition: 0.125s cubic-bezier(0.4, 0, 1, 1);\n}\n\n.walletconnect-modal__header {\n align-items: center;\n display: flex;\n height: 26px;\n left: 0;\n justify-content: space-between;\n position: absolute;\n top: -42px;\n width: 100%;\n}\n\n.walletconnect-modal__base .wc-logo {\n align-items: center;\n display: flex;\n height: 26px;\n margin-top: 15px;\n padding-bottom: 15px;\n pointer-events: auto;\n}\n\n.walletconnect-modal__base .wc-logo div {\n background-color: #3399ff;\n height: 21px;\n margin-right: 5px;\n mask-image: url("images/wc-logo.svg") center no-repeat;\n width: 32px;\n}\n\n.walletconnect-modal__base .wc-logo p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n}\n\n.walletconnect-modal__base h2 {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 0 0 19px 0;\n text-align: center;\n width: 100%;\n}\n\n.walletconnect-modal__base__row {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n align-items: center;\n border-radius: 20px;\n cursor: pointer;\n display: flex;\n height: 56px;\n justify-content: space-between;\n padding: 0 15px;\n position: relative;\n margin: 0px 0px 8px;\n text-align: left;\n transition: 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n will-change: transform;\n text-decoration: none;\n}\n\n.walletconnect-modal__base__row:hover {\n background: rgba(60, 66, 82, 0.06);\n}\n\n.walletconnect-modal__base__row:active {\n background: rgba(60, 66, 82, 0.06);\n transform: scale(0.975);\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n}\n\n.walletconnect-modal__base__row__h3 {\n color: #25292e;\n font-size: 20px;\n font-weight: 700;\n margin: 0;\n padding-bottom: 3px;\n}\n\n.walletconnect-modal__base__row__right {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.walletconnect-modal__base__row__right__app-icon {\n border-radius: 8px;\n height: 34px;\n margin: 0 11px 2px 0;\n width: 34px;\n background-size: 100%;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-modal__base__row__right__caret {\n height: 18px;\n opacity: 0.3;\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n width: 8px;\n will-change: opacity;\n}\n\n.walletconnect-modal__base__row:hover .caret,\n.walletconnect-modal__base__row:active .caret {\n opacity: 0.6;\n}\n\n.walletconnect-modal__mobile__toggle {\n width: 80%;\n display: flex;\n margin: 0 auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n margin-bottom: 18px;\n background: #d4d5d9;\n}\n\n.walletconnect-modal__single_wallet {\n display: flex;\n justify-content: center;\n margin-top: 7px;\n margin-bottom: 18px;\n}\n\n.walletconnect-modal__single_wallet a {\n cursor: pointer;\n color: rgb(64, 153, 255);\n font-size: 21px;\n font-weight: 800;\n text-decoration: none !important;\n margin: 0 auto;\n}\n\n.walletconnect-modal__mobile__toggle_selector {\n width: calc(50% - 8px);\n background: white;\n position: absolute;\n border-radius: 5px;\n height: calc(100% - 8px);\n top: 4px;\n transition: all 0.2s ease-in-out;\n transform: translate3d(4px, 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle.right__selected .walletconnect-modal__mobile__toggle_selector {\n transform: translate3d(calc(100% + 12px), 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle a {\n font-size: 12px;\n width: 50%;\n text-align: center;\n padding: 8px;\n margin: 0;\n font-weight: 600;\n z-index: 1;\n}\n\n.walletconnect-modal__footer {\n display: flex;\n justify-content: center;\n margin-top: 20px;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__footer {\n margin-top: 5vw;\n }\n}\n\n.walletconnect-modal__footer a {\n cursor: pointer;\n color: #898d97;\n font-size: 15px;\n margin: 0 auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__footer a {\n font-size: 14px;\n }\n}\n\n.walletconnect-connect__buttons__wrapper {\n max-height: 44vh;\n}\n\n.walletconnect-connect__buttons__wrapper__android {\n margin: 50% 0;\n}\n\n.walletconnect-connect__buttons__wrapper__wrap {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n margin: 10px 0;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__buttons__wrapper__wrap {\n margin-top: 40px;\n }\n}\n\n.walletconnect-connect__button {\n background-color: rgb(64, 153, 255);\n padding: 12px;\n border-radius: 8px;\n text-decoration: none;\n color: rgb(255, 255, 255);\n font-weight: 500;\n}\n\n.walletconnect-connect__button__icon_anchor {\n cursor: pointer;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: 8px;\n width: 42px;\n justify-self: center;\n flex-direction: column;\n text-decoration: none !important;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-connect__button__icon_anchor {\n margin: 4px;\n }\n}\n\n.walletconnect-connect__button__icon {\n border-radius: 10px;\n height: 42px;\n margin: 0;\n width: 42px;\n background-size: cover !important;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-connect__button__text {\n color: #424952;\n font-size: 2.7vw;\n text-decoration: none !important;\n padding: 0;\n margin-top: 1.8vw;\n font-weight: 600;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__button__text {\n font-size: 16px;\n margin-top: 12px;\n }\n}\n\n.walletconnect-search__input {\n border: none;\n background: #d4d5d9;\n border-style: none;\n padding: 8px 16px;\n outline: none;\n font-style: normal;\n font-stretch: normal;\n font-size: 16px;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: left;\n border-radius: 8px;\n width: calc(100% - 16px);\n margin: 0;\n margin-bottom: 8px;\n}\n',e.head.appendChild(n)}();var r,o=function(){var e=i.getDocumentOrThrow(),t=e.createElement("div");return t.setAttribute("id","walletconnect-wrapper"),e.body.appendChild(t),t}();a.render(a.createElement(g,{text:(r=i.getNavigatorOrThrow().language.split("-")[0]||"en",y[r]||y.en),uri:e,onClose:v(t),qrcodeModalOptions:n}),o)}(e,t,n)},close:function(){_()||m()}};e.exports=b}).call(this,n(19))},function(e,t,n){const r=n(77),i=n(78),o=n(96),s=n(97);function a(e,t,n,o,s){const a=[].slice.call(arguments,1),c=a.length,u="function"==typeof a[c-1];if(!u&&!r())throw new Error("Callback required as last argument");if(!u){if(c<1)throw new Error("Too few arguments provided");return 1===c?(n=t,t=o=void 0):2!==c||t.getContext||(o=n,n=t,t=void 0),new Promise((function(r,s){try{const s=i.create(n,o);r(e(s,t,o))}catch(e){s(e)}}))}if(c<2)throw new Error("Too few arguments provided");2===c?(s=n,n=t,t=o=void 0):3===c&&(t.getContext&&void 0===s?(s=o,o=void 0):(s=o,o=n,n=t,t=void 0));try{const r=i.create(n,o);s(null,e(r,t,o))}catch(e){s(e)}}t.create=i.create,t.toCanvas=a.bind(null,o.render),t.toDataURL=a.bind(null,o.renderToDataURL),t.toString=a.bind(null,(function(e,t,n){return s.render(e,n)}))},function(e,t){e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},function(e,t,n){const r=n(9),i=n(21),o=n(79),s=n(80),a=n(81),c=n(82),u=n(83),l=n(53),f=n(84),h=n(87),d=n(88),p=n(10),g=n(89);function y(e,t,n){const r=e.size,i=d.getEncodedBits(t,n);let o,s;for(o=0;o<15;o++)s=1==(i>>o&1),o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(r-15+o,8,s,!0),o<8?e.set(8,r-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(r-8,8,1,!0)}function m(e,t,n){const i=new o;n.forEach((function(t){i.put(t.mode.bit,4),i.put(t.getLength(),p.getCharCountIndicator(t.mode,e)),t.write(i)}));const s=8*(r.getSymbolTotalCodewords(e)-l.getTotalCodewordsCount(e,t));for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const a=(s-i.getLengthInBits())/8;for(let e=0;e=0&&t<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===t||6===t)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,o+r,!0,!0):e.set(i+t,o+r,!1,!0))}}(p,t),function(e){const t=e.size;for(let n=8;n=7&&function(e,t){const n=e.size,r=h.getEncodedBits(t);let i,o,s;for(let t=0;t<18;t++)i=Math.floor(t/3),o=t%3+n-8-3,s=1==(r>>t&1),e.set(i,o,s,!0),e.set(o,i,s,!0)}(p,t),function(e,t){const n=e.size;let r=-1,i=n-1,o=7,s=0;for(let a=n-1;a>0;a-=2)for(6===a&&a--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,a-n)){let r=!1;s>>o&1)),e.set(i,a-n,r),o--,-1===o&&(s++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}(p,f),isNaN(i)&&(i=u.getBestMask(p,y.bind(null,p,n))),u.applyMask(i,p),y(p,n,i),{modules:p,version:t,errorCorrectionLevel:n,maskPattern:i,segments:o}}t.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let n,o,s=i.M;return void 0!==t&&(s=i.from(t.errorCorrectionLevel,i.M),n=h.from(t.version),o=u.from(t.maskPattern),t.toSJISFunc&&r.setToSJISFunction(t.toSJISFunc)),v(e,n,s,o)}},function(e,t){function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let n=0;n>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=n},function(e,t){function n(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){const i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=n},function(e,t,n){const r=n(9).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,n=r(e),i=145===n?26:2*Math.ceil((n-13)/(2*t-2)),o=[n-7];for(let e=1;e=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let n=0,r=0,i=0,o=null,s=null;for(let a=0;a=5&&(n+=r-5+3),o=t,r=1),t=e.get(c,a),t===s?i++:(i>=5&&(n+=i-5+3),s=t,i=1)}r>=5&&(n+=r-5+3),i>=5&&(n+=i-5+3)}return n},t.getPenaltyN2=function(e){const t=e.size;let n=0;for(let r=0;r=10&&(1488===r||93===r)&&n++,i=i<<1&2047|e.get(s,o),s>=10&&(1488===i||93===i)&&n++}return 40*n},t.getPenaltyN4=function(e){let t=0;const n=e.data.length;for(let r=0;r0){const e=new Uint8Array(this.degree);return e.set(n,i),e}return n},e.exports=i},function(e,t,n){const r=n(86);t.mul=function(e,t){const n=new Uint8Array(e.length+t.length-1);for(let i=0;i=0;){const e=n[0];for(let i=0;i1)return function(e,n){for(let r=1;r<=40;r++)if(l(e,r)<=t.getCapacity(r,n,s.MIXED))return r}(e,i);if(0===e.length)return 1;r=e[0]}else r=e;return function(e,n,r){for(let i=1;i<=40;i++)if(n<=t.getCapacity(i,r,e))return i}(r.mode,r.getLength(),i)},t.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;r.getBCHDigit(t)-c>=0;)t^=7973<=0;)o^=1335<=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(s))},t.rawSplit=function(e){return t.fromArray(d(e,u.isKanjiModeEnabled()))}},function(e,t,n){const r=n(10);function i(e){this.mode=r.NUMERIC,this.data=e.toString()}i.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);const i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,3*i+1))},e.exports=i},function(e,t,n){const r=n(10),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function o(e){this.mode=r.ALPHANUMERIC,this.data=e}o.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=45*i.indexOf(this.data[t]);n+=i.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(i.indexOf(this.data[t]),6)},e.exports=o},function(e,t,n){const r=n(93),i=n(10);function o(e){this.mode=i.BYTE,"string"==typeof e&&(e=r(e)),this.data=new Uint8Array(e)}o.getBitsLength=function(e){return 8*e},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){for(let t=0,n=this.data.length;t=55296&&i<=56319&&n>r+1){var o=e.charCodeAt(r+1);o>=56320&&o<=57343&&(i=1024*(i-55296)+o-56320+65536,r+=1)}i<128?t.push(i):i<2048?(t.push(i>>6|192),t.push(63&i|128)):i<55296||i>=57344&&i<65536?(t.push(i>>12|224),t.push(i>>6&63|128),t.push(63&i|128)):i>=65536&&i<=1114111?(t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128)):t.push(239,191,189)}return new Uint8Array(t).buffer}},function(e,t,n){const r=n(10),i=n(9);function o(e){this.mode=r.KANJI,this.data=e}o.getBitsLength=function(e){return 13*e},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t;for(t=0;t=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),e.put(n,13)}},e.exports=o},function(e,t,n){var r={single_source_shortest_paths:function(e,t,n){var i={},o={};o[t]=0;var s,a,c,u,l,f,h,d=r.PriorityQueue.make();for(d.push(t,0);!d.empty();)for(c in a=(s=d.pop()).value,u=s.cost,l=e[a]||{})l.hasOwnProperty(c)&&(f=u+l[c],h=o[c],(void 0===o[c]||h>f)&&(o[c]=f,d.push(c,f),i[c]=a));if(void 0!==n&&void 0===o[n]){var p=["Could not find a path from ",t," to ",n,"."].join("");throw new Error(p)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,n){var i=r.single_source_shortest_paths(e,t,n);return r.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(e){var t,n=r.PriorityQueue,i={};for(t in e=e||{},n)n.hasOwnProperty(t)&&(i[t]=n[t]);return i.queue=[],i.sorter=e.sorter||n.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=r},function(e,t,n){const r=n(56);t.render=function(e,t,n){let i=n,o=t;void 0!==i||t&&t.getContext||(i=t,t=void 0),t||(o=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),i=r.getOptions(i);const s=r.getImageWidth(e.modules.size,i),a=o.getContext("2d"),c=a.createImageData(s,s);return r.qrToImageData(c.data,e,i),function(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}(a,o,s),a.putImageData(c,0,0),o},t.renderToDataURL=function(e,n,r){let i=r;void 0!==i||n&&n.getContext||(i=n,n=void 0),i||(i={});const o=t.render(e,n,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}},function(e,t,n){const r=n(56);function i(e,t){const n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function o(e,t,n){let r=e+t;return void 0!==n&&(r+=" "+n),r}t.render=function(e,t,n){const s=r.getOptions(t),a=e.modules.size,c=e.modules.data,u=a+2*s.margin,l=s.color.light.a?"':"",f="0&&u>0&&e[c-1]||(r+=s?o("M",u+n,.5+l+n):o("m",i,0),i=0,s=!1),u+1',h='viewBox="0 0 '+u+" "+u+'"',d=''+l+f+"\n";return"function"==typeof n&&n(null,d),d}},function(e,t,n){var r=n(99),i={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,o,s,a,c,u,l=!1;t||(t={}),n=t.debug||!1;try{if(s=r(),a=document.createRange(),c=document.getSelection(),(u=document.createElement("span")).textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=i[t.format]||i.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(u),a.selectNodeContents(u),c.addRange(a),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),o=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{c&&("function"==typeof c.removeRange?c.removeRange(a):c.removeAllRanges()),u&&document.body.removeChild(u),s()}return l}},function(e,t){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;rt.event!==e))}trigger(e){let t,n=[];t=Object(o.isJsonRpcRequest)(e)?e.method:Object(o.isJsonRpcResponseSuccess)(e)||Object(o.isJsonRpcResponseError)(e)?"response:"+e.id:Object(o.isInternalEvent)(e)?e.event:"",t&&(n=this._eventEmitters.filter((e=>e.event===t))),n&&n.length||Object(o.isReservedEvent)(t)||Object(o.isInternalEvent)(t)||(n=this._eventEmitters.filter((e=>"call_request"===e.event))),n.forEach((t=>{if(Object(o.isJsonRpcResponseError)(e)){const n=new Error(e.error.message);t.callback(n,null)}else t.callback(null,e)}))}},c=class{constructor(e="walletconnect"){this.storageId=e}getSession(){let e=null;const t=Object(o.getLocal)(this.storageId);return t&&Object(o.isWalletConnectSession)(t)&&(e=t),e}setSession(e){return Object(o.setLocal)(this.storageId,e),e}removeSession(){Object(o.removeLocal)(this.storageId)}};const u="abcdefghijklmnopqrstuvwxyz0123456789".split("").map((e=>`https://${e}.bridge.walletconnect.org`));var l=class{constructor(e){if(this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new a,this._clientMeta=Object(o.getClientMeta)()||e.connectorOpts.clientMeta||null,this._cryptoLib=e.cryptoLib,this._sessionStorage=e.sessionStorage||new c(e.connectorOpts.storageId),this._qrcodeModal=e.connectorOpts.qrcodeModal,this._qrcodeModalOptions=e.connectorOpts.qrcodeModalOptions,this._signingMethods=[...i.SIGNING_METHODS,...e.connectorOpts.signingMethods||[]],!e.connectorOpts.bridge&&!e.connectorOpts.uri&&!e.connectorOpts.session)throw new Error(i.ERROR_MISSING_REQUIRED);var t;e.connectorOpts.bridge&&(this.bridge=function(e){return"walletconnect.org"===function(e){return function(e){let t=e.indexOf("//")>-1?e.split("/")[2]:e.split("/")[0];return t=t.split(":")[0],t=t.split("?")[0],t}(e).split(".").slice(-2).join(".")}(e)}(t=e.connectorOpts.bridge)?u[Math.floor(Math.random()*u.length)]:t),e.connectorOpts.uri&&(this.uri=e.connectorOpts.uri);const n=e.connectorOpts.session||this._getStorageSession();n&&(this.session=n),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=e.transport||new s.a({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),e.connectorOpts.uri&&this._subscribeToSessionRequest(),e.pushServerOpts&&this._registerPushServer(e.pushServerOpts)}set bridge(e){e&&(this._bridge=e)}get bridge(){return this._bridge}set key(e){if(!e)return;const t=Object(o.convertHexToArrayBuffer)(e);this._key=t}get key(){return this._key?Object(o.convertArrayBufferToHex)(this._key,!0):""}set clientId(e){e&&(this._clientId=e)}get clientId(){let e=this._clientId;return e||(e=this._clientId=Object(o.uuid)()),this._clientId}set peerId(e){e&&(this._peerId=e)}get peerId(){return this._peerId}set clientMeta(e){}get clientMeta(){let e=this._clientMeta;return e||(e=this._clientMeta=Object(o.getClientMeta)()),e}set peerMeta(e){this._peerMeta=e}get peerMeta(){return this._peerMeta}set handshakeTopic(e){e&&(this._handshakeTopic=e)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(e){e&&(this._handshakeId=e)}get handshakeId(){return this._handshakeId}get uri(){return this._formatUri()}set uri(e){if(!e)return;const{handshakeTopic:t,bridge:n,key:r}=this._parseUri(e);this.handshakeTopic=t,this.bridge=n,this.key=r}set chainId(e){this._chainId=e}get chainId(){return this._chainId}set networkId(e){this._networkId=e}get networkId(){return this._networkId}set accounts(e){this._accounts=e}get accounts(){return this._accounts}set rpcUrl(e){this._rpcUrl=e}get rpcUrl(){return this._rpcUrl}set connected(e){}get connected(){return this._connected}set pending(e){}get pending(){return!!this._handshakeTopic}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(e){e&&(this._connected=e.connected,this.accounts=e.accounts,this.chainId=e.chainId,this.bridge=e.bridge,this.key=e.key,this.clientId=e.clientId,this.clientMeta=e.clientMeta,this.peerId=e.peerId,this.peerMeta=e.peerMeta,this.handshakeId=e.handshakeId,this.handshakeTopic=e.handshakeTopic)}on(e,t){const n={event:e,callback:t};this._eventManager.subscribe(n)}off(e){this._eventManager.unsubscribe(e)}async createInstantRequest(e){this._key=await this._generateKey();const t=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(e)}]});this.handshakeId=t.id,this.handshakeTopic=Object(o.uuid)(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",(()=>{throw new Error(i.ERROR_QRCODE_MODAL_USER_CLOSED)}));const n=()=>{this.killSession()};try{const e=await this._sendCallRequest(t);return e&&n(),e}catch(e){throw n(),e}}async connect(e){if(!this._qrcodeModal)throw new Error(i.ERROR_QRCODE_MODAL_NOT_PROVIDED);return this.connected?{chainId:this.chainId,accounts:this.accounts}:(await this.createSession(e),new Promise((async(e,t)=>{this.on("modal_closed",(()=>t(new Error(i.ERROR_QRCODE_MODAL_USER_CLOSED)))),this.on("connect",((n,r)=>{if(n)return t(n);e(r.params[0])}))})))}async createSession(e){if(this._connected)throw new Error(i.ERROR_SESSION_CONNECTED);if(this.pending)return;this._key=await this._generateKey();const t=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:e&&e.chainId?e.chainId:null}]});this.handshakeId=t.id,this.handshakeTopic=Object(o.uuid)(),this._sendSessionRequest(t,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]})}approveSession(e){if(this._connected)throw new Error(i.ERROR_SESSION_CONNECTED);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";const t={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},n={id:this.handshakeId,jsonrpc:"2.0",result:t};this._sendResponse(n),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(e){if(this._connected)throw new Error(i.ERROR_SESSION_CONNECTED);const t=e&&e.message?e.message:i.ERROR_SESSION_REJECTED,n=this._formatResponse({id:this.handshakeId,error:{message:t}});this._sendResponse(n),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:t}]}),this._removeStorageSession()}updateSession(e){if(!this._connected)throw new Error(i.ERROR_SESSION_DISCONNECTED);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";const t={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},n=this._formatRequest({method:"wc_sessionUpdate",params:[t]});this._sendSessionRequest(n,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}async killSession(e){const t=e?e.message:"Session Disconnected",n=this._formatRequest({method:"wc_sessionUpdate",params:[{approved:!1,chainId:null,networkId:null,accounts:null}]});await this._sendRequest(n),this._handleSessionDisconnect(t)}async sendTransaction(e){if(!this._connected)throw new Error(i.ERROR_SESSION_DISCONNECTED);const t=e,n=this._formatRequest({method:"eth_sendTransaction",params:[t]});return await this._sendCallRequest(n)}async signTransaction(e){if(!this._connected)throw new Error(i.ERROR_SESSION_DISCONNECTED);const t=e,n=this._formatRequest({method:"eth_signTransaction",params:[t]});return await this._sendCallRequest(n)}async signMessage(e){if(!this._connected)throw new Error(i.ERROR_SESSION_DISCONNECTED);const t=this._formatRequest({method:"eth_sign",params:e});return await this._sendCallRequest(t)}async signPersonalMessage(e){if(!this._connected)throw new Error(i.ERROR_SESSION_DISCONNECTED);const t=this._formatRequest({method:"personal_sign",params:e});return await this._sendCallRequest(t)}async signTypedData(e){if(!this._connected)throw new Error(i.ERROR_SESSION_DISCONNECTED);const t=this._formatRequest({method:"eth_signTypedData",params:e});return await this._sendCallRequest(t)}async updateChain(e){if(!this._connected)throw new Error("Session currently disconnected");const t=this._formatRequest({method:"wallet_updateChain",params:[e]});return await this._sendCallRequest(t)}unsafeSend(e,t){return this._sendRequest(e,t),this._eventManager.trigger({event:"call_request_sent",params:[{request:e,options:t}]}),new Promise(((t,n)=>{this._subscribeToResponse(e.id,((e,r)=>{if(e)n(e);else{if(!r)throw new Error(i.ERROR_MISSING_JSON_RPC);t(r)}}))}))}async sendCustomRequest(e,t){if(!this._connected)throw new Error(i.ERROR_SESSION_DISCONNECTED);switch(e.method){case"eth_accounts":return this.accounts;case"eth_chainId":return Object(o.convertNumberToHex)(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":case"personal_sign":e.params}const n=this._formatRequest(e);return await this._sendCallRequest(n,t)}approveRequest(e){if(!Object(o.isJsonRpcResponseSuccess)(e))throw new Error(i.ERROR_MISSING_RESULT);{const t=this._formatResponse(e);this._sendResponse(t)}}rejectRequest(e){if(!Object(o.isJsonRpcResponseError)(e))throw new Error(i.ERROR_MISSING_ERROR);{const t=this._formatResponse(e);this._sendResponse(t)}}transportClose(){this._transport.close()}async _sendRequest(e,t){const n=this._formatRequest(e),r=await this._encrypt(n),i=void 0!==(null==t?void 0:t.topic)?t.topic:this.peerId,s=JSON.stringify(r),a=void 0!==(null==t?void 0:t.forcePushNotification)?!t.forcePushNotification:Object(o.isSilentPayload)(n);this._transport.send(s,i,a)}async _sendResponse(e){const t=await this._encrypt(e),n=this.peerId,r=JSON.stringify(t);this._transport.send(r,n,!0)}async _sendSessionRequest(e,t,n){this._sendRequest(e,n),this._subscribeToSessionResponse(e.id,t)}_sendCallRequest(e,t){return this._sendRequest(e,t),this._eventManager.trigger({event:"call_request_sent",params:[{request:e,options:t}]}),this._subscribeToCallResponse(e.id)}_formatRequest(e){if(void 0===e.method)throw new Error(i.ERROR_MISSING_METHOD);return{id:void 0===e.id?Object(o.payloadId)():e.id,jsonrpc:"2.0",method:e.method,params:void 0===e.params?[]:e.params}}_formatResponse(e){if(void 0===e.id)throw new Error(i.ERROR_MISSING_ID);const t={id:e.id,jsonrpc:"2.0"};if(Object(o.isJsonRpcResponseError)(e)){const n=Object(o.formatRpcError)(e.error);return Object.assign(Object.assign(Object.assign({},t),e),{error:n})}if(Object(o.isJsonRpcResponseSuccess)(e))return Object.assign(Object.assign({},t),e);throw new Error(i.ERROR_INVALID_RESPONSE)}_handleSessionDisconnect(e){const t=e||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),Object(o.removeLocal)(i.MOBILE_LINK_CHOICE_KEY)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:t}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(e,t){t&&t.approved?(this._connected?(t.chainId&&(this.chainId=t.chainId),t.accounts&&(this.accounts=t.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,t.chainId&&(this.chainId=t.chainId),t.accounts&&(this.accounts=t.accounts),t.peerId&&!this.peerId&&(this.peerId=t.peerId),t.peerMeta&&!this.peerMeta&&(this.peerMeta=t.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(e)}async _handleIncomingMessages(e){if(![this.clientId,this.handshakeTopic].includes(e.topic))return;let t;try{t=JSON.parse(e.payload)}catch(e){return}const n=await this._decrypt(t);n&&this._eventManager.trigger(n)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(e,t){this.on("response:"+e,t)}_subscribeToSessionResponse(e,t){this._subscribeToResponse(e,((e,n)=>{e?this._handleSessionResponse(e.message):Object(o.isJsonRpcResponseSuccess)(n)?this._handleSessionResponse(t,n.result):n.error&&n.error.message?this._handleSessionResponse(n.error.message):this._handleSessionResponse(t)}))}_subscribeToCallResponse(e){return new Promise(((t,n)=>{this._subscribeToResponse(e,((e,r)=>{e?n(e):Object(o.isJsonRpcResponseSuccess)(r)?t(r.result):r.error&&r.error.message?n(r.error):n(new Error(i.ERROR_INVALID_RESPONSE))}))}))}_subscribeToInternalEvents(){this.on("display_uri",(()=>{this._qrcodeModal&&this._qrcodeModal.open(this.uri,(()=>{this._eventManager.trigger({event:"modal_closed",params:[]})}),this._qrcodeModalOptions)})),this.on("connect",(()=>{this._qrcodeModal&&this._qrcodeModal.close()})),this.on("call_request_sent",((e,t)=>{const{request:n}=t.params[0];if(Object(o.isMobile)()&&this._signingMethods.includes(n.method)){const e=Object(o.getLocal)(i.MOBILE_LINK_CHOICE_KEY);e&&(window.location.href=e.href)}})),this.on("wc_sessionRequest",((e,t)=>{e&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:e.toString()}]}),this.handshakeId=t.id,this.peerId=t.params[0].peerId,this.peerMeta=t.params[0].peerMeta;const n=Object.assign(Object.assign({},t),{method:"session_request"});this._eventManager.trigger(n)})),this.on("wc_sessionUpdate",((e,t)=>{e&&this._handleSessionResponse(e.message),this._handleSessionResponse("Session disconnected",t.params[0])}))}_initTransport(){this._transport.on("message",(e=>this._handleIncomingMessages(e))),this._transport.on("open",(()=>this._eventManager.trigger({event:"transport_open",params:[]}))),this._transport.on("close",(()=>this._eventManager.trigger({event:"transport_close",params:[]}))),this._transport.on("error",(()=>this._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]}))),this._transport.open()}_formatUri(){return`${this.protocol}:${this.handshakeTopic}@${this.version}?bridge=${encodeURIComponent(this.bridge)}&key=${this.key}`}_parseUri(e){const t=Object(o.parseWalletConnectUri)(e);if(t.protocol===this.protocol){if(!t.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");const e=t.handshakeTopic;if(!t.bridge)throw Error("Invalid or missing bridge url parameter value");const n=decodeURIComponent(t.bridge);if(!t.key)throw Error("Invalid or missing key parameter value");return{handshakeTopic:e,bridge:n,key:t.key}}throw new Error(i.ERROR_INVALID_URI)}async _generateKey(){return this._cryptoLib?await this._cryptoLib.generateKey():null}async _encrypt(e){const t=this._key;return this._cryptoLib&&t?await this._cryptoLib.encrypt(e,t):null}async _decrypt(e){const t=this._key;return this._cryptoLib&&t?await this._cryptoLib.decrypt(e,t):null}_getStorageSession(){let e=null;return this._sessionStorage&&(e=this._sessionStorage.getSession()),e}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(e){if(!e.url||"string"!=typeof e.url)throw Error("Invalid or missing pushServerOpts.url parameter value");if(!e.type||"string"!=typeof e.type)throw Error("Invalid or missing pushServerOpts.type parameter value");if(!e.token||"string"!=typeof e.token)throw Error("Invalid or missing pushServerOpts.token parameter value");const t={bridge:this.bridge,topic:this.clientId,type:e.type,token:e.token,peerName:"",language:e.language||""};this.on("connect",(async(n,r)=>{if(n)throw n;if(e.peerMeta){const e=r.params[0].peerMeta.name;t.peerName=e}try{const n=await fetch(e.url+"/new",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)});if(!(await n.json()).success)throw Error("Failed to register in Push Server")}catch(n){throw Error("Failed to register in Push Server")}}))}},f=n(14),h=n(0);async function d(e){const t=(e||256)/8,n=f.randomBytes(t);return Object(o.convertBufferToArrayBuffer)(h.b(n))}async function p(e,t){const n=h.n(e.data),r=h.n(e.iv),i=h.n(e.hmac),o=h.c(i,!1),s=h.j(n,r),a=await f.hmacSha256Sign(t,s),c=h.c(a,!1);return h.A(o)===h.A(c)}async function g(e,t,n){const r=h.f(Object(o.convertArrayBufferToBuffer)(t)),i=n||await d(128),s=h.f(Object(o.convertArrayBufferToBuffer)(i)),a=h.c(s,!1),c=JSON.stringify(e),u=h.C(c),l=await f.aesCbcEncrypt(s,r,u),p=h.c(l,!1),g=h.j(l,s),y=await f.hmacSha256Sign(r,g);return{data:p,hmac:h.c(y,!1),iv:a}}async function y(e,t){const n=h.f(Object(o.convertArrayBufferToBuffer)(t));if(!n)throw new Error("Missing key: required for decryption");if(!await p(e,n))return null;const r=h.n(e.data),i=h.n(e.iv),s=await f.aesCbcDecrypt(i,n,r),a=h.e(s);let c;try{c=JSON.parse(a)}catch(e){return null}return c}t.default=class extends l{constructor(e,t){super({cryptoLib:r,connectorOpts:e,pushServerOpts:t})}}},function(e,t,n){n.r(t),n.d(t,"Component",(function(){return O})),n.d(t,"Fragment",(function(){return _})),n.d(t,"createContext",(function(){return $})),n.d(t,"createElement",(function(){return y})),n.d(t,"createRef",(function(){return v})),n.d(t,"useCallback",(function(){return fe})),n.d(t,"useContext",(function(){return he})),n.d(t,"useDebugValue",(function(){return de})),n.d(t,"useEffect",(function(){return se})),n.d(t,"useErrorBoundary",(function(){return pe})),n.d(t,"useId",(function(){return ge})),n.d(t,"useImperativeHandle",(function(){return ue})),n.d(t,"useLayoutEffect",(function(){return ae})),n.d(t,"useMemo",(function(){return le})),n.d(t,"useReducer",(function(){return oe})),n.d(t,"useRef",(function(){return ce})),n.d(t,"useState",(function(){return ie})),n.d(t,"Children",(function(){return Ae})),n.d(t,"PureComponent",(function(){return Ie})),n.d(t,"StrictMode",(function(){return ht})),n.d(t,"Suspense",(function(){return Le})),n.d(t,"SuspenseList",(function(){return De})),n.d(t,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return rt})),n.d(t,"cloneElement",(function(){return at})),n.d(t,"createFactory",(function(){return ot})),n.d(t,"createPortal",(function(){return He})),n.d(t,"default",(function(){return vt})),n.d(t,"findDOMNode",(function(){return ut})),n.d(t,"flushSync",(function(){return ft})),n.d(t,"forwardRef",(function(){return ke})),n.d(t,"hydrate",(function(){return Ge})),n.d(t,"isValidElement",(function(){return st})),n.d(t,"lazy",(function(){return je})),n.d(t,"memo",(function(){return xe})),n.d(t,"render",(function(){return Ke})),n.d(t,"startTransition",(function(){return dt})),n.d(t,"unmountComponentAtNode",(function(){return ct})),n.d(t,"unstable_batchedUpdates",(function(){return lt})),n.d(t,"useDeferredValue",(function(){return pt})),n.d(t,"useInsertionEffect",(function(){return yt})),n.d(t,"useSyncExternalStore",(function(){return mt})),n.d(t,"useTransition",(function(){return gt})),n.d(t,"version",(function(){return it}));var r,i,o,s,a,c,u,l,f={},h=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function p(e,t){for(var n in t)e[n]=t[n];return e}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function y(e,t,n){var i,o,s,a={};for(s in t)"key"==s?i=t[s]:"ref"==s?o=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return m(e,a,i,o,null)}function m(e,t,n,r,s){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==s?++o:s};return null==s&&null!=i.vnode&&i.vnode(a),a}function v(){return{current:null}}function _(e){return e.children}function b(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||d.test(t)?n:n+"px"}function w(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||b(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||b(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?S:E,o):e.removeEventListener(t,o?S:E,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function E(e){s=!0;try{return this.l[e.type+!1](i.event?i.event(e):e)}finally{s=!1}}function S(e){s=!0;try{return this.l[e.type+!0](i.event?i.event(e):e)}finally{s=!1}}function O(e,t){this.props=e,this.context=t}function R(e,t){if(null==t)return e.__?R(e.__,e.__.__k.indexOf(e)+1):null;for(var n;tt&&a.sort((function(e,t){return e.__v.__b-t.__v.__b})));P.__r=0}function k(e,t,n,r,i,o,s,a,c,u){var l,d,p,g,y,v,b,w=r&&r.__k||h,E=w.length;for(n.__k=[],l=0;l0?m(g.type,g.props,g.key,g.ref?g.ref:null,g.__v):g)){if(g.__=n,g.__b=n.__b+1,null===(p=w[l])||p&&g.key==p.key&&g.type===p.type)w[l]=void 0;else for(d=0;d=0;t--)if((n=e.__k[t])&&(r=M(n)))return r;return null}function L(e,t,n,r,o,s,a,c,u){var l,f,h,d,g,y,m,v,b,w,E,S,R,I,x,C=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(u=n.__h,c=t.__e=n.__e,t.__h=null,s=[c]),(l=i.__b)&&l(t);try{e:if("function"==typeof C){if(v=t.props,b=(l=C.contextType)&&r[l.__c],w=l?b?b.props.value:l.__:r,n.__c?m=(f=t.__c=n.__c).__=f.__E:("prototype"in C&&C.prototype.render?t.__c=f=new C(v,w):(t.__c=f=new O(v,w),f.constructor=C,f.render=B),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=w,f.__n=r,h=f.__d=!0,f.__h=[],f._sb=[]),null==f.__s&&(f.__s=f.state),null!=C.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=p({},f.__s)),p(f.__s,C.getDerivedStateFromProps(v,f.__s))),d=f.props,g=f.state,f.__v=t,h)null==C.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(null==C.getDerivedStateFromProps&&v!==d&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(v,w),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(v,f.__s,w)||t.__v===n.__v){for(t.__v!==n.__v&&(f.props=v,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),E=0;E2&&(a.children=arguments.length>3?r.call(arguments,2):n),m(e.type,a,i||e.key,o||e.ref,null)}function $(e,t){var n={__c:t="__cC"+l++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(C)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=h.slice,i={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},o=0,s=!1,O.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=p({},this.state),"function"==typeof e&&(e=e(p({},n),this.props)),e&&p(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),C(this))},O.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),C(this))},O.prototype.render=_,a=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,P.__r=0,l=0;var V,W,K,G,Y=0,Q=[],J=[],X=i.__b,Z=i.__r,ee=i.diffed,te=i.__c,ne=i.unmount;function re(e,t){i.__h&&i.__h(W,e,Y||t),Y=0;var n=W.__H||(W.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:J}),n.__[e]}function ie(e){return Y=1,oe(Ee,e)}function oe(e,t,n){var r=re(V++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ee(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=W,!W.u)){W.u=!0;var i=W.shouldComponentUpdate;W.shouldComponentUpdate=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var s=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!i||i.call(this,e,t,n))}}return r.__N||r.__}function se(e,t){var n=re(V++,3);!i.__s&&we(n.__H,t)&&(n.__=e,n.i=t,W.__H.__h.push(n))}function ae(e,t){var n=re(V++,4);!i.__s&&we(n.__H,t)&&(n.__=e,n.i=t,W.__h.push(n))}function ce(e){return Y=5,le((function(){return{current:e}}),[])}function ue(e,t,n){Y=6,ae((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function le(e,t){var n=re(V++,7);return we(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function fe(e,t){return Y=8,le((function(){return e}),t)}function he(e){var t=W.context[e.__c],n=re(V++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(W)),t.props.value):e.__}function de(e,t){i.useDebugValue&&i.useDebugValue(t?t(e):e)}function pe(e){var t=re(V++,10),n=ie();return t.__=e,W.componentDidCatch||(W.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function ge(){var e=re(V++,11);if(!e.__){for(var t=W.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function ye(){for(var e;e=Q.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(_e),e.__H.__h.forEach(be),e.__H.__h=[]}catch(t){e.__H.__h=[],i.__e(t,e.__v)}}i.__b=function(e){W=null,X&&X(e)},i.__r=function(e){Z&&Z(e),V=0;var t=(W=e.__c).__H;t&&(K===W?(t.__h=[],W.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=J,e.__N=e.i=void 0}))):(t.__h.forEach(_e),t.__h.forEach(be),t.__h=[])),K=W},i.diffed=function(e){ee&&ee(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Q.push(t)&&G===i.requestAnimationFrame||((G=i.requestAnimationFrame)||ve)(ye)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==J&&(e.__=e.__V),e.i=void 0,e.__V=J}))),K=W=null},i.__c=function(e,t){t.some((function(e){try{e.__h.forEach(_e),e.__h=e.__h.filter((function(e){return!e.__||be(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],i.__e(n,e.__v)}})),te&&te(e,t)},i.unmount=function(e){ne&&ne(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{_e(e)}catch(e){t=e}})),n.__H=void 0,t&&i.__e(t,n.__v))};var me="function"==typeof requestAnimationFrame;function ve(e){var t,n=function(){clearTimeout(r),me&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);me&&(t=requestAnimationFrame(n))}function _e(e){var t=W,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),W=t}function be(e){var t=W;e.__c=e.__(),W=t}function we(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Ee(e,t){return"function"==typeof t?t(e):t}function Se(e,t){for(var n in t)e[n]=t[n];return e}function Oe(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Re(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}function Ie(e){this.props=e}function xe(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:Oe(this.props,e)}function r(t){return this.shouldComponentUpdate=n,y(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Ie.prototype=new O).isPureReactComponent=!0,Ie.prototype.shouldComponentUpdate=function(e,t){return Oe(this.props,e)||Oe(this.state,t)};var Ce=i.__b;i.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ce&&Ce(e)};var Pe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ke(e){function t(t){var n=Se({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=Pe,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Ne=function(e,t){return null==e?null:A(A(e).map(t))},Ae={map:Ne,forEach:Ne,count:function(e){return e?A(e).length:0},only:function(e){var t=A(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:A},Te=i.__e;i.__e=function(e,t,n,r){if(e.then)for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t);Te(e,t,n,r)};var Me=i.unmount;function Le(){this.__u=0,this.t=null,this.__b=null}function Ue(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function je(e){var t,n,r;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return y(n,i)}return i.displayName="Lazy",i.__f=!0,i}function De(){this.u=null,this.o=null}i.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),Me&&Me(e)},(Le.prototype=new O).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var i=Ue(r.__v),o=!1,s=function(){o||(o=!0,n.__R=null,i?i(a):a())};n.__R=s;var a=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},Le.prototype.componentWillUnmount=function(){this.t=[]},Le.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=Se({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&y(_,null,e.fallback);return i&&(i.__h=null),[y(_,null,t.__a?null:e.children),i]};var ze=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),F(y(Be,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function He(e,t){var n=y(Fe,{__v:e,i:t});return n.containerInfo=t,n}(De.prototype=new O).__a=function(e){var t=this,n=Ue(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),ze(t,e,r)):i()};n?n(o):o()}},De.prototype.render=function(e){this.u=null,this.o=new Map;var t=A(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},De.prototype.componentDidUpdate=De.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){ze(e,n,t)}))};var qe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,$e=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ve="undefined"!=typeof document,We=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function Ke(e,t,n){return null==t.__k&&(t.textContent=""),F(e,t),"function"==typeof n&&n(),e?e.__c:null}function Ge(e,t,n){return H(e,t),"function"==typeof n&&n(),e?e.__c:null}O.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(O.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Ye=i.event;function Qe(){}function Je(){return this.cancelBubble}function Xe(){return this.defaultPrevented}i.event=function(e){return Ye&&(e=Ye(e)),e.persist=Qe,e.isPropagationStopped=Je,e.isDefaultPrevented=Xe,e.nativeEvent=e};var Ze,et={configurable:!0,get:function(){return this.class}},tt=i.vnode;i.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var o in r={},n){var s=n[o];Ve&&"children"===o&&"noscript"===t||"value"===o&&"defaultValue"in n&&null==s||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===s?s="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!We(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(o)?o=o.toLowerCase():i&&$e.test(o)?o=o.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===s&&(s=void 0),/^oninput$/i.test(o)&&(o=o.toLowerCase(),r[o]&&(o="oninputCapture")),r[o]=s)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=A(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=A(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(et.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",et))}e.$$typeof=qe,tt&&tt(e)};var nt=i.__r;i.__r=function(e){nt&&nt(e),Ze=e.__c};var rt={ReactCurrentDispatcher:{current:{readContext:function(e){return Ze.__n[e.__c].props.value}}}},it="17.0.2";function ot(e){return y.bind(null,e)}function st(e){return!!e&&e.$$typeof===qe}function at(e){return st(e)?q.apply(null,arguments):e}function ct(e){return!!e.__k&&(F(null,e),!0)}function ut(e){return e&&(e.base||1===e.nodeType&&e)||null}var lt=function(e,t){return e(t)},ft=function(e,t){return e(t)},ht=_;function dt(e){e()}function pt(e){return e}function gt(){return[!1,dt]}var yt=ae;function mt(e,t){var n=t(),r=ie({h:{__:n,v:t}}),i=r[0].h,o=r[1];return ae((function(){i.__=n,i.v=t,Re(i.__,t())||o({h:i})}),[e,n,t]),se((function(){return Re(i.__,i.v())||o({h:i}),e((function(){Re(i.__,i.v())||o({h:i})}))}),[e]),n}var vt={useState:ie,useId:ge,useReducer:oe,useEffect:se,useLayoutEffect:ae,useInsertionEffect:ae,useTransition:gt,useDeferredValue:pt,useSyncExternalStore:mt,startTransition:dt,useRef:ce,useImperativeHandle:ue,useMemo:le,useCallback:fe,useContext:he,useDebugValue:de,version:"17.0.2",Children:Ae,render:Ke,hydrate:Ge,unmountComponentAtNode:ct,createPortal:He,createElement:y,createContext:$,createFactory:ot,cloneElement:at,createRef:v,Fragment:_,isValidElement:st,findDOMNode:ut,Component:O,PureComponent:Ie,memo:xe,forwardRef:ke,flushSync:ft,unstable_batchedUpdates:lt,StrictMode:_,Suspense:Le,SuspenseList:De,lazy:je,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:rt}},function(e,t,n){n.r(t),n.d(t,"JsonRpcProvider",(function(){return o}));var r=n(13),i=n(7);class o extends i.IJsonRpcProvider{constructor(e){super(e),this.events=new r.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(Object(i.formatJsonRpcRequest)(e.method,e.params||[]),t)}async requestStrict(e,t){return new Promise((async(n,r)=>{if(!this.connection.connected)try{await this.open()}catch(e){r(e)}this.events.on(""+e.id,(e=>{Object(i.isJsonRpcError)(e)?r(e.error):n(e.result)}));try{await this.connection.send(e,t)}catch(e){r(e)}}))}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Object(i.isJsonRpcResponse)(e)?this.events.emit(""+e.id,e):this.events.emit("message",{type:e.method,data:e.params})}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",(e=>this.onPayload(e))),this.connection.on("close",(()=>this.events.emit("disconnect"))),this.connection.on("error",(e=>this.events.emit("error",e))),this.hasRegisteredEventListeners=!0)}}var s=o;t.default=s},function(e,t,n){n.r(t),n.d(t,"HttpConnection",(function(){return u}));var r=n(13),i=n(23),o=n.n(i),s=n(12),a=n(7);const c={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class u{constructor(e){if(this.url=e,this.events=new r.EventEmitter,this.isAvailable=!1,this.registering=!1,!Object(a.isHttpUrl)(e))throw new Error("Provided URL is not compatible with HTTP connection: "+e);this.url=e}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,t){this.isAvailable||await this.register();try{const t=Object(s.b)(e),n=await o()(this.url,Object.assign(Object.assign({},c),{body:t})),r=await n.json();this.onPayload({data:r})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!Object(a.isHttpUrl)(e))throw new Error("Provided URL is not compatible with HTTP connection: "+e);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),void 0===this.isAvailable)return t(new Error("HTTP connection is missing or invalid"));e()}))}))}this.url=e,this.registering=!0;try{const t=Object(s.b)({id:1,jsonrpc:"2.0",method:"test",params:[]});await o()(e,Object.assign(Object.assign({},c),{body:t})),this.onOpen()}catch(e){const t=this.parseError(e);throw this.events.emit("register_error",t),this.onClose(),t}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(void 0===e.data)return;const t="string"==typeof e.data?Object(s.a)(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),r=n.message||n.toString(),i=Object(a.formatJsonRpcError)(e,r);this.events.emit("payload",i)}parseError(e,t=this.url){return Object(a.parseConnectionError)(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}var l=u;t.default=l}])}(g);var y,m=d(g.exports),v={exports:{}},_={},b={exports:{}},w={};!function(e){e.exports=function(){if(y)return w;y=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),f=Symbol.iterator,h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},d=Object.assign,p={};function g(e,t,n){this.props=e,this.context=t,this.refs=p,this.updater=n||h}function m(){}function v(e,t,n){this.props=e,this.context=t,this.refs=p,this.updater=n||h}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=g.prototype;var _=v.prototype=new m;_.constructor=v,d(_,g.prototype),_.isPureReactComponent=!0;var b=Array.isArray,E=Object.prototype.hasOwnProperty,S={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function R(t,n,r){var i,o={},s=null,a=null;if(null!=n)for(i in void 0!==n.ref&&(a=n.ref),void 0!==n.key&&(s=""+n.key),n)E.call(n,i)&&!O.hasOwnProperty(i)&&(o[i]=n[i]);var c=arguments.length-2;if(1===c)o.children=r;else if(1d)&&(z=(H=H.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(y,"$1"+e.trim());case 58:return e.trim()+t.replace(y,"$1"+e.trim());default:if(0<1*n&&0c.charCodeAt(8))break;case 115:s=s.replace(c,"-webkit-"+c)+";"+s;break;case 207:case 102:s=s.replace(c,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var ne=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)(i<<=1)<0&&te(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o=oe&&(oe=t+1),re.set(e,t),ie.set(t,e)},ue="style["+X+'][data-styled-version="5.3.11"]',le=new RegExp("^"+X+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),fe=function(e,t,n){for(var r,i=n.split(","),o=0,s=i.length;o=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(X))return r}}(r),s=void 0!==o?o.nextSibling:null;i.setAttribute(X,"active"),i.setAttribute("data-styled-version","5.3.11");var a=n.nc;return a&&i.setAttribute("nonce",a),r.insertBefore(i,s),i},pe=function(){function e(e){var t=this.element=de(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(u+=e+",")})),r+=""+a+c+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),be=/(a)(d)/gi,we=function(e){return String.fromCharCode(e+(e>25?39:97))};function Ee(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=we(t%52)+n;return(we(t%52)+n).replace(be,"$1-$2")}var Se=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Oe=function(e){return Se(5381,e)},Re=Oe("5.3.11"),Ie=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&function(e){for(var t=0;t>>0);if(!t.hasNameForId(r,s)){var a=n(o,"."+s,void 0,r);t.insertRules(r,s,a)}i.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,u=Se(this.baseHash,n.hash),l="",f=0;f>>0);if(!t.hasNameForId(r,g)){var y=n(l,"."+g,void 0,r);t.insertRules(r,g,y)}i.push(g)}}return i.join(" ")},e}(),xe=/^\s*\/\/.*$/gm,Ce=[":","[",".","#"],Pe=S.createContext();Pe.Consumer;var ke=S.createContext(),Ne=(ke.Consumer,new _e),Ae=function(e){var t,n,r,i,o=G,s=o.options,a=void 0===s?G:s,c=o.plugins,u=void 0===c?K:c,l=new x(a),f=[],h=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,i,o,s,a,c,u,l,f){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(i[0]+r),"";default:return r+(0===f?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),d=function(e,r,o){return 0===r&&-1!==Ce.indexOf(o[n.length])||o.match(i)?e:"."+t};function p(e,o,s,a){void 0===a&&(a="&");var c=e.replace(xe,""),u=o&&s?s+" "+o+" { "+c+" }":c;return t=a,n=o,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),l(s||!o?"":o,u)}return l.use([].concat(u,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(n)>0&&(i[0]=i[0].replace(r,d))},h,function(e){if(-2===e){var t=f;return f=[],t}}])),p.hash=u.length?u.reduce((function(e,t){return t.name||te(15),Se(e,t.name)}),5381).toString():"",p}(),Te=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ae);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return te(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=Ae),this.name+e.hash},e}(),Me=/([A-Z])/,Le=/([A-Z])/g,Ue=/^ms-/,je=function(e){return"-"+e.toLowerCase()};function De(e){return Me.test(e)?e.replace(Le,je).replace(Ue,"-ms-"):e}var ze=function(e){return null==e||!1===e||""===e};function Be(e,t,n,r){if(Array.isArray(e)){for(var i,o=[],s=0,a=e.length;s1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,$e=/(^-|-$)/g;function Ve(e){return e.replace(qe,"-").replace($e,"")}function We(e){return"string"==typeof e&&!0}var Ke=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Ge=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Ye(e,t,n){var r=e[n];Ke(t)&&Ke(r)?Qe(r,t):e[n]=t}function Qe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r>>0)}("5.3.11"+n+Xe[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):a,u=t.displayName,l=void 0===u?function(e){return We(e)?"styled."+e:"Styled("+Q(e)+")"}(e):u,f=t.displayName&&t.componentId?Ve(t.displayName)+"-"+t.componentId:t.componentId||c,h=r&&e.attrs?Array.prototype.concat(e.attrs,s).filter(Boolean):s,d=t.shouldForwardProp;r&&e.shouldForwardProp&&(d=t.shouldForwardProp?function(n,r,i){return e.shouldForwardProp(n,r,i)&&t.shouldForwardProp(n,r,i)}:e.shouldForwardProp);var p,g=new Ie(n,f,r?e.componentStyle:void 0),y=g.isStatic&&0===s.length,m=function(e,t){return function(e,t,n,r){var i=e.attrs,o=e.componentStyle,s=e.defaultProps,a=e.foldedComponentIds,c=e.shouldForwardProp,u=e.styledComponentId,l=e.target,f=function(e,t,n){void 0===e&&(e=G);var r=$({},t,{theme:e}),i={};return n.forEach((function(e){var t,n,o,s=e;for(t in Y(s)&&(s=s(r)),s)r[t]=i[t]="className"===t?(n=i[t],o=s[t],n&&o?n+" "+o:n||o):s[t]})),[r,i]}(function(e,t,n){return void 0===n&&(n=G),e.theme!==n.theme&&e.theme||t||n.theme}(t,b.exports.useContext(Je),s)||G,t,i),h=f[0],d=f[1],p=function(e,t,n,r){var i=b.exports.useContext(Pe)||Ne,o=b.exports.useContext(ke)||Ae;return t?e.generateAndInjectStyles(G,i,o):e.generateAndInjectStyles(n,i,o)}(o,r,h),g=n,y=d.$as||t.$as||d.as||t.as||l,m=We(y),v=d!==t?$({},t,{},d):t,_={};for(var w in v)"$"!==w[0]&&"as"!==w&&("forwardedAs"===w?_.as=v[w]:(c?c(w,k,y):!m||k(w))&&(_[w]=v[w]));return t.style&&d.style!==t.style&&(_.style=$({},t.style,{},d.style)),_.className=Array.prototype.concat(a,u,p!==u?p:null,t.className,d.className).filter(Boolean).join(" "),_.ref=g,b.exports.createElement(y,_)}(p,e,t,y)};return m.displayName=l,(p=S.forwardRef(m)).attrs=h,p.componentStyle=g,p.displayName=l,p.shouldForwardProp=d,p.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):K,p.styledComponentId=f,p.target=r?e.target:e,p.withComponent=function(e){var r=t.componentId,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(t,["componentId"]),o=r&&r+"-"+(We(e)?e:Ve(Q(e)));return Ze(e,$({},i,{attrs:h,componentId:o}),n)},Object.defineProperty(p,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Qe({},e.defaultProps,t):t}}),Object.defineProperty(p,"toString",{value:function(){return"."+p.styledComponentId}}),i&&q(p,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),p}var et=function(e){return function e(t,n,r){if(void 0===r&&(r=G),!R.exports.isValidElementType(n))return te(1,String(n));var i=function(){return t(n,r,He.apply(void 0,arguments))};return i.withConfig=function(i){return e(t,n,$({},r,{},i))},i.attrs=function(i){return e(t,n,$({},r,{attrs:Array.prototype.concat(r.attrs,i).filter(Boolean)}))},i}(Ze,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){et[e]=et(e)}));const tt=et.div` - z-index: 998; - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - background-color: rgba(0, 0, 0, 0.6); - transition: opacity .25s; -`,nt="only screen and (min-width: 640px)",rt="only screen and (max-height: 640px)",it="1.2rem",ot=et.div` - z-index: 999; - position: fixed; - top: 0px; - left: 0px; - width: 100vw; - height: 100%; - - font: 14px inter, sans-serif; - font-family: "Segoe UI", Helvetica, Arial, sans-serif; - font-feature-settings: "kern"; - text-align: left !important; - - display: flex; - flex-direction: column; - justify-content: end; - align-items: center; - - @media ${nt} { - justify-content: start; - align-items: end; - } -`,st=et.div` - position: relative; - bottom: 0px; - left: 0px; - width: 100%; - border-radius: ${it} ${it} 0 0; - background: #131214; - - transform: scale(1); - transition: opacity .25s,transform .25s; - - @media ${nt} { - max-width: 340px; - margin: auto; - border-radius: ${it}; - } -`,at=et.button` - box-sizing: border-box; - margin: 0.2rem 0.2rem 0 0; - border: none; - padding: 0; - width: 18px; - height: 18px; - background: transparent; - outline: none; - cursor: pointer; - - & > img { - width: 18px; - height: 18px; - } -`,ct="15px",ut=et.div` - display: flex; - flex: 1; - flex-direction: row; - justify-content: space-between; - padding: ${ct}; - padding-bottom: 0.9rem; -`,lt=et.div` - margin-bottom: ${ct}; - border-top: 1px solid #2b2a2b; - padding: ${ct} ${ct} 0 ${ct}; - color: #C3C3C3; - - ${({textAlign:e})=>e&&He` - text-align: ${e}; - `} -`,ft=et.h2` - color: #fff; - margin: 0; - line-height: 28px; - font-size: 24px; - font-weight: 600; - - @media ${rt} { - font-size: 18px; - } -`;et.h3` - color: #fff; - margin: 0; - font-size: 20px; - font-weight: 500; - line-height: 24px; -`;const ht=et.p` - ${({noMargin:e})=>e?He` - margin: 0; - `:"\n margin: 12px 0 0 0;\n "} - font-size: 14px; - font-weight: 500; - line-height: 20px; -`,dt=et.button` - width: 100%; - - ${({extraMargin:e})=>e?He` - margin: 2rem 0 1.2rem 0; - `:He` - margin-top: 1.2rem; - `} - - border-radius: 3rem; - padding: 0.8rem 1rem; - - font-size: 14px; - font-weight: 600; - line-height: 17px; - - transition: all .5s ease; - cursor: pointer; - - ${({variant:e})=>"primary"==e?He` - border: none; - background-color: white; - color: #000; - &:hover, &:focus { - background-color: rgba(255, 255, 255, 0.8); - } - `:He` - border: 1px solid #565656; - background-color: transparent; - color: #fff; - &:hover { - background-color: rgba(255, 255, 255, 0.05); - } - `} -`,pt=et.a` - color: #BBB0FF; - cursor: pointer; -`;let gt=e=>{};const yt=({onClose:e,children:t})=>{const[n,r]=b.exports.useState(!0);gt=r;const i=()=>{gt(!1),e&&e()};return n?v.exports.jsxs(v.exports.Fragment,{children:[v.exports.jsx(tt,{}),v.exports.jsx(ot,Object.assign({id:"ModalWrapper",onClick:e=>{var t;"ModalWrapper"===(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.id)&&i()}},{children:v.exports.jsxs(st,{children:[v.exports.jsxs(ut,{children:[v.exports.jsx("img",{src:"data:image/svg+xml,%3csvg width='72' height='24' viewBox='0 0 72 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M61.3616 22.4887V23.9996H71.7318V17.1853H70.2208V22.4887H61.3616ZM61.3616 0V1.51096H70.2208V6.81473H71.7318V0H61.3616ZM56.0137 11.689V8.17796H58.3842C59.5398 8.17796 59.9546 8.56305 59.9546 9.61506V10.2372C59.9546 11.3186 59.5545 11.689 58.3842 11.689H56.0137ZM59.7764 12.311C60.8578 12.0296 61.6133 11.022 61.6133 9.82231C61.6133 9.06683 61.3172 8.38521 60.7542 7.83698C60.0432 7.15536 59.0948 6.81473 57.8653 6.81473H54.5322V17.1849H56.0137V13.0518H58.2361C59.3767 13.0518 59.836 13.5258 59.836 14.7112V17.1853H61.3469V14.9482C61.3469 13.3186 60.9618 12.6965 59.7764 12.5187V12.311ZM47.303 12.6517H51.866V11.2888H47.303V8.17761H52.3102V6.81473H45.7916V17.1849H52.5325V15.822H47.303V12.6517ZM42.3398 13.1999V13.9109C42.3398 15.4072 41.7916 15.8963 40.414 15.8963H40.0881C38.7102 15.8963 38.0436 15.4516 38.0436 13.3925V10.6072C38.0436 8.53329 38.7399 8.10338 40.1175 8.10338H40.4137C41.7618 8.10338 42.1914 8.60716 42.2061 9.99979H43.8357C43.6876 7.9553 42.3248 6.66665 40.2803 6.66665C39.2878 6.66665 38.4581 6.97787 37.836 7.57021C36.9027 8.44437 36.3842 9.92593 36.3842 11.9998C36.3842 13.9999 36.8288 15.4814 37.7471 16.3997C38.3692 17.0071 39.2286 17.333 40.073 17.333C40.9619 17.333 41.7769 16.9773 42.1914 16.2071H42.3986V17.1849H43.7615V11.837H39.7467V13.1999H42.3398ZM29.2737 8.17761H30.8886C32.4146 8.17761 33.2443 8.5627 33.2443 10.6369V13.3627C33.2443 15.4366 32.4146 15.822 30.8886 15.822H29.2737V8.17761ZM31.0216 17.1853C33.8513 17.1853 34.903 15.0372 34.903 12.0002C34.903 8.91874 33.7771 6.81509 30.9919 6.81509H27.7917V17.1853H31.0216ZM20.6367 12.6517H25.1997V11.2888H20.6367V8.17761H25.644V6.81473H19.1254V17.1849H25.8663V15.822H20.6367V12.6517ZM11.8962 6.81473H10.3852V17.1849H17.2V15.822H11.8962V6.81473ZM0 17.1853V24H10.3702V22.4887H1.51096V17.1853H0ZM0 0V6.81473H1.51096V1.51096H10.3702V0H0Z' fill='white'/%3e%3c/svg%3e"}),v.exports.jsx(at,Object.assign({onClick:i},{children:v.exports.jsx("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M22 2L2 22' stroke='white' stroke-width='3'/%3e%3cpath d='M2 2L22 22' stroke='white' stroke-width='3'/%3e%3c/svg%3e"})}))]}),v.exports.jsx(v.exports.Fragment,{children:t})]})}))]}):null};var mt,vt,_t,bt,wt={exports:{}},Et={},St={exports:{}},Ot={};function Rt(){return vt||(vt=1,function(e){e.exports=(mt||(mt=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0>>1,o=e[r];if(!(0>>1;ri(c,n))ui(l,c)?(e[r]=l,e[u]=n,r=u):(e[r]=c,e[a]=n,r=a);else{if(!(ui(l,n)))break e;e[r]=l,e[u]=n,r=u}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var c=[],u=[],l=1,f=null,h=3,d=!1,p=!1,g=!1,y="function"==typeof setTimeout?setTimeout:null,m="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var i=n(u);null!==i;){if(null===i.callback)r(u);else{if(!(i.startTime<=e))break;r(u),i.sortIndex=i.expirationTime,t(c,i)}i=n(u)}}function b(e){if(g=!1,_(e),!p)if(null!==n(c))p=!0,A(w);else{var t=n(u);null!==t&&T(b,t.startTime-e)}}function w(t,i){p=!1,g&&(g=!1,m(R),R=-1),d=!0;var o=h;try{for(_(i),f=n(c);null!==f&&(!(f.expirationTime>i)||t&&!C());){var s=f.callback;if("function"==typeof s){f.callback=null,h=f.priorityLevel;var a=s(f.expirationTime<=i);i=e.unstable_now(),"function"==typeof a?f.callback=a:f===n(c)&&r(c),_(i)}else r(c);f=n(c)}if(null!==f)var l=!0;else{var y=n(u);null!==y&&T(b,y.startTime-i),l=!1}return l}finally{f=null,h=o,d=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,S=!1,O=null,R=-1,I=5,x=-1;function C(){return!(e.unstable_now()-xe||125s?(r.sortIndex=o,t(u,r),null===n(c)&&r===n(u)&&(g?(m(R),R=-1):g=!0,T(b,o-s))):(r.sortIndex=a,t(c,r),p||d||(p=!0,A(w))),r},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}}(Ot)),Ot)}(St)),St.exports}function It(){if(_t)return Et;_t=1;var e=b.exports,t=Rt();function n(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n