@dodoex/wallet-web3 0.0.41-6 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DefaultJsonRpcProvider-39051876.js → DefaultJsonRpcProvider-81dbd3f9.js} +1 -1
- package/dist/__node-resolve_empty-314df16e.js +1 -0
- package/dist/__tslib-895a7349.js +1 -0
- package/dist/{blocto-b1fd16e0.js → blocto-a553b391.js} +1 -1
- package/dist/bn-8f7cc9b5.js +1 -0
- package/dist/{browser-ponyfill-45febd35.js → browser-ponyfill-4134b2b7.js} +1 -1
- package/dist/cjs/{DefaultJsonRpcProvider-9c49bc74.cjs → DefaultJsonRpcProvider-851de86a.cjs} +1 -1
- package/dist/cjs/{__node-resolve_empty-cc04456f.cjs → __node-resolve_empty-04cc3662.cjs} +1 -1
- package/dist/cjs/__tslib-07f80053.cjs +1 -0
- package/dist/cjs/{blocto-21bcf508.cjs → blocto-1d2d3abc.cjs} +1 -1
- package/dist/cjs/bn-8a65a921.cjs +1 -0
- package/dist/cjs/{browser-ponyfill-1a8d200e.cjs → browser-ponyfill-96a14706.cjs} +1 -1
- package/dist/cjs/{draggabilly-f1bb3b36.cjs → draggabilly-326f0353.cjs} +1 -1
- package/dist/cjs/ethers-c6e7830c.cjs +1 -0
- package/dist/cjs/id-ac2184da.cjs +1 -0
- package/dist/cjs/{index-50ef639c.cjs → index-01b3872e.cjs} +1 -1
- package/dist/cjs/index-38a82c12.cjs +1 -0
- package/dist/cjs/index-4685dfbc.cjs +9 -0
- package/dist/cjs/{index-fec2b0e7.cjs → index-4f46ab04.cjs} +1 -1
- package/dist/cjs/{index-bb9d8efd.cjs → index-6130f88a.cjs} +2 -2
- package/dist/cjs/index-823d3a25.cjs +6 -0
- package/dist/cjs/index-8d32723e.cjs +15 -0
- package/dist/cjs/index-97c32dcf.cjs +1 -0
- package/dist/cjs/{index-1cf2025a.cjs → index-b3a93c7d.cjs} +1 -1
- package/dist/cjs/{index-7fb18b59.cjs → index-c6a78b5c.cjs} +1 -1
- package/dist/cjs/index-d89005f4.cjs +1 -0
- package/dist/cjs/{index-9f2a69d5.cjs → index-df8e5839.cjs} +1 -1
- package/dist/cjs/{index-35edc6a0.cjs → index-eb09e54d.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{index.es-c188e54b.cjs → index.es-168fe2b1.cjs} +2 -2
- package/dist/cjs/{interface-847c070f.cjs → interface-f6b53727.cjs} +1 -1
- package/dist/cjs/{lib-typedarrays-924fdb15.cjs → lib-typedarrays-05755aa6.cjs} +1 -1
- package/dist/cjs/{portis-04649135.cjs → portis-7873ce6a.cjs} +1 -1
- package/dist/cjs/{provider-55f49a37.cjs → provider-d7c647ea.cjs} +1 -1
- package/dist/cjs/{rainbow-331b4b7f.cjs → rainbow-43c8e5f6.cjs} +1 -1
- package/dist/cjs/sha224-86e8cc7f.cjs +1 -0
- package/dist/cjs/{sha256-a9306fd5.cjs → sha256-7cc68713.cjs} +1 -1
- package/dist/cjs/state.d.ts +0 -1
- package/dist/cjs/uAuth-6aa71b34.cjs +1 -0
- package/dist/cjs/{walletConnect-4a8a9594.cjs → walletConnect-b0df4f12.cjs} +1 -1
- package/dist/cjs/walletLink-eb56d177.cjs +3 -0
- package/dist/{draggabilly-bfad3669.js → draggabilly-291f869b.js} +1 -1
- package/dist/ethers-f8f094be.js +1 -0
- package/dist/id-dcb529f4.js +1 -0
- package/dist/{index-65d96278.js → index-0ee5ef8d.js} +1 -1
- package/dist/{index-2421fbca.js → index-20ce8a4c.js} +1 -1
- package/dist/{index-c900ddbc.js → index-4e6b81d8.js} +1 -1
- package/dist/index-7a7a090a.js +1 -0
- package/dist/{index-33d9ef5d.js → index-89a7e976.js} +1 -1
- package/dist/index-914dc773.js +15 -0
- package/dist/index-a1df7720.js +1 -0
- package/dist/index-bc061f7b.js +9 -0
- package/dist/index-cbfb042c.js +1 -0
- package/dist/{index-1fbb15b5.js → index-cebac794.js} +2 -2
- package/dist/index-cec5c507.js +6 -0
- package/dist/{index-f08d6a6b.js → index-e0d3617a.js} +1 -1
- package/dist/index-e3070128.js +1 -0
- package/dist/{index.es-5eecb376.js → index.es-b6986074.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{interface-b85b700d.js → interface-6c3ec32a.js} +1 -1
- package/dist/{lib-typedarrays-a8e83421.js → lib-typedarrays-f1051e37.js} +1 -1
- package/dist/{portis-43f60af4.js → portis-6c321b6b.js} +1 -1
- package/dist/{provider-301ac332.js → provider-0a241f15.js} +1 -1
- package/dist/{rainbow-23c1faed.js → rainbow-43a583fd.js} +1 -1
- package/dist/{sha224-c866b8af.js → sha224-1e5a1736.js} +1 -1
- package/dist/{sha256-aa67d92b.js → sha256-79cd8cb2.js} +1 -1
- package/dist/state.d.ts +0 -1
- package/dist/uAuth-57530103.js +1 -0
- package/dist/{walletConnect-6fa1fc97.js → walletConnect-dc900305.js} +1 -1
- package/dist/walletLink-7f641f02.js +3 -0
- package/package.json +1 -1
- package/dist/__node-resolve_empty-8d36ef45.js +0 -1
- package/dist/__tslib-028c435c.js +0 -1
- package/dist/bn-6691dc4b.js +0 -1
- package/dist/cjs/__tslib-1a913bb4.cjs +0 -1
- package/dist/cjs/bn-f78d1a17.cjs +0 -1
- package/dist/cjs/ethers-b4443d90.cjs +0 -1
- package/dist/cjs/id-81d6569b.cjs +0 -1
- package/dist/cjs/index-2b6e2d0e.cjs +0 -9
- package/dist/cjs/index-2faa3982.cjs +0 -6
- package/dist/cjs/index-39d0684d.cjs +0 -1
- package/dist/cjs/index-603ccd56.cjs +0 -1
- package/dist/cjs/index-61c5fbfc.cjs +0 -1
- package/dist/cjs/index-81e04477.cjs +0 -15
- package/dist/cjs/sha224-ec932277.cjs +0 -1
- package/dist/cjs/uAuth-f08a6bc1.cjs +0 -1
- package/dist/cjs/walletLink-55148573.cjs +0 -3
- package/dist/ethers-149a03bf.js +0 -1
- package/dist/id-9ebc6c25.js +0 -1
- package/dist/index-3fa89254.js +0 -1
- package/dist/index-5bdb764f.js +0 -9
- package/dist/index-660d9f03.js +0 -1
- package/dist/index-b40bcea4.js +0 -1
- package/dist/index-bf8de361.js +0 -6
- package/dist/index-c953d0ac.js +0 -1
- package/dist/index-e4bf19f4.js +0 -15
- package/dist/uAuth-0c0662eb.js +0 -1
- package/dist/walletLink-88727a96.js +0 -3
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{c as t,g as e,e as r,b as n,_ as i,i as o,d as s}from"./index-bc061f7b.js";import a from"events";import{r as u}from"./__node-resolve_empty-314df16e.js";import{i as c}from"./inherits_browser-51bb8c3c.js";import l from"buffer";import{s as h}from"./index-6be6f872.js";import{r as d}from"./__tslib-895a7349.js";import"@ethersproject/providers";import"zustand";import"@ethersproject/address";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/properties";import"@ethersproject/transactions";import"@ethersproject/bytes";import"util";var f={},p={},g={};Object.defineProperty(g,"__esModule",{value:!0}),g.walletLogo=void 0;g.walletLogo=(t,e)=>{let r;switch(t){case"standard":default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`}};var y={};Object.defineProperty(y,"__esModule",{value:!0}),y.ScopedLocalStorage=void 0;y.ScopedLocalStorage=class{constructor(t){this.scope=t}setItem(t,e){localStorage.setItem(this.scopedKey(t),e)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),e=[];for(let r=0;r<localStorage.length;r++){const n=localStorage.key(r);"string"==typeof n&&n.startsWith(t)&&e.push(n)}e.forEach((t=>localStorage.removeItem(t)))}scopedKey(t){return`${this.scope}:${t}`}};var b={},m={};Object.defineProperty(m,"__esModule",{value:!0});const v=a;function w(t,e,r){try{Reflect.apply(t,e,r)}catch(t){setTimeout((()=>{throw t}))}}class _ extends v.EventEmitter{emit(t,...e){let r="error"===t;const n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let t;if(e.length>0&&([t]=e),t instanceof Error)throw t;const r=new Error("Unhandled error."+(t?` (${t.message})`:""));throw r.context=t,r}const i=n[t];if(void 0===i)return!1;if("function"==typeof i)w(i,this,e);else{const t=i.length,r=function(t){const e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}(i);for(let n=0;n<t;n+=1)w(r[n],this,e)}return!0}}m.default=_;var S={exports:{}};!function(t,e){function r(t,e){if(!t)throw new 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 i(t,e,r){if(i.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"))}var o;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:u.Buffer}catch(t){}function s(t,e){var n=t.charCodeAt(e);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+t)}function a(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,n,i){for(var o=0,s=0,a=Math.min(t.length,n),u=e;u<a;u++){var c=t.charCodeAt(u)-48;o*=i,s=c>=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&s<i,"Invalid character"),o+=s}return o}function l(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,n):(this._parseBase(t,e,i),"le"===n&&this._initArray(this.toArray(),e,n)))},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===n)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},i.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=a(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=a(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(t,l,l+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=c(t,l,t.length,e),l=0;l<s;l++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype._move=function(t){l(t,this)},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(t){i.prototype.inspect=h}else i.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],f=[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],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function g(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,h=67108863&u,d=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=d;f++){var p=c-f|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[f])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}i.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);o=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),n=0!==o||s!==this.length-1?d[6-u.length]+u+n:u+n}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],l=p[t];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var g=h.modrn(l).toString(t);n=(h=h.idivn(l)).isZero()?g+n:d[c-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},i.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},i.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.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},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},i.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},i.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},i.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<<i:this.words[n]&~(1<<i),this._strip()},i.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var y=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,l=0|s[0],h=8191&l,d=l>>>13,f=0|s[1],p=8191&f,g=f>>>13,y=0|s[2],b=8191&y,m=y>>>13,v=0|s[3],w=8191&v,_=v>>>13,S=0|s[4],E=8191&S,M=S>>>13,x=0|s[5],k=8191&x,C=x>>>13,I=0|s[6],R=8191&I,A=I>>>13,N=0|s[7],j=8191&N,O=N>>>13,T=0|s[8],P=8191&T,L=T>>>13,D=0|s[9],B=8191&D,F=D>>>13,U=0|a[0],V=8191&U,H=U>>>13,z=0|a[1],W=8191&z,q=z>>>13,J=0|a[2],$=8191&J,Z=J>>>13,G=0|a[3],Q=8191&G,Y=G>>>13,K=0|a[4],X=8191&K,tt=K>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191<,dt=lt>>>13,ft=0|a[9],pt=8191&ft,gt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(c+(n=Math.imul(h,V))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(d,V)|0))<<13)|0;c=((o=Math.imul(d,H))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,H))+Math.imul(g,V)|0,o=Math.imul(g,H);var bt=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(d,W)|0))<<13)|0;c=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,V),i=(i=Math.imul(b,H))+Math.imul(m,V)|0,o=Math.imul(m,H),n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,q)|0;var mt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,H))+Math.imul(_,V)|0,o=Math.imul(_,H),n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,Z)|0;var vt=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(d,Q)|0))<<13)|0;c=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,H))+Math.imul(M,V)|0,o=Math.imul(M,H),n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,Z)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,Y)|0;var wt=(c+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,X)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,V),i=(i=Math.imul(k,H))+Math.imul(C,V)|0,o=Math.imul(C,H),n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;c=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,H))+Math.imul(A,V)|0,o=Math.imul(A,H),n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,q)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(b,X)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0;var St=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,H))+Math.imul(O,V)|0,o=Math.imul(O,H),n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var Et=(c+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,ut)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(P,V),i=(i=Math.imul(P,H))+Math.imul(L,V)|0,o=Math.imul(L,H),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,q)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,q)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,Z)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ct)|0;var Mt=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,V),i=(i=Math.imul(B,H))+Math.imul(F,V)|0,o=Math.imul(F,H),n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,dt)|0;var xt=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,gt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,gt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,q))+Math.imul(F,W)|0,o=Math.imul(F,q),n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(b,ht)|0,i=(i=i+Math.imul(b,dt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,dt)|0;var kt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,Z))+Math.imul(F,$)|0,o=Math.imul(F,Z),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ct)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,dt)|0;var Ct=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,gt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,Q),i=(i=Math.imul(B,Y))+Math.imul(F,Q)|0,o=Math.imul(F,Y),n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,dt)|0;var It=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,gt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(B,X),i=(i=Math.imul(B,tt))+Math.imul(F,X)|0,o=Math.imul(F,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,dt)|0;var Rt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,gt)|0)+Math.imul(M,pt)|0))<<13)|0;c=((o=o+Math.imul(M,gt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(j,ut)|0,i=(i=i+Math.imul(j,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var At=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,gt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,gt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,ot),i=(i=Math.imul(B,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ct)|0,n=n+Math.imul(j,ht)|0,i=(i=i+Math.imul(j,dt)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,dt)|0;var Nt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,gt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,gt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(B,ut),i=(i=Math.imul(B,ct))+Math.imul(F,ut)|0,o=Math.imul(F,ct),n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,dt)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,dt)|0;var jt=(c+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,gt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,gt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(B,ht),i=(i=Math.imul(B,dt))+Math.imul(F,ht)|0,o=Math.imul(F,dt);var Ot=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,gt)|0)+Math.imul(L,pt)|0))<<13)|0;c=((o=o+Math.imul(L,gt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Tt=(c+(n=Math.imul(B,pt))|0)+((8191&(i=(i=Math.imul(B,gt))+Math.imul(F,pt)|0))<<13)|0;return c=((o=Math.imul(F,gt))+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u[0]=yt,u[1]=bt,u[2]=mt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Et,u[8]=Mt,u[9]=xt,u[10]=kt,u[11]=Ct,u[12]=It,u[13]=Rt,u[14]=At,u[15]=Nt,u[16]=jt,u[17]=Ot,u[18]=Tt,0!==c&&(u[19]=c,r.length++),r};function b(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var l=o-c,h=(0|t.words[l])*(0|e.words[c]),d=67108863&h;a=67108863&(d=d+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function m(t,e,r){return b(t,e,r)}Math.imul||(y=g),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):r<63?g(this,t,e):r<1024?b(this,t,e):m(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),m(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<67108864);for(var n=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&n);n>>=26,n+=o/67108864|0,n+=s>>>26,this.words[i]=67108863&s}return 0!==n&&(this.words[i]=n,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var o=r.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<n;this.words[e]=u|s,s=a>>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,n){var i;r("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=n;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<<e;return!(this.length<=n||!(this.words[n]&i))},i.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),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<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var i,o,s=t.length+n;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+n])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)a=(o=(0|this.words[i+n])+a)>>26,this.words[i+n]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var a,u=n.length-o.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(o,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var d=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(o,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=d)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(o=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var o,s,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var n=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/t|0,n=o%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),c=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(h)),o.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(n.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),o.isub(a),s.isub(u)):(n.isub(e),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),u=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,d=1;0==(n.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(n.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,s=n;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new x(t)},i.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)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=i._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 k(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}w.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},w.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 n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},n(_,w),_.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.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<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(S,w),n(E,w),n(M,w),M.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new S;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},x.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.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)},x.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},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,o),d=this.pow(t,o.addn(1).iushrn(1)),f=this.pow(t,o),p=s;0!==f.cmp(a);){for(var g=f,y=0;0!==g.cmp(a);y++)g=g.redSqr();r(y<p);var b=this.pow(h,new i(1).iushln(p-y-1));d=d.redMul(b),h=b.redSqr(),f=f.redMul(h),p=y}return d},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var o=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var h=c>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===l)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new k(t)},n(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(S,t);var E={},M={},x=N;N.default=N,N.stable=P,N.stableStringify=P;var k="[...]",C="[Circular]",I=[],R=[];function A(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function N(t,e,r,n){var i;void 0===n&&(n=A()),O(t,"",0,[],void 0,0,n);try{i=0===R.length?JSON.stringify(t,e,r):JSON.stringify(t,D(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==I.length;){var o=I.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function j(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);void 0!==i.get?i.configurable?(Object.defineProperty(n,r,{value:t}),I.push([n,r,e,i])):R.push([e,r,t]):(n[r]=t,I.push([n,r,e]))}function O(t,e,r,n,i,o,s){var a;if(o+=1,"object"==typeof t&&null!==t){for(a=0;a<n.length;a++)if(n[a]===t)return void j(C,t,e,i);if(void 0!==s.depthLimit&&o>s.depthLimit)return void j(k,t,e,i);if(void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void j(k,t,e,i);if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)O(t[a],a,a,n,t,o,s);else{var u=Object.keys(t);for(a=0;a<u.length;a++){var c=u[a];O(t[c],c,a,n,t,o,s)}}n.pop()}}function T(t,e){return t<e?-1:t>e?1:0}function P(t,e,r,n){void 0===n&&(n=A());var i,o=L(t,"",0,[],void 0,0,n)||t;try{i=0===R.length?JSON.stringify(o,e,r):JSON.stringify(o,D(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==I.length;){var s=I.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function L(t,e,r,n,i,o,s){var a;if(o+=1,"object"==typeof t&&null!==t){for(a=0;a<n.length;a++)if(n[a]===t)return void j(C,t,e,i);try{if("function"==typeof t.toJSON)return}catch(t){return}if(void 0!==s.depthLimit&&o>s.depthLimit)return void j(k,t,e,i);if(void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void j(k,t,e,i);if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)L(t[a],a,a,n,t,o,s);else{var u={},c=Object.keys(t).sort(T);for(a=0;a<c.length;a++){var l=c[a];L(t[l],l,a,n,t,o,s),u[l]=t[l]}if(void 0===i)return u;I.push([i,e,t]),i[e]=u}n.pop()}}function D(t){return t=void 0!==t?t:function(t,e){return e},function(e,r){if(R.length>0)for(var n=0;n<R.length;n++){var i=R[n];if(i[1]===e&&i[0]===r){r=i[2],R.splice(n,1);break}}return t.call(this,e,r)}}Object.defineProperty(M,"__esModule",{value:!0}),M.EthereumProviderError=M.EthereumRpcError=void 0;const B=x;class F extends Error{constructor(t,e,r){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a nonempty string.');super(e),this.code=t,void 0!==r&&(this.data=r)}serialize(){const t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return B.default(this.serialize(),U,2)}}M.EthereumRpcError=F;function U(t,e){if("[Circular]"!==e)return e}M.EthereumProviderError=class extends F{constructor(t,e,r){if(!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,r)}};var V={},H={};Object.defineProperty(H,"__esModule",{value:!0}),H.errorValues=H.errorCodes=void 0,H.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},H.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=H,r=M,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};function s(r,n=i){if(Number.isInteger(r)){const n=r.toString();if(l(e.errorValues,n))return e.errorValues[n].message;if(u(r))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function a(t){if(!Number.isInteger(t))return!1;const r=t.toString();return!!e.errorValues[r]||!!u(t)}function u(t){return t>=-32099&&t<=-32e3}function c(t){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({},t):t}function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=s,t.isValidCode=a,t.serializeError=function(t,{fallbackError:e=o,shouldIncludeStack:n=!1}={}){var i,u;if(!e||!Number.isInteger(e.code)||"string"!=typeof e.message)throw new Error("Must provide fallback error with integer number code and string message.");if(t instanceof r.EthereumRpcError)return t.serialize();const h={};if(t&&"object"==typeof t&&!Array.isArray(t)&&l(t,"code")&&a(t.code)){const e=t;h.code=e.code,e.message&&"string"==typeof e.message?(h.message=e.message,l(e,"data")&&(h.data=e.data)):(h.message=s(h.code),h.data={originalError:c(t)})}else{h.code=e.code;const r=null===(i=t)||void 0===i?void 0:i.message;h.message=r&&"string"==typeof r?r:e.message,h.data={originalError:c(t)}}const d=null===(u=t)||void 0===u?void 0:u.stack;return n&&t&&d&&"string"==typeof d&&(h.stack=d),h}}(V);var z={};Object.defineProperty(z,"__esModule",{value:!0}),z.ethErrors=void 0;const W=M,q=V,J=H;function $(t,e){const[r,n]=G(e);return new W.EthereumRpcError(t,r||q.getMessageFromCode(t),n)}function Z(t,e){const[r,n]=G(e);return new W.EthereumProviderError(t,r||q.getMessageFromCode(t),n)}function G(t){if(t){if("string"==typeof t)return[t];if("object"==typeof t&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&"string"!=typeof e)throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}z.ethErrors={rpc:{parse:t=>$(J.errorCodes.rpc.parse,t),invalidRequest:t=>$(J.errorCodes.rpc.invalidRequest,t),invalidParams:t=>$(J.errorCodes.rpc.invalidParams,t),methodNotFound:t=>$(J.errorCodes.rpc.methodNotFound,t),internal:t=>$(J.errorCodes.rpc.internal,t),server:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return $(e,t)},invalidInput:t=>$(J.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>$(J.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>$(J.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>$(J.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>$(J.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>$(J.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Z(J.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Z(J.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Z(J.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Z(J.errorCodes.provider.disconnected,t),chainDisconnected:t=>Z(J.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new W.EthereumProviderError(e,r,n)}}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=M;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=V;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=z;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=H;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})}(E);var Q={};Object.defineProperty(Q,"__esModule",{value:!0}),Q.EVENTS=void 0,Q.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Y={},K={exports:{}},X={exports:{}};
|
|
2
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
3
|
+
!function(t,e){var r=l,n=r.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}}(X,X.exports);var tt=X.exports.Buffer;function et(t,e){this._block=tt.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}et.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=tt.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,o=this._len,s=0;s<i;){for(var a=o%n,u=Math.min(i-s,n-a),c=0;c<u;c++)r[a+c]=t[s+c];s+=u,(o+=u)%n==0&&this._update(r)}return this._len+=i,this},et.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},et.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var rt=et,nt=c.exports,it=rt,ot=X.exports.Buffer,st=[1518500249,1859775393,-1894007588,-899497514],at=new Array(80);function ut(){this.init(),this._w=at,it.call(this,64,56)}function ct(t){return t<<30|t>>>2}function lt(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}nt(ut,it),ut.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},ut.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,u=0;u<16;++u)r[u]=t.readInt32BE(4*u);for(;u<80;++u)r[u]=r[u-3]^r[u-8]^r[u-14]^r[u-16];for(var c=0;c<80;++c){var l=~~(c/20),h=0|((e=n)<<5|e>>>27)+lt(l,i,o,s)+a+r[c]+st[l];a=s,s=o,o=ct(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},ut.prototype._hash=function(){var t=ot.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var ht=ut,dt=c.exports,ft=rt,pt=X.exports.Buffer,gt=[1518500249,1859775393,-1894007588,-899497514],yt=new Array(80);function bt(){this.init(),this._w=yt,ft.call(this,64,56)}function mt(t){return t<<5|t>>>27}function vt(t){return t<<30|t>>>2}function wt(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}dt(bt,ft),bt.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},bt.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,u=0;u<16;++u)r[u]=t.readInt32BE(4*u);for(;u<80;++u)r[u]=(e=r[u-3]^r[u-8]^r[u-14]^r[u-16])<<1|e>>>31;for(var c=0;c<80;++c){var l=~~(c/20),h=mt(n)+wt(l,i,o,s)+a+r[c]+gt[l]|0;a=s,s=o,o=vt(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},bt.prototype._hash=function(){var t=pt.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var _t=bt,St=c.exports,Et=rt,Mt=X.exports.Buffer,xt=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],kt=new Array(64);function Ct(){this.init(),this._w=kt,Et.call(this,64,56)}function It(t,e,r){return r^t&(e^r)}function Rt(t,e,r){return t&e|r&(t|e)}function At(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function Nt(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function jt(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function Ot(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}St(Ct,Et),Ct.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Ct.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,a=0|this._f,u=0|this._g,c=0|this._h,l=0;l<16;++l)e[l]=t.readInt32BE(4*l);for(;l<64;++l)e[l]=Ot(e[l-2])+e[l-7]+jt(e[l-15])+e[l-16]|0;for(var h=0;h<64;++h){var d=c+Nt(s)+It(s,a,u)+xt[h]+e[h]|0,f=At(r)+Rt(r,n,i)|0;c=u,u=a,a=s,s=o+d|0,o=i,i=n,n=r,r=d+f|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=a+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},Ct.prototype._hash=function(){var t=Mt.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var Tt=Ct,Pt=c.exports,Lt=Tt,Dt=rt,Bt=X.exports.Buffer,Ft=new Array(64);function Ut(){this.init(),this._w=Ft,Dt.call(this,64,56)}Pt(Ut,Lt),Ut.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Ut.prototype._hash=function(){var t=Bt.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var Vt=Ut,Ht=c.exports,zt=rt,Wt=X.exports.Buffer,qt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Jt=new Array(160);function $t(){this.init(),this._w=Jt,zt.call(this,128,112)}function Zt(t,e,r){return r^t&(e^r)}function Gt(t,e,r){return t&e|r&(t|e)}function Qt(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function Yt(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function Kt(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function Xt(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function te(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function ee(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function re(t,e){return t>>>0<e>>>0?1:0}Ht($t,zt),$t.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},$t.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,a=0|this._fh,u=0|this._gh,c=0|this._hh,l=0|this._al,h=0|this._bl,d=0|this._cl,f=0|this._dl,p=0|this._el,g=0|this._fl,y=0|this._gl,b=0|this._hl,m=0;m<32;m+=2)e[m]=t.readInt32BE(4*m),e[m+1]=t.readInt32BE(4*m+4);for(;m<160;m+=2){var v=e[m-30],w=e[m-30+1],_=Kt(v,w),S=Xt(w,v),E=te(v=e[m-4],w=e[m-4+1]),M=ee(w,v),x=e[m-14],k=e[m-14+1],C=e[m-32],I=e[m-32+1],R=S+k|0,A=_+x+re(R,S)|0;A=(A=A+E+re(R=R+M|0,M)|0)+C+re(R=R+I|0,I)|0,e[m]=A,e[m+1]=R}for(var N=0;N<160;N+=2){A=e[N],R=e[N+1];var j=Gt(r,n,i),O=Gt(l,h,d),T=Qt(r,l),P=Qt(l,r),L=Yt(s,p),D=Yt(p,s),B=qt[N],F=qt[N+1],U=Zt(s,a,u),V=Zt(p,g,y),H=b+D|0,z=c+L+re(H,b)|0;z=(z=(z=z+U+re(H=H+V|0,V)|0)+B+re(H=H+F|0,F)|0)+A+re(H=H+R|0,R)|0;var W=P+O|0,q=T+j+re(W,P)|0;c=u,b=y,u=a,y=g,a=s,g=p,s=o+z+re(p=f+H|0,f)|0,o=i,f=d,i=n,d=h,n=r,h=l,r=z+q+re(l=H+W|0,H)|0}this._al=this._al+l|0,this._bl=this._bl+h|0,this._cl=this._cl+d|0,this._dl=this._dl+f|0,this._el=this._el+p|0,this._fl=this._fl+g|0,this._gl=this._gl+y|0,this._hl=this._hl+b|0,this._ah=this._ah+r+re(this._al,l)|0,this._bh=this._bh+n+re(this._bl,h)|0,this._ch=this._ch+i+re(this._cl,d)|0,this._dh=this._dh+o+re(this._dl,f)|0,this._eh=this._eh+s+re(this._el,p)|0,this._fh=this._fh+a+re(this._fl,g)|0,this._gh=this._gh+u+re(this._gl,y)|0,this._hh=this._hh+c+re(this._hl,b)|0},$t.prototype._hash=function(){var t=Wt.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var ne=$t,ie=c.exports,oe=ne,se=rt,ae=X.exports.Buffer,ue=new Array(160);function ce(){this.init(),this._w=ue,se.call(this,128,112)}ie(ce,oe),ce.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},ce.prototype._hash=function(){var t=ae.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var le=ce,he=K.exports=function(t){t=t.toLowerCase();var e=he[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};he.sha=ht,he.sha1=_t,he.sha224=Vt,he.sha256=Tt,he.sha384=le,he.sha512=ne;var de,fe={},pe="undefined"!=typeof Symbol&&Symbol,ge=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0},ye=Array.prototype.slice,be=Object.prototype.toString,me=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==be.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var r,n=ye.call(arguments,1),i=Math.max(0,e.length-n.length),o=[],s=0;s<i;s++)o.push("$"+s);if(r=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof r){var i=e.apply(this,n.concat(ye.call(arguments)));return Object(i)===i?i:this}return e.apply(t,n.concat(ye.call(arguments)))})),e.prototype){var a=function(){};a.prototype=e.prototype,r.prototype=new a,a.prototype=null}return r},ve=Function.prototype.bind||me,we=ve.call(Function.call,Object.prototype.hasOwnProperty),_e=SyntaxError,Se=Function,Ee=TypeError,Me=function(t){try{return Se('"use strict"; return ('+t+").constructor;")()}catch(t){}},xe=Object.getOwnPropertyDescriptor;if(xe)try{xe({},"")}catch(rp){xe=null}var ke=function(){throw new Ee},Ce=xe?function(){try{return ke}catch(t){try{return xe(arguments,"callee").get}catch(t){return ke}}}():ke,Ie="function"==typeof pe&&"function"==typeof Symbol&&"symbol"==typeof pe("foo")&&"symbol"==typeof Symbol("bar")&&ge(),Re=Object.getPrototypeOf||function(t){return t.__proto__},Ae={},Ne="undefined"==typeof Uint8Array?de:Re(Uint8Array),je={"%AggregateError%":"undefined"==typeof AggregateError?de:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?de:ArrayBuffer,"%ArrayIteratorPrototype%":Ie?Re([][Symbol.iterator]()):de,"%AsyncFromSyncIteratorPrototype%":de,"%AsyncFunction%":Ae,"%AsyncGenerator%":Ae,"%AsyncGeneratorFunction%":Ae,"%AsyncIteratorPrototype%":Ae,"%Atomics%":"undefined"==typeof Atomics?de:Atomics,"%BigInt%":"undefined"==typeof BigInt?de:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?de:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?de:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?de:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?de:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?de:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?de:FinalizationRegistry,"%Function%":Se,"%GeneratorFunction%":Ae,"%Int8Array%":"undefined"==typeof Int8Array?de:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?de:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?de:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ie?Re(Re([][Symbol.iterator]())):de,"%JSON%":"object"==typeof JSON?JSON:de,"%Map%":"undefined"==typeof Map?de:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&Ie?Re((new Map)[Symbol.iterator]()):de,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?de:Promise,"%Proxy%":"undefined"==typeof Proxy?de:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?de:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?de:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&Ie?Re((new Set)[Symbol.iterator]()):de,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?de:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ie?Re(""[Symbol.iterator]()):de,"%Symbol%":Ie?Symbol:de,"%SyntaxError%":_e,"%ThrowTypeError%":Ce,"%TypedArray%":Ne,"%TypeError%":Ee,"%Uint8Array%":"undefined"==typeof Uint8Array?de:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?de:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?de:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?de:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?de:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?de:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?de:WeakSet};try{null.error}catch(rp){var Oe=Re(Re(rp));je["%Error.prototype%"]=Oe}var Te=function t(e){var r;if("%AsyncFunction%"===e)r=Me("async function () {}");else if("%GeneratorFunction%"===e)r=Me("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=Me("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=Re(i.prototype))}return je[e]=r,r},Pe={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Le=ve,De=we,Be=Le.call(Function.call,Array.prototype.concat),Fe=Le.call(Function.apply,Array.prototype.splice),Ue=Le.call(Function.call,String.prototype.replace),Ve=Le.call(Function.call,String.prototype.slice),He=Le.call(Function.call,RegExp.prototype.exec),ze=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,We=/\\(\\)?/g,qe=function(t,e){var r,n=t;if(De(Pe,n)&&(n="%"+(r=Pe[n])[0]+"%"),De(je,n)){var i=je[n];if(i===Ae&&(i=Te(n)),void 0===i&&!e)throw new Ee("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new _e("intrinsic "+t+" does not exist!")},Je=function(t,e){if("string"!=typeof t||0===t.length)throw new Ee("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new Ee('"allowMissing" argument must be a boolean');if(null===He(/^%?[^%]*%?$/,t))throw new _e("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=Ve(t,0,1),r=Ve(t,-1);if("%"===e&&"%"!==r)throw new _e("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new _e("invalid intrinsic syntax, expected opening `%`");var n=[];return Ue(t,ze,(function(t,e,r,i){n[n.length]=r?Ue(i,We,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=qe("%"+n+"%",e),o=i.name,s=i.value,a=!1,u=i.alias;u&&(n=u[0],Fe(r,Be([0,1],u)));for(var c=1,l=!0;c<r.length;c+=1){var h=r[c],d=Ve(h,0,1),f=Ve(h,-1);if(('"'===d||"'"===d||"`"===d||'"'===f||"'"===f||"`"===f)&&d!==f)throw new _e("property names with quotes must have matching quotes");if("constructor"!==h&&l||(a=!0),De(je,o="%"+(n+="."+h)+"%"))s=je[o];else if(null!=s){if(!(h in s)){if(!e)throw new Ee("base intrinsic for "+t+" exists, but the property is not available.");return}if(xe&&c+1>=r.length){var p=xe(s,h);s=(l=!!p)&&"get"in p&&!("originalValue"in p.get)?p.get:s[h]}else l=De(s,h),s=s[h];l&&!a&&(je[o]=s)}}return s},$e={exports:{}};!function(t){var e=ve,r=Je,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),o=r("%Reflect.apply%",!0)||e.call(i,n),s=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch(t){a=null}t.exports=function(t){var r=o(e,i,arguments);s&&a&&(s(r,"length").configurable&&a(r,"length",{value:1+u(0,t.length-(arguments.length-1))}));return r};var c=function(){return o(e,n,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c}($e);var Ze=Je,Ge=$e.exports,Qe=Ge(Ze("String.prototype.indexOf")),Ye="function"==typeof Map&&Map.prototype,Ke=Object.getOwnPropertyDescriptor&&Ye?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Xe=Ye&&Ke&&"function"==typeof Ke.get?Ke.get:null,tr=Ye&&Map.prototype.forEach,er="function"==typeof Set&&Set.prototype,rr=Object.getOwnPropertyDescriptor&&er?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,nr=er&&rr&&"function"==typeof rr.get?rr.get:null,ir=er&&Set.prototype.forEach,or="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,sr="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,ar="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,ur=Boolean.prototype.valueOf,cr=Object.prototype.toString,lr=Function.prototype.toString,hr=String.prototype.match,dr=String.prototype.slice,fr=String.prototype.replace,pr=String.prototype.toUpperCase,gr=String.prototype.toLowerCase,yr=RegExp.prototype.test,br=Array.prototype.concat,mr=Array.prototype.join,vr=Array.prototype.slice,wr=Math.floor,_r="function"==typeof BigInt?BigInt.prototype.valueOf:null,Sr=Object.getOwnPropertySymbols,Er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Mr="function"==typeof Symbol&&"object"==typeof Symbol.iterator,xr="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Mr||"symbol")?Symbol.toStringTag:null,kr=Object.prototype.propertyIsEnumerable,Cr=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Ir(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||yr.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-wr(-t):wr(t);if(n!==t){var i=String(n),o=dr.call(e,i.length+1);return fr.call(i,r,"$&_")+"."+fr.call(fr.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fr.call(e,r,"$&_")}var Rr=u,Ar=Rr.custom,Nr=Lr(Ar)?Ar:null;function jr(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function Or(t){return fr.call(String(t),/"/g,""")}function Tr(t){return!("[object Array]"!==Fr(t)||xr&&"object"==typeof t&&xr in t)}function Pr(t){return!("[object RegExp]"!==Fr(t)||xr&&"object"==typeof t&&xr in t)}function Lr(t){if(Mr)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!Er)return!1;try{return Er.call(t),!0}catch(t){}return!1}var Dr=Object.prototype.hasOwnProperty||function(t){return t in this};function Br(t,e){return Dr.call(t,e)}function Fr(t){return cr.call(t)}function Ur(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function Vr(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Vr(dr.call(t,0,e.maxStringLength),e)+n}return jr(fr.call(fr.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Hr),"single",e)}function Hr(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+pr.call(e.toString(16))}function zr(t){return"Object("+t+")"}function Wr(t){return t+" { ? }"}function qr(t,e,r,n){return t+" ("+e+") {"+(n?Jr(r,n):mr.call(r,", "))+"}"}function Jr(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+mr.call(t,","+r)+"\n"+e.prev}function $r(t,e){var r=Tr(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=Br(t,i)?e(t[i],t):""}var o,s="function"==typeof Sr?Sr(t):[];if(Mr){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var u in t)Br(t,u)&&(r&&String(Number(u))===u&&u<t.length||Mr&&o["$"+u]instanceof Symbol||(yr.call(/[^\w$]/,u)?n.push(e(u,t)+": "+e(t[u],t)):n.push(u+": "+e(t[u],t))));if("function"==typeof Sr)for(var c=0;c<s.length;c++)kr.call(t,s[c])&&n.push("["+e(s[c])+"]: "+e(t[s[c]],t));return n}var Zr=Je,Gr=function(t,e){var r=Ze(t,!!e);return"function"==typeof r&&Qe(t,".prototype.")>-1?Ge(r):r},Qr=function t(e,r,n,i){var o=r||{};if(Br(o,"quoteStyle")&&"single"!==o.quoteStyle&&"double"!==o.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Br(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!Br(o,"customInspect")||o.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Br(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Br(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return Vr(e,o);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var u=String(e);return a?Ir(e,u):u}if("bigint"==typeof e){var c=String(e)+"n";return a?Ir(e,c):c}var l=void 0===o.depth?5:o.depth;if(void 0===n&&(n=0),n>=l&&l>0&&"object"==typeof e)return Tr(e)?"[Array]":"[Object]";var h=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=mr.call(Array(t.indent+1)," ")}return{base:r,prev:mr.call(Array(e+1),r)}}(o,n);if(void 0===i)i=[];else if(Ur(i,e)>=0)return"[Circular]";function d(e,r,s){if(r&&(i=vr.call(i)).push(r),s){var a={depth:o.depth};return Br(o,"quoteStyle")&&(a.quoteStyle=o.quoteStyle),t(e,a,n+1,i)}return t(e,o,n+1,i)}if("function"==typeof e&&!Pr(e)){var f=function(t){if(t.name)return t.name;var e=hr.call(lr.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),p=$r(e,d);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+mr.call(p,", ")+" }":"")}if(Lr(e)){var g=Mr?fr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Er.call(e);return"object"!=typeof e||Mr?g:zr(g)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var y="<"+gr.call(String(e.nodeName)),b=e.attributes||[],m=0;m<b.length;m++)y+=" "+b[m].name+"="+jr(Or(b[m].value),"double",o);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+gr.call(String(e.nodeName))+">"}if(Tr(e)){if(0===e.length)return"[]";var v=$r(e,d);return h&&!function(t){for(var e=0;e<t.length;e++)if(Ur(t[e],"\n")>=0)return!1;return!0}(v)?"["+Jr(v,h)+"]":"[ "+mr.call(v,", ")+" ]"}if(function(t){return!("[object Error]"!==Fr(t)||xr&&"object"==typeof t&&xr in t)}(e)){var w=$r(e,d);return"cause"in Error.prototype||!("cause"in e)||kr.call(e,"cause")?0===w.length?"["+String(e)+"]":"{ ["+String(e)+"] "+mr.call(w,", ")+" }":"{ ["+String(e)+"] "+mr.call(br.call("[cause]: "+d(e.cause),w),", ")+" }"}if("object"==typeof e&&s){if(Nr&&"function"==typeof e[Nr]&&Rr)return Rr(e,{depth:l-n});if("symbol"!==s&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!Xe||!t||"object"!=typeof t)return!1;try{Xe.call(t);try{nr.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var _=[];return tr&&tr.call(e,(function(t,r){_.push(d(r,e,!0)+" => "+d(t,e))})),qr("Map",Xe.call(e),_,h)}if(function(t){if(!nr||!t||"object"!=typeof t)return!1;try{nr.call(t);try{Xe.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var S=[];return ir&&ir.call(e,(function(t){S.push(d(t,e))})),qr("Set",nr.call(e),S,h)}if(function(t){if(!or||!t||"object"!=typeof t)return!1;try{or.call(t,or);try{sr.call(t,sr)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Wr("WeakMap");if(function(t){if(!sr||!t||"object"!=typeof t)return!1;try{sr.call(t,sr);try{or.call(t,or)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Wr("WeakSet");if(function(t){if(!ar||!t||"object"!=typeof t)return!1;try{return ar.call(t),!0}catch(t){}return!1}(e))return Wr("WeakRef");if(function(t){return!("[object Number]"!==Fr(t)||xr&&"object"==typeof t&&xr in t)}(e))return zr(d(Number(e)));if(function(t){if(!t||"object"!=typeof t||!_r)return!1;try{return _r.call(t),!0}catch(t){}return!1}(e))return zr(d(_r.call(e)));if(function(t){return!("[object Boolean]"!==Fr(t)||xr&&"object"==typeof t&&xr in t)}(e))return zr(ur.call(e));if(function(t){return!("[object String]"!==Fr(t)||xr&&"object"==typeof t&&xr in t)}(e))return zr(d(String(e)));if(!function(t){return!("[object Date]"!==Fr(t)||xr&&"object"==typeof t&&xr in t)}(e)&&!Pr(e)){var E=$r(e,d),M=Cr?Cr(e)===Object.prototype:e instanceof Object||e.constructor===Object,x=e instanceof Object?"":"null prototype",k=!M&&xr&&Object(e)===e&&xr in e?dr.call(Fr(e),8,-1):x?"Object":"",C=(M||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(k||x?"["+mr.call(br.call([],k||[],x||[]),": ")+"] ":"");return 0===E.length?C+"{}":h?C+"{"+Jr(E,h)+"}":C+"{ "+mr.call(E,", ")+" }"}return String(e)},Yr=Zr("%TypeError%"),Kr=Zr("%WeakMap%",!0),Xr=Zr("%Map%",!0),tn=Gr("WeakMap.prototype.get",!0),en=Gr("WeakMap.prototype.set",!0),rn=Gr("WeakMap.prototype.has",!0),nn=Gr("Map.prototype.get",!0),on=Gr("Map.prototype.set",!0),sn=Gr("Map.prototype.has",!0),an=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r},un=String.prototype.replace,cn=/%20/g,ln="RFC3986",hn={default:ln,formatters:{RFC1738:function(t){return un.call(t,cn,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:ln},dn=hn,fn=Object.prototype.hasOwnProperty,pn=Array.isArray,gn=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),yn=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r},bn={arrayToObject:yn,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var i=e[n],o=i.obj[i.prop],s=Object.keys(o),a=0;a<s.length;++a){var u=s[a],c=o[u];"object"==typeof c&&null!==c&&-1===r.indexOf(c)&&(e.push({obj:o,prop:u}),r.push(c))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(pn(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r,n,i){if(0===t.length)return t;var o=t;if("symbol"==typeof t?o=Symbol.prototype.toString.call(t):"string"!=typeof t&&(o=String(t)),"iso-8859-1"===r)return escape(o).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var s="",a=0;a<o.length;++a){var u=o.charCodeAt(a);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===dn.RFC1738&&(40===u||41===u)?s+=o.charAt(a):u<128?s+=gn[u]:u<2048?s+=gn[192|u>>6]+gn[128|63&u]:u<55296||u>=57344?s+=gn[224|u>>12]+gn[128|u>>6&63]+gn[128|63&u]:(a+=1,u=65536+((1023&u)<<10|1023&o.charCodeAt(a)),s+=gn[240|u>>18]+gn[128|u>>12&63]+gn[128|u>>6&63]+gn[128|63&u])}return s},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(pn(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},merge:function t(e,r,n){if(!r)return e;if("object"!=typeof r){if(pn(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!fn.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var i=e;return pn(e)&&!pn(r)&&(i=yn(e,n)),pn(e)&&pn(r)?(r.forEach((function(r,i){if(fn.call(e,i)){var o=e[i];o&&"object"==typeof o&&r&&"object"==typeof r?e[i]=t(o,r,n):e.push(r)}else e[i]=r})),e):Object.keys(r).reduce((function(e,i){var o=r[i];return fn.call(e,i)?e[i]=t(e[i],o,n):e[i]=o,e}),i)}},mn=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new Yr("Side channel does not contain "+Qr(t))},get:function(n){if(Kr&&n&&("object"==typeof n||"function"==typeof n)){if(t)return tn(t,n)}else if(Xr){if(e)return nn(e,n)}else if(r)return function(t,e){var r=an(t,e);return r&&r.value}(r,n)},has:function(n){if(Kr&&n&&("object"==typeof n||"function"==typeof n)){if(t)return rn(t,n)}else if(Xr){if(e)return sn(e,n)}else if(r)return function(t,e){return!!an(t,e)}(r,n);return!1},set:function(n,i){Kr&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new Kr),en(t,n,i)):Xr?(e||(e=new Xr),on(e,n,i)):(r||(r={key:{},next:null}),function(t,e,r){var n=an(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,i))}};return n},vn=bn,wn=hn,_n=Object.prototype.hasOwnProperty,Sn={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},En=Array.isArray,Mn=Array.prototype.push,xn=function(t,e){Mn.apply(t,En(e)?e:[e])},kn=Date.prototype.toISOString,Cn=wn.default,In={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:vn.encode,encodeValuesOnly:!1,format:Cn,formatter:wn.formatters[Cn],indices:!1,serializeDate:function(t){return kn.call(t)},skipNulls:!1,strictNullHandling:!1},Rn={},An=function t(e,r,n,i,o,s,a,u,c,l,h,d,f,p,g,y){for(var b=e,m=y,v=0,w=!1;void 0!==(m=m.get(Rn))&&!w;){var _=m.get(e);if(v+=1,void 0!==_){if(_===v)throw new RangeError("Cyclic object value");w=!0}void 0===m.get(Rn)&&(v=0)}if("function"==typeof u?b=u(r,b):b instanceof Date?b=h(b):"comma"===n&&En(b)&&(b=vn.maybeMap(b,(function(t){return t instanceof Date?h(t):t}))),null===b){if(o)return a&&!p?a(r,In.encoder,g,"key",d):r;b=""}if(function(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||"symbol"==typeof t||"bigint"==typeof t}(b)||vn.isBuffer(b))return a?[f(p?r:a(r,In.encoder,g,"key",d))+"="+f(a(b,In.encoder,g,"value",d))]:[f(r)+"="+f(String(b))];var S,E=[];if(void 0===b)return E;if("comma"===n&&En(b))p&&a&&(b=vn.maybeMap(b,a)),S=[{value:b.length>0?b.join(",")||null:void 0}];else if(En(u))S=u;else{var M=Object.keys(b);S=c?M.sort(c):M}for(var x=i&&En(b)&&1===b.length?r+"[]":r,k=0;k<S.length;++k){var C=S[k],I="object"==typeof C&&void 0!==C.value?C.value:b[C];if(!s||null!==I){var R=En(b)?"function"==typeof n?n(x,C):x:x+(l?"."+C:"["+C+"]");y.set(e,v);var A=mn();A.set(Rn,y),xn(E,t(I,R,n,i,o,s,"comma"===n&&p&&En(b)?null:a,u,c,l,h,d,f,p,g,A))}}return E},Nn=bn,jn=Object.prototype.hasOwnProperty,On=Array.isArray,Tn={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Nn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Pn=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},Ln=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Dn=function(t,e,r,n){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(i),a=s?i.slice(0,s.index):i,u=[];if(a){if(!r.plainObjects&&jn.call(Object.prototype,a)&&!r.allowPrototypes)return;u.push(a)}for(var c=0;r.depth>0&&null!==(s=o.exec(i))&&c<r.depth;){if(c+=1,!r.plainObjects&&jn.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(s[1])}return s&&u.push("["+i.slice(s.index)+"]"),function(t,e,r,n){for(var i=n?e:Ln(e,r),o=t.length-1;o>=0;--o){var s,a=t[o];if("[]"===a&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var u="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(u,10);r.parseArrays||""!==u?!isNaN(c)&&a!==u&&String(c)===u&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(s=[])[c]=i:"__proto__"!==u&&(s[u]=i):s={0:i}}i=s}return i}(u,e,r,n)}},Bn=function(t,e){var r,n=t,i=function(t){if(!t)return In;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||In.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=wn.default;if(void 0!==t.format){if(!_n.call(wn.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=wn.formatters[r],i=In.filter;return("function"==typeof t.filter||En(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:In.addQueryPrefix,allowDots:void 0===t.allowDots?In.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:In.charsetSentinel,delimiter:void 0===t.delimiter?In.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:In.encode,encoder:"function"==typeof t.encoder?t.encoder:In.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:In.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:In.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:In.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:In.strictNullHandling}}(e);"function"==typeof i.filter?n=(0,i.filter)("",n):En(i.filter)&&(r=i.filter);var o,s=[];if("object"!=typeof n||null===n)return"";o=e&&e.arrayFormat in Sn?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var a=Sn[o];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u="comma"===a&&e&&e.commaRoundTrip;r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);for(var c=mn(),l=0;l<r.length;++l){var h=r[l];i.skipNulls&&null===n[h]||xn(s,An(n[h],h,a,u,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,c))}var d=s.join(i.delimiter),f=!0===i.addQueryPrefix?"?":"";return i.charsetSentinel&&("iso-8859-1"===i.charset?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),d.length>0?f+d:""},Fn=function(t,e){var r=function(t){if(!t)return Tn;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?Tn.charset:t.charset;return{allowDots:void 0===t.allowDots?Tn.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:Tn.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:Tn.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:Tn.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Tn.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:Tn.comma,decoder:"function"==typeof t.decoder?t.decoder:Tn.decoder,delimiter:"string"==typeof t.delimiter||Nn.isRegExp(t.delimiter)?t.delimiter:Tn.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:Tn.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:Tn.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:Tn.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:Tn.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Tn.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},i=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=e.parameterLimit===1/0?void 0:e.parameterLimit,s=i.split(e.delimiter,o),a=-1,u=e.charset;if(e.charsetSentinel)for(r=0;r<s.length;++r)0===s[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===s[r]?u="utf-8":"utf8=%26%2310003%3B"===s[r]&&(u="iso-8859-1"),a=r,r=s.length);for(r=0;r<s.length;++r)if(r!==a){var c,l,h=s[r],d=h.indexOf("]="),f=-1===d?h.indexOf("="):d+1;-1===f?(c=e.decoder(h,Tn.decoder,u,"key"),l=e.strictNullHandling?null:""):(c=e.decoder(h.slice(0,f),Tn.decoder,u,"key"),l=Nn.maybeMap(Ln(h.slice(f+1),e),(function(t){return e.decoder(t,Tn.decoder,u,"value")}))),l&&e.interpretNumericEntities&&"iso-8859-1"===u&&(l=Pn(l)),h.indexOf("[]=")>-1&&(l=On(l)?[l]:l),jn.call(n,c)?n[c]=Nn.combine(n[c],l):n[c]=l}return n}(t,r):t,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),s=0;s<o.length;++s){var a=o[s],u=Dn(a,n[a],r,"string"==typeof t);i=Nn.merge(i,u,r)}return!0===r.allowSparse?i:Nn.compact(i)},Un={formats:hn,parse:Fn,stringify:Bn},Vn={};!function(t){function e(){return t=>t}var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0,t.OpaqueType=e,t.HexString=t=>t,t.AddressString=t=>t,t.BigIntString=t=>t,t.IntNumber=function(t){return Math.floor(t)},t.RegExpString=t=>t,(r=t.ProviderType||(t.ProviderType={})).CoinbaseWallet="CoinbaseWallet",r.MetaMask="MetaMask",r.Unselected=""}(Vn);var Hn=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fe,"__esModule",{value:!0}),fe.isInIFrame=fe.createQrUrl=fe.getFavicon=fe.range=fe.isBigNumber=fe.ensureParsedJSONObject=fe.ensureBN=fe.ensureRegExpString=fe.ensureIntNumber=fe.ensureBuffer=fe.ensureAddressString=fe.ensureEvenLengthHexString=fe.ensureHexString=fe.isHexString=fe.prepend0x=fe.strip0x=fe.has0xPrefix=fe.hexStringFromIntNumber=fe.intNumberFromHexString=fe.bigIntStringFromBN=fe.hexStringFromBuffer=fe.hexStringToUint8Array=fe.uint8ArrayToHex=fe.randomBytesHex=void 0;const zn=Hn(S.exports),Wn=Un,qn=Vn,Jn=/^[0-9]*$/,$n=/^[a-f0-9]*$/;function Zn(t){return[...t].map((t=>t.toString(16).padStart(2,"0"))).join("")}function Gn(t){return t.startsWith("0x")||t.startsWith("0X")}function Qn(t){return Gn(t)?t.slice(2):t}function Yn(t){return Gn(t)?"0x"+t.slice(2):"0x"+t}function Kn(t){if("string"!=typeof t)return!1;const e=Qn(t).toLowerCase();return $n.test(e)}function Xn(t,e=!1){if("string"==typeof t){const r=Qn(t).toLowerCase();if($n.test(r))return(0,qn.HexString)(e?"0x"+r:r)}throw new Error(`"${String(t)}" is not a hexadecimal string`)}function ti(t,e=!1){let r=Xn(t,!1);return r.length%2==1&&(r=(0,qn.HexString)("0"+r)),e?(0,qn.HexString)("0x"+r):r}function ei(t){if("number"==typeof t&&Number.isInteger(t))return(0,qn.IntNumber)(t);if("string"==typeof t){if(Jn.test(t))return(0,qn.IntNumber)(Number(t));if(Kn(t))return(0,qn.IntNumber)(new zn.default(ti(t,!1),16).toNumber())}throw new Error(`Not an integer: ${String(t)}`)}function ri(t){if(null==t||"function"!=typeof t.constructor)return!1;const{constructor:e}=t;return"function"==typeof e.config&&"number"==typeof e.EUCLID}fe.randomBytesHex=function(t){return Zn(crypto.getRandomValues(new Uint8Array(t)))},fe.uint8ArrayToHex=Zn,fe.hexStringToUint8Array=function(t){return new Uint8Array(t.match(/.{1,2}/g).map((t=>parseInt(t,16))))},fe.hexStringFromBuffer=function(t,e=!1){const r=t.toString("hex");return(0,qn.HexString)(e?"0x"+r:r)},fe.bigIntStringFromBN=function(t){return(0,qn.BigIntString)(t.toString(10))},fe.intNumberFromHexString=function(t){return(0,qn.IntNumber)(new zn.default(ti(t,!1),16).toNumber())},fe.hexStringFromIntNumber=function(t){return(0,qn.HexString)("0x"+new zn.default(t).toString(16))},fe.has0xPrefix=Gn,fe.strip0x=Qn,fe.prepend0x=Yn,fe.isHexString=Kn,fe.ensureHexString=Xn,fe.ensureEvenLengthHexString=ti,fe.ensureAddressString=function(t){if("string"==typeof t){const e=Qn(t).toLowerCase();if(Kn(e)&&40===e.length)return(0,qn.AddressString)(Yn(e))}throw new Error(`Invalid Ethereum address: ${String(t)}`)},fe.ensureBuffer=function(t){if(Buffer.isBuffer(t))return t;if("string"==typeof t){if(Kn(t)){const e=ti(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw new Error(`Not binary data: ${String(t)}`)},fe.ensureIntNumber=ei,fe.ensureRegExpString=function(t){if(t instanceof RegExp)return(0,qn.RegExpString)(t.toString());throw new Error(`Not a RegExp: ${String(t)}`)},fe.ensureBN=function(t){if(null!==t&&(zn.default.isBN(t)||ri(t)))return new zn.default(t.toString(10),10);if("number"==typeof t)return new zn.default(ei(t));if("string"==typeof t){if(Jn.test(t))return new zn.default(t,10);if(Kn(t))return new zn.default(ti(t,!1),16)}throw new Error(`Not an integer: ${String(t)}`)},fe.ensureParsedJSONObject=function(t){if("string"==typeof t)return JSON.parse(t);if("object"==typeof t)return t;throw new Error(`Not a JSON string or an object: ${String(t)}`)},fe.isBigNumber=ri,fe.range=function(t,e){return Array.from({length:e-t},((e,r)=>t+r))},fe.getFavicon=function(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`},fe.createQrUrl=function(t,e,r,n,i,o){return`${r}/#/link?${(0,Wn.stringify)({[n?"parent-id":"id"]:t,secret:e,server:r,v:i,chainId:o})}`},fe.isInIFrame=function(){try{return null!==window.frameElement}catch(t){return!1}},Object.defineProperty(Y,"__esModule",{value:!0}),Y.Session=void 0;const ni=K.exports,ii=fe,oi="session:id",si="session:secret",ai="session:linked";class ui{constructor(t,e,r,n){this._storage=t,this._id=e||(0,ii.randomBytesHex)(16),this._secret=r||(0,ii.randomBytesHex)(32),this._key=(new ni.sha256).update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!n}static load(t){const e=t.getItem(oi),r=t.getItem(ai),n=t.getItem(si);return e&&n?new ui(t,e,n,"1"===r):null}static hash(t){return(new ni.sha256).update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(oi,this._id),this._storage.setItem(si,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(ai,this._linked?"1":"0")}}Y.Session=ui;var ci={};Object.defineProperty(ci,"__esModule",{value:!0}),ci.WalletSDKRelayAbstract=ci.APP_VERSION_KEY=ci.LOCAL_STORAGE_ADDRESSES_KEY=ci.WALLET_USER_NAME_KEY=void 0;const li=E;ci.WALLET_USER_NAME_KEY="walletUsername",ci.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",ci.APP_VERSION_KEY="AppVersion";ci.WalletSDKRelayAbstract=class{async makeEthereumJSONRPCRequest(t,e){if(!e)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(e,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then((t=>t.json())).then((t=>{if(!t)throw li.ethErrors.rpc.parse({});const e=t,{error:r}=e;if(r)throw(0,li.serializeError)(r);return e}))}};var hi,di,fi={exports:{}},pi=a.EventEmitter;function gi(){if(di)return hi;function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function r(t,e,r){return(e=i(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}di=1;var o=l.Buffer,s=u.inspect,a=s&&s.custom||"inspect";function c(t,e,r){o.prototype.copy.call(t,e,r)}return hi=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var r,i,u;return r=t,i=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e=o.allocUnsafe(t>>>0),r=this.head,n=0;r;)c(r.data,e,n),n+=r.data.length,r=r.next;return e}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,s=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,s),0==(t-=s)){s===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(s));break}++n}return this.length-=n,e}},{key:a,value:function(t,r){return s(this,e(e({},r),{},{depth:0,customInspect:!1}))}}],i&&n(r.prototype,i),u&&n(r,u),Object.defineProperty(r,"prototype",{writable:!1}),t}(),hi}function yi(t,e){mi(t,e),bi(t)}function bi(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function mi(t,e){t.emit("error",e)}var vi={destroy:function(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(mi,this,t)):process.nextTick(mi,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?process.nextTick(bi,r):(r._writableState.errorEmitted=!0,process.nextTick(yi,r,t)):process.nextTick(yi,r,t):e?(process.nextTick(bi,r),e(t)):process.nextTick(bi,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}},wi={};var _i={};function Si(t,e,r){r||(r=Error);var n=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);n.prototype.name=r.name,n.prototype.code=t,_i[t]=n}function Ei(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}Si("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),Si("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,o,s;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(Ei(e,"type"));else{var a=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(a," ").concat(n," ").concat(Ei(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),Si("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),Si("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),Si("ERR_STREAM_PREMATURE_CLOSE","Premature close"),Si("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),Si("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),Si("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),Si("ERR_STREAM_WRITE_AFTER_END","write after end"),Si("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),Si("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),Si("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),wi.codes=_i;var Mi=wi.codes.ERR_INVALID_OPT_VALUE;var xi,ki,Ci,Ii,Ri,Ai,Ni={getHighWaterMark:function(t,e,r,n){var i=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,n,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new Mi(n?r:"highWaterMark",i);return Math.floor(i)}return t.objectMode?16:16384}};function ji(){if(ki)return xi;function e(e){try{if(!t.localStorage)return!1}catch(t){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}return ki=1,xi=function(t,r){if(e("noDeprecation"))return t;var n=!1;return function(){if(!n){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),n=!0}return t.apply(this,arguments)}},xi}function Oi(){if(Ii)return Ci;function e(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var r;Ii=1,Ci=M,M.WritableState=E;var n={deprecate:ji()},i=pi,o=l.Buffer,s=(void 0!==t?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a,u=vi,h=Ni.getHighWaterMark,d=wi.codes,f=d.ERR_INVALID_ARG_TYPE,p=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,y=d.ERR_STREAM_CANNOT_PIPE,b=d.ERR_STREAM_DESTROYED,m=d.ERR_STREAM_NULL_VALUES,v=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,_=u.errorOrDestroy;function S(){}function E(t,n,i){r=r||Ti(),t=t||{},"boolean"!=typeof i&&(i=n instanceof r),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(A,t,e),t._writableState.errorEmitted=!0,_(t,n)):(i(n),t._writableState.errorEmitted=!0,_(t,n),A(t,e))}(t,r,n,e,i);else{var o=I(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||C(t,r),n?process.nextTick(k,t,r,o,i):k(t,r,o,i)}}(n,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function M(t){var e=this instanceof(r=r||Ti());if(!e&&!a.call(M,this))return new M(t);this._writableState=new E(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),i.call(this)}function x(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new b("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function k(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),A(t,e)}function C(t,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(t._writev&&n&&n.next){var i=r.bufferedRequestCount,o=new Array(i),s=r.corkedRequestsFree;s.entry=n;for(var a=0,u=!0;n;)o[a]=n,n.isBuf||(u=!1),n=n.next,a+=1;o.allBuffers=u,x(t,r,!0,r.length,o,"",s.finish),r.pendingcb++,r.lastBufferedRequest=null,s.next?(r.corkedRequestsFree=s.next,s.next=null):r.corkedRequestsFree=new e(r),r.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,h=n.callback;if(x(t,r,!1,r.objectMode?1:c.length,c,l,h),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function R(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),A(t,e)}))}function A(t,e){var r=I(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(R,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}return c.exports(M,i),E.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(E.prototype,"buffer",{get:n.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(t){return!!a.call(this,t)||this===M&&(t&&t._writableState instanceof E)}})):a=function(t){return t instanceof this},M.prototype.pipe=function(){_(this,new y)},M.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,u=!i.objectMode&&(n=t,o.isBuffer(n)||n instanceof s);return u&&!o.isBuffer(t)&&(t=function(t){return o.from(t)}(t)),"function"==typeof e&&(r=e,e=null),u?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=S),i.ending?function(t,e){var r=new v;_(t,r),process.nextTick(e,r)}(this,r):(u||function(t,e,r,n){var i;return null===r?i=new m:"string"==typeof r||e.objectMode||(i=new f("chunk",["string","Buffer"],r)),!i||(_(t,i),process.nextTick(n,i),!1)}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,s){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=o.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var u=e.objectMode?1:n.length;e.length+=u;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else x(t,e,!1,u,n,i,s);return c}(this,i,u,t,e,r)),a},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||C(this,t))},M.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(t,e,r){r(new p("_write()"))},M.prototype._writev=null,M.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,A(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),M.prototype.destroy=u.destroy,M.prototype._undestroy=u.undestroy,M.prototype._destroy=function(t,e){e(t)},Ci}function Ti(){if(Ai)return Ri;Ai=1;var t=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Ri=s;var e=Zi(),r=Oi();c.exports(s,e);for(var n=t(r.prototype),i=0;i<n.length;i++){var o=n[i];s.prototype[o]||(s.prototype[o]=r.prototype[o])}function s(t){if(!(this instanceof s))return new s(t);e.call(this,t),r.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",a)))}function a(){this._writableState.ended||process.nextTick(u,this)}function u(t){t.end()}return Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),Ri}var Pi,Li={};function Di(){if(Pi)return Li;Pi=1;var t=X.exports.Buffer,e=t.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(r);if("string"!=typeof n&&(t.isEncoding===e||!e(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=o,this.end=s,n=4;break;case"utf8":this.fillLast=i,n=4;break;case"base64":this.text=a,this.end=u,n=3;break;default:return this.write=c,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}function n(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function i(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function o(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function s(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function a(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function u(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function l(t){return t&&t.length?this.write(t):""}return Li.StringDecoder=r,r.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},r.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},r.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var o=n(e[i]);if(o>=0)return o>0&&(t.lastNeed=o-1),o;if(--i<r||-2===o)return 0;if(o=n(e[i]),o>=0)return o>0&&(t.lastNeed=o-2),o;if(--i<r||-2===o)return 0;if(o=n(e[i]),o>=0)return o>0&&(2===o?o=0:t.lastNeed=o-3),o;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},r.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length},Li}var Bi=wi.codes.ERR_STREAM_PREMATURE_CLOSE;function Fi(){}var Ui,Vi,Hi,zi,Wi,qi,Ji=function t(e,r,n){if("function"==typeof r)return t(e,null,r);r||(r={}),n=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(n||Fi);var i=r.readable||!1!==r.readable&&e.readable,o=r.writable||!1!==r.writable&&e.writable,s=function(){e.writable||u()},a=e._writableState&&e._writableState.finished,u=function(){o=!1,a=!0,i||n.call(e)},c=e._readableState&&e._readableState.endEmitted,l=function(){i=!1,c=!0,o||n.call(e)},h=function(t){n.call(e,t)},d=function(){var t;return i&&!c?(e._readableState&&e._readableState.ended||(t=new Bi),n.call(e,t)):o&&!a?(e._writableState&&e._writableState.ended||(t=new Bi),n.call(e,t)):void 0},f=function(){e.req.on("finish",u)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?o&&!e._writableState&&(e.on("end",s),e.on("close",s)):(e.on("complete",u),e.on("abort",d),e.req?f():e.on("request",f)),e.on("end",l),e.on("finish",u),!1!==r.error&&e.on("error",h),e.on("close",d),function(){e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",f),e.req&&e.req.removeListener("finish",u),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",u),e.removeListener("end",l),e.removeListener("error",h),e.removeListener("close",d)}};function $i(){if(Vi)return Ui;var t;function e(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Vi=1;var r=Ji,n=Symbol("lastResolve"),i=Symbol("lastReject"),o=Symbol("error"),s=Symbol("ended"),a=Symbol("lastPromise"),u=Symbol("handlePromise"),c=Symbol("stream");function l(t,e){return{value:t,done:e}}function h(t){var e=t[n];if(null!==e){var r=t[c].read();null!==r&&(t[a]=null,t[n]=null,t[i]=null,e(l(r,!1)))}}function d(t){process.nextTick(h,t)}var f=Object.getPrototypeOf((function(){})),p=Object.setPrototypeOf((e(t={get stream(){return this[c]},next:function(){var t=this,e=this[o];if(null!==e)return Promise.reject(e);if(this[s])return Promise.resolve(l(void 0,!0));if(this[c].destroyed)return new Promise((function(e,r){process.nextTick((function(){t[o]?r(t[o]):e(l(void 0,!0))}))}));var r,n=this[a];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[s]?r(l(void 0,!0)):e[u](r,n)}),n)}}(n,this));else{var i=this[c].read();if(null!==i)return Promise.resolve(l(i,!1));r=new Promise(this[u])}return this[a]=r,r}},Symbol.asyncIterator,(function(){return this})),e(t,"return",(function(){var t=this;return new Promise((function(e,r){t[c].destroy(null,(function(t){t?r(t):e(l(void 0,!0))}))}))})),t),f);return Ui=function(t){var h,f=Object.create(p,(e(h={},c,{value:t,writable:!0}),e(h,n,{value:null,writable:!0}),e(h,i,{value:null,writable:!0}),e(h,o,{value:null,writable:!0}),e(h,s,{value:t._readableState.endEmitted,writable:!0}),e(h,u,{value:function(t,e){var r=f[c].read();r?(f[a]=null,f[n]=null,f[i]=null,t(l(r,!1))):(f[n]=t,f[i]=e)},writable:!0}),h));return f[a]=null,r(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=f[i];return null!==e&&(f[a]=null,f[n]=null,f[i]=null,e(t)),void(f[o]=t)}var r=f[n];null!==r&&(f[a]=null,f[n]=null,f[i]=null,r(l(void 0,!0))),f[s]=!0})),t.on("readable",d.bind(null,f)),f},Ui}function Zi(){if(qi)return Wi;var e;qi=1,Wi=k,k.ReadableState=x,a.EventEmitter;var r=function(t,e){return t.listeners(e).length},n=pi,i=l.Buffer,o=(void 0!==t?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var s,h=u;s=h&&h.debuglog?h.debuglog("stream"):function(){};var d,f,p,g=gi(),y=vi,b=Ni.getHighWaterMark,m=wi.codes,v=m.ERR_INVALID_ARG_TYPE,w=m.ERR_STREAM_PUSH_AFTER_EOF,_=m.ERR_METHOD_NOT_IMPLEMENTED,S=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;c.exports(k,n);var E=y.errorOrDestroy,M=["error","close","destroy","pause","resume"];function x(t,r,n){e=e||Ti(),t=t||{},"boolean"!=typeof n&&(n=r instanceof e),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=b(this,t,"readableHighWaterMark",n),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=Di().StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function k(t){if(e=e||Ti(),!(this instanceof k))return new k(t);var r=this instanceof e;this._readableState=new x(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),n.call(this)}function C(t,e,r,n,a){s("readableAddChunk",e);var u,c=t._readableState;if(null===e)c.reading=!1,function(t,e){if(s("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?N(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,j(t)))}(t,c);else if(a||(u=function(t,e){var r;n=e,i.isBuffer(n)||n instanceof o||"string"==typeof e||void 0===e||t.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],e));var n;return r}(c,e)),u)E(t,u);else if(c.objectMode||e&&e.length>0)if("string"==typeof e||c.objectMode||Object.getPrototypeOf(e)===i.prototype||(e=function(t){return i.from(t)}(e)),n)c.endEmitted?E(t,new S):I(t,c,e,!0);else if(c.ended)E(t,new w);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(e=c.decoder.write(e),c.objectMode||0!==e.length?I(t,c,e,!1):O(t,c)):I(t,c,e,!1)}else n||(c.reading=!1,O(t,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function I(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&N(t)),O(t,e)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),k.prototype.destroy=y.destroy,k.prototype._undestroy=y.undestroy,k.prototype._destroy=function(t,e){e(t)},k.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=i.from(t,e),e=""),r=!0),C(this,t,e,!1,r)},k.prototype.unshift=function(t){return C(this,t,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(t){d||(d=Di().StringDecoder);var e=new d(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var R=1073741824;function A(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=R?t=R:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function N(t){var e=t._readableState;s("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(s("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(j,t))}function j(t){var e=t._readableState;s("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,B(t)}function O(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(T,t,e))}function T(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(s("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function P(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){s("readable nexttick read 0"),t.read(0)}function D(t,e){s("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),B(t),e.flowing&&!e.reading&&t.read(0)}function B(t){var e=t._readableState;for(s("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;s("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(V,e,t))}function V(t,e){if(s("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function H(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}return k.prototype.read=function(t){s("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return s("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):N(this),null;if(0===(t=A(t,e))&&e.ended)return 0===e.length&&U(this),null;var n,i=e.needReadable;return s("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&s("length less than watermark",i=!0),e.ended||e.reading?s("reading or ended",i=!1):i&&(s("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=A(r,e))),null===(n=t>0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(t){E(this,new _("_read()"))},k.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,s("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==process.stdout&&t!==process.stderr?u:g;function a(e,r){s("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,s("cleanup"),t.removeListener("close",f),t.removeListener("finish",p),t.removeListener("drain",c),t.removeListener("error",d),t.removeListener("unpipe",a),n.removeListener("end",u),n.removeListener("end",g),n.removeListener("data",h),l=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}function u(){s("onend"),t.end()}i.endEmitted?process.nextTick(o):n.once("end",o),t.on("unpipe",a);var c=function(t){return function(){var e=t._readableState;s("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&r(t,"data")&&(e.flowing=!0,B(t))}}(n);t.on("drain",c);var l=!1;function h(e){s("ondata");var r=t.write(e);s("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==H(i.pipes,t))&&!l&&(s("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function d(e){s("onerror",e),g(),t.removeListener("error",d),0===r(t,"error")&&E(t,e)}function f(){t.removeListener("finish",p),g()}function p(){s("onfinish"),t.removeListener("close",f),g()}function g(){s("unpipe"),n.unpipe(t)}return n.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",f),t.once("finish",p),t.emit("pipe",n),i.flowing||(s("pipe resume"),n.resume()),t},k.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=H(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},k.prototype.on=function(t,e){var r=n.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,s("on readable",i.length,i.reading),i.length?N(this):i.reading||process.nextTick(L,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(t,e){var r=n.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(P,this),r},k.prototype.removeAllListeners=function(t){var e=n.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(P,this),e},k.prototype.resume=function(){var t=this._readableState;return t.flowing||(s("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(D,t,e))}(this,t)),t.paused=!1,this},k.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(s("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(s("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<M.length;o++)t.on(M[o],this.emit.bind(this,M[o]));return this._read=function(e){s("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=$i()),f(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),k._fromList=F,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(t,e){return void 0===p&&(p=zi?Hi:(zi=1,Hi=function(){throw new Error("Readable.from is not available in the browser")})),p(k,t,e)}),Wi}var Gi=no,Qi=wi.codes,Yi=Qi.ERR_METHOD_NOT_IMPLEMENTED,Ki=Qi.ERR_MULTIPLE_CALLBACK,Xi=Qi.ERR_TRANSFORM_ALREADY_TRANSFORMING,to=Qi.ERR_TRANSFORM_WITH_LENGTH_0,eo=Ti();function ro(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new Ki);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function no(t){if(!(this instanceof no))return new no(t);eo.call(this,t),this._transformState={afterTransform:ro.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",io)}function io(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?oo(this,null,null):this._flush((function(e,r){oo(t,e,r)}))}function oo(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new to;if(t._transformState.transforming)throw new Xi;return t.push(null)}c.exports(no,eo),no.prototype.push=function(t,e){return this._transformState.needTransform=!1,eo.prototype.push.call(this,t,e)},no.prototype._transform=function(t,e,r){r(new Yi("_transform()"))},no.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},no.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},no.prototype._destroy=function(t,e){eo.prototype._destroy.call(this,t,(function(t){e(t)}))};var so,ao=co,uo=Gi;function co(t){if(!(this instanceof co))return new co(t);uo.call(this,t)}c.exports(co,uo),co.prototype._transform=function(t,e,r){r(null,t)};var lo=wi.codes,ho=lo.ERR_MISSING_ARGS,fo=lo.ERR_STREAM_DESTROYED;function po(t){if(t)throw t}function go(t){t()}function yo(t,e){return t.pipe(e)}var bo=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=function(t){return t.length?"function"!=typeof t[t.length-1]?po:t.pop():po}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new ho("streams");var o=e.map((function(t,r){var s=r<e.length-1;return function(t,e,r,n){n=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(n);var i=!1;t.on("close",(function(){i=!0})),void 0===so&&(so=Ji),so(t,{readable:e,writable:r},(function(t){if(t)return n(t);i=!0,n()}));var o=!1;return function(e){if(!i&&!o)return o=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void n(e||new fo("pipe"))}}(t,s,r>0,(function(t){n||(n=t),t&&o.forEach(go),s||(o.forEach(go),i(n))}))}));return e.reduce(yo)};!function(t,e){(e=fi.exports=Zi()).Stream=e,e.Readable=e,e.Writable=Oi(),e.Duplex=Ti(),e.Transform=Gi,e.PassThrough=ao,e.finished=Ji,e.pipeline=bo}(0,fi.exports);const{Transform:mo}=fi.exports;const{Transform:vo}=fi.exports;const wo=t=>class e extends mo{constructor(e,r,n,i,o){super(o),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=o,this._state=new t,this._state.initialize(e,r),this._finalized=!1}_transform(t,e,r){let n=null;try{this.update(t,e)}catch(t){n=t}r(n)}_flush(t){let e=null;try{this.push(this.digest())}catch(t){e=t}t(e)}update(t,e){if(!Buffer.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(t)||(t=Buffer.from(t,e)),this._state.absorb(t),this}digest(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},_o=t=>class e extends vo{constructor(e,r,n,i){super(i),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new t,this._state.initialize(e,r),this._finalized=!1}_transform(t,e,r){let n=null;try{this.update(t,e)}catch(t){n=t}r(n)}_flush(){}_read(t){this.push(this.squeeze(t))}update(t,e){if(!Buffer.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(t)||(t=Buffer.from(t,e)),this._state.absorb(t),this}squeeze(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(t);return void 0!==e&&(r=r.toString(e)),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}};var So={};const Eo=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];So.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],o=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],u=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49];let d=l^(i<<1|o>>>31),f=h^(o<<1|i>>>31);const p=t[0]^d,g=t[1]^f,y=t[10]^d,b=t[11]^f,m=t[20]^d,v=t[21]^f,w=t[30]^d,_=t[31]^f,S=t[40]^d,E=t[41]^f;d=r^(s<<1|a>>>31),f=n^(a<<1|s>>>31);const M=t[2]^d,x=t[3]^f,k=t[12]^d,C=t[13]^f,I=t[22]^d,R=t[23]^f,A=t[32]^d,N=t[33]^f,j=t[42]^d,O=t[43]^f;d=i^(u<<1|c>>>31),f=o^(c<<1|u>>>31);const T=t[4]^d,P=t[5]^f,L=t[14]^d,D=t[15]^f,B=t[24]^d,F=t[25]^f,U=t[34]^d,V=t[35]^f,H=t[44]^d,z=t[45]^f;d=s^(l<<1|h>>>31),f=a^(h<<1|l>>>31);const W=t[6]^d,q=t[7]^f,J=t[16]^d,$=t[17]^f,Z=t[26]^d,G=t[27]^f,Q=t[36]^d,Y=t[37]^f,K=t[46]^d,X=t[47]^f;d=u^(r<<1|n>>>31),f=c^(n<<1|r>>>31);const tt=t[8]^d,et=t[9]^f,rt=t[18]^d,nt=t[19]^f,it=t[28]^d,ot=t[29]^f,st=t[38]^d,at=t[39]^f,ut=t[48]^d,ct=t[49]^f,lt=p,ht=g,dt=b<<4|y>>>28,ft=y<<4|b>>>28,pt=m<<3|v>>>29,gt=v<<3|m>>>29,yt=_<<9|w>>>23,bt=w<<9|_>>>23,mt=S<<18|E>>>14,vt=E<<18|S>>>14,wt=M<<1|x>>>31,_t=x<<1|M>>>31,St=C<<12|k>>>20,Et=k<<12|C>>>20,Mt=I<<10|R>>>22,xt=R<<10|I>>>22,kt=N<<13|A>>>19,Ct=A<<13|N>>>19,It=j<<2|O>>>30,Rt=O<<2|j>>>30,At=P<<30|T>>>2,Nt=T<<30|P>>>2,jt=L<<6|D>>>26,Ot=D<<6|L>>>26,Tt=F<<11|B>>>21,Pt=B<<11|F>>>21,Lt=U<<15|V>>>17,Dt=V<<15|U>>>17,Bt=z<<29|H>>>3,Ft=H<<29|z>>>3,Ut=W<<28|q>>>4,Vt=q<<28|W>>>4,Ht=$<<23|J>>>9,zt=J<<23|$>>>9,Wt=Z<<25|G>>>7,qt=G<<25|Z>>>7,Jt=Q<<21|Y>>>11,$t=Y<<21|Q>>>11,Zt=X<<24|K>>>8,Gt=K<<24|X>>>8,Qt=tt<<27|et>>>5,Yt=et<<27|tt>>>5,Kt=rt<<20|nt>>>12,Xt=nt<<20|rt>>>12,te=ot<<7|it>>>25,ee=it<<7|ot>>>25,re=st<<8|at>>>24,ne=at<<8|st>>>24,ie=ut<<14|ct>>>18,oe=ct<<14|ut>>>18;t[0]=lt^~St&Tt,t[1]=ht^~Et&Pt,t[10]=Ut^~Kt&pt,t[11]=Vt^~Xt>,t[20]=wt^~jt&Wt,t[21]=_t^~Ot&qt,t[30]=Qt^~dt&Mt,t[31]=Yt^~ft&xt,t[40]=At^~Ht&te,t[41]=Nt^~zt&ee,t[2]=St^~Tt&Jt,t[3]=Et^~Pt&$t,t[12]=Kt^~pt&kt,t[13]=Xt^~gt&Ct,t[22]=jt^~Wt&re,t[23]=Ot^~qt&ne,t[32]=dt^~Mt&Lt,t[33]=ft^~xt&Dt,t[42]=Ht^~te&yt,t[43]=zt^~ee&bt,t[4]=Tt^~Jt&ie,t[5]=Pt^~$t&oe,t[14]=pt^~kt&Bt,t[15]=gt^~Ct&Ft,t[24]=Wt^~re&mt,t[25]=qt^~ne&vt,t[34]=Mt^~Lt&Zt,t[35]=xt^~Dt&Gt,t[44]=te^~yt&It,t[45]=ee^~bt&Rt,t[6]=Jt^~ie<,t[7]=$t^~oe&ht,t[16]=kt^~Bt&Ut,t[17]=Ct^~Ft&Vt,t[26]=re^~mt&wt,t[27]=ne^~vt&_t,t[36]=Lt^~Zt&Qt,t[37]=Dt^~Gt&Yt,t[46]=yt^~It&At,t[47]=bt^~Rt&Nt,t[8]=ie^~lt&St,t[9]=oe^~ht&Et,t[18]=Bt^~Ut&Kt,t[19]=Ft^~Vt&Xt,t[28]=mt^~wt&jt,t[29]=vt^~_t&Ot,t[38]=Zt^~Qt&dt,t[39]=Gt^~Yt&ft,t[48]=It^~At&Ht,t[49]=Rt^~Nt&zt,t[0]^=Eo[2*e],t[1]^=Eo[2*e+1]}};const Mo=So;function xo(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}xo.prototype.initialize=function(t,e){for(let t=0;t<50;++t)this.state[t]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},xo.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(Mo.p1600(this.state),this.count=0)},xo.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<this.count%4*8,0!=(128&t)&&this.count===this.blockSize-1&&Mo.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,Mo.p1600(this.state),this.count=0,this.squeezing=!0},xo.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=Buffer.alloc(t);for(let r=0;r<t;++r)e[r]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(Mo.p1600(this.state),this.count=0);return e},xo.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var ko=function(t){const e=wo(t),r=_o(t);return function(t,n){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new e(1152,448,null,224,n);case"keccak256":return new e(1088,512,null,256,n);case"keccak384":return new e(832,768,null,384,n);case"keccak512":return new e(576,1024,null,512,n);case"sha3-224":return new e(1152,448,6,224,n);case"sha3-256":return new e(1088,512,6,256,n);case"sha3-384":return new e(832,768,6,384,n);case"sha3-512":return new e(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+t)}}}(xo);const Co=ko,Io=S.exports;function Ro(t){return Buffer.allocUnsafe(t).fill(0)}function Ao(t,e,r){const n=Ro(e);return t=No(t),r?t.length<e?(t.copy(n),n):t.slice(0,e):t.length<e?(t.copy(n,e-t.length),n):t.slice(-e)}function No(t){if(!Buffer.isBuffer(t))if(Array.isArray(t))t=Buffer.from(t);else if("string"==typeof t)t=jo(t)?Buffer.from((e=Oo(t)).length%2?"0"+e:e,"hex"):Buffer.from(t);else if("number"==typeof t)t=intToBuffer(t);else if(null==t)t=Buffer.allocUnsafe(0);else if(Io.isBN(t))t=t.toArrayLike(Buffer);else{if(!t.toArray)throw new Error("invalid type");t=Buffer.from(t.toArray())}var e;return t}function jo(t){return"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]*$/)}function Oo(t){return"string"==typeof t&&t.startsWith("0x")?t.slice(2):t}var To={zeros:Ro,setLength:Ao,setLengthRight:function(t,e){return Ao(t,e,!0)},isHexString:jo,stripHexPrefix:Oo,toBuffer:No,bufferToHex:function(t){return"0x"+(t=No(t)).toString("hex")},keccak:function(t,e){return t=No(t),e||(e=256),Co("keccak"+e).update(t).digest()}};const Po=To,Lo=S.exports;function Do(t){return t.startsWith("int[")?"int256"+t.slice(3):"int"===t?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):"uint"===t?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):"fixed"===t?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):"ufixed"===t?"ufixed128x128":t}function Bo(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function Fo(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function Uo(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?""===e[2]?"dynamic":parseInt(e[2],10):null}function Vo(t){var e=typeof t;if("string"===e)return Po.isHexString(t)?new Lo(Po.stripHexPrefix(t),16):new Lo(t,10);if("number"===e)return new Lo(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function Ho(t,e){var r,n,i,o;if("address"===t)return Ho("uint160",Vo(e));if("bool"===t)return Ho("uint8",e?1:0);if("string"===t)return Ho("bytes",new Buffer(e,"utf8"));if(function(t){return t.lastIndexOf("]")===t.length-1}(t)){if(void 0===e.length)throw new Error("Not an array?");if("dynamic"!==(r=Uo(t))&&0!==r&&e.length>r)throw new Error("Elements exceed array size: "+r);for(o in i=[],t=t.slice(0,t.lastIndexOf("[")),"string"==typeof e&&(e=JSON.parse(e)),e)i.push(Ho(t,e[o]));if("dynamic"===r){var s=Ho("uint256",e.length);i.unshift(s)}return Buffer.concat(i)}if("bytes"===t)return e=new Buffer(e),i=Buffer.concat([Ho("uint256",e.length),e]),e.length%32!=0&&(i=Buffer.concat([i,Po.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if((r=Bo(t))<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return Po.setLengthRight(e,32)}if(t.startsWith("uint")){if((r=Bo(t))%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if((n=Vo(e)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}if(t.startsWith("int")){if((r=Bo(t))%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if((n=Vo(e)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}if(t.startsWith("ufixed")){if(r=Fo(t),(n=Vo(e))<0)throw new Error("Supplied ufixed is negative");return Ho("uint256",n.mul(new Lo(2).pow(new Lo(r[1]))))}if(t.startsWith("fixed"))return r=Fo(t),Ho("int256",Vo(e).mul(new Lo(2).pow(new Lo(r[1]))));throw new Error("Unsupported or invalid type: "+t)}function zo(t){return"string"===t||"bytes"===t||"dynamic"===Uo(t)}function Wo(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],o=0;o<t.length;o++){var s=Do(t[o]),a=e[o];if("bytes"===s)i.push(a);else if("string"===s)i.push(new Buffer(a,"utf8"));else if("bool"===s)i.push(new Buffer(a?"01":"00","hex"));else if("address"===s)i.push(Po.setLength(a,20));else if(s.startsWith("bytes")){if((r=Bo(s))<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(Po.setLengthRight(a,r))}else if(s.startsWith("uint")){if((r=Bo(s))%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if((n=Vo(a)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else{if(!s.startsWith("int"))throw new Error("Unsupported or invalid type: "+s);if((r=Bo(s))%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if((n=Vo(a)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}}return Buffer.concat(i)}var qo={rawEncode:function(t,e){var r=[],n=[],i=32*t.length;for(var o in t){var s=Do(t[o]),a=Ho(s,e[o]);zo(s)?(r.push(Ho("uint256",i)),n.push(a),i+=a.length):r.push(a)}return Buffer.concat(r.concat(n))},solidityPack:Wo,soliditySHA3:function(t,e){return Po.keccak(Wo(t,e))}};const Jo=To,$o=qo,Zo={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Go={encodeData(t,e,r,n=!0){const i=["bytes32"],o=[this.hashType(t,r)];if(n){const s=(t,e,i)=>{if(void 0!==r[e])return["bytes32",null==i?"0x0000000000000000000000000000000000000000000000000000000000000000":Jo.keccak(this.encodeData(e,i,r,n))];if(void 0===i)throw new Error(`missing value for field ${t} of type ${e}`);if("bytes"===e)return["bytes32",Jo.keccak(i)];if("string"===e)return"string"==typeof i&&(i=Buffer.from(i,"utf8")),["bytes32",Jo.keccak(i)];if(e.lastIndexOf("]")===e.length-1){const r=e.slice(0,e.lastIndexOf("[")),n=i.map((e=>s(t,r,e)));return["bytes32",Jo.keccak($o.rawEncode(n.map((([t])=>t)),n.map((([,t])=>t))))]}return[e,i]};for(const n of r[t]){const[t,r]=s(n.name,n.type,e[n.name]);i.push(t),o.push(r)}}else for(const s of r[t]){let t=e[s.name];if(void 0!==t)if("bytes"===s.type)i.push("bytes32"),t=Jo.keccak(t),o.push(t);else if("string"===s.type)i.push("bytes32"),"string"==typeof t&&(t=Buffer.from(t,"utf8")),t=Jo.keccak(t),o.push(t);else if(void 0!==r[s.type])i.push("bytes32"),t=Jo.keccak(this.encodeData(s.type,t,r,n)),o.push(t);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(s.type),o.push(t)}}return $o.rawEncode(i,o)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter((e=>e!==t));n=[t].concat(n.sort());for(const t of n){if(!e[t])throw new Error("No type definition specified: "+t);r+=t+"("+e[t].map((({name:t,type:e})=>e+" "+t)).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||void 0===e[t])return r;r.push(t);for(const n of e[t])for(const t of this.findTypeDependencies(n.type,e,r))!r.includes(t)&&r.push(t);return r},hashStruct(t,e,r,n=!0){return Jo.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return Jo.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in Zo.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),"EIP712Domain"!==r.primaryType&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),Jo.keccak(Buffer.concat(n))}};var Qo={TYPED_MESSAGE_SCHEMA:Zo,TypedDataUtils:Go,hashForSignTypedDataLegacy:function(t){return function(t){const e=new Error("Expect argument to be non-empty array");if("object"!=typeof t||!t.length)throw e;const r=t.map((function(t){return"bytes"===t.type?Jo.toBuffer(t.value):t.value})),n=t.map((function(t){return t.type})),i=t.map((function(t){if(!t.name)throw e;return t.type+" "+t.name}));return $o.soliditySHA3(["bytes32","bytes32"],[$o.soliditySHA3(new Array(t.length).fill("string"),i),$o.soliditySHA3(n,r)])}(t.data)},hashForSignTypedData_v3:function(t){return Go.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Go.hash(t.data)}};var Yo={};Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.filterFromParam=Yo.FilterPolyfill=void 0;const Ko=Vn,Xo=fe,ts={jsonrpc:"2.0",id:0};function es(t){return{fromBlock:ns(t.fromBlock),toBlock:ns(t.toBlock),addresses:void 0===t.address?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}function rs(t){const e={fromBlock:is(t.fromBlock),toBlock:is(t.toBlock),topics:t.topics};return null!==t.addresses&&(e.address=t.addresses),e}function ns(t){if(void 0===t||"latest"===t||"pending"===t)return"latest";if("earliest"===t)return(0,Ko.IntNumber)(0);if((0,Xo.isHexString)(t))return(0,Xo.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function is(t){return"latest"===t?t:(0,Xo.hexStringFromIntNumber)(t)}function os(){return Object.assign(Object.assign({},ts),{error:{code:-32e3,message:"filter not found"}})}function ss(){return Object.assign(Object.assign({},ts),{result:[]})}Yo.FilterPolyfill=class{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Ko.IntNumber)(1),this.provider=t}async newFilter(t){const e=es(t),r=this.makeFilterId(),n=await this.setInitialCursorPosition(r,e.fromBlock);return console.log(`Installing new log filter(${r}):`,e,"initial cursor position:",n),this.logFilters.set(r,e),this.setFilterTimeout(r),(0,Xo.hexStringFromIntNumber)(r)}async newBlockFilter(){const t=this.makeFilterId(),e=await this.setInitialCursorPosition(t,"latest");return console.log(`Installing new block filter (${t}) with initial cursor position:`,e),this.blockFilters.add(t),this.setFilterTimeout(t),(0,Xo.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),e=await this.setInitialCursorPosition(t,"latest");return console.log(`Installing new block filter (${t}) with initial cursor position:`,e),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,Xo.hexStringFromIntNumber)(t)}uninstallFilter(t){const e=(0,Xo.intNumberFromHexString)(t);return console.log(`Uninstalling filter (${e})`),this.deleteFilter(e),!0}getFilterChanges(t){const e=(0,Xo.intNumberFromHexString)(t);return this.timeouts.has(e)&&this.setFilterTimeout(e),this.logFilters.has(e)?this.getLogFilterChanges(e):this.blockFilters.has(e)?this.getBlockFilterChanges(e):this.pendingTransactionFilters.has(e)?this.getPendingTransactionFilterChanges(e):Promise.resolve(os())}async getFilterLogs(t){const e=(0,Xo.intNumberFromHexString)(t),r=this.logFilters.get(e);return r?this.sendAsyncPromise(Object.assign(Object.assign({},ts),{method:"eth_getLogs",params:[rs(r)]})):os()}makeFilterId(){return(0,Ko.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise(((e,r)=>{this.provider.sendAsync(t,((t,n)=>t?r(t):Array.isArray(n)||null==n?r(new Error(`unexpected response received: ${JSON.stringify(n)}`)):void e(n)))}))}deleteFilter(t){console.log(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const e=this.logFilters.get(t),r=this.cursors.get(t);if(!r||!e)return os();const n=await this.getCurrentBlockHeight(),i="latest"===e.toBlock?n:e.toBlock;if(r>n)return ss();if(r>e.toBlock)return ss();console.log(`Fetching logs from ${r} to ${i} for filter ${t}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},ts),{method:"eth_getLogs",params:[rs(Object.assign(Object.assign({},e),{fromBlock:r,toBlock:i}))]}));if(Array.isArray(o.result)){const e=o.result.map((t=>(0,Xo.intNumberFromHexString)(t.blockNumber||"0x0"))),n=Math.max(...e);if(n&&n>r){const e=(0,Ko.IntNumber)(n+1);console.log(`Moving cursor position for filter (${t}) from ${r} to ${e}`),this.cursors.set(t,e)}}return o}async getBlockFilterChanges(t){const e=this.cursors.get(t);if(!e)return os();const r=await this.getCurrentBlockHeight();if(e>r)return ss();console.log(`Fetching blocks from ${e} to ${r} for filter (${t})`);const n=(await Promise.all((0,Xo.range)(e,r+1).map((t=>this.getBlockHashByNumber((0,Ko.IntNumber)(t)))))).filter((t=>!!t)),i=(0,Ko.IntNumber)(e+n.length);return console.log(`Moving cursor position for filter (${t}) from ${e} to ${i}`),this.cursors.set(t,i),Object.assign(Object.assign({},ts),{result:n})}async getPendingTransactionFilterChanges(t){return Promise.resolve(ss())}async setInitialCursorPosition(t,e){const r=await this.getCurrentBlockHeight(),n="number"==typeof e&&e>r?e:r;return this.cursors.set(t,n),n}setFilterTimeout(t){const e=this.timeouts.get(t);e&&window.clearTimeout(e);const r=window.setTimeout((()=>{console.log(`Filter (${t}) timed out`),this.deleteFilter(t)}),3e5);this.timeouts.set(t,r)}async getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},ts),{method:"eth_blockNumber",params:[]}));return(0,Xo.intNumberFromHexString)((0,Xo.ensureHexString)(t))}async getBlockHashByNumber(t){const e=await this.sendAsyncPromise(Object.assign(Object.assign({},ts),{method:"eth_getBlockByNumber",params:[(0,Xo.hexStringFromIntNumber)(t),!1]}));return e.result&&"string"==typeof e.result.hash?(0,Xo.ensureHexString)(e.result.hash):null}},Yo.filterFromParam=es;var as={};!function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,(e=t.JSONRPCMethod||(t.JSONRPCMethod={})).eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(as);var us={},cs={},ls={},hs=function(t){var e=(t=t||{}).max||Number.MAX_SAFE_INTEGER,r=void 0!==t.start?t.start:Math.floor(Math.random()*e);return function(){return r%=e,r++}};const ds=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let t=0;t<arguments.length;t++)n[t]=arguments[t];return new r(((r,i)=>{e.errorFirst?n.push((function(t,n){if(e.multiArgs){const e=new Array(arguments.length-1);for(let t=1;t<arguments.length;t++)e[t-1]=arguments[t];t?(e.unshift(t),i(e)):r(e)}else t?i(t):r(n)})):n.push((function(t){if(e.multiArgs){const t=new Array(arguments.length-1);for(let e=0;e<arguments.length;e++)t[e]=arguments[e];r(t)}else r(t)})),t.apply(this,n)}))};var fs={},ps=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fs,"__esModule",{value:!0}),fs.BaseBlockTracker=void 0;const gs=ps(m),ys=(t,e)=>t+e,bs=["sync","latest"];class ms extends gs.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||2e4,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){if(this._currentBlock)return this._currentBlock;return await new Promise((t=>this.once("latest",t)))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){bs.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return bs.map((t=>this.listenerCount(t))).reduce(ys)}_newPotentialLatest(t){const e=this._currentBlock;e&&vs(t)<=vs(e)||this._setCurrentBlock(t)}_setCurrentBlock(t){const e=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:e,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}function vs(t){return Number.parseInt(t,16)}fs.BaseBlockTracker=ms;var ws={},_s={},Ss={};class Es extends TypeError{constructor(t,e){let r;const{message:n,explanation:i,...o}=t,{path:s}=t,a=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...e()])}}function Ms(t){return"object"==typeof t&&null!=t}function xs(t){if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function ks(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function Cs(t,e,r,n){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:i,branch:o}=e,{type:s}=r,{refinement:a,message:u=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${ks(n)}\``}=t;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...t,message:u}}function*Is(t,e,r,n){(function(t){return Ms(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const i of t){const t=Cs(i,e,r,n);t&&(yield t)}}function*Rs(t,e,r={}){const{path:n=[],branch:i=[t],coerce:o=!1,mask:s=!1}=r,a={path:n,branch:i};if(o&&(t=e.coercer(t,a),s&&"type"!==e.type&&Ms(e.schema)&&Ms(t)&&!Array.isArray(t)))for(const r in t)void 0===e.schema[r]&&delete t[r];let u="valid";for(const n of e.validator(t,a))n.explanation=r.message,u="not_valid",yield[n,void 0];for(let[c,l,h]of e.entries(t,a)){const e=Rs(l,h,{path:void 0===c?n:[...n,c],branch:void 0===c?i:[...i,l],coerce:o,mask:s,message:r.message});for(const r of e)r[0]?(u=null!=r[0].refinement?"not_refined":"not_valid",yield[r[0],void 0]):o&&(l=r[1],void 0===c?t=l:t instanceof Map?t.set(c,l):t instanceof Set?t.add(l):Ms(t)&&(void 0!==l||c in t)&&(t[c]=l))}if("not_valid"!==u)for(const n of e.refiner(t,a))n.explanation=r.message,u="not_refined",yield[n,void 0];"valid"===u&&(yield[void 0,t])}class As{constructor(t){const{type:e,schema:r,validator:n,refiner:i,coercer:o=(t=>t),entries:s=function*(){}}=t;this.type=e,this.schema=r,this.entries=s,this.coercer=o,this.validator=n?(t,e)=>Is(n(t,e),e,this,t):()=>[],this.refiner=i?(t,e)=>Is(i(t,e),e,this,t):()=>[]}assert(t,e){return Ns(t,this,e)}create(t,e){return js(t,this,e)}is(t){return Ts(t,this)}mask(t,e){return Os(t,this,e)}validate(t,e={}){return Ps(t,this,e)}}function Ns(t,e,r){const n=Ps(t,e,{message:r});if(n[0])throw n[0]}function js(t,e,r){const n=Ps(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Os(t,e,r){const n=Ps(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Ts(t,e){return!Ps(t,e)[0]}function Ps(t,e,r={}){const n=Rs(t,e,r),i=function(t){const{done:e,value:r}=t.next();return e?void 0:r}(n);if(i[0]){const t=new Es(i[0],(function*(){for(const t of n)t[0]&&(yield t[0])}));return[t,void 0]}return[void 0,i[1]]}function Ls(t,e){return new As({type:t,schema:null,validator:e})}function Ds(){return Ls("never",(()=>!1))}function Bs(t){const e=t?Object.keys(t):[],r=Ds();return new As({type:"object",schema:t||null,*entries(n){if(t&&Ms(n)){const i=new Set(Object.keys(n));for(const r of e)i.delete(r),yield[r,n[r],t[r]];for(const t of i)yield[t,n[t],r]}},validator:t=>Ms(t)||`Expected an object, but received: ${ks(t)}`,coercer:t=>Ms(t)?{...t}:t})}function Fs(t){return new As({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})}function Us(){return Ls("string",(t=>"string"==typeof t||`Expected a string, but received: ${ks(t)}`))}function Vs(t){const e=Object.keys(t);return new As({type:"type",schema:t,*entries(r){if(Ms(r))for(const n of e)yield[n,r[n],t[n]]},validator:t=>Ms(t)||`Expected an object, but received: ${ks(t)}`,coercer:t=>Ms(t)?{...t}:t})}function Hs(){return Ls("unknown",(()=>!0))}function zs(t,e,r){return new As({...t,coercer:(n,i)=>Ts(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function Ws(t){return t instanceof Map||t instanceof Set?t.size:t.length}function qs(t,e,r){return new As({...t,*refiner(n,i){yield*t.refiner(n,i);const o=Is(r(n,i),i,t,n);for(const t of o)yield{...t,refinement:e}}})}var Js=Object.freeze({__proto__:null,Struct:As,StructError:Es,any:function(){return Ls("any",(()=>!0))},array:function(t){return new As({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${ks(t)}`})},assert:Ns,assign:function(...t){const e="type"===t[0].type,r=t.map((t=>t.schema)),n=Object.assign({},...r);return e?Vs(n):Bs(n)},bigint:function(){return Ls("bigint",(t=>"bigint"==typeof t))},boolean:function(){return Ls("boolean",(t=>"boolean"==typeof t))},coerce:zs,create:js,date:function(){return Ls("date",(t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${ks(t)}`))},defaulted:function(t,e,r={}){return zs(t,Hs(),(t=>{const n="function"==typeof e?e():e;if(void 0===t)return n;if(!r.strict&&xs(t)&&xs(n)){const e={...t};let r=!1;for(const t in n)void 0===e[t]&&(e[t]=n[t],r=!0);if(r)return e}return t}))},define:Ls,deprecated:function(t,e){return new As({...t,refiner:(e,r)=>void 0===e||t.refiner(e,r),validator:(r,n)=>void 0===r||(e(r,n),t.validator(r,n))})},dynamic:function(t){return new As({type:"dynamic",schema:null,*entries(e,r){const n=t(e,r);yield*n.entries(e,r)},validator:(e,r)=>t(e,r).validator(e,r),coercer:(e,r)=>t(e,r).coercer(e,r),refiner:(e,r)=>t(e,r).refiner(e,r)})},empty:function(t){return qs(t,"empty",(e=>{const r=Ws(e);return 0===r||`Expected an empty ${t.type} but received one with a size of \`${r}\``}))},enums:function(t){const e={},r=t.map((t=>ks(t))).join();for(const r of t)e[r]=r;return new As({type:"enums",schema:e,validator:e=>t.includes(e)||`Expected one of \`${r}\`, but received: ${ks(e)}`})},func:function(){return Ls("func",(t=>"function"==typeof t||`Expected a function, but received: ${ks(t)}`))},instance:function(t){return Ls("instance",(e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${ks(e)}`))},integer:function(){return Ls("integer",(t=>"number"==typeof t&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${ks(t)}`))},intersection:function(t){return new As({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})},is:Ts,lazy:function(t){let e;return new As({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator:(r,n)=>(e??(e=t()),e.validator(r,n)),coercer:(r,n)=>(e??(e=t()),e.coercer(r,n)),refiner:(r,n)=>(e??(e=t()),e.refiner(r,n))})},literal:function(t){const e=ks(t),r=typeof t;return new As({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||`Expected the literal \`${e}\`, but received: ${ks(r)}`})},map:function(t,e){return new As({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer:t=>t instanceof Map?new Map(t):t,validator:t=>t instanceof Map||`Expected a \`Map\` object, but received: ${ks(t)}`})},mask:Os,max:function(t,e,r={}){const{exclusive:n}=r;return qs(t,"max",(r=>n?r<e:r<=e||`Expected a ${t.type} less than ${n?"":"or equal to "}${e} but received \`${r}\``))},min:function(t,e,r={}){const{exclusive:n}=r;return qs(t,"min",(r=>n?r>e:r>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${r}\``))},never:Ds,nonempty:function(t){return qs(t,"nonempty",(e=>Ws(e)>0||`Expected a nonempty ${t.type} but received an empty one`))},nullable:function(t){return new As({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})},number:function(){return Ls("number",(t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${ks(t)}`))},object:Bs,omit:function(t,e){const{schema:r}=t,n={...r};for(const t of e)delete n[t];return"type"===t.type?Vs(n):Bs(n)},optional:Fs,partial:function(t){const e=t instanceof As?{...t.schema}:{...t};for(const t in e)e[t]=Fs(e[t]);return Bs(e)},pattern:function(t,e){return qs(t,"pattern",(r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`))},pick:function(t,e){const{schema:r}=t,n={};for(const t of e)n[t]=r[t];return Bs(n)},record:function(t,e){return new As({type:"record",schema:null,*entries(r){if(Ms(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator:t=>Ms(t)||`Expected an object, but received: ${ks(t)}`})},refine:qs,regexp:function(){return Ls("regexp",(t=>t instanceof RegExp))},set:function(t){return new As({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer:t=>t instanceof Set?new Set(t):t,validator:t=>t instanceof Set||`Expected a \`Set\` object, but received: ${ks(t)}`})},size:function(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return qs(t,"size",(t=>{if("number"==typeof t||t instanceof Date)return e<=t&&t<=r||`${n} ${i} but received \`${t}\``;if(t instanceof Map||t instanceof Set){const{size:o}=t;return e<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}{const{length:o}=t;return e<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}}))},string:Us,struct:function(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Ls(t,e)},trimmed:function(t){return zs(t,Us(),(t=>t.trim()))},tuple:function(t){const e=Ds();return new As({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator:t=>Array.isArray(t)||`Expected an array, but received: ${ks(t)}`})},type:Vs,union:function(t){const e=t.map((t=>t.type)).join(" | ");return new As({type:"union",schema:null,coercer(e){for(const r of t){const[t,n]=r.validate(e,{coerce:!0});if(!t)return n}return e},validator(r,n){const i=[];for(const e of t){const[...t]=Rs(r,e,n),[o]=t;if(!o[0])return[];for(const[e]of t)e&&i.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${ks(r)}`,...i]}})},unknown:Hs,validate:Ps}),$s=e(Js);Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.assertExhaustive=Ss.assertStruct=Ss.assert=Ss.AssertionError=void 0;const Zs=$s;function Gs(t,e){return r=t,Boolean("string"==typeof(null===(i=null===(n=null==r?void 0:r.prototype)||void 0===n?void 0:n.constructor)||void 0===i?void 0:i.name))?new t({message:e}):t({message:e});var r,n,i}class Qs extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}Ss.AssertionError=Qs,Ss.assert=function(t,e="Assertion failed.",r=Qs){if(!t){if(e instanceof Error)throw e;throw Gs(r,e)}},Ss.assertStruct=function(t,e,r="Assertion failed",n=Qs){try{(0,Zs.assert)(t,e)}catch(t){throw Gs(n,`${r}: ${function(t){const e=function(t){return"object"==typeof t&&null!==t&&"message"in t}(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}(t)}.`)}},Ss.assertExhaustive=function(t){throw new Error("Invalid branch reached. Should be detected during compilation.")};var Ys={};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.base64=void 0;const Ks=$s,Xs=Ss;Ys.base64=(t,e={})=>{var r,n;const i=null!==(r=e.paddingRequired)&&void 0!==r&&r,o=null!==(n=e.characterSet)&&void 0!==n?n:"base64";let s,a;return"base64"===o?s=String.raw`[A-Za-z0-9+\/]`:((0,Xs.assert)("base64url"===o),s=String.raw`[-_A-Za-z0-9]`),a=i?new RegExp(`^(?:${s}{4})*(?:${s}{3}=|${s}{2}==)?$`,"u"):new RegExp(`^(?:${s}{4})*(?:${s}{2,3}|${s}{3}=|${s}{2}==)?$`,"u"),(0,Ks.pattern)(t,a)};var ta={},ea={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=$s,r=Ss;function n(r){return(0,e.is)(r,t.HexStruct)}function i(r){return(0,e.is)(r,t.StrictHexStruct)}t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu),t.isHexString=n,t.isStrictHexString=i,t.assertIsHexString=function(t){(0,r.assert)(n(t),"Value must be a hexadecimal string.")},t.assertIsStrictHexString=function(t){(0,r.assert)(i(t),'Value must be a hexadecimal string, starting with "0x".')},t.add0x=function(t){return t.startsWith("0x")?t:t.startsWith("0X")?`0x${t.substring(2)}`:`0x${t}`},t.remove0x=function(t){return t.startsWith("0x")||t.startsWith("0X")?t.substring(2):t}}(ea),Object.defineProperty(ta,"__esModule",{value:!0}),ta.createDataView=ta.concatBytes=ta.valueToBytes=ta.stringToBytes=ta.numberToBytes=ta.signedBigIntToBytes=ta.bigIntToBytes=ta.hexToBytes=ta.bytesToString=ta.bytesToNumber=ta.bytesToSignedBigInt=ta.bytesToBigInt=ta.bytesToHex=ta.assertIsBytes=ta.isBytes=void 0;const ra=Ss,na=ea,ia=48,oa=58,sa=87;const aa=function(){const t=[];return()=>{if(0===t.length)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}();function ua(t){return t instanceof Uint8Array}function ca(t){(0,ra.assert)(ua(t),"Value must be a Uint8Array.")}function la(t){if(ca(t),0===t.length)return"0x";const e=aa(),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=e[t[n]];return(0,na.add0x)(r.join(""))}function ha(t){ca(t);const e=la(t);return BigInt(e)}function da(t){var e;if("0x"===(null===(e=null==t?void 0:t.toLowerCase)||void 0===e?void 0:e.call(t)))return new Uint8Array;(0,na.assertIsHexString)(t);const r=(0,na.remove0x)(t).toLowerCase(),n=r.length%2==0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let t=0;t<i.length;t++){const e=n.charCodeAt(2*t),r=n.charCodeAt(2*t+1),o=e-(e<oa?ia:sa),s=r-(r<oa?ia:sa);i[t]=16*o+s}return i}function fa(t){(0,ra.assert)("bigint"==typeof t,"Value must be a bigint."),(0,ra.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");return da(t.toString(16))}function pa(t){(0,ra.assert)("number"==typeof t,"Value must be a number."),(0,ra.assert)(t>=0,"Value must be a non-negative number."),(0,ra.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");return da(t.toString(16))}function ga(t){return(0,ra.assert)("string"==typeof t,"Value must be a string."),(new TextEncoder).encode(t)}function ya(t){if("bigint"==typeof t)return fa(t);if("number"==typeof t)return pa(t);if("string"==typeof t)return t.startsWith("0x")?da(t):ga(t);if(ua(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}ta.isBytes=ua,ta.assertIsBytes=ca,ta.bytesToHex=la,ta.bytesToBigInt=ha,ta.bytesToSignedBigInt=function(t){ca(t);let e=BigInt(0);for(const r of t)e=(e<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*t.length,e)},ta.bytesToNumber=function(t){ca(t);const e=ha(t);return(0,ra.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)},ta.bytesToString=function(t){return ca(t),(new TextDecoder).decode(t)},ta.hexToBytes=da,ta.bigIntToBytes=fa,ta.signedBigIntToBytes=function(t,e){(0,ra.assert)("bigint"==typeof t,"Value must be a bigint."),(0,ra.assert)("number"==typeof e,"Byte length must be a number."),(0,ra.assert)(e>0,"Byte length must be greater than 0."),(0,ra.assert)(function(t,e){(0,ra.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(8*e-1))}(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let t=0;t<n.length;t++)n[t]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()},ta.numberToBytes=pa,ta.stringToBytes=ga,ta.valueToBytes=ya,ta.concatBytes=function(t){const e=new Array(t.length);let r=0;for(let n=0;n<t.length;n++){const i=ya(t[n]);e[n]=i,r+=i.length}const n=new Uint8Array(r);for(let t=0,r=0;t<e.length;t++)n.set(e[t],r),r+=e[t].length;return n},ta.createDataView=function(t){if("undefined"!=typeof Buffer&&t instanceof Buffer){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)};var ba={};Object.defineProperty(ba,"__esModule",{value:!0}),ba.ChecksumStruct=void 0;const ma=$s,va=Ys;ba.ChecksumStruct=(0,ma.size)((0,va.base64)((0,ma.string)(),{paddingRequired:!0}),44,44);var wa={};Object.defineProperty(wa,"__esModule",{value:!0}),wa.createHex=wa.createBytes=wa.createBigInt=wa.createNumber=void 0;const _a=$s,Sa=Ss,Ea=ta,Ma=ea,xa=(0,_a.union)([(0,_a.number)(),(0,_a.bigint)(),(0,_a.string)(),Ma.StrictHexStruct]),ka=(0,_a.coerce)((0,_a.number)(),xa,Number),Ca=(0,_a.coerce)((0,_a.bigint)(),xa,BigInt);(0,_a.union)([Ma.StrictHexStruct,(0,_a.instance)(Uint8Array)]);const Ia=(0,_a.coerce)((0,_a.instance)(Uint8Array),(0,_a.union)([Ma.StrictHexStruct]),Ea.hexToBytes),Ra=(0,_a.coerce)(Ma.StrictHexStruct,(0,_a.instance)(Uint8Array),Ea.bytesToHex);wa.createNumber=function(t){try{const e=(0,_a.create)(t,ka);return(0,Sa.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){if(e instanceof _a.StructError)throw new Error(`Expected a number-like value, got "${t}".`);throw e}},wa.createBigInt=function(t){try{return(0,_a.create)(t,Ca)}catch(t){if(t instanceof _a.StructError)throw new Error(`Expected a number-like value, got "${String(t.value)}".`);throw t}},wa.createBytes=function(t){if("string"==typeof t&&"0x"===t.toLowerCase())return new Uint8Array;try{return(0,_a.create)(t,Ia)}catch(t){if(t instanceof _a.StructError)throw new Error(`Expected a bytes-like value, got "${String(t.value)}".`);throw t}},wa.createHex=function(t){if(t instanceof Uint8Array&&0===t.length||"string"==typeof t&&"0x"===t.toLowerCase())return"0x";try{return(0,_a.create)(t,Ra)}catch(t){if(t instanceof _a.StructError)throw new Error(`Expected a bytes-like value, got "${String(t.value)}".`);throw t}};var Aa,Na,ja={},Oa=t&&t.__classPrivateFieldSet||function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},Ta=t&&t.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};Object.defineProperty(ja,"__esModule",{value:!0}),ja.FrozenSet=ja.FrozenMap=void 0;class Pa{constructor(t){Aa.set(this,void 0),Oa(this,Aa,new Map(t),"f"),Object.freeze(this)}get size(){return Ta(this,Aa,"f").size}[(Aa=new WeakMap,Symbol.iterator)](){return Ta(this,Aa,"f")[Symbol.iterator]()}entries(){return Ta(this,Aa,"f").entries()}forEach(t,e){return Ta(this,Aa,"f").forEach(((r,n,i)=>t.call(e,r,n,this)))}get(t){return Ta(this,Aa,"f").get(t)}has(t){return Ta(this,Aa,"f").has(t)}keys(){return Ta(this,Aa,"f").keys()}values(){return Ta(this,Aa,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([t,e])=>`${String(t)} => ${String(e)}`)).join(", ")} `:""}}`}}ja.FrozenMap=Pa;class La{constructor(t){Na.set(this,void 0),Oa(this,Na,new Set(t),"f"),Object.freeze(this)}get size(){return Ta(this,Na,"f").size}[(Na=new WeakMap,Symbol.iterator)](){return Ta(this,Na,"f")[Symbol.iterator]()}entries(){return Ta(this,Na,"f").entries()}forEach(t,e){return Ta(this,Na,"f").forEach(((r,n,i)=>t.call(e,r,n,this)))}has(t){return Ta(this,Na,"f").has(t)}keys(){return Ta(this,Na,"f").keys()}values(){return Ta(this,Na,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((t=>String(t))).join(", ")} `:""}}`}}ja.FrozenSet=La,Object.freeze(Pa),Object.freeze(Pa.prototype),Object.freeze(La),Object.freeze(La.prototype);var Da={},Ba={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0,t.isNonEmptyArray=function(t){return Array.isArray(t)&&t.length>0},t.isNullOrUndefined=function(t){return null==t},t.isObject=function(t){return Boolean(t)&&"object"==typeof t&&!Array.isArray(t)};var e;function r(t){return t.charCodeAt(0)<=127}t.hasProperty=(t,e)=>Object.hasOwnProperty.call(t,e),(e=t.JsonSize||(t.JsonSize={}))[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date",t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,t.isPlainObject=function(t){if("object"!=typeof t||null===t)return!1;try{let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}catch(t){return!1}},t.isASCII=r,t.calculateStringSize=function(e){var n;return e.split("").reduce(((t,e)=>r(e)?t+1:t+2),0)+(null!==(n=e.match(t.ESCAPE_CHARACTERS_REGEXP))&&void 0!==n?n:[]).length},t.calculateNumberSize=function(t){return t.toString().length}}(Ba),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=$s,r=Ss,n=Ba;function i(t,e=!1){const r=new Set;return function t(e,i){if(void 0===e)return[!1,0];if(null===e)return[!0,i?0:n.JsonSize.Null];const o=typeof e;try{if("function"===o)return[!1,0];if("string"===o||e instanceof String)return[!0,i?0:(0,n.calculateStringSize)(e)+2*n.JsonSize.Quote];if("boolean"===o||e instanceof Boolean)return i?[!0,0]:[!0,1==e?n.JsonSize.True:n.JsonSize.False];if("number"===o||e instanceof Number)return i?[!0,0]:[!0,(0,n.calculateNumberSize)(e)];if(e instanceof Date)return i?[!0,0]:[!0,isNaN(e.getDate())?n.JsonSize.Null:n.JsonSize.Date+2*n.JsonSize.Quote]}catch(t){return[!1,0]}if(!(0,n.isPlainObject)(e)&&!Array.isArray(e))return[!1,0];if(r.has(e))return[!1,0];r.add(e);try{return[!0,Object.entries(e).reduce(((o,[s,a],u,c)=>{let[l,h]=t(a,i);if(!l)throw new Error("JSON validation did not pass. Validation process stopped.");if(r.delete(e),i)return 0;return o+(Array.isArray(e)?0:s.length+n.JsonSize.Comma+2*n.JsonSize.Colon)+h+(u<c.length-1?n.JsonSize.Comma:0)}),i?0:2*n.JsonSize.Wrapper)]}catch(t){return[!1,0]}}(t,e)}t.JsonStruct=(0,e.define)("Json",(t=>{const[e]=i(t,!0);return!!e||"Expected a valid JSON-serializable value"})),t.isValidJson=function(r){return(0,e.is)(r,t.JsonStruct)},t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]),t.isJsonRpcNotification=function(r){return(0,e.is)(r,t.JsonRpcNotificationStruct)},t.assertIsJsonRpcNotification=function(e,n){(0,r.assertStruct)(e,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",n)},t.isJsonRpcRequest=function(r){return(0,e.is)(r,t.JsonRpcRequestStruct)},t.assertIsJsonRpcRequest=function(e,n){(0,r.assertStruct)(e,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",n)},t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]),t.isPendingJsonRpcResponse=function(r){return(0,e.is)(r,t.PendingJsonRpcResponseStruct)},t.assertIsPendingJsonRpcResponse=function(e,n){(0,r.assertStruct)(e,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",n)},t.isJsonRpcResponse=function(r){return(0,e.is)(r,t.JsonRpcResponseStruct)},t.assertIsJsonRpcResponse=function(e,n){(0,r.assertStruct)(e,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",n)},t.isJsonRpcSuccess=function(r){return(0,e.is)(r,t.JsonRpcSuccessStruct)},t.assertIsJsonRpcSuccess=function(e,n){(0,r.assertStruct)(e,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",n)},t.isJsonRpcFailure=function(r){return(0,e.is)(r,t.JsonRpcFailureStruct)},t.assertIsJsonRpcFailure=function(e,n){(0,r.assertStruct)(e,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",n)},t.isJsonRpcError=function(r){return(0,e.is)(r,t.JsonRpcErrorStruct)},t.assertIsJsonRpcError=function(e,n){(0,r.assertStruct)(e,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",n)},t.getJsonRpcIdValidator=function(t){const{permitEmptyString:e,permitFractions:r,permitNull:n}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},t);return t=>Boolean("number"==typeof t&&(r||Number.isInteger(t))||"string"==typeof t&&(e||t.length>0)||n&&null===t)},t.validateJsonAndGetSize=i}(Da);var Fa,Ua,Va={},Ha={exports:{}};function za(){if(Ua)return Fa;Ua=1;var t=1e3,e=60*t,r=60*e,n=24*r,i=7*n,o=365.25*n;function s(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}return Fa=function(a,u){u=u||{};var c=typeof a;if("string"===c&&a.length>0)return function(s){if((s=String(s)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(!a)return;var u=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*o;case"weeks":case"week":case"w":return u*i;case"days":case"day":case"d":return u*n;case"hours":case"hour":case"hrs":case"hr":case"h":return u*r;case"minutes":case"minute":case"mins":case"min":case"m":return u*e;case"seconds":case"second":case"secs":case"sec":case"s":return u*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(a);if("number"===c&&isFinite(a))return u.long?function(i){var o=Math.abs(i);if(o>=n)return s(i,o,n,"day");if(o>=r)return s(i,o,r,"hour");if(o>=e)return s(i,o,e,"minute");if(o>=t)return s(i,o,t,"second");return i+" ms"}(a):function(i){var o=Math.abs(i);if(o>=n)return Math.round(i/n)+"d";if(o>=r)return Math.round(i/r)+"h";if(o>=e)return Math.round(i/e)+"m";if(o>=t)return Math.round(i/t)+"s";return i+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},Fa}var Wa=function(t){function e(t){let n,i,o,s=null;function a(...t){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];n=o.call(r,e),t.splice(s,1),s--}return n})),e.formatArgs.call(r,t);(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,r){const n=e(this.namespace+(void 0===r?":":r)+t);return n.log=this.log,n}function n(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(n),...e.skips.map(n).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=za(),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((r=>{e[r]=t[r]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;return e.colors[Math.abs(r)%e.colors.length]},e.enable(e.load()),e};!function(t,e){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(n++,"%c"===t&&(i=n))})),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=Wa(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(Ha,Ha.exports);var qa=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Va,"__esModule",{value:!0}),Va.createModuleLogger=Va.createProjectLogger=void 0;const Ja=(0,qa(Ha.exports).default)("metamask");Va.createProjectLogger=function(t){return Ja.extend(t)},Va.createModuleLogger=function(t,e){return t.extend(e)};var $a={};Object.defineProperty($a,"__esModule",{value:!0}),$a.hexToBigInt=$a.hexToNumber=$a.bigIntToHex=$a.numberToHex=void 0;const Za=Ss,Ga=ea;$a.numberToHex=t=>((0,Za.assert)("number"==typeof t,"Value must be a number."),(0,Za.assert)(t>=0,"Value must be a non-negative number."),(0,Za.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Ga.add0x)(t.toString(16)));$a.bigIntToHex=t=>((0,Za.assert)("bigint"==typeof t,"Value must be a bigint."),(0,Za.assert)(t>=0,"Value must be a non-negative bigint."),(0,Ga.add0x)(t.toString(16)));$a.hexToNumber=t=>{(0,Ga.assertIsHexString)(t);const e=parseInt(t,16);return(0,Za.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};$a.hexToBigInt=t=>((0,Ga.assertIsHexString)(t),BigInt((0,Ga.add0x)(t)));var Qa={};Object.defineProperty(Qa,"__esModule",{value:!0});var Ya={};!function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,(e=t.Duration||(t.Duration={}))[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year";const r=(t,e)=>{if(!(t=>Number.isInteger(t)&&t>=0)(t))throw new Error(`"${e}" must be a non-negative integer. Received: "${t}".`)};t.inMilliseconds=function(t,e){return r(t,"count"),t*e},t.timeSince=function(t){return r(t,"timestamp"),Date.now()-t}}(Ya);var Ka={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=h,r=$s,n=Ss;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",(t=>null!==(0,e.valid)(t)||`Expected SemVer version, got "${t}"`)),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",(t=>null!==(0,e.validRange)(t)||`Expected SemVer range, got "${t}"`)),t.isValidSemVerVersion=function(e){return(0,r.is)(e,t.VersionStruct)},t.isValidSemVerRange=function(e){return(0,r.is)(e,t.VersionRangeStruct)},t.assertIsSemVerVersion=function(e){(0,n.assertStruct)(e,t.VersionStruct)},t.assertIsSemVerRange=function(e){(0,n.assertStruct)(e,t.VersionRangeStruct)},t.gtVersion=function(t,r){return(0,e.gt)(t,r)},t.gtRange=function(t,r){return(0,e.gtr)(t,r)},t.satisfiesVersionRange=function(t,r){return(0,e.satisfies)(t,r,{includePrerelease:!0})}}(Ka),function(e){var r=t&&t.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),n=t&&t.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),n(Ss,e),n(Ys,e),n(ta,e),n(ba,e),n(wa,e),n(ja,e),n(ea,e),n(Da,e),n(Va,e),n(Ba,e),n($a,e),n(Qa,e),n(Ya,e),n(Ka,e)}(_s),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=_s;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")}(ws);var Xa=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ls,"__esModule",{value:!0}),ls.PollingBlockTracker=void 0;const tu=Xa(hs),eu=Xa(((t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=t=>{const r=e=>"string"==typeof e?t===e:e.test(t);return e.include?e.include.some(r):!e.exclude.some(r)};let n;n="function"==typeof t?function(){return e.excludeMain?t.apply(this,arguments):ds(t,e).apply(this,arguments)}:Object.create(Object.getPrototypeOf(t));for(const i in t){const o=t[i];n[i]="function"==typeof o&&r(i)?ds(o,e):o}return n})),ru=fs,nu=(0,ws.createModuleLogger)(ws.projectLogger,"polling-block-tracker"),iu=(0,tu.default)();class ou extends ru.BaseBlockTracker{constructor(t={}){var e;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:null!==(e=t.blockResetDuration)&&void 0!==e?e:t.pollingInterval}),this._provider=t.provider,this._pollingInterval=t.pollingInterval||2e4,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=void 0===t.keepEventLoopActive||t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const t=su(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await t}catch(e){const r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${null!==(t=e.stack)&&void 0!==t?t:e}`);try{this.emit("error",r)}catch(t){console.error(r)}const n=su(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await n}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:iu(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),nu("Making request",t);const e=await(0,eu.default)((e=>this._provider.sendAsync(t,e)))();if(nu("Got response",e),e.error)throw new Error(`PollingBlockTracker - encountered error fetching block:\n${e.error.message}`);return e.result}}function su(t,e){return new Promise((r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()}))}ls.PollingBlockTracker=ou;var au={},uu=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(au,"__esModule",{value:!0}),au.SubscribeBlockTracker=void 0;const cu=uu(hs),lu=fs,hu=(0,cu.default)();class du extends lu.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(void 0===this._subscriptionId||null===this._subscriptionId)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(null!==this._subscriptionId&&void 0!==this._subscriptionId)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...e){return new Promise(((r,n)=>{this._provider.sendAsync({id:hu(),method:t,params:e,jsonrpc:"2.0"},((t,e)=>{t?n(t):r(e.result)}))}))}_handleSubData(t,e){var r;"eth_subscription"===e.method&&(null===(r=e.params)||void 0===r?void 0:r.subscription)===this._subscriptionId&&this._newPotentialLatest(e.params.result.number)}}au.SubscribeBlockTracker=du;var fu={};Object.defineProperty(fu,"__esModule",{value:!0}),function(e){var r=t&&t.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),n=t&&t.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),n(ls,e),n(au,e),n(fu,e)}(cs);var pu={},gu={},yu={};Object.defineProperty(yu,"__esModule",{value:!0}),yu.getUniqueId=void 0;const bu=4294967295;let mu=Math.floor(Math.random()*bu);yu.getUniqueId=function(){return mu=(mu+1)%bu,mu},Object.defineProperty(gu,"__esModule",{value:!0}),gu.createIdRemapMiddleware=void 0;const vu=yu;gu.createIdRemapMiddleware=function(){return(t,e,r,n)=>{const i=t.id,o=vu.getUniqueId();t.id=o,e.id=o,r((r=>{t.id=i,e.id=i,r()}))}};var wu={};Object.defineProperty(wu,"__esModule",{value:!0}),wu.createAsyncMiddleware=void 0,wu.createAsyncMiddleware=function(t){return async(e,r,n,i)=>{let o;const s=new Promise((t=>{o=t}));let a=null,u=!1;const c=async()=>{u=!0,n((t=>{a=t,o()})),await s};try{await t(e,r,c),u?(await s,a(null)):i(null)}catch(t){a?a(t):i(t)}}};var _u={};Object.defineProperty(_u,"__esModule",{value:!0}),_u.createScaffoldMiddleware=void 0,_u.createScaffoldMiddleware=function(t){return(e,r,n,i)=>{const o=t[e.method];return void 0===o?n():"function"==typeof o?o(e,r,n,i):(r.result=o,i())}};var Su={},Eu={},Mu={};Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.EthereumProviderError=Mu.EthereumRpcError=void 0;const xu=x;class ku extends Error{constructor(t,e,r){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a nonempty string.');super(e),this.code=t,void 0!==r&&(this.data=r)}serialize(){const t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return xu.default(this.serialize(),Cu,2)}}Mu.EthereumRpcError=ku;function Cu(t,e){if("[Circular]"!==e)return e}Mu.EthereumProviderError=class extends ku{constructor(t,e,r){if(!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,r)}};var Iu={},Ru={};Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.errorValues=Ru.errorCodes=void 0,Ru.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},Ru.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Ru,r=Mu,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};function s(r,n=i){if(Number.isInteger(r)){const n=r.toString();if(l(e.errorValues,n))return e.errorValues[n].message;if(u(r))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function a(t){if(!Number.isInteger(t))return!1;const r=t.toString();return!!e.errorValues[r]||!!u(t)}function u(t){return t>=-32099&&t<=-32e3}function c(t){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({},t):t}function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=s,t.isValidCode=a,t.serializeError=function(t,{fallbackError:e=o,shouldIncludeStack:n=!1}={}){var i,u;if(!e||!Number.isInteger(e.code)||"string"!=typeof e.message)throw new Error("Must provide fallback error with integer number code and string message.");if(t instanceof r.EthereumRpcError)return t.serialize();const h={};if(t&&"object"==typeof t&&!Array.isArray(t)&&l(t,"code")&&a(t.code)){const e=t;h.code=e.code,e.message&&"string"==typeof e.message?(h.message=e.message,l(e,"data")&&(h.data=e.data)):(h.message=s(h.code),h.data={originalError:c(t)})}else{h.code=e.code;const r=null===(i=t)||void 0===i?void 0:i.message;h.message=r&&"string"==typeof r?r:e.message,h.data={originalError:c(t)}}const d=null===(u=t)||void 0===u?void 0:u.stack;return n&&t&&d&&"string"==typeof d&&(h.stack=d),h}}(Iu);var Au={};Object.defineProperty(Au,"__esModule",{value:!0}),Au.ethErrors=void 0;const Nu=Mu,ju=Iu,Ou=Ru;function Tu(t,e){const[r,n]=Lu(e);return new Nu.EthereumRpcError(t,r||ju.getMessageFromCode(t),n)}function Pu(t,e){const[r,n]=Lu(e);return new Nu.EthereumProviderError(t,r||ju.getMessageFromCode(t),n)}function Lu(t){if(t){if("string"==typeof t)return[t];if("object"==typeof t&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&"string"!=typeof e)throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}Au.ethErrors={rpc:{parse:t=>Tu(Ou.errorCodes.rpc.parse,t),invalidRequest:t=>Tu(Ou.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Tu(Ou.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Tu(Ou.errorCodes.rpc.methodNotFound,t),internal:t=>Tu(Ou.errorCodes.rpc.internal,t),server:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Tu(e,t)},invalidInput:t=>Tu(Ou.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Tu(Ou.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Tu(Ou.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Tu(Ou.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Tu(Ou.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Tu(Ou.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Pu(Ou.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Pu(Ou.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Pu(Ou.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Pu(Ou.errorCodes.provider.disconnected,t),chainDisconnected:t=>Pu(Ou.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new Nu.EthereumProviderError(e,r,n)}}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=Mu;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=Iu;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Au;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Ru;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})}(Eu);var Du=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Su,"__esModule",{value:!0}),Su.JsonRpcEngine=void 0;const Bu=Du(m),Fu=Eu;class Uu extends Bu.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,e){if(e&&"function"!=typeof e)throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?e?this._handleBatch(t,e):this._handleBatch(t):e?this._handle(t,e):this._promiseHandle(t)}asMiddleware(){return async(t,e,r,n)=>{try{const[i,o,s]=await Uu._runAllMiddleware(t,e,this._middleware);return o?(await Uu._runReturnHandlers(s),n(i)):r((async t=>{try{await Uu._runReturnHandlers(s)}catch(e){return t(e)}return t()}))}catch(t){return n(t)}}}async _handleBatch(t,e){try{const r=await Promise.all(t.map(this._promiseHandle.bind(this)));return e?e(null,r):r}catch(t){if(e)return e(t);throw t}}_promiseHandle(t){return new Promise((e=>{this._handle(t,((t,r)=>{e(r)}))}))}async _handle(t,e){if(!t||Array.isArray(t)||"object"!=typeof t){const r=new Fu.EthereumRpcError(Fu.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof t,{request:t});return e(r,{id:void 0,jsonrpc:"2.0",error:r})}if("string"!=typeof t.method){const r=new Fu.EthereumRpcError(Fu.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof t.method,{request:t});return e(r,{id:t.id,jsonrpc:"2.0",error:r})}const r=Object.assign({},t),n={id:r.id,jsonrpc:r.jsonrpc};let i=null;try{await this._processRequest(r,n)}catch(t){i=t}return i&&(delete n.result,n.error||(n.error=Fu.serializeError(i))),e(i,n)}async _processRequest(t,e){const[r,n,i]=await Uu._runAllMiddleware(t,e,this._middleware);if(Uu._checkForCompletion(t,e,n),await Uu._runReturnHandlers(i),r)throw r}static async _runAllMiddleware(t,e,r){const n=[];let i=null,o=!1;for(const s of r)if([i,o]=await Uu._runMiddleware(t,e,s,n),o)break;return[i,o,n.reverse()]}static _runMiddleware(t,e,r,n){return new Promise((i=>{const o=t=>{const r=t||e.error;r&&(e.error=Fu.serializeError(r)),i([r,!0])},s=r=>{e.error?o(e.error):(r&&("function"!=typeof r&&o(new Fu.EthereumRpcError(Fu.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof r}" for request:\n${Vu(t)}`,{request:t})),n.push(r)),i([null,!1]))};try{r(t,e,s,o)}catch(t){o(t)}}))}static async _runReturnHandlers(t){for(const e of t)await new Promise(((t,r)=>{e((e=>e?r(e):t()))}))}static _checkForCompletion(t,e,r){if(!("result"in e)&&!("error"in e))throw new Fu.EthereumRpcError(Fu.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:\n${Vu(t)}`,{request:t});if(!r)throw new Fu.EthereumRpcError(Fu.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:\n${Vu(t)}`,{request:t})}}function Vu(t){return JSON.stringify(t,null,2)}Su.JsonRpcEngine=Uu;var Hu={};Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.mergeMiddleware=void 0;const zu=Su;Hu.mergeMiddleware=function(t){const e=new zu.JsonRpcEngine;return t.forEach((t=>e.push(t))),e.asMiddleware()},function(e){var r=t&&t.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),n=t&&t.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),n(gu,e),n(wu,e),n(_u,e),n(yu,e),n(Su,e),n(Hu,e)}(pu);var Wu={},qu={},Ju={};Object.defineProperty(Ju,"__esModule",{value:!0});var $u=d,Zu=function(){function t(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return t.prototype.acquire=function(){var t=this,e=this.isLocked(),r=new Promise((function(e){return t._queue.push(e)}));return e||this._dispatch(),r},t.prototype.runExclusive=function(t){return $u.__awaiter(this,void 0,void 0,(function(){var e,r,n;return $u.__generator(this,(function(i){switch(i.label){case 0:return[4,this.acquire()];case 1:e=i.sent(),r=e[0],n=e[1],i.label=2;case 2:return i.trys.push([2,,4,5]),[4,t(r)];case 3:return[2,i.sent()];case 4:return n(),[7];case 5:return[2]}}))}))},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},t.prototype._dispatch=function(){var t=this,e=this._queue.shift();if(e){var r=!1;this._currentReleaser=function(){r||(r=!0,t._value++,t._dispatch())},e([this._value--,this._currentReleaser])}},t}();Ju.default=Zu,Object.defineProperty(qu,"__esModule",{value:!0});var Gu=d,Qu=Ju,Yu=function(){function t(){this._semaphore=new Qu.default(1)}return t.prototype.acquire=function(){return Gu.__awaiter(this,void 0,void 0,(function(){var t;return Gu.__generator(this,(function(e){switch(e.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=e.sent(),[2,t[1]]}}))}))},t.prototype.runExclusive=function(t){return this._semaphore.runExclusive((function(){return t()}))},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();qu.default=Yu;var Ku={};Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.withTimeout=void 0;var Xu=d;Ku.withTimeout=function(t,e,r){var n=this;return void 0===r&&(r=new Error("timeout")),{acquire:function(){return new Promise((function(i,o){return Xu.__awaiter(n,void 0,void 0,(function(){var n,s;return Xu.__generator(this,(function(a){switch(a.label){case 0:return n=!1,setTimeout((function(){n=!0,o(r)}),e),[4,t.acquire()];case 1:return s=a.sent(),n?(Array.isArray(s)?s[1]:s)():i(s),[2]}}))}))}))},runExclusive:function(t){return Xu.__awaiter(this,void 0,void 0,(function(){var e,r;return Xu.__generator(this,(function(n){switch(n.label){case 0:e=function(){},n.label=1;case 1:return n.trys.push([1,,7,8]),[4,this.acquire()];case 2:return r=n.sent(),Array.isArray(r)?(e=r[1],[4,t(r[0])]):[3,4];case 3:return[2,n.sent()];case 4:return e=r,[4,t()];case 5:return[2,n.sent()];case 6:return[3,8];case 7:return e(),[7];case 8:return[2]}}))}))},release:function(){t.release()},isLocked:function(){return t.isLocked()}}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=qu;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=Ju;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Ku;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})}(Wu);var tc=function(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var n in r)ec.call(r,n)&&(t[n]=r[n])}return t},ec=Object.prototype.hasOwnProperty;const rc=tc,nc=hs();var ic=oc;function oc(t){this.currentProvider=t}function sc(t){return function(){var e=[].slice.call(arguments),r=e.pop();this.sendAsync({method:t,params:e},r)}}function ac(t,e){return function(){var r=[].slice.call(arguments),n=r.pop();r.length<t&&r.push("latest"),this.sendAsync({method:e,params:r},n)}}oc.prototype.getBalance=ac(2,"eth_getBalance"),oc.prototype.getCode=ac(2,"eth_getCode"),oc.prototype.getTransactionCount=ac(2,"eth_getTransactionCount"),oc.prototype.getStorageAt=ac(3,"eth_getStorageAt"),oc.prototype.call=ac(2,"eth_call"),oc.prototype.protocolVersion=sc("eth_protocolVersion"),oc.prototype.syncing=sc("eth_syncing"),oc.prototype.coinbase=sc("eth_coinbase"),oc.prototype.mining=sc("eth_mining"),oc.prototype.hashrate=sc("eth_hashrate"),oc.prototype.gasPrice=sc("eth_gasPrice"),oc.prototype.accounts=sc("eth_accounts"),oc.prototype.blockNumber=sc("eth_blockNumber"),oc.prototype.getBlockTransactionCountByHash=sc("eth_getBlockTransactionCountByHash"),oc.prototype.getBlockTransactionCountByNumber=sc("eth_getBlockTransactionCountByNumber"),oc.prototype.getUncleCountByBlockHash=sc("eth_getUncleCountByBlockHash"),oc.prototype.getUncleCountByBlockNumber=sc("eth_getUncleCountByBlockNumber"),oc.prototype.sign=sc("eth_sign"),oc.prototype.sendTransaction=sc("eth_sendTransaction"),oc.prototype.sendRawTransaction=sc("eth_sendRawTransaction"),oc.prototype.estimateGas=sc("eth_estimateGas"),oc.prototype.getBlockByHash=sc("eth_getBlockByHash"),oc.prototype.getBlockByNumber=sc("eth_getBlockByNumber"),oc.prototype.getTransactionByHash=sc("eth_getTransactionByHash"),oc.prototype.getTransactionByBlockHashAndIndex=sc("eth_getTransactionByBlockHashAndIndex"),oc.prototype.getTransactionByBlockNumberAndIndex=sc("eth_getTransactionByBlockNumberAndIndex"),oc.prototype.getTransactionReceipt=sc("eth_getTransactionReceipt"),oc.prototype.getUncleByBlockHashAndIndex=sc("eth_getUncleByBlockHashAndIndex"),oc.prototype.getUncleByBlockNumberAndIndex=sc("eth_getUncleByBlockNumberAndIndex"),oc.prototype.getCompilers=sc("eth_getCompilers"),oc.prototype.compileLLL=sc("eth_compileLLL"),oc.prototype.compileSolidity=sc("eth_compileSolidity"),oc.prototype.compileSerpent=sc("eth_compileSerpent"),oc.prototype.newFilter=sc("eth_newFilter"),oc.prototype.newBlockFilter=sc("eth_newBlockFilter"),oc.prototype.newPendingTransactionFilter=sc("eth_newPendingTransactionFilter"),oc.prototype.uninstallFilter=sc("eth_uninstallFilter"),oc.prototype.getFilterChanges=sc("eth_getFilterChanges"),oc.prototype.getFilterLogs=sc("eth_getFilterLogs"),oc.prototype.getLogs=sc("eth_getLogs"),oc.prototype.getWork=sc("eth_getWork"),oc.prototype.submitWork=sc("eth_submitWork"),oc.prototype.submitHashrate=sc("eth_submitHashrate"),oc.prototype.sendAsync=function(t,e){var r;this.currentProvider.sendAsync((r=t,rc({id:nc(),jsonrpc:"2.0",params:[]},r)),(function(t,r){if(!t&&r.error&&(t=new Error("EthQuery - RPC Error - "+r.error.message)),t)return e(t);e(null,r.result)}))};const uc=(t,e,r,n)=>function(...i){return new(0,e.promiseModule)(((o,s)=>{e.multiArgs?i.push(((...t)=>{e.errorFirst?t[0]?s(t):(t.shift(),o(t)):o(t)})):e.errorFirst?i.push(((t,e)=>{t?s(t):o(e)})):i.push(o);const a=this===r?n:this;Reflect.apply(t,a,i)}))},cc=new WeakMap;const lc=m.default;var hc=class extends lc{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach((t=>this.emit("update",t)))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};const dc=hc;var fc={minBlockRef:function(...t){return pc(t)[0]},maxBlockRef:function(...t){const e=pc(t);return e[e.length-1]},sortBlockRefs:pc,bnToHex:function(t){return"0x"+t.toString(16)},blockRefIsNumber:function(t){return t&&!["earliest","latest","pending"].includes(t)},hexToInt:gc,incrementHexInt:function(t){if(null==t)return t;return yc(gc(t)+1)},intToHex:yc,unsafeRandomBytes:function(t){let e="0x";for(let r=0;r<t;r++)e+=bc(),e+=bc();return e}};function pc(t){return t.sort(((t,e)=>"latest"===t||"earliest"===e?1:"latest"===e||"earliest"===t?-1:gc(t)-gc(e)))}function gc(t){return null==t?t:Number.parseInt(t,16)}function yc(t){if(null==t)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function bc(){return Math.floor(16*Math.random()).toString(16)}const mc=ic,vc=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const r=typeof t;if(null===t||"object"!==r&&"function"!==r)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===t?"null":r}\``);const n=new WeakMap,i=new Proxy(t,{apply(t,r,o){const s=n.get(t);if(s)return Reflect.apply(s,r,o);const a=e.excludeMain?t:uc(t,e,i,t);return n.set(t,a),Reflect.apply(a,r,o)},get(t,r){const o=t[r];if(!((t,r)=>{let n=cc.get(t);if(n||(n={},cc.set(t,n)),r in n)return n[r];const i=t=>"string"==typeof t||"symbol"==typeof r?r===t:t.test(r),o=Reflect.getOwnPropertyDescriptor(t,r),s=void 0===o||o.writable||o.configurable,a=(e.include?e.include.some(i):!e.exclude.some(i))&&s;return n[r]=a,a})(t,r)||o===Function.prototype[r])return o;const s=n.get(o);if(s)return s;if("function"==typeof o){const r=uc(o,e,i,t);return n.set(o,r),r}return o}});return i},wc=class extends dc{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}},{bnToHex:_c,hexToInt:Sc,incrementHexInt:Ec,minBlockRef:Mc,blockRefIsNumber:xc}=fc;var kc=class extends wc{constructor({provider:t,params:e}){super(),this.type="log",this.ethQuery=new mc(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},e),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map((t=>t.toLowerCase())))}async initialize({currentBlock:t}){let e=this.params.fromBlock;["latest","pending"].includes(e)&&(e=t),"earliest"===e&&(e="0x0"),this.params.fromBlock=e;const r=Mc(this.params.toBlock,t),n=Object.assign({},this.params,{toBlock:r}),i=await this._fetchLogs(n);this.addInitialResults(i)}async update({oldBlock:t,newBlock:e}){const r=e;let n;n=t?Ec(t):e;const i=Object.assign({},this.params,{fromBlock:n,toBlock:r}),o=(await this._fetchLogs(i)).filter((t=>this.matchLog(t)));this.addResults(o)}async _fetchLogs(t){return await vc((e=>this.ethQuery.getLogs(t,e)))()}matchLog(t){if(Sc(this.params.fromBlock)>=Sc(t.blockNumber))return!1;if(xc(this.params.toBlock)&&Sc(this.params.toBlock)<=Sc(t.blockNumber))return!1;const e=t.address&&t.address.toLowerCase();if(this.params.address&&e&&!this.params.address.includes(e))return!1;return this.params.topics.every(((e,r)=>{let n=t.topics[r];if(!n)return!1;n=n.toLowerCase();let i=Array.isArray(e)?e:[e];if(i.includes(null))return!0;i=i.map((t=>t.toLowerCase()));return i.includes(n)}))}},Cc=async function({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=Ic(e),i=Ic(r),o=Array(i-n+1).fill().map(((t,e)=>n+e)).map(Rc);return await Promise.all(o.map((e=>async function(t,e,r){for(let n=0;n<3;n++)try{return await Ac(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(t){console.error(`provider.sendAsync failed: ${t.stack||t.message||t}`)}throw new Error(`Block not found for params: ${JSON.stringify(r)}`)}(t,"eth_getBlockByNumber",[e,!1]))))};function Ic(t){return null==t?t:Number.parseInt(t,16)}function Rc(t){if(null==t)return t;return"0x"+t.toString(16)}function Ac(t,e){return new Promise(((r,n)=>{t.sendAsync(e,((t,e)=>{t?n(t):e.error?n(e.error):e.result?r(e.result):n(new Error("Result was empty"))}))}))}const Nc=hc,jc=Cc,{incrementHexInt:Oc}=fc;var Tc=class extends Nc{constructor({provider:t,params:e}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:e}){const r=e,n=Oc(t),i=(await jc({provider:this.provider,fromBlock:n,toBlock:r})).map((t=>t.hash));this.addResults(i)}};const Pc=hc,Lc=Cc,{incrementHexInt:Dc}=fc;var Bc=class extends Pc{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const e=t,r=Dc(t),n=await Lc({provider:this.provider,fromBlock:r,toBlock:e}),i=[];for(const t of n)i.push(...t.transactions);this.addResults(i)}};const Fc=Wu.Mutex,{createAsyncMiddleware:Uc,createScaffoldMiddleware:Vc}=pu,Hc=kc,zc=Tc,Wc=Bc,{intToHex:qc,hexToInt:Jc}=fc;var $c=function({blockTracker:t,provider:e}){let r=0,n={};const i=new Fc,o=function({mutex:t}){return e=>async(r,n,i,o)=>{(await t.acquire())(),e(r,n,i,o)}}({mutex:i}),s=Vc({eth_newFilter:o(Zc(u)),eth_newBlockFilter:o(Zc(c)),eth_newPendingTransactionFilter:o(Zc(l)),eth_uninstallFilter:o(Gc(f)),eth_getFilterChanges:o(Gc(h)),eth_getFilterLogs:o(Gc(d))}),a=async({oldBlock:t,newBlock:e})=>{if(0===n.length)return;const r=await i.acquire();try{await Promise.all(Qc(n).map((async r=>{try{await r.update({oldBlock:t,newBlock:e})}catch(t){console.error(t)}})))}catch(t){console.error(t)}r()};return s.newLogFilter=u,s.newBlockFilter=c,s.newPendingTransactionFilter=l,s.uninstallFilter=f,s.getFilterChanges=h,s.getFilterLogs=d,s.destroy=()=>{!async function(){const t=Qc(n).length;n={},g({prevFilterCount:t,newFilterCount:0})}()},s;async function u(t){const r=new Hc({provider:e,params:t});return await p(r),r}async function c(){const t=new zc({provider:e});return await p(t),t}async function l(){const t=new Wc({provider:e});return await p(t),t}async function h(t){const e=Jc(t),r=n[e];if(!r)throw new Error(`No filter for index "${e}"`);return r.getChangesAndClear()}async function d(t){const e=Jc(t),r=n[e];if(!r)throw new Error(`No filter for index "${e}"`);let i=[];return"log"===r.type&&(i=r.getAllResults()),i}async function f(t){const e=Jc(t),r=n[e],i=Boolean(r);return i&&await async function(t){const e=Qc(n).length;delete n[t];const r=Qc(n).length;g({prevFilterCount:e,newFilterCount:r})}(e),i}async function p(e){const i=Qc(n).length,o=await t.getLatestBlock();await e.initialize({currentBlock:o}),r++,n[r]=e,e.id=r,e.idHex=qc(r);return g({prevFilterCount:i,newFilterCount:Qc(n).length}),r}function g({prevFilterCount:e,newFilterCount:r}){0===e&&r>0?t.on("sync",a):e>0&&0===r&&t.removeListener("sync",a)}};function Zc(t){return Gc((async(...e)=>{const r=await t(...e);return qc(r.id)}))}function Gc(t){return Uc((async(e,r)=>{const n=await t.apply(null,e.params);r.result=n}))}function Qc(t,e){const r=[];for(let e in t)r.push(t[e]);return r}const Yc=m.default,{createAsyncMiddleware:Kc,createScaffoldMiddleware:Xc}=pu,tl=$c,{unsafeRandomBytes:el,incrementHexInt:rl}=fc,nl=Cc;var il=function({blockTracker:t,provider:e}){const r={},n=tl({blockTracker:t,provider:e});let i=!1;const o=new Yc,s=Xc({eth_subscribe:Kc((async function(o,s){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const u=o.params[0],c=el(16);let l;switch(u){case"newHeads":l=h({subId:c});break;case"logs":const t=o.params[1];l=d({subId:c,filter:await n.newLogFilter(t)});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${u}"`)}return r[c]=l,void(s.result=c);function h({subId:r}){const n={type:u,destroy:async()=>{t.removeListener("sync",n.update)},update:async({oldBlock:t,newBlock:n})=>{const i=n,o=rl(t);(await nl({provider:e,fromBlock:o,toBlock:i})).map(ol).filter((t=>null!==t)).forEach((t=>{a(r,t)}))}};return t.on("sync",n.update),n}function d({subId:t,filter:e}){e.on("update",(e=>a(t,e)));return{type:u,destroy:async()=>await n.uninstallFilter(e.idHex)}}})),eth_unsubscribe:Kc((async function(t,e){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const n=t.params[0],o=r[n];if(!o)return void(e.result=!1);delete r[n],await o.destroy(),e.result=!0}))});return s.destroy=function(){o.removeAllListeners();for(const t in r)r[t].destroy(),delete r[t];i=!0},{events:o,middleware:s};function a(t,e){o.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:t,result:e}})}};function ol(t){return null==t?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(us,"__esModule",{value:!0}),us.SubscriptionManager=void 0;const sl=cs,al=il,ul=()=>{};us.SubscriptionManager=class{constructor(t){const e=new sl.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:r,middleware:n}=al({blockTracker:e,provider:t});this.events=r,this.subscriptionMiddleware=n}async handleRequest(t){const e={};return await this.subscriptionMiddleware(t,e,ul,ul),e}destroy(){this.subscriptionMiddleware.destroy()}};var cl=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(b,"__esModule",{value:!0}),b.CoinbaseWalletProvider=void 0;const ll=cl(m),hl=cl(S.exports),dl=E,fl=Q,pl=Y,gl=ci,yl=fe,bl=cl(Qo),ml=Yo,vl=as,wl=us,_l="DefaultChainId",Sl="DefaultJsonRpcUrl";class El extends ll.default{constructor(t){var e,r;super(),this._filterPolyfill=new ml.FilterPolyfill(this),this._subscriptionManager=new wl.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this._send=this.send.bind(this),this._sendAsync=this.sendAsync.bind(this),this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=null===(e=t.overrideIsCoinbaseWallet)||void 0===e||e,this.isCoinbaseBrowser=null!==(r=t.overrideIsCoinbaseBrowser)&&void 0!==r&&r,this.qrUrl=t.qrUrl,this.supportsAddressSwitching=t.supportsAddressSwitching,this.isLedger=t.isLedger;const n=this.getChainId(),i=(0,yl.prepend0x)(n.toString(16));this.emit("connect",{chainIdStr:i});const o=this._storage.getItem(gl.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const t=o.split(" ");""!==t[0]&&(this._addresses=t.map((t=>(0,yl.ensureAddressString)(t))),this.emit("accountsChanged",t))}this._subscriptionManager.events.on("notification",(t=>{this.emit("message",{type:t.method,data:t.params})})),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",(t=>{var e;if(t.origin===location.origin&&t.source===window&&"walletLinkMessage"===t.data.type){if("defaultChainChanged"===t.data.data.action||"dappChainSwitched"===t.data.data.action){const r=t.data.data.chainId,n=null!==(e=t.data.data.jsonRpcUrl)&&void 0!==e?e:this.jsonRpcUrl;this.updateProviderInfo(n,Number(r))}"addressChanged"===t.data.data.action&&this._setAddresses([t.data.data.address])}}))}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,yl.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return null!==(t=this._storage.getItem(Sl))&&void 0!==t?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(Sl,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,e){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=e,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,e){this.jsonRpcUrl=t;const r=this.getChainId();this._storage.setItem(_l,e.toString(10));!((0,yl.ensureIntNumber)(e)!==r)&&this.hasMadeFirstChainChangedEmission||(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,e,r,n,i,o){const s=await this.initializeRelay();return!!(await s.watchAsset(t,e,r,n,i,null==o?void 0:o.toString()).promise).result}async addEthereumChain(t,e,r,n,i,o){var s,a;if((0,yl.ensureIntNumber)(t)===this.getChainId())return!1;const u=await this.initializeRelay(),c=u.inlineAddEthereumChain(t.toString());this._isAuthorized()||c||await u.requestEthereumAccounts().promise;const l=await u.addEthereumChain(t.toString(),e,i,r,n,o).promise;return!0===(null===(s=l.result)||void 0===s?void 0:s.isApproved)&&this.updateProviderInfo(e[0],t),!0===(null===(a=l.result)||void 0===a?void 0:a.isApproved)}async switchEthereumChain(t){const e=await this.initializeRelay(),r=await e.switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if(r.errorCode)throw dl.ethErrors.provider.custom({code:r.errorCode});const n=r.result;n.isApproved&&n.rpcUrl.length>0&&this.updateProviderInfo(n.rpcUrl,t)}setAppInfo(t,e){this.initializeRelay().then((r=>r.setAppInfo(t,e)))}async enable(){var t;return null===(t=this.diagnostic)||void 0===t||t.log(fl.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?pl.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this._send(vl.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(t,e){if("string"==typeof t){const r={jsonrpc:"2.0",id:0,method:t,params:Array.isArray(e)?e:void 0!==e?[e]:[]};return this._sendRequestAsync(r).then((t=>t.result))}if("function"==typeof e){const r=t,n=e;return this._sendAsync(r,n)}if(Array.isArray(t)){return t.map((t=>this._sendRequest(t)))}const r=t;return this._sendRequest(r)}async sendAsync(t,e){if("function"!=typeof e)throw new Error("callback is required");if(Array.isArray(t)){const r=e;return void this._sendMultipleRequestsAsync(t).then((t=>r(null,t))).catch((t=>r(t,null)))}const r=e;return this._sendRequestAsync(t).then((t=>r(null,t))).catch((t=>r(t,null)))}async request(t){if(!t||"object"!=typeof t||Array.isArray(t))throw dl.ethErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:r}=t;if("string"!=typeof e||0===e.length)throw dl.ethErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw dl.ethErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const n=void 0===r?[]:r,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:e,params:n,jsonrpc:"2.0",id:i})).result}async scanQRCode(t){const e=await this.initializeRelay(),r=await e.scanQRCode((0,yl.ensureRegExpString)(t)).promise;if("string"!=typeof r.result)throw new Error("result was not a string");return r.result}async genericRequest(t,e){const r=await this.initializeRelay(),n=await r.genericRequest(t,e).promise;if("string"!=typeof n.result)throw new Error("result was not a string");return n.result}async selectProvider(t){const e=await this.initializeRelay(),r=await e.selectProvider(t).promise;if("string"!=typeof r.result)throw new Error("result was not a string");return r.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const e={jsonrpc:"2.0",id:t.id},{method:r}=t;if(e.result=this._handleSynchronousMethods(t),void 0===e.result)throw new Error(`Coinbase Wallet does not support calling ${r} synchronously without a callback. Please provide a callback parameter to call ${r} asynchronously.`);return e}_setAddresses(t,e){if(!Array.isArray(t))throw new Error("addresses is not an array");const r=t.map((t=>(0,yl.ensureAddressString)(t)));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&!1===this.supportsAddressSwitching&&!e||(this._addresses=r,this.emit("accountsChanged",this._addresses),this._storage.setItem(gl.LOCAL_STORAGE_ADDRESSES_KEY,r.join(" "))))}_sendRequestAsync(t){return new Promise(((e,r)=>{try{const n=this._handleSynchronousMethods(t);if(void 0!==n)return e({jsonrpc:"2.0",id:t.id,result:n});const i=this._handleAsynchronousFilterMethods(t);if(void 0!==i)return void i.then((r=>e(Object.assign(Object.assign({},r),{id:t.id})))).catch((t=>r(t)));const o=this._handleSubscriptionMethods(t);if(void 0!==o)return void o.then((r=>e({jsonrpc:"2.0",id:t.id,result:r.result}))).catch((t=>r(t)))}catch(t){return r(t)}this._handleAsynchronousMethods(t).then((r=>r&&e(Object.assign(Object.assign({},r),{id:t.id})))).catch((t=>r(t)))}))}_sendMultipleRequestsAsync(t){return Promise.all(t.map((t=>this._sendRequestAsync(t))))}_handleSynchronousMethods(t){const{method:e}=t,r=t.params||[];switch(e){case vl.JSONRPCMethod.eth_accounts:return this._eth_accounts();case vl.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case vl.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(r);case vl.JSONRPCMethod.net_version:return this._net_version();case vl.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:e}=t,r=t.params||[];switch(e){case vl.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case vl.JSONRPCMethod.eth_sign:return this._eth_sign(r);case vl.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(r);case vl.JSONRPCMethod.personal_sign:return this._personal_sign(r);case vl.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(r);case vl.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(r);case vl.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(r);case vl.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(r);case vl.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(r);case vl.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case vl.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(r);case vl.JSONRPCMethod.eth_signTypedData_v4:case vl.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(r);case vl.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(r);case vl.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(r);case vl.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(r);case vl.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(r)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(t){const{method:e}=t,r=t.params||[];switch(e){case vl.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(r);case vl.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case vl.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case vl.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(r);case vl.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(r)}}_handleSubscriptionMethods(t){switch(t.method){case vl.JSONRPCMethod.eth_subscribe:case vl.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const e=(0,yl.ensureAddressString)(t);return this._addresses.map((t=>(0,yl.ensureAddressString)(t))).includes(e)}catch(t){}return!1}_ensureKnownAddress(t){var e;if(!this._isKnownAddress(t))throw null===(e=this.diagnostic)||void 0===e||e.log(fl.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const e=t.from?(0,yl.ensureAddressString)(t.from):this.selectedAddress;if(!e)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(e);return{fromAddress:e,toAddress:t.to?(0,yl.ensureAddressString)(t.to):null,weiValue:null!=t.value?(0,yl.ensureBN)(t.value):new hl.default(0),data:t.data?(0,yl.ensureBuffer)(t.data):Buffer.alloc(0),nonce:null!=t.nonce?(0,yl.ensureIntNumber)(t.nonce):null,gasPriceInWei:null!=t.gasPrice?(0,yl.ensureBN)(t.gasPrice):null,maxFeePerGas:null!=t.maxFeePerGas?(0,yl.ensureBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:null!=t.maxPriorityFeePerGas?(0,yl.ensureBN)(t.maxPriorityFeePerGas):null,gasLimit:null!=t.gas?(0,yl.ensureBN)(t.gas):null,chainId:this.getChainId()}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw dl.ethErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw dl.ethErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,e,r,n){this._ensureKnownAddress(e);try{const i=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await i.signEthereumMessage(t,e,r,n).promise).result}}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw dl.ethErrors.provider.userRejectedRequest("User denied message signature");throw t}}async _ethereumAddressFromSignedMessage(t,e,r){const n=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await n.ethereumAddressFromSignedMessage(t,e,r).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,yl.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(_l);if(!t)return(0,yl.ensureIntNumber)(this._chainIdFromOpts);const e=parseInt(t,10);return(0,yl.ensureIntNumber)(e)}async _eth_requestAccounts(){var t;if(null===(t=this.diagnostic)||void 0===t||t.log(fl.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?pl.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{const t=await this.initializeRelay();e=await t.requestEthereumAccounts().promise}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw dl.ethErrors.provider.userRejectedRequest("User denied account authorization");throw t}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const e=(0,yl.ensureAddressString)(t[0]),r=(0,yl.ensureBuffer)(t[1]);return this._signEthereumMessage(r,e,!1)}_eth_ecRecover(t){const e=(0,yl.ensureBuffer)(t[0]),r=(0,yl.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(e,r,!1)}_personal_sign(t){this._requireAuthorization();const e=(0,yl.ensureBuffer)(t[0]),r=(0,yl.ensureAddressString)(t[1]);return this._signEthereumMessage(e,r,!0)}_personal_ecRecover(t){const e=(0,yl.ensureBuffer)(t[0]),r=(0,yl.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(e,r,!0)}async _eth_signTransaction(t){this._requireAuthorization();const e=this._prepareTransactionParams(t[0]||{});try{const t=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await t.signEthereumTransaction(e).promise).result}}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw dl.ethErrors.provider.userRejectedRequest("User denied transaction signature");throw t}}async _eth_sendRawTransaction(t){const e=(0,yl.ensureBuffer)(t[0]),r=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await r.submitEthereumTransaction(e,this.getChainId()).promise).result}}async _eth_sendTransaction(t){this._requireAuthorization();const e=this._prepareTransactionParams(t[0]||{});try{const t=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await t.signAndSubmitEthereumTransaction(e).promise).result}}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw dl.ethErrors.provider.userRejectedRequest("User denied transaction signature");throw t}}async _eth_signTypedData_v1(t){this._requireAuthorization();const e=(0,yl.ensureParsedJSONObject)(t[0]),r=(0,yl.ensureAddressString)(t[1]);this._ensureKnownAddress(r);const n=bl.default.hashForSignTypedDataLegacy({data:e}),i=JSON.stringify(e,null,2);return this._signEthereumMessage(n,r,!1,i)}async _eth_signTypedData_v3(t){this._requireAuthorization();const e=(0,yl.ensureAddressString)(t[0]),r=(0,yl.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(e);const n=bl.default.hashForSignTypedData_v3({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(n,e,!1,i)}async _eth_signTypedData_v4(t){this._requireAuthorization();const e=(0,yl.ensureAddressString)(t[0]),r=(0,yl.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(e);const n=bl.default.hashForSignTypedData_v4({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(n,e,!1,i)}async _cbwallet_arbitrary(t){const e=t[0],r=t[1];if("string"!=typeof r)throw new Error("parameter must be a string");if("object"!=typeof e||null===e)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(e,r)}}async _wallet_addEthereumChain(t){var e,r,n,i;const o=t[0];if(0===(null===(e=o.rpcUrls)||void 0===e?void 0:e.length))return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||""===o.chainName.trim())throw dl.ethErrors.provider.custom({code:0,message:"chainName is a required field"});if(!o.nativeCurrency)throw dl.ethErrors.provider.custom({code:0,message:"nativeCurrency is a required field"});const s=parseInt(o.chainId,16);return await this.addEthereumChain(s,null!==(r=o.rpcUrls)&&void 0!==r?r:[],null!==(n=o.blockExplorerUrls)&&void 0!==n?n:[],o.chainName,null!==(i=o.iconUrls)&&void 0!==i?i:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const e=t[0];return await this.switchEthereumChain(parseInt(e.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const e=Array.isArray(t)?t[0]:t;if(!e.type)throw dl.ethErrors.rpc.invalidParams({message:"Type is required"});if("ERC20"!==(null==e?void 0:e.type))throw dl.ethErrors.rpc.invalidParams({message:`Asset of type '${e.type}' is not supported`});if(!(null==e?void 0:e.options))throw dl.ethErrors.rpc.invalidParams({message:"Options are required"});if(!(null==e?void 0:e.options.address))throw dl.ethErrors.rpc.invalidParams({message:"Address is required"});const r=this.getChainId(),{address:n,symbol:i,image:o,decimals:s}=e.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(e.type,n,i,s,o,r)}}_eth_uninstallFilter(t){const e=(0,yl.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(e)}async _eth_newFilter(t){const e=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(e)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const e=(0,yl.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(e)}_eth_getFilterLogs(t){const e=(0,yl.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(e)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then((t=>(t.setAccountsCallback(((t,e)=>this._setAddresses(t,e))),t.setChainCallback(((t,e)=>{this.updateProviderInfo(e,parseInt(t,10))})),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t)))}}b.CoinbaseWalletProvider=El;var Ml,xl,kl,Cl,Il,Rl,Al,Nl,jl,Ol={},Tl={},Pl={},Ll=[],Dl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Bl(t,e){for(var r in e)t[r]=e[r];return t}function Fl(t){var e=t.parentNode;e&&e.removeChild(t)}function Ul(t,e,r){var n,i,o,s={};for(o in e)"key"==o?n=e[o]:"ref"==o?i=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?Ml.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return Vl(t,s,n,i,null)}function Vl(t,e,r,n,i){var o={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++kl:i};return null==i&&null!=xl.vnode&&xl.vnode(o),o}function Hl(t){return t.children}function zl(t,e){this.props=t,this.context=e}function Wl(t,e){if(null==e)return t.__?Wl(t.__,t.__.__k.indexOf(t)+1):null;for(var r;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Wl(t):null}function ql(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return ql(t)}}function Jl(t){(!t.__d&&(t.__d=!0)&&Il.push(t)&&!$l.__r++||Rl!==xl.debounceRendering)&&((Rl=xl.debounceRendering)||Al)($l)}function $l(){var t,e,r,n,i,o,s,a;for(Il.sort(Nl);t=Il.shift();)t.__d&&(e=Il.length,n=void 0,i=void 0,s=(o=(r=t).__v).__e,(a=r.__P)&&(n=[],(i=Bl({},o)).__v=o.__v+1,rh(a,o,i,r.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,n,null==s?Wl(o):s,o.__h),nh(n,o),o.__e!=s&&ql(o)),Il.length>e&&Il.sort(Nl));$l.__r=0}function Zl(t,e,r,n,i,o,s,a,u,c){var l,h,d,f,p,g,y,b=n&&n.__k||Ll,m=b.length;for(r.__k=[],l=0;l<e.length;l++)if(null!=(f=r.__k[l]=null==(f=e[l])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Vl(null,f,null,null,f):Array.isArray(f)?Vl(Hl,{children:f},null,null,null):f.__b>0?Vl(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=r,f.__b=r.__b+1,null===(d=b[l])||d&&f.key==d.key&&f.type===d.type)b[l]=void 0;else for(h=0;h<m;h++){if((d=b[h])&&f.key==d.key&&f.type===d.type){b[h]=void 0;break}d=null}rh(t,f,d=d||Pl,i,o,s,a,u,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(y||(y=[]),d.ref&&y.push(d.ref,null,f),y.push(h,f.__c||p,f)),null!=p?(null==g&&(g=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=u=Gl(f,u,t):u=Ql(t,f,d,b,p,u),"function"==typeof r.type&&(r.__d=u)):u&&d.__e==u&&u.parentNode!=t&&(u=Wl(d))}for(r.__e=g,l=m;l--;)null!=b[l]&&("function"==typeof r.type&&null!=b[l].__e&&b[l].__e==r.__d&&(r.__d=Yl(n).nextSibling),sh(b[l],b[l]));if(y)for(l=0;l<y.length;l++)oh(y[l],y[++l],y[++l])}function Gl(t,e,r){for(var n,i=t.__k,o=0;i&&o<i.length;o++)(n=i[o])&&(n.__=t,e="function"==typeof n.type?Gl(n,e,r):Ql(r,n,n,i,n.__e,e));return e}function Ql(t,e,r,n,i,o){var s,a,u;if(void 0!==e.__d)s=e.__d,e.__d=void 0;else if(null==r||i!=o||null==i.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(i),s=null;else{for(a=o,u=0;(a=a.nextSibling)&&u<n.length;u+=1)if(a==i)break t;t.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function Yl(t){var e,r,n;if(null==t.type||"string"==typeof t.type)return t.__e;if(t.__k)for(e=t.__k.length-1;e>=0;e--)if((r=t.__k[e])&&(n=Yl(r)))return n;return null}function Kl(t,e,r){"-"===e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||Dl.test(e)?r:r+"px"}function Xl(t,e,r,n,i){var o;t:if("style"===e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof n&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||Kl(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||Kl(t.style,e,r[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?n||t.addEventListener(e,o?eh:th,o):t.removeEventListener(e,o?eh:th,o);else if("dangerouslySetInnerHTML"!==e){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,r))}}function th(t){return this.l[t.type+!1](xl.event?xl.event(t):t)}function eh(t){return this.l[t.type+!0](xl.event?xl.event(t):t)}function rh(t,e,r,n,i,o,s,a,u){var c,l,h,d,f,p,g,y,b,m,v,w,_,S,E,M=e.type;if(void 0!==e.constructor)return null;null!=r.__h&&(u=r.__h,a=e.__e=r.__e,e.__h=null,o=[a]),(c=xl.__b)&&c(e);try{t:if("function"==typeof M){if(y=e.props,b=(c=M.contextType)&&n[c.__c],m=c?b?b.props.value:c.__:n,r.__c?g=(l=e.__c=r.__c).__=l.__E:("prototype"in M&&M.prototype.render?e.__c=l=new M(y,m):(e.__c=l=new zl(y,m),l.constructor=M,l.render=ah),b&&b.sub(l),l.props=y,l.state||(l.state={}),l.context=m,l.__n=n,h=l.__d=!0,l.__h=[],l._sb=[]),null==l.__s&&(l.__s=l.state),null!=M.getDerivedStateFromProps&&(l.__s==l.state&&(l.__s=Bl({},l.__s)),Bl(l.__s,M.getDerivedStateFromProps(y,l.__s))),d=l.props,f=l.state,l.__v=e,h)null==M.getDerivedStateFromProps&&null!=l.componentWillMount&&l.componentWillMount(),null!=l.componentDidMount&&l.__h.push(l.componentDidMount);else{if(null==M.getDerivedStateFromProps&&y!==d&&null!=l.componentWillReceiveProps&&l.componentWillReceiveProps(y,m),!l.__e&&null!=l.shouldComponentUpdate&&!1===l.shouldComponentUpdate(y,l.__s,m)||e.__v===r.__v){for(e.__v!==r.__v&&(l.props=y,l.state=l.__s,l.__d=!1),l.__e=!1,e.__e=r.__e,e.__k=r.__k,e.__k.forEach((function(t){t&&(t.__=e)})),v=0;v<l._sb.length;v++)l.__h.push(l._sb[v]);l._sb=[],l.__h.length&&s.push(l);break t}null!=l.componentWillUpdate&&l.componentWillUpdate(y,l.__s,m),null!=l.componentDidUpdate&&l.__h.push((function(){l.componentDidUpdate(d,f,p)}))}if(l.context=m,l.props=y,l.__P=t,w=xl.__r,_=0,"prototype"in M&&M.prototype.render){for(l.state=l.__s,l.__d=!1,w&&w(e),c=l.render(l.props,l.state,l.context),S=0;S<l._sb.length;S++)l.__h.push(l._sb[S]);l._sb=[]}else do{l.__d=!1,w&&w(e),c=l.render(l.props,l.state,l.context),l.state=l.__s}while(l.__d&&++_<25);l.state=l.__s,null!=l.getChildContext&&(n=Bl(Bl({},n),l.getChildContext())),h||null==l.getSnapshotBeforeUpdate||(p=l.getSnapshotBeforeUpdate(d,f)),E=null!=c&&c.type===Hl&&null==c.key?c.props.children:c,Zl(t,Array.isArray(E)?E:[E],e,r,n,i,o,s,a,u),l.base=e.__e,e.__h=null,l.__h.length&&s.push(l),g&&(l.__E=l.__=null),l.__e=!1}else null==o&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=ih(r.__e,e,r,n,i,o,s,u);(c=xl.diffed)&&c(e)}catch(t){e.__v=null,(u||null!=o)&&(e.__e=a,e.__h=!!u,o[o.indexOf(a)]=null),xl.__e(t,e,r)}}function nh(t,e){xl.__c&&xl.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){xl.__e(t,e.__v)}}))}function ih(t,e,r,n,i,o,s,a){var u,c,l,h=r.props,d=e.props,f=e.type,p=0;if("svg"===f&&(i=!0),null!=o)for(;p<o.length;p++)if((u=o[p])&&"setAttribute"in u==!!f&&(f?u.localName===f:3===u.nodeType)){t=u,o[p]=null;break}if(null==t){if(null===f)return document.createTextNode(d);t=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,a=!1}if(null===f)h===d||a&&t.data===d||(t.data=d);else{if(o=o&&Ml.call(t.childNodes),c=(h=r.props||Pl).dangerouslySetInnerHTML,l=d.dangerouslySetInnerHTML,!a){if(null!=o)for(h={},p=0;p<t.attributes.length;p++)h[t.attributes[p].name]=t.attributes[p].value;(l||c)&&(l&&(c&&l.__html==c.__html||l.__html===t.innerHTML)||(t.innerHTML=l&&l.__html||""))}if(function(t,e,r,n,i){var o;for(o in r)"children"===o||"key"===o||o in e||Xl(t,o,null,r[o],n);for(o in e)i&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||r[o]===e[o]||Xl(t,o,e[o],r[o],n)}(t,d,h,i,a),l)e.__k=[];else if(p=e.props.children,Zl(t,Array.isArray(p)?p:[p],e,r,n,i&&"foreignObject"!==f,o,s,o?o[0]:r.__k&&Wl(r,0),a),null!=o)for(p=o.length;p--;)null!=o[p]&&Fl(o[p]);a||("value"in d&&void 0!==(p=d.value)&&(p!==t.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&Xl(t,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==t.checked&&Xl(t,"checked",p,h.checked,!1))}return t}function oh(t,e,r){try{"function"==typeof t?t(e):t.current=e}catch(t){xl.__e(t,r)}}function sh(t,e,r){var n,i;if(xl.unmount&&xl.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||oh(n,null,e)),null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){xl.__e(t,e)}n.base=n.__P=null,t.__c=void 0}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&sh(n[i],e,r||"function"!=typeof t.type);r||null==t.__e||Fl(t.__e),t.__=t.__e=t.__d=void 0}function ah(t,e,r){return this.constructor(t,r)}function uh(t,e,r){var n,i,o;xl.__&&xl.__(t,e),i=(n="function"==typeof r)?null:r&&r.__k||e.__k,o=[],rh(e,t=(!n&&r||e).__k=Ul(Hl,null,[t]),i||Pl,Pl,void 0!==e.ownerSVGElement,!n&&r?[r]:i?null:e.firstChild?Ml.call(e.childNodes):null,o,!n&&r?r:i?i.__e:e.firstChild,n),nh(o,t)}Ml=Ll.slice,xl={__e:function(t,e,r,n){for(var i,o,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(t)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(e){t=e}throw t}},kl=0,Cl=function(t){return null!=t&&void 0===t.constructor},zl.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Bl({},this.state),"function"==typeof t&&(t=t(Bl({},r),this.props)),t&&Bl(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Jl(this))},zl.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Jl(this))},zl.prototype.render=Hl,Il=[],Al="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Nl=function(t,e){return t.__v.__b-e.__v.__b},$l.__r=0,jl=0;var ch=Object.freeze({__proto__:null,Component:zl,Fragment:Hl,cloneElement:function(t,e,r){var n,i,o,s=Bl({},t.props);for(o in e)"key"==o?n=e[o]:"ref"==o?i=e[o]:s[o]=e[o];return arguments.length>2&&(s.children=arguments.length>3?Ml.call(arguments,2):r),Vl(t.type,s,n||t.key,i||t.ref,null)},createContext:function(t,e){var r={__c:e="__cC"+jl++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var r,n;return this.getChildContext||(r=[],(n={})[e]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&r.some((function(t){t.__e=!0,Jl(t)}))},this.sub=function(t){r.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r.splice(r.indexOf(t),1),e&&e.call(t)}}),t.children}};return r.Provider.__=r.Consumer.contextType=r},createElement:Ul,createRef:function(){return{current:null}},h:Ul,hydrate:function t(e,r){uh(e,r,t)},get isValidElement(){return Cl},get options(){return xl},render:uh,toChildArray:function t(e,r){return r=r||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){t(e,r)})):r.push(e)),r}}),lh=e(ch);function hh(t){return"function"==typeof t}var dh=!1,fh={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;dh=t},get useDeprecatedSynchronousErrorHandling(){return dh}};function ph(t){setTimeout((function(){throw t}),0)}var gh={closed:!0,next:function(t){},error:function(t){if(fh.useDeprecatedSynchronousErrorHandling)throw t;ph(t)},complete:function(){}},yh=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}();function bh(t){return null!==t&&"object"==typeof t}var mh=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),vh=mh,wh=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,n=r._parentOrParents,i=r._ctorUnsubscribe,o=r._unsubscribe,s=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(var a=0;a<n.length;++a){n[a].remove(this)}if(hh(o)){i&&(this._unsubscribe=void 0);try{o.call(this)}catch(t){e=t instanceof vh?_h(t.errors):[t]}}if(yh(s)){a=-1;for(var u=s.length;++a<u;){var c=s[a];if(bh(c))try{c.unsubscribe()}catch(t){e=e||[],t instanceof vh?e=e.concat(_h(t.errors)):e.push(t)}}}if(e)throw new vh(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;(r=new t)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof t){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[r]:o.push(r),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function _h(t){return t.reduce((function(t,e){return t.concat(e instanceof vh?e.errors:e)}),[])}var Sh=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),Eh=function(t){function e(r,n,i){var o=t.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=gh;break;case 1:if(!r){o.destination=gh;break}if("object"==typeof r){r instanceof e?(o.syncErrorThrowable=r.syncErrorThrowable,o.destination=r,r.add(o)):(o.syncErrorThrowable=!0,o.destination=new Mh(o,r));break}default:o.syncErrorThrowable=!0,o.destination=new Mh(o,r,n,i)}return o}return r(e,t),e.prototype[Sh]=function(){return this},e.create=function(t,r,n){var i=new e(t,r,n);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(wh),Mh=function(t){function e(e,r,n,i){var o,s=t.call(this)||this;s._parentSubscriber=e;var a=s;return hh(r)?o=r:r&&(o=r.next,n=r.error,i=r.complete,r!==gh&&(hh((a=Object.create(r)).unsubscribe)&&s.add(a.unsubscribe.bind(a)),a.unsubscribe=s.unsubscribe.bind(s))),s._context=a,s._next=o,s._error=n,s._complete=i,s}return r(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;fh.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,r=fh.useDeprecatedSynchronousErrorHandling;if(this._error)r&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)r?(e.syncErrorValue=t,e.syncErrorThrown=!0):ph(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;ph(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};fh.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),fh.useDeprecatedSynchronousErrorHandling)throw t;ph(t)}},e.prototype.__tryOrSetError=function(t,e,r){if(!fh.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,r)}catch(e){return fh.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(ph(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(Eh);function xh(t){for(;t;){var e=t,r=e.closed,n=e.destination,i=e.isStopped;if(r||i)return!1;t=n&&n instanceof Eh?n:null}return!0}var kh=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function Ch(t){return t}function Ih(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Rh(t)}function Rh(t){return 0===t.length?Ch:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Ah=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n=this.operator,i=function(t,e,r){if(t){if(t instanceof Eh)return t;if(t[Sh])return t[Sh]()}return t||e||r?new Eh(t,e,r):new Eh(gh)}(t,e,r);if(n?i.add(n.call(i,this.source)):i.add(this.source||fh.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),fh.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){fh.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),xh(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=Nh(e))((function(e,n){var i;i=r.subscribe((function(e){try{t(e)}catch(t){n(t),i&&i.unsubscribe()}}),n,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[kh]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:Rh(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=Nh(t))((function(t,r){var n;e.subscribe((function(t){return n=t}),(function(t){return r(t)}),(function(){return t(n)}))}))},t.create=function(e){return new t(e)},t}();function Nh(t){if(t||(t=fh.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var jh=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),Oh=function(t){function e(e,r){var n=t.call(this)||this;return n.subject=e,n.subscriber=r,n.closed=!1,n}return r(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(wh),Th=function(t){function e(e){var r=t.call(this,e)||this;return r.destination=e,r}return r(e,t),e}(Eh),Ph=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return r(e,t),e.prototype[Sh]=function(){return new Th(this)},e.prototype.lift=function(t){var e=new Lh(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new jh;if(!this.isStopped)for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new jh;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new jh;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),n=0;n<e;n++)r[n].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new jh;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new jh;return this.hasError?(t.error(this.thrownError),wh.EMPTY):this.isStopped?(t.complete(),wh.EMPTY):(this.observers.push(t),new Oh(this,t))},e.prototype.asObservable=function(){var t=new Ah;return t.source=this,t},e.create=function(t,e){return new Lh(t,e)},e}(Ah),Lh=function(t){function e(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return r(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):wh.EMPTY},e}(Ph);function Dh(){return function(t){return t.lift(new Bh(t))}}var Bh=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var r=this.connectable;r._refCount++;var n=new Fh(t,r),i=e.subscribe(n);return n.closed||(n.connection=r.connect()),i},t}(),Fh=function(t){function e(e,r){var n=t.call(this,e)||this;return n.connectable=r,n}return r(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,n=t._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null},e}(Eh),Uh=function(t){function e(e,r){var n=t.call(this)||this;return n.source=e,n.subjectFactory=r,n._refCount=0,n._isComplete=!1,n}return r(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new wh).add(this.source.subscribe(new Hh(this.getSubject(),this))),t.closed&&(this._connection=null,t=wh.EMPTY)),t},e.prototype.refCount=function(){return Dh()(this)},e}(Ah),Vh=function(){var t=Uh.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),Hh=function(t){function e(e,r){var n=t.call(this,e)||this;return n.connectable=r,n}return r(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(Th);var zh=function(){function t(t,e,r,n){this.keySelector=t,this.elementSelector=e,this.durationSelector=r,this.subjectSelector=n}return t.prototype.call=function(t,e){return e.subscribe(new Wh(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),Wh=function(t){function e(e,r,n,i,o){var s=t.call(this,e)||this;return s.keySelector=r,s.elementSelector=n,s.durationSelector=i,s.subjectSelector=o,s.groups=null,s.attemptedToUnsubscribe=!1,s.count=0,s}return r(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},e.prototype._group=function(t,e){var r=this.groups;r||(r=this.groups=new Map);var n,i=r.get(e);if(this.elementSelector)try{n=this.elementSelector(t)}catch(t){this.error(t)}else n=t;if(!i){i=this.subjectSelector?this.subjectSelector():new Ph,r.set(e,i);var o=new Jh(e,i,this);if(this.destination.next(o),this.durationSelector){var s=void 0;try{s=this.durationSelector(new Jh(e,i))}catch(t){return void this.error(t)}this.add(s.subscribe(new qh(e,i,this)))}}i.closed||i.next(n)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,r){e.error(t)})),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(Eh),qh=function(t){function e(e,r,n){var i=t.call(this,r)||this;return i.key=e,i.group=r,i.parent=n,i}return r(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(Eh),Jh=function(t){function e(e,r,n){var i=t.call(this)||this;return i.key=e,i.groupSubject=r,i.refCountSubscription=n,i}return r(e,t),e.prototype._subscribe=function(t){var e=new wh,r=this.refCountSubscription,n=this.groupSubject;return r&&!r.closed&&e.add(new $h(r)),e.add(n.subscribe(t)),e},e}(Ah),$h=function(t){function e(e){var r=t.call(this)||this;return r.parent=e,e.count++,r}return r(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(wh),Zh=function(t){function e(e){var r=t.call(this)||this;return r._value=e,r}return r(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var r=t.prototype._subscribe.call(this,e);return r&&!r.closed&&e.next(this._value),r},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new jh;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(Ph),Gh=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n.pending=!1,n}return r(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(n,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,n=void 0;try{this.work(t)}catch(t){r=!0,n=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),n},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,r){return t.call(this)||this}return r(e,t),e.prototype.schedule=function(t,e){return this},e}(wh)),Qh=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return r(e,t),e.prototype.schedule=function(e,r){return void 0===r&&(r=0),r>0?t.prototype.schedule.call(this,e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,r){return r>0||this.closed?t.prototype.execute.call(this,e,r):this._execute(e,r)},e.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0?t.prototype.requestAsyncId.call(this,e,r,n):e.flush(this)},e}(Gh),Yh=function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=function(){return Date.now()},t}(),Kh=function(t){function e(r,n){void 0===n&&(n=Yh.now);var i=t.call(this,r,(function(){return e.delegate&&e.delegate!==i?e.delegate.now():n()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return r(e,t),e.prototype.schedule=function(r,n,i){return void 0===n&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,i):t.prototype.schedule.call(this,r,n,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},e}(Yh),Xh=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(Kh))(Qh),td=Xh,ed=new Ah((function(t){return t.complete()}));function rd(t){return t?function(t){return new Ah((function(e){return t.schedule((function(){return e.complete()}))}))}(t):ed}function nd(t){return t&&"function"==typeof t.schedule}var id,od=function(t){return function(e){for(var r=0,n=t.length;r<n&&!e.closed;r++)e.next(t[r]);e.complete()}};function sd(t,e){return new Ah((function(r){var n=new wh,i=0;return n.add(e.schedule((function(){i!==t.length?(r.next(t[i++]),r.closed||n.add(this.schedule())):r.complete()}))),n}))}function ad(t,e){return e?sd(t,e):new Ah(od(t))}function ud(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return nd(r)?(t.pop(),sd(t,r)):ad(t)}function cd(t,e){return new Ah(e?function(r){return e.schedule(ld,0,{error:t,subscriber:r})}:function(e){return e.error(t)})}function ld(t){var e=t.error;t.subscriber.error(e)}id||(id={});var hd=function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){switch(this.kind){case"N":return ud(this.value);case"E":return cd(this.error);case"C":return rd()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();var dd=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new fd(t,this.scheduler,this.delay))},t}(),fd=function(t){function e(e,r,n){void 0===n&&(n=0);var i=t.call(this,e)||this;return i.scheduler=r,i.delay=n,i}return r(e,t),e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new pd(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(hd.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(hd.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(hd.createComplete()),this.unsubscribe()},e}(Eh),pd=function(){return function(t,e){this.notification=t,this.destination=e}}(),gd=function(t){function e(e,r,n){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this)||this;return i.scheduler=n,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=e<1?1:e,i._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return r(e,t),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var r=this._events;r.push(e),r.length>this._bufferSize&&r.shift()}t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new yd(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,r=this._infiniteTimeWindow,n=r?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=n.length;if(this.closed)throw new jh;if(this.isStopped||this.hasError?e=wh.EMPTY:(this.observers.push(t),e=new Oh(this,t)),i&&t.add(t=new fd(t,i)),r)for(var s=0;s<o&&!t.closed;s++)t.next(n[s]);else for(s=0;s<o&&!t.closed;s++)t.next(n[s].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||td).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,r=this._windowTime,n=this._events,i=n.length,o=0;o<i&&!(t-n[o].time<r);)o++;return i>e&&(o=Math.max(o,i-e)),o>0&&n.splice(0,o),n},e}(Ph),yd=function(){return function(t,e){this.time=t,this.value=e}}(),bd=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return r(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),wh.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),wh.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(Ph),md=1,vd=function(){return Promise.resolve()}(),wd={};function _d(t){return t in wd&&(delete wd[t],!0)}var Sd=function(t){var e=md++;return wd[e]=!0,vd.then((function(){return _d(e)&&t()})),e},Ed=function(t){_d(t)},Md=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return r(e,t),e.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0?t.prototype.requestAsyncId.call(this,e,r,n):(e.actions.push(this),e.scheduled||(e.scheduled=Sd(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,n);0===e.actions.length&&(Ed(r),e.scheduled=void 0)},e}(Gh),xd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,n=-1,i=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++n<i&&(t=r.shift()));if(this.active=!1,e){for(;++n<i&&(t=r.shift());)t.unsubscribe();throw e}},e}(Kh),kd=new xd(Md),Cd=kd,Id=new Kh(Gh),Rd=Id,Ad=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return r(e,t),e.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0?t.prototype.requestAsyncId.call(this,e,r,n):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},e.prototype.recycleAsyncId=function(e,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,n);0===e.actions.length&&(cancelAnimationFrame(r),e.scheduled=void 0)},e}(Gh),Nd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,n=-1,i=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++n<i&&(t=r.shift()));if(this.active=!1,e){for(;++n<i&&(t=r.shift());)t.unsubscribe();throw e}},e}(Kh),jd=new Nd(Ad),Od=jd,Td=function(t){function e(e,r){void 0===e&&(e=Pd),void 0===r&&(r=Number.POSITIVE_INFINITY);var n=t.call(this,e,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return r(e,t),e.prototype.flush=function(){for(var t,e,r=this.actions,n=this.maxFrames;(e=r[0])&&e.delay<=n&&(r.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=r.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(Kh),Pd=function(t){function e(e,r,n){void 0===n&&(n=e.index+=1);var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i.index=n,i.active=!0,i.index=e.index=n,i}return r(e,t),e.prototype.schedule=function(r,n){if(void 0===n&&(n=0),!this.id)return t.prototype.schedule.call(this,r,n);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(r,n)},e.prototype.requestAsyncId=function(t,r,n){void 0===n&&(n=0),this.delay=t.frame+n;var i=t.actions;return i.push(this),i.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,r){},e.prototype._execute=function(e,r){if(!0===this.active)return t.prototype._execute.call(this,e,r)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(Gh);function Ld(){}var Dd=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),Bd=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),Fd=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}();function Ud(t,e){return function(r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new Vd(t,e))}}var Vd=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Hd(t,this.project,this.thisArg))},t}(),Hd=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.project=r,i.count=0,i.thisArg=n||i,i}return r(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(Eh);function zd(t){var e=this,r=t.args,n=t.subscriber,i=t.params,o=i.callbackFunc,s=i.context,a=i.scheduler,u=i.subject;if(!u){u=i.subject=new bd;try{o.apply(s,r.concat([function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t.length<=1?t[0]:t;e.add(a.schedule(Wd,0,{value:n,subject:u}))}]))}catch(t){u.error(t)}}this.add(u.subscribe(n))}function Wd(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function qd(t){var e=this,r=t.params,n=t.subscriber,i=t.context,o=r.callbackFunc,s=r.args,a=r.scheduler,u=r.subject;if(!u){u=r.subject=new bd;try{o.apply(i,s.concat([function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t.shift();if(n)e.add(a.schedule($d,0,{err:n,subject:u}));else{var i=t.length<=1?t[0]:t;e.add(a.schedule(Jd,0,{value:i,subject:u}))}}]))}catch(t){this.add(a.schedule($d,0,{err:t,subject:u}))}}this.add(u.subscribe(n))}function Jd(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function $d(t){var e=t.err;t.subject.error(e)}var Zd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.notifyNext=function(t,e,r,n,i){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(Eh),Gd=function(t){function e(e,r,n){var i=t.call(this)||this;return i.parent=e,i.outerValue=r,i.outerIndex=n,i.index=0,i}return r(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(Eh);function Qd(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var Yd=Qd(),Kd=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Xd(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var tf=function(t){if(t&&"function"==typeof t[kh])return n=t,function(t){var e=n[kh]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(Kd(t))return od(t);if(Xd(t))return r=t,function(t){return r.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,ph),t};if(t&&"function"==typeof t[Yd])return e=t,function(t){for(var r=e[Yd]();;){var n=void 0;try{n=r.next()}catch(e){return t.error(e),t}if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}return"function"==typeof r.return&&t.add((function(){r.return&&r.return()})),t};var e,r,n,i=bh(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+i+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function ef(t,e,r,n,i){if(void 0===i&&(i=new Gd(t,r,n)),!i.closed)return e instanceof Ah?e.subscribe(i):tf(e)(i)}var rf={};var nf=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new of(t,this.resultSelector))},t}(),of=function(t){function e(e,r){var n=t.call(this,e)||this;return n.resultSelector=r,n.active=0,n.values=[],n.observables=[],n}return r(e,t),e.prototype._next=function(t){this.values.push(rf),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var r=0;r<e;r++){var n=t[r];this.add(ef(this,n,void 0,r))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,r){var n=this.values,i=n[r],o=this.toRespond?i===rf?--this.toRespond:this.toRespond:0;n[r]=e,0===o&&(this.resultSelector?this._tryResultSelector(n):this.destination.next(n.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(Zd);function sf(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[kh]}(t))return function(t,e){return new Ah((function(r){var n=new wh;return n.add(e.schedule((function(){var i=t[kh]();n.add(i.subscribe({next:function(t){n.add(e.schedule((function(){return r.next(t)})))},error:function(t){n.add(e.schedule((function(){return r.error(t)})))},complete:function(){n.add(e.schedule((function(){return r.complete()})))}}))}))),n}))}(t,e);if(Xd(t))return function(t,e){return new Ah((function(r){var n=new wh;return n.add(e.schedule((function(){return t.then((function(t){n.add(e.schedule((function(){r.next(t),n.add(e.schedule((function(){return r.complete()})))})))}),(function(t){n.add(e.schedule((function(){return r.error(t)})))}))}))),n}))}(t,e);if(Kd(t))return sd(t,e);if(function(t){return t&&"function"==typeof t[Yd]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new Ah((function(r){var n,i=new wh;return i.add((function(){n&&"function"==typeof n.return&&n.return()})),i.add(e.schedule((function(){n=t[Yd](),i.add(e.schedule((function(){if(!r.closed){var t,e;try{var i=n.next();t=i.value,e=i.done}catch(t){return void r.error(t)}e?r.complete():(r.next(t),this.schedule())}})))}))),i}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function af(t,e){return e?sf(t,e):t instanceof Ah?t:new Ah(tf(t))}var uf=function(t){function e(e){var r=t.call(this)||this;return r.parent=e,r}return r(e,t),e.prototype._next=function(t){this.parent.notifyNext(t)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(Eh),cf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(Eh);function lf(t,e){if(!e.closed){if(t instanceof Ah)return t.subscribe(e);var r;try{r=tf(t)(e)}catch(t){e.error(t)}return r}}function hf(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?function(n){return n.pipe(hf((function(r,n){return af(t(r,n)).pipe(Ud((function(t,i){return e(r,t,n,i)})))}),r))}:("number"==typeof e&&(r=e),function(e){return e.lift(new df(t,r))})}var df=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new ff(t,this.project,this.concurrent))},t}(),ff=function(t){function e(e,r,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var i=t.call(this,e)||this;return i.project=r,i.concurrent=n,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return r(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new uf(this),r=this.destination;r.add(e);var n=lf(t,e);n!==e&&r.add(n)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(cf),pf=hf;function gf(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),hf(Ch,t)}function yf(){return gf(1)}function bf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return yf()(ud.apply(void 0,t))}function mf(t){return new Ah((function(e){var r;try{r=t()}catch(t){return void e.error(t)}return(r?af(r):rd()).subscribe(e)}))}function vf(t,e){return new Ah((function(r){var n=t.length;if(0!==n)for(var i=new Array(n),o=0,s=0,a=function(a){var u=af(t[a]),c=!1;r.add(u.subscribe({next:function(t){c||(c=!0,s++),i[a]=t},error:function(t){return r.error(t)},complete:function(){++o!==n&&c||(s===n&&r.next(e?e.reduce((function(t,e,r){return t[e]=i[r],t}),{}):i),r.complete())}}))},u=0;u<n;u++)a(u);else r.complete()}))}function wf(t,e,r,n,i){var o;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){var s=t;t.addEventListener(e,r,i),o=function(){return s.removeEventListener(e,r,i)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){var a=t;t.on(e,r),o=function(){return a.off(e,r)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){var u=t;t.addListener(e,r),o=function(){return u.removeListener(e,r)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var c=0,l=t.length;c<l;c++)wf(t[c],e,r,n,i)}n.add(o)}function _f(t){var e=t.subscriber,r=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(t){return void e.error(t)}else t.needIterate=!0;if(r){var n=void 0;try{n=r(t.state)}catch(t){return void e.error(t)}if(!n)return void e.complete();if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(t){return void e.error(t)}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function Sf(t){return!yh(t)&&t-parseFloat(t)+1>=0}function Ef(t){var e=t.subscriber,r=t.counter,n=t.period;e.next(r),this.schedule({subscriber:e,counter:r+1,period:n},n)}function Mf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return nd(i)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(r=t.pop())):"number"==typeof i&&(r=t.pop()),null===n&&1===t.length&&t[0]instanceof Ah?t[0]:gf(r)(ad(t,n))}var xf=new Ah(Ld);function kf(t){var e=t.keys,r=t.index,n=t.subscriber,i=t.subscription,o=t.obj;if(!n.closed)if(r<e.length){var s=e[r];n.next([s,o[s]]),i.add(this.schedule({keys:e,index:r+1,subscriber:n,subscription:i,obj:o}))}else n.complete()}function Cf(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}function If(t,e){return function(r){return r.lift(new Rf(t,e))}}var Rf=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Af(t,this.predicate,this.thisArg))},t}(),Af=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.predicate=r,i.thisArg=n,i.count=0,i}return r(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(Eh);function Nf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!yh(t[0]))return t[0];t=t[0]}return ad(t,void 0).lift(new jf)}var jf=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Of(t))},t}(),Of=function(t){function e(e){var r=t.call(this,e)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return r(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var r=0;r<e&&!this.hasFirst;r++){var n=ef(this,t[r],void 0,r);this.subscriptions&&this.subscriptions.push(n),this.add(n)}this.observables=null}},e.prototype.notifyNext=function(t,e,r){if(!this.hasFirst){this.hasFirst=!0;for(var n=0;n<this.subscriptions.length;n++)if(n!==r){var i=this.subscriptions[n];i.unsubscribe(),this.remove(i)}this.subscriptions=null}this.destination.next(e)},e}(Zd);function Tf(t){var e=t.start,r=t.index,n=t.count,i=t.subscriber;r>=n?i.complete():(i.next(e),i.closed||(t.index=r+1,t.start=e+1,this.schedule(t)))}function Pf(t,e,r){void 0===t&&(t=0);var n=-1;return Sf(e)?n=Number(e)<1?1:Number(e):nd(e)&&(r=e),nd(r)||(r=Rd),new Ah((function(e){var i=Sf(t)?t:+t-r.now();return r.schedule(Lf,i,{index:0,period:n,subscriber:e})}))}function Lf(t){var e=t.index,r=t.period,n=t.subscriber;if(n.next(e),!n.closed){if(-1===r)return n.complete();t.index=e+1,this.schedule(t,r)}}function Df(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return"function"==typeof r&&t.pop(),ad(t,void 0).lift(new Bf(r))}var Bf=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Ff(t,this.resultSelector))},t}(),Ff=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.resultSelector=r,i.iterators=[],i.active=0,i.resultSelector="function"==typeof r?r:void 0,i}return r(e,t),e.prototype._next=function(t){var e=this.iterators;yh(t)?e.push(new Vf(t)):"function"==typeof t[Yd]?e.push(new Uf(t[Yd]())):e.push(new Hf(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var r=0;r<e;r++){var n=t[r];if(n.stillUnsubscribed)this.destination.add(n.subscribe());else this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,r=this.destination,n=0;n<e;n++){if("function"==typeof(s=t[n]).hasValue&&!s.hasValue())return}var i=!1,o=[];for(n=0;n<e;n++){var s,a=(s=t[n]).next();if(s.hasCompleted()&&(i=!0),a.done)return void r.complete();o.push(a.value)}this.resultSelector?this._tryresultSelector(o):r.next(o),i&&r.complete()},e.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(Eh),Uf=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},t}(),Vf=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[Yd]=function(){return this},t.prototype.next=function(t){var e=this.index++,r=this.array;return e<this.length?{value:r[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),Hf=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.parent=r,i.observable=n,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return r(e,t),e.prototype[Yd]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t){this.buffer.push(t),this.parent.checkIterators()},e.prototype.subscribe=function(){return lf(this.observable,new uf(this))},e}(cf),zf=Object.freeze({__proto__:null,Observable:Ah,ConnectableObservable:Uh,GroupedObservable:Jh,observable:kh,Subject:Ph,BehaviorSubject:Zh,ReplaySubject:gd,AsyncSubject:bd,asap:Cd,asapScheduler:kd,async:Rd,asyncScheduler:Id,queue:td,queueScheduler:Xh,animationFrame:Od,animationFrameScheduler:jd,VirtualTimeScheduler:Td,VirtualAction:Pd,Scheduler:Yh,Subscription:wh,Subscriber:Eh,Notification:hd,get NotificationKind(){return id},pipe:Ih,noop:Ld,identity:Ch,isObservable:function(t){return!!t&&(t instanceof Ah||"function"==typeof t.lift&&"function"==typeof t.subscribe)},ArgumentOutOfRangeError:Dd,EmptyError:Bd,ObjectUnsubscribedError:jh,UnsubscriptionError:vh,TimeoutError:Fd,bindCallback:function t(e,r,n){if(r){if(!nd(r))return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return t(e,n).apply(void 0,i).pipe(Ud((function(t){return yh(t)?r.apply(void 0,t):r(t)})))};n=r}return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i,o=this,s={context:o,subject:i,callbackFunc:e,scheduler:n};return new Ah((function(r){if(n){var a={args:t,subscriber:r,params:s};return n.schedule(zd,0,a)}if(!i){i=new bd;try{e.apply(o,t.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.next(t.length<=1?t[0]:t),i.complete()}]))}catch(t){xh(i)?i.error(t):console.warn(t)}}return i.subscribe(r)}))}},bindNodeCallback:function t(e,r,n){if(r){if(!nd(r))return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return t(e,n).apply(void 0,i).pipe(Ud((function(t){return yh(t)?r.apply(void 0,t):r(t)})))};n=r}return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i={subject:void 0,args:t,callbackFunc:e,scheduler:n,context:this};return new Ah((function(r){var o=i.context,s=i.subject;if(n)return n.schedule(qd,0,{params:i,subscriber:r,context:o});if(!s){s=i.subject=new bd;try{e.apply(o,t.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.shift();r?s.error(r):(s.next(t.length<=1?t[0]:t),s.complete())}]))}catch(t){xh(s)?s.error(t):console.warn(t)}}return s.subscribe(r)}))}},combineLatest:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=void 0,n=void 0;return nd(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&yh(t[0])&&(t=t[0]),ad(t,n).lift(new nf(r))},concat:bf,defer:mf,empty:rd,forkJoin:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){var r=t[0];if(yh(r))return vf(r,null);if(bh(r)&&Object.getPrototypeOf(r)===Object.prototype){var n=Object.keys(r);return vf(n.map((function(t){return r[t]})),n)}}if("function"==typeof t[t.length-1]){var i=t.pop();return vf(t=1===t.length&&yh(t[0])?t[0]:t,null).pipe(Ud((function(t){return i.apply(void 0,t)})))}return vf(t,null)},from:af,fromEvent:function t(e,r,n,i){return hh(n)&&(i=n,n=void 0),i?t(e,r,n).pipe(Ud((function(t){return yh(t)?i.apply(void 0,t):i(t)}))):new Ah((function(t){wf(e,r,(function(e){arguments.length>1?t.next(Array.prototype.slice.call(arguments)):t.next(e)}),t,n)}))},fromEventPattern:function t(e,r,n){return n?t(e,r).pipe(Ud((function(t){return yh(t)?n.apply(void 0,t):n(t)}))):new Ah((function(t){var n,i=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t.next(1===e.length?e[0]:e)};try{n=e(i)}catch(e){return void t.error(e)}if(hh(r))return function(){return r(i,n)}}))},generate:function(t,e,r,n,i){var o,s;if(1==arguments.length){var a=t;s=a.initialState,e=a.condition,r=a.iterate,o=a.resultSelector||Ch,i=a.scheduler}else void 0===n||nd(n)?(s=t,o=Ch,i=n):(s=t,o=n);return new Ah((function(t){var n=s;if(i)return i.schedule(_f,0,{subscriber:t,iterate:r,condition:e,resultSelector:o,state:n});for(;;){if(e){var a=void 0;try{a=e(n)}catch(e){return void t.error(e)}if(!a){t.complete();break}}var u=void 0;try{u=o(n)}catch(e){return void t.error(e)}if(t.next(u),t.closed)break;try{n=r(n)}catch(e){return void t.error(e)}}}))},iif:function(t,e,r){return void 0===e&&(e=ed),void 0===r&&(r=ed),mf((function(){return t()?e:r}))},interval:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=Rd),(!Sf(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=Rd),new Ah((function(r){return r.add(e.schedule(Ef,t,{subscriber:r,counter:0,period:t})),r}))},merge:Mf,never:function(){return xf},of:ud,onErrorResumeNext:function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(0===e.length)return ed;var n=e[0],i=e.slice(1);return 1===e.length&&yh(n)?t.apply(void 0,n):new Ah((function(e){var r=function(){return e.add(t.apply(void 0,i).subscribe(e))};return af(n).subscribe({next:function(t){e.next(t)},error:r,complete:r})}))},pairs:function(t,e){return new Ah(e?function(r){var n=Object.keys(t),i=new wh;return i.add(e.schedule(kf,0,{keys:n,index:0,subscriber:r,subscription:i,obj:t})),i}:function(e){for(var r=Object.keys(t),n=0;n<r.length&&!e.closed;n++){var i=r[n];t.hasOwnProperty(i)&&e.next([i,t[i]])}e.complete()})},partition:function(t,e,r){return[If(e,r)(new Ah(tf(t))),If(Cf(e,r))(new Ah(tf(t)))]},race:Nf,range:function(t,e,r){return void 0===t&&(t=0),new Ah((function(n){void 0===e&&(e=t,t=0);var i=0,o=t;if(r)return r.schedule(Tf,0,{index:i,count:e,start:t,subscriber:n});for(;;){if(i++>=e){n.complete();break}if(n.next(o++),n.closed)break}}))},throwError:cd,timer:Pf,using:function(t,e){return new Ah((function(r){var n,i;try{n=t()}catch(t){return void r.error(t)}try{i=e(n)}catch(t){return void r.error(t)}var o=(i?af(i):ed).subscribe(r);return function(){o.unsubscribe(),n&&n.unsubscribe()}}))},zip:Df,scheduled:sf,EMPTY:ed,NEVER:xf,config:fh}),Wf=e(zf),qf={};function Jf(t){var e,r,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=Jf(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function $f(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=Jf(t))&&(n&&(n+=" "),n+=e);return n}var Zf,Gf,Qf,Yf,Kf=e(Object.freeze({__proto__:null,clsx:$f,default:$f})),Xf=0,tp=[],ep=[],rp=xl.__b,np=xl.__r,ip=xl.diffed,op=xl.__c,sp=xl.unmount;function ap(t,e){xl.__h&&xl.__h(Gf,t,Xf||e),Xf=0;var r=Gf.__H||(Gf.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:ep}),r.__[t]}function up(t){return Xf=1,cp(mp,t)}function cp(t,e,r){var n=ap(Zf++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):mp(void 0,e),function(t){var e=n.__N?n.__N[0]:n.__[0],r=n.t(e,t);e!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=Gf,!Gf.u)){var i=function(t,e,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(t){return t.__c}));if(i.every((function(t){return!t.__N})))return!o||o.call(this,t,e,r);var s=!1;return i.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(s=!0)}})),!(!s&&n.__c.props===t)&&(!o||o.call(this,t,e,r))};Gf.u=!0;var o=Gf.shouldComponentUpdate,s=Gf.componentWillUpdate;Gf.componentWillUpdate=function(t,e,r){if(this.__e){var n=o;o=void 0,i(t,e,r),o=n}s&&s.call(this,t,e,r)},Gf.shouldComponentUpdate=i}return n.__N||n.__}function lp(t,e){var r=ap(Zf++,4);!xl.__s&&bp(r.__H,e)&&(r.__=t,r.i=e,Gf.__h.push(r))}function hp(t,e){var r=ap(Zf++,7);return bp(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function dp(){for(var t;t=tp.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(gp),t.__H.__h.forEach(yp),t.__H.__h=[]}catch(e){t.__H.__h=[],xl.__e(e,t.__v)}}xl.__b=function(t){Gf=null,rp&&rp(t)},xl.__r=function(t){np&&np(t),Zf=0;var e=(Gf=t.__c).__H;e&&(Qf===Gf?(e.__h=[],Gf.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=ep,t.__N=t.i=void 0}))):(e.__h.forEach(gp),e.__h.forEach(yp),e.__h=[])),Qf=Gf},xl.diffed=function(t){ip&&ip(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==tp.push(e)&&Yf===xl.requestAnimationFrame||((Yf=xl.requestAnimationFrame)||pp)(dp)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==ep&&(t.__=t.__V),t.i=void 0,t.__V=ep}))),Qf=Gf=null},xl.__c=function(t,e){e.some((function(t){try{t.__h.forEach(gp),t.__h=t.__h.filter((function(t){return!t.__||yp(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],xl.__e(r,t.__v)}})),op&&op(t,e)},xl.unmount=function(t){sp&&sp(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{gp(t)}catch(t){e=t}})),r.__H=void 0,e&&xl.__e(e,r.__v))};var fp="function"==typeof requestAnimationFrame;function pp(t){var e,r=function(){clearTimeout(n),fp&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);fp&&(e=requestAnimationFrame(r))}function gp(t){var e=Gf,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Gf=e}function yp(t){var e=Gf;t.__c=t.__(),Gf=e}function bp(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function mp(t,e){return"function"==typeof e?e(t):e}var vp=Object.freeze({__proto__:null,useCallback:function(t,e){return Xf=8,hp((function(){return t}),e)},useContext:function(t){var e=Gf.context[t.__c],r=ap(Zf++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Gf)),e.props.value):t.__},useDebugValue:function(t,e){xl.useDebugValue&&xl.useDebugValue(e?e(t):t)},useEffect:function(t,e){var r=ap(Zf++,3);!xl.__s&&bp(r.__H,e)&&(r.__=t,r.i=e,Gf.__H.__h.push(r))},useErrorBoundary:function(t){var e=ap(Zf++,10),r=up();return e.__=t,Gf.componentDidCatch||(Gf.componentDidCatch=function(t,n){e.__&&e.__(t,n),r[1](t)}),[r[0],function(){r[1](void 0)}]},useId:function(){var t=ap(Zf++,11);if(!t.__){for(var e=Gf.__v;null!==e&&!e.__m&&null!==e.__;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__},useImperativeHandle:function(t,e,r){Xf=6,lp((function(){return"function"==typeof t?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0}),null==r?r:r.concat(t))},useLayoutEffect:lp,useMemo:hp,useReducer:cp,useRef:function(t){return Xf=5,hp((function(){return{current:t}}),[])},useState:up}),wp=e(vp),_p={},Sp={};Object.defineProperty(Sp,"__esModule",{value:!0}),Sp.LIB_VERSION=void 0,Sp.LIB_VERSION="3.6.6";var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0}),Ep.CloseIcon=void 0;const Mp=lh;Ep.CloseIcon=function(t){return(0,Mp.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,Mp.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))};var xp={};Object.defineProperty(xp,"__esModule",{value:!0}),xp.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var kp={};Object.defineProperty(kp,"__esModule",{value:!0}),kp.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0}),Cp.QRCodeIcon=void 0;const Ip=lh;Cp.QRCodeIcon=function(t){return(0,Ip.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ip.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,Ip.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,Ip.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,Ip.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,Ip.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,Ip.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,Ip.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,Ip.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,Ip.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))};var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.default='\n <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100Z" fill="white"/>\n <path d="M50.512 94C74.2907 94 93.5673 74.5244 93.5673 50.5C93.5673 26.4756 74.2907 7 50.512 7C26.7332 7 7.45667 26.4756 7.45667 50.5C7.45667 74.5244 26.7332 94 50.512 94Z" fill="#0052FF"/>\n <path d="M50.6248 65.4335C42.3697 65.4335 35.8996 58.7469 35.8996 50.5C35.8996 42.2531 42.5928 35.5664 50.6248 35.5664C57.9873 35.5664 64.0111 40.9157 65.1267 48.0481H80.0749C78.7363 32.6688 66.0191 20.6328 50.6248 20.6328C34.3379 20.6328 20.9514 34.0062 20.9514 50.5C20.9514 66.9936 34.1148 80.3671 50.6248 80.3671C66.2422 80.3671 78.7363 68.331 80.0749 52.9516H65.1267C64.0111 60.0841 57.9873 65.4335 50.6248 65.4335Z" fill="white"/>\n </svg>\n';var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.default='\n <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">\n <circle cx="50" cy="50" r="50" fill="white"/>\n <circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/>\n <circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.3379 49.9484C19.3379 66.8508 33.04 80.553 49.9425 80.553C66.8449 80.553 80.5471 66.8508 80.5471 49.9484C80.5471 33.0459 66.8449 19.3438 49.9425 19.3438C33.04 19.3438 19.3379 33.0459 19.3379 49.9484ZM44.0817 40.0799C41.8725 40.0799 40.0817 41.8708 40.0817 44.0799V55.8029C40.0817 58.012 41.8725 59.8029 44.0817 59.8029H55.8046C58.0138 59.8029 59.8046 58.012 59.8046 55.8029V44.0799C59.8046 41.8708 58.0138 40.0799 55.8046 40.0799H44.0817Z" fill="white"/>\n </svg>\n';var Np={};Object.defineProperty(Np,"__esModule",{value:!0}),Np.StatusDotIcon=void 0;const jp=lh;Np.StatusDotIcon=function(t){return(0,jp.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,jp.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))};var Op={};function Tp(t){this.mode=Lp.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e<r;e++){var n=[],i=this.data.charCodeAt(e);i>65536?(n[0]=240|(1835008&i)>>>18,n[1]=128|(258048&i)>>>12,n[2]=128|(4032&i)>>>6,n[3]=128|63&i):i>2048?(n[0]=224|(61440&i)>>>12,n[1]=128|(4032&i)>>>6,n[2]=128|63&i):i>128?(n[0]=192|(1984&i)>>>6,n[1]=128|63&i):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function Pp(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Tp.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e<r;e++)t.put(this.parsedData[e],8)}},Pp.prototype={addData:function(t){var e=new Tp(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=Pp.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(this.modules[t+r][e+n]=0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=Gp.getLostPoint(this);(0==r||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r);this.make();for(var i=0;i<this.modules.length;i++)for(var o=1*i,s=0;s<this.modules[i].length;s++){var a=1*s;this.modules[i][s]&&(n.beginFill(0,100),n.moveTo(a,o),n.lineTo(a+1,o),n.lineTo(a+1,o+1),n.lineTo(a,o+1),n.endFill())}return n},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)null==this.modules[t][6]&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)null==this.modules[6][e]&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=Gp.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var r=0;r<t.length;r++){var n=t[e],i=t[r];if(null==this.modules[n][i])for(var o=-2;o<=2;o++)for(var s=-2;s<=2;s++)this.modules[n+o][i+s]=-2==o||2==o||-2==s||2==s||0==o&&0==s}},setupTypeNumber:function(t){for(var e=Gp.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!t&&1==(e>>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(r=0;r<18;r++){n=!t&&1==(e>>r&1);this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=Gp.getBCHTypeInfo(r),i=0;i<15;i++){var o=!t&&1==(n>>i&1);i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(i=0;i<15;i++){o=!t&&1==(n>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var a=0;a<2;a++)if(null==this.modules[n][s-a]){var u=!1;o<t.length&&(u=1==(t[o]>>>i&1)),Gp.getMask(e,n,s-a)&&(u=!u),this.modules[n][s-a]=u,-1==--i&&(o++,i=7)}if((n+=r)<0||this.moduleCount<=n){n-=r,r=-r;break}}}},Pp.PAD0=236,Pp.PAD1=17,Pp.createData=function(t,e,r){for(var n=Xp.getRSBlocks(t,e),i=new tg,o=0;o<r.length;o++){var s=r[o];i.put(s.mode,4),i.put(s.getLength(),Gp.getLengthInBits(s.mode,t)),s.write(i)}var a=0;for(o=0;o<n.length;o++)a+=n[o].dataCount;if(i.getLengthInBits()>8*a)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+8*a+")");for(i.getLengthInBits()+4<=8*a&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*a||(i.put(Pp.PAD0,8),i.getLengthInBits()>=8*a));)i.put(Pp.PAD1,8);return Pp.createBytes(i,n)},Pp.createBytes=function(t,e){for(var r=0,n=0,i=0,o=new Array(e.length),s=new Array(e.length),a=0;a<e.length;a++){var u=e[a].dataCount,c=e[a].totalCount-u;n=Math.max(n,u),i=Math.max(i,c),o[a]=new Array(u);for(var l=0;l<o[a].length;l++)o[a][l]=255&t.buffer[l+r];r+=u;var h=Gp.getErrorCorrectPolynomial(c),d=new Kp(o[a],h.getLength()-1).mod(h);s[a]=new Array(h.getLength()-1);for(l=0;l<s[a].length;l++){var f=l+d.getLength()-s[a].length;s[a][l]=f>=0?d.get(f):0}}var p=0;for(l=0;l<e.length;l++)p+=e[l].totalCount;var g=new Array(p),y=0;for(l=0;l<n;l++)for(a=0;a<e.length;a++)l<o[a].length&&(g[y++]=o[a][l]);for(l=0;l<i;l++)for(a=0;a<e.length;a++)l<s[a].length&&(g[y++]=s[a][l]);return g};for(var Lp={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Dp=1,Bp=0,Fp=3,Up=2,Vp=0,Hp=1,zp=2,Wp=3,qp=4,Jp=5,$p=6,Zp=7,Gp={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;Gp.getBCHDigit(e)-Gp.getBCHDigit(Gp.G15)>=0;)e^=Gp.G15<<Gp.getBCHDigit(e)-Gp.getBCHDigit(Gp.G15);return(t<<10|e)^Gp.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;Gp.getBCHDigit(e)-Gp.getBCHDigit(Gp.G18)>=0;)e^=Gp.G18<<Gp.getBCHDigit(e)-Gp.getBCHDigit(Gp.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;0!=t;)e++,t>>>=1;return e},getPatternPosition:function(t){return Gp.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case Vp:return(e+r)%2==0;case Hp:return e%2==0;case zp:return r%3==0;case Wp:return(e+r)%3==0;case qp:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case Jp:return e*r%2+e*r%3==0;case $p:return(e*r%2+e*r%3)%2==0;case Zp:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new Kp([1],0),r=0;r<t;r++)e=e.multiply(new Kp([1,Qp.gexp(r)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Lp.MODE_NUMBER:return 10;case Lp.MODE_ALPHA_NUM:return 9;case Lp.MODE_8BIT_BYTE:case Lp.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Lp.MODE_NUMBER:return 12;case Lp.MODE_ALPHA_NUM:return 11;case Lp.MODE_8BIT_BYTE:return 16;case Lp.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else{if(!(e<41))throw new Error("type:"+e);switch(t){case Lp.MODE_NUMBER:return 14;case Lp.MODE_ALPHA_NUM:return 13;case Lp.MODE_8BIT_BYTE:return 16;case Lp.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}}},getLostPoint:function(t){for(var e=t.getModuleCount(),r=0,n=0;n<e;n++)for(var i=0;i<e;i++){for(var o=0,s=t.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||e<=n+a))for(var u=-1;u<=1;u++)i+u<0||e<=i+u||0==a&&0==u||s==t.isDark(n+a,i+u)&&o++;o>5&&(r+=3+o-5)}for(n=0;n<e-1;n++)for(i=0;i<e-1;i++){var c=0;t.isDark(n,i)&&c++,t.isDark(n+1,i)&&c++,t.isDark(n,i+1)&&c++,t.isDark(n+1,i+1)&&c++,0!=c&&4!=c||(r+=3)}for(n=0;n<e;n++)for(i=0;i<e-6;i++)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(r+=40);for(i=0;i<e;i++)for(n=0;n<e-6;n++)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(r+=40);var l=0;for(i=0;i<e;i++)for(n=0;n<e;n++)t.isDark(n,i)&&l++;return r+=10*(Math.abs(100*l/e/e-50)/5)}},Qp={glog:function(t){if(t<1)throw new Error("glog("+t+")");return Qp.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return Qp.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},Yp=0;Yp<8;Yp++)Qp.EXP_TABLE[Yp]=1<<Yp;for(Yp=8;Yp<256;Yp++)Qp.EXP_TABLE[Yp]=Qp.EXP_TABLE[Yp-4]^Qp.EXP_TABLE[Yp-5]^Qp.EXP_TABLE[Yp-6]^Qp.EXP_TABLE[Yp-8];for(Yp=0;Yp<255;Yp++)Qp.LOG_TABLE[Qp.EXP_TABLE[Yp]]=Yp;function Kp(t,e){if(null==t.length)throw new Error(t.length+"/"+e);for(var r=0;r<t.length&&0==t[r];)r++;this.num=new Array(t.length-r+e);for(var n=0;n<t.length-r;n++)this.num[n]=t[n+r]}function Xp(t,e){this.totalCount=t,this.dataCount=e}function tg(){this.buffer=[],this.length=0}Kp.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<t.getLength();n++)e[r+n]^=Qp.gexp(Qp.glog(this.get(r))+Qp.glog(t.get(n)));return new Kp(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=Qp.glog(this.get(0))-Qp.glog(t.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(n=0;n<t.getLength();n++)r[n]^=Qp.gexp(Qp.glog(t.get(n))+e);return new Kp(r,0).mod(t)}},Xp.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],Xp.getRSBlocks=function(t,e){var r=Xp.getRsBlockTable(t,e);if(null==r)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var n=r.length/3,i=[],o=0;o<n;o++)for(var s=r[3*o+0],a=r[3*o+1],u=r[3*o+2],c=0;c<s;c++)i.push(new Xp(a,u));return i},Xp.getRsBlockTable=function(t,e){switch(e){case Dp:return Xp.RS_BLOCK_TABLE[4*(t-1)+0];case Bp:return Xp.RS_BLOCK_TABLE[4*(t-1)+1];case Fp:return Xp.RS_BLOCK_TABLE[4*(t-1)+2];case Up:return Xp.RS_BLOCK_TABLE[4*(t-1)+3];default:return}},tg.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var r=0;r<e;r++)this.putBit(1==(t>>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var eg=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function rg(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},"string"==typeof t&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if("string"!=typeof this.options.content)throw new Error("Expected 'content' as string!");if(0===this.options.content.length)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0&&this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");var r=this.options.content,n=function(t,e){for(var r=function(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=t?3:0)}(t),n=1,i=0,o=0,s=eg.length;o<=s;o++){var a=eg[o];if(!a)throw new Error("Content too long: expected "+i+" but got "+r);switch(e){case"L":i=a[0];break;case"M":i=a[1];break;case"Q":i=a[2];break;case"H":i=a[3];break;default:throw new Error("Unknwon error correction level: "+e)}if(r<=i)break;n++}if(n>eg.length)throw new Error("Content too long");return n}(r,this.options.ecl),i=function(t){switch(t){case"L":return Dp;case"M":return Bp;case"Q":return Fp;case"H":return Up;default:throw new Error("Unknwon error correction level: "+t)}}(this.options.ecl);this.qrcode=new Pp(n,i),this.qrcode.addData(r),this.qrcode.make()}rg.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;void 0===t&&(t={container:e.container||"svg"});for(var n=void 0===e.pretty||!!e.pretty,i=n?" ":"",o=n?"\r\n":"",s=e.width,a=e.height,u=r.length,c=s/(u+2*e.padding),l=a/(u+2*e.padding),h=void 0!==e.join&&!!e.join,d=void 0!==e.swap&&!!e.swap,f=void 0===e.xmlDeclaration||!!e.xmlDeclaration,p=void 0!==e.predefined&&!!e.predefined,g=p?i+'<defs><path id="qrmodule" d="M0 0 h'+l+" v"+c+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+o:"",y=i+'<rect x="0" y="0" width="'+s+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+o,b="",m="",v=0;v<u;v++)for(var w=0;w<u;w++){if(r[w][v]){var _=w*c+e.padding*c,S=v*l+e.padding*l;if(d){var E=_;_=S,S=E}if(h){var M=c+_,x=l+S;_=Number.isInteger(_)?Number(_):_.toFixed(2),S=Number.isInteger(S)?Number(S):S.toFixed(2),M=Number.isInteger(M)?Number(M):M.toFixed(2),m+="M"+_+","+S+" V"+(x=Number.isInteger(x)?Number(x):x.toFixed(2))+" H"+M+" V"+S+" H"+_+" Z "}else b+=p?i+'<use x="'+_.toString()+'" y="'+S.toString()+'" href="#qrmodule" />'+o:i+'<rect x="'+_.toString()+'" y="'+S.toString()+'" width="'+c+'" height="'+l+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+o}}h&&(b=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+m+'" />');let k="";if(void 0!==this.options.image&&this.options.image.svg){const t=s*this.options.image.width/100,e=a*this.options.image.height/100;k+=`<svg x="${s/2-t/2}" y="${a/2-e/2}" width="${t}" height="${e}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,k+=this.options.image.svg+o,k+="</svg>"}var C="";switch(t.container){case"svg":f&&(C+='<?xml version="1.0" standalone="yes"?>'+o),C+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+s+'" height="'+a+'">'+o,C+=g+y+b,C+=k,C+="</svg>";break;case"svg-viewbox":f&&(C+='<?xml version="1.0" standalone="yes"?>'+o),C+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+s+" "+a+'">'+o,C+=g+y+b,C+=k,C+="</svg>";break;case"g":C+='<g width="'+s+'" height="'+a+'">'+o,C+=g+y+b,C+=k,C+="</g>";break;default:C+=(g+y+b+k).replace(/^\s+/,"")}return C};var ng=rg,ig=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Op,"__esModule",{value:!0}),Op.QRCode=void 0;const og=lh,sg=wp,ag=ig(ng);Op.QRCode=t=>{const[e,r]=(0,sg.useState)("");return(0,sg.useEffect)((()=>{var e,n;const i=new ag.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:null!==(e=t.width)&&void 0!==e?e:256,height:null!==(n=t.height)&&void 0!==n?n:256,padding:0,image:t.image}),o=Buffer.from(i.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)})),e?(0,og.h)("img",{src:e,alt:"QR Code"}):null};var ug={},cg={};Object.defineProperty(cg,"__esModule",{value:!0}),cg.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var lg=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ug,"__esModule",{value:!0}),ug.Spinner=void 0;const hg=lh,dg=lg(cg);ug.Spinner=t=>{var e;const r=null!==(e=t.size)&&void 0!==e?e:64,n=t.color||"#000";return(0,hg.h)("div",{class:"-cbwsdk-spinner"},(0,hg.h)("style",null,dg.default),(0,hg.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,hg.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};var fg={};Object.defineProperty(fg,"__esModule",{value:!0}),fg.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var pg=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_p,"__esModule",{value:!0}),_p.CoinbaseAppSteps=_p.CoinbaseWalletSteps=_p.ConnectItem=_p.ConnectContent=void 0;const gg=pg(Kf),yg=lh,bg=wp,mg=fe,vg=Sp,wg=Ep,_g=pg(xp),Sg=pg(kp),Eg=Cp,Mg=pg(Rp),xg=pg(Ap),kg=Np,Cg=Op,Ig=ug,Rg=pg(fg),Ag={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:Sg.default,steps:Og},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:_g.default,steps:Tg}},Ng=t=>"light"===t?"#FFFFFF":"#0A0B0D";function jg({title:t,description:e,icon:r,selected:n,theme:i,onClick:o}){return(0,yg.h)("div",{onClick:o,class:(0,gg.default)("-cbwsdk-connect-item",i,{selected:n})},(0,yg.h)("div",null,(0,yg.h)("img",{src:r,alt:t})),(0,yg.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,yg.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,yg.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}function Og({theme:t}){return(0,yg.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,yg.h)("li",{class:(0,gg.default)("-cbwsdk-wallet-steps-item",t)},(0,yg.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,yg.h)("li",{class:(0,gg.default)("-cbwsdk-wallet-steps-item",t)},(0,yg.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,yg.h)("span",null,"Tap ",(0,yg.h)("strong",null,"Scan")," "),(0,yg.h)("span",{class:(0,gg.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,yg.h)(Eg.QRCodeIcon,{fill:Ng(t)})))))}function Tg({theme:t}){return(0,yg.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,yg.h)("li",{class:(0,gg.default)("-cbwsdk-wallet-steps-item",t)},(0,yg.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,yg.h)("li",{class:(0,gg.default)("-cbwsdk-wallet-steps-item",t)},(0,yg.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,yg.h)("span",null,"Tap ",(0,yg.h)("strong",null,"More")),(0,yg.h)("span",{class:(0,gg.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,yg.h)(kg.StatusDotIcon,{fill:Ng(t)})),(0,yg.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,yg.h)("strong",null,"Scan")),(0,yg.h)("span",{class:(0,gg.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,yg.h)(Eg.QRCodeIcon,{fill:Ng(t)})))))}_p.ConnectContent=function(t){const{theme:e}=t,[r,n]=(0,bg.useState)("coinbase-wallet-app"),i=(0,bg.useCallback)((t=>{n(t)}),[]),o=(0,mg.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId);if(!r)return null;const s=Ag[r].steps,a="coinbase-app"===r;return(0,yg.h)("div",{"data-testid":"connect-content",class:(0,gg.default)("-cbwsdk-connect-content",e)},(0,yg.h)("style",null,Rg.default),(0,yg.h)("div",{class:"-cbwsdk-connect-content-header"},(0,yg.h)("h2",{class:(0,gg.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,yg.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,yg.h)(wg.CloseIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,yg.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,yg.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,yg.h)("div",null,Object.entries(Ag).map((([t,n])=>(0,yg.h)(jg,{key:t,title:n.title,description:n.description,icon:n.icon,selected:r===t,onClick:()=>i(t),theme:e})))),a&&(0,yg.h)("div",{class:(0,gg.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,yg.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,yg.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,yg.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,yg.h)(Cg.QRCode,{content:o,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:(u=r,"coinbase-app"===u?Mg.default:xg.default),width:25,height:25}}),(0,yg.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:vg.LIB_VERSION}),(0,yg.h)("input",{type:"hidden",value:o})),(0,yg.h)(s,{theme:e}),!t.isConnected&&(0,yg.h)("div",{"data-testid":"connecting-spinner",class:(0,gg.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,yg.h)(Ig.Spinner,{size:36,color:"dark"===e?"#FFF":"#000"}),(0,yg.h)("p",null,"Connecting...")))));var u},_p.ConnectItem=jg,_p.CoinbaseWalletSteps=Og,_p.CoinbaseAppSteps=Tg;var Pg={},Lg={};Object.defineProperty(Lg,"__esModule",{value:!0}),Lg.ArrowLeftIcon=void 0;const Dg=lh;Lg.ArrowLeftIcon=function(t){return(0,Dg.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,Dg.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))};var Bg={};Object.defineProperty(Bg,"__esModule",{value:!0}),Bg.LaptopIcon=void 0;const Fg=lh;Bg.LaptopIcon=function(t){return(0,Fg.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Fg.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Fg.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))};var Ug={};Object.defineProperty(Ug,"__esModule",{value:!0}),Ug.SafeIcon=void 0;const Vg=lh;Ug.SafeIcon=function(t){return(0,Vg.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Vg.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))};var Hg={};Object.defineProperty(Hg,"__esModule",{value:!0}),Hg.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var zg=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pg,"__esModule",{value:!0}),Pg.TryExtensionContent=void 0;const Wg=zg(Kf),qg=lh,Jg=wp,$g=Lg,Zg=Bg,Gg=Ug,Qg=zg(Hg);Pg.TryExtensionContent=function({theme:t}){const[e,r]=(0,Jg.useState)(!1),n=(0,Jg.useCallback)((()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")}),[]),i=(0,Jg.useCallback)((()=>{e?window.location.reload():(n(),r(!0))}),[n,e]);return(0,qg.h)("div",{class:(0,Wg.default)("-cbwsdk-try-extension",t)},(0,qg.h)("style",null,Qg.default),(0,qg.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,qg.h)("h3",{class:(0,Wg.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,qg.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,qg.h)("button",{class:(0,Wg.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,qg.h)("div",null,!e&&(0,qg.h)($g.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:"light"===t?"#0052FF":"#588AF5"})))),(0,qg.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,qg.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,qg.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,qg.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,qg.h)("span",{class:(0,Wg.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,qg.h)(Zg.LaptopIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,qg.h)("div",{class:(0,Wg.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,qg.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,qg.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,qg.h)("span",{class:(0,Wg.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,qg.h)(Gg.SafeIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,qg.h)("div",{class:(0,Wg.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))};var Yg={};Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var Kg=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qf,"__esModule",{value:!0}),qf.ConnectDialog=void 0;const Xg=Kg(Kf),ty=lh,ey=wp,ry=_p,ny=Pg,iy=Kg(Yg);qf.ConnectDialog=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,ey.useState)(!e),[o,s]=(0,ey.useState)(!e);(0,ey.useEffect)((()=>{const t=[window.setTimeout((()=>{s(!e)}),10)];return e?i(!1):t.push(window.setTimeout((()=>{i(!0)}),360)),()=>{t.forEach(window.clearTimeout)}}),[t.isOpen]);const a=r?"dark":"light";return(0,ty.h)("div",{class:(0,Xg.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,ty.h)("style",null,iy.default),(0,ty.h)("div",{class:(0,Xg.default)("-cbwsdk-connect-dialog-backdrop",a,o&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,ty.h)("div",{class:"-cbwsdk-connect-dialog"},(0,ty.h)("div",{class:(0,Xg.default)("-cbwsdk-connect-dialog-box",o&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,ty.h)(ry.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,ty.h)(ny.TryExtensionContent,{theme:a}))))},Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.LinkFlow=void 0;const oy=lh,sy=Wf,ay=qf;Tl.LinkFlow=class{constructor(t){this.extensionUI$=new sy.BehaviorSubject({}),this.subscriptions=new sy.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection,this.connected$=t.connected$,this.chainId$=t.chainId$}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe((t=>{this.isConnected!==t&&(this.isConnected=t,this.render())}))),this.subscriptions.add(this.chainId$.subscribe((t=>{this.chainId!==t&&(this.chainId=t,this.render())})))}detach(){var t;this.root&&(this.subscriptions.unsubscribe(),(0,oy.render)(null,this.root),null===(t=this.root.parentElement)||void 0===t||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const t=this.extensionUI$.subscribe((()=>{this.root&&(0,oy.render)((0,oy.h)(ay.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}));this.subscriptions.add(t)}};var uy={},cy={};Object.defineProperty(cy,"__esModule",{value:!0}),cy.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}",function(e){var r=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const n=r(Kf),i=lh,o=wp,s=r(cy);function a(t){return"coinbase-app"===t?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}e.Snackbar=class{constructor(t){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=t.darkMode}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",t.appendChild(this.root),this.render()}presentItem(t){const e=this.nextItemKey++;return this.items.set(e,t),this.render(),()=>{this.items.delete(e),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,i.render)((0,i.h)("div",null,(0,i.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map((([t,r])=>(0,i.h)(e.SnackbarInstance,Object.assign({},r,{key:t})))))),this.root)}};e.SnackbarContainer=t=>(0,i.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-container")},(0,i.h)("style",null,s.default),(0,i.h)("div",{class:"-cbwsdk-snackbar"},t.children));e.SnackbarInstance=({autoExpand:t,message:e,menuItems:r,appSrc:s})=>{const[u,c]=(0,o.useState)(!0),[l,h]=(0,o.useState)(null!=t&&t);(0,o.useEffect)((()=>{const t=[window.setTimeout((()=>{c(!1)}),1),window.setTimeout((()=>{h(!0)}),1e4)];return()=>{t.forEach(window.clearTimeout)}}));return(0,i.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance",u&&"-cbwsdk-snackbar-instance-hidden",l&&"-cbwsdk-snackbar-instance-expanded")},(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{h(!l)}},(0,i.h)("img",{src:a(s),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),(0,i.h)("div",{class:"-gear-container"},!l&&(0,i.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,i.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map(((t,e)=>(0,i.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item",t.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:t.onClick,key:e},(0,i.h)("svg",{width:t.svgWidth,height:t.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.h)("path",{"fill-rule":t.defaultFillRule,"clip-rule":t.defaultClipRule,d:t.path,fill:"#AAAAAA"})),(0,i.h)("span",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item-info",t.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},t.info))))))}}(uy);var ly={},hy={};Object.defineProperty(hy,"__esModule",{value:!0}),hy.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var dy=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ly,"__esModule",{value:!0}),ly.injectCssReset=void 0;const fy=dy(hy);ly.injectCssReset=function(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(fy.default)),document.documentElement.appendChild(t)},Object.defineProperty(Ol,"__esModule",{value:!0}),Ol.WalletSDKUI=void 0;const py=Tl,gy=uy,yy=ly;Ol.WalletSDKUI=class{constructor(t){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new gy.Snackbar({darkMode:t.darkMode}),this.linkFlow=new py.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,connected$:t.connected$,chainId$:t.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,e=document.createElement("div");e.className="-cbwsdk-css-reset",t.appendChild(e),this.linkFlow.attach(e),this.snackbar.attach(e),this.attached=!0,(0,yy.injectCssReset)()}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(t){}watchAsset(t){}switchEthereumChain(t){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(t){}signEthereumTransaction(t){}submitEthereumTransaction(t){}ethereumAddressFromSignedMessage(t){}showConnecting(t){let e;return e=t.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:{message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(e)}setAppSrc(t){this.appSrc=t}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(t){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return null!==(t=this.standalone)&&void 0!==t&&t}};var by,my={},vy={};function wy(t,e,r){if(!r||typeof r.value!==by.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:by.boolTrue,get:function(){var t=r.value.bind(this);return Object.defineProperty(this,e,{value:t,configurable:by.boolTrue,writable:by.boolTrue}),t}}}function _y(t){return function(e){return e.lift(new Sy(t))}}Object.defineProperty(vy,"__esModule",{value:!0}),function(t){t.typeOfFunction="function",t.boolTrue=!0}(by||(by={})),vy.bind=wy,vy.default=wy;var Sy=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Ey(t,this.durationSelector))},t}(),Ey=function(t){function e(e,r){var n=t.call(this,e)||this;return n.durationSelector=r,n.hasValue=!1,n}return r(e,t),e.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var r=lf(e,new uf(this));!r||r.closed?this.clearThrottle():this.add(this.throttled=r)}},e.prototype.clearThrottle=function(){var t=this,e=t.value,r=t.hasValue,n=t.throttled;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),r&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(cf);var My=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new xy(t,this.closingNotifier))},t}(),xy=function(t){function e(e,r){var n=t.call(this,e)||this;return n.buffer=[],n.add(lf(r,new uf(n))),n}return r(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype.notifyNext=function(){var t=this.buffer;this.buffer=[],this.destination.next(t)},e}(cf);var ky=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?Iy:Cy}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),Cy=function(t){function e(e,r){var n=t.call(this,e)||this;return n.bufferSize=r,n.buffer=[],n}return r(e,t),e.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},e}(Eh),Iy=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.bufferSize=r,i.startBufferEvery=n,i.buffers=[],i.count=0,i}return r(e,t),e.prototype._next=function(t){var e=this,r=e.bufferSize,n=e.startBufferEvery,i=e.buffers,o=e.count;this.count++,o%n==0&&i.push([]);for(var s=i.length;s--;){var a=i[s];a.push(t),a.length===r&&(i.splice(s,1),this.destination.next(a))}},e.prototype._complete=function(){for(var e=this.buffers,r=this.destination;e.length>0;){var n=e.shift();n.length>0&&r.next(n)}t.prototype._complete.call(this)},e}(Eh);var Ry=function(){function t(t,e,r,n){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=r,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new Ny(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),Ay=function(){return function(){this.buffer=[]}}(),Ny=function(t){function e(e,r,n,i,o){var s=t.call(this,e)||this;s.bufferTimeSpan=r,s.bufferCreationInterval=n,s.maxBufferSize=i,s.scheduler=o,s.contexts=[];var a=s.openContext();if(s.timespanOnly=null==n||n<0,s.timespanOnly){var u={subscriber:s,context:a,bufferTimeSpan:r};s.add(a.closeAction=o.schedule(jy,r,u))}else{var c={subscriber:s,context:a},l={bufferTimeSpan:r,bufferCreationInterval:n,subscriber:s,scheduler:o};s.add(a.closeAction=o.schedule(Ty,r,c)),s.add(o.schedule(Oy,n,l))}return s}return r(e,t),e.prototype._next=function(t){for(var e,r=this.contexts,n=r.length,i=0;i<n;i++){var o=r[i],s=o.buffer;s.push(t),s.length==this.maxBufferSize&&(e=o)}e&&this.onBufferFull(e)},e.prototype._error=function(e){this.contexts.length=0,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts,r=this.destination;e.length>0;){var n=e.shift();r.next(n.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var r=this.bufferTimeSpan,n={subscriber:this,context:t,bufferTimeSpan:r};this.add(t.closeAction=this.scheduler.schedule(jy,r,n))}},e.prototype.openContext=function(){var t=new Ay;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(Eh);function jy(t){var e=t.subscriber,r=t.context;r&&e.closeContext(r),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function Oy(t){var e=t.bufferCreationInterval,r=t.bufferTimeSpan,n=t.subscriber,i=t.scheduler,o=n.openContext();n.closed||(n.add(o.closeAction=i.schedule(Ty,r,{subscriber:n,context:o})),this.schedule(t,e))}function Ty(t){var e=t.subscriber,r=t.context;e.closeContext(r)}var Py=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Ly(t,this.openings,this.closingSelector))},t}(),Ly=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.closingSelector=n,i.contexts=[],i.add(ef(i,r)),i}return r(e,t),e.prototype._next=function(t){for(var e=this.contexts,r=e.length,n=0;n<r;n++)e[n].buffer.push(t)},e.prototype._error=function(e){for(var r=this.contexts;r.length>0;){var n=r.shift();n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var r=e.shift();this.destination.next(r.buffer),r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var r=t.buffer,n=t.subscription;this.destination.next(r),e.splice(e.indexOf(t),1),this.remove(n),n.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,r=new wh,n={buffer:[],subscription:r};e.push(n);var i=ef(this,t,n);!i||i.closed?this.closeBuffer(n):(i.context=n,this.add(i),r.add(i))},e}(Zd);var Dy=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new By(t,this.closingSelector))},t}(),By=function(t){function e(e,r){var n=t.call(this,e)||this;return n.closingSelector=r,n.subscribing=!1,n.openBuffer(),n}return r(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,r=this.buffer;this.buffer&&this.destination.next(r),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new wh,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(lf(e,new uf(this))),this.subscribing=!1},e}(cf);var Fy=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new Uy(t,this.selector,this.caught))},t}(),Uy=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.selector=r,i.caught=n,i}return r(e,t),e.prototype.error=function(e){if(!this.isStopped){var r=void 0;try{r=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var n=new uf(this);this.add(n);var i=lf(r,n);i!==n&&this.add(i)}},e}(cf);function Vy(t,e){return hf(t,e,1)}var Hy=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new zy(t,this.predicate,this.source))},t}(),zy=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.predicate=r,i.source=n,i.count=0,i.index=0,i}return r(e,t),e.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},e.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(Eh);var Wy=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new qy(t,this.durationSelector))},t}(),qy=function(t){function e(e,r){var n=t.call(this,e)||this;return n.durationSelector=r,n.hasValue=!1,n}return r(e,t),e.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(t,e){var r=this.durationSubscription;this.value=t,this.hasValue=!0,r&&(r.unsubscribe(),this.remove(r)),(r=lf(e,new uf(this)))&&!r.closed&&this.add(this.durationSubscription=r)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var e=this.value,r=this.durationSubscription;r&&(this.durationSubscription=void 0,r.unsubscribe(),this.remove(r)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,e)}},e}(cf);var Jy=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new $y(t,this.dueTime,this.scheduler))},t}(),$y=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.dueTime=r,i.scheduler=n,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return r(e,t),e.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Zy,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},e.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},e}(Eh);function Zy(t){t.debouncedNext()}function Gy(t){return void 0===t&&(t=null),function(e){return e.lift(new Qy(t))}}var Qy=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new Yy(t,this.defaultValue))},t}(),Yy=function(t){function e(e,r){var n=t.call(this,e)||this;return n.defaultValue=r,n.isEmpty=!0,n}return r(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(Eh);function Ky(t){return t instanceof Date&&!isNaN(+t)}var Xy=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new tb(t,this.delay,this.scheduler))},t}(),tb=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.delay=r,i.scheduler=n,i.queue=[],i.active=!1,i.errored=!1,i}return r(e,t),e.dispatch=function(t){for(var e=t.source,r=e.queue,n=t.scheduler,i=t.destination;r.length>0&&r[0].time-n.now()<=0;)r.shift().notification.observe(i);if(r.length>0){var o=Math.max(0,r[0].time-n.now());this.schedule(t,o)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,r=new eb(e.now()+this.delay,t);this.queue.push(r),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(hd.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(hd.createComplete()),this.unsubscribe()},e}(Eh),eb=function(){return function(t,e){this.time=t,this.notification=e}}();var rb=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new nb(t,this.delayDurationSelector))},t}(),nb=function(t){function e(e,r){var n=t.call(this,e)||this;return n.delayDurationSelector=r,n.completed=!1,n.delayNotifierSubscriptions=[],n.index=0,n}return r(e,t),e.prototype.notifyNext=function(t,e,r,n,i){this.destination.next(t),this.removeSubscription(i),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){var e=this.index++;try{var r=this.delayDurationSelector(t,e);r&&this.tryDelay(r,t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},e.prototype.tryDelay=function(t,e){var r=ef(this,t,e);r&&!r.closed&&(this.destination.add(r),this.delayNotifierSubscriptions.push(r))},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(Zd),ib=function(t){function e(e,r){var n=t.call(this)||this;return n.source=e,n.subscriptionDelay=r,n}return r(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new ob(t,this.source))},e}(Ah),ob=function(t){function e(e,r){var n=t.call(this)||this;return n.parent=e,n.source=r,n.sourceSubscribed=!1,n}return r(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(Eh);var sb=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ab(t))},t}(),ab=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(Eh);var ub=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new cb(t,this.keySelector,this.flushes))},t}(),cb=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.keySelector=r,i.values=new Set,n&&i.add(lf(n,new uf(i))),i}return r(e,t),e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(t){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,r=this.destination;try{e=this.keySelector(t)}catch(t){return void r.error(t)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var r=this.values;r.has(t)||(r.add(t),this.destination.next(e))},e}(cf);function lb(t,e){return function(r){return r.lift(new hb(t,e))}}var hb=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new db(t,this.compare,this.keySelector))},t}(),db=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.keySelector=n,i.hasKey=!1,"function"==typeof r&&(i.compare=r),i}return r(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var r=this.keySelector;e=r?r(t):t}catch(t){return this.destination.error(t)}var n=!1;if(this.hasKey)try{n=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;n||(this.key=e,this.destination.next(t))},e}(Eh);function fb(t){return void 0===t&&(t=yb),function(e){return e.lift(new pb(t))}}var pb=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,e){return e.subscribe(new gb(t,this.errorFactory))},t}(),gb=function(t){function e(e,r){var n=t.call(this,e)||this;return n.errorFactory=r,n.hasValue=!1,n}return r(e,t),e.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)},e}(Eh);function yb(){return new Bd}function bb(t){return function(e){return 0===t?rd():e.lift(new mb(t))}}var mb=function(){function t(t){if(this.total=t,this.total<0)throw new Dd}return t.prototype.call=function(t,e){return e.subscribe(new vb(t,this.total))},t}(),vb=function(t){function e(e,r){var n=t.call(this,e)||this;return n.total=r,n.count=0,n}return r(e,t),e.prototype._next=function(t){var e=this.total,r=++this.count;r<=e&&(this.destination.next(t),r===e&&(this.destination.complete(),this.unsubscribe()))},e}(Eh);var wb=function(){function t(t,e,r){this.predicate=t,this.thisArg=e,this.source=r}return t.prototype.call=function(t,e){return e.subscribe(new _b(t,this.predicate,this.thisArg,this.source))},t}(),_b=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.predicate=r,o.thisArg=n,o.source=i,o.index=0,o.thisArg=n||o,o}return r(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(Eh);var Sb=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Eb(t))},t}(),Eb=function(t){function e(e){var r=t.call(this,e)||this;return r.hasCompleted=!1,r.hasSubscription=!1,r}return r(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(lf(t,new uf(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(cf);var Mb=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new xb(t,this.project))},t}(),xb=function(t){function e(e,r){var n=t.call(this,e)||this;return n.project=r,n.hasSubscription=!1,n.hasCompleted=!1,n.index=0,n}return r(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new uf(this),r=this.destination;r.add(e);var n=lf(t,e);n!==e&&r.add(n)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(cf);var kb=function(){function t(t,e,r){this.project=t,this.concurrent=e,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new Cb(t,this.project,this.concurrent,this.scheduler))},t}(),Cb=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.project=r,o.concurrent=n,o.scheduler=i,o.index=0,o.active=0,o.hasCompleted=!1,n<Number.POSITIVE_INFINITY&&(o.buffer=[]),o}return r(e,t),e.dispatch=function(t){var e=t.subscriber,r=t.result,n=t.value,i=t.index;e.subscribeToProjection(r,n,i)},e.prototype._next=function(t){var r=this.destination;if(r.closed)this._complete();else{var n=this.index++;if(this.active<this.concurrent){r.next(t);try{var i=(0,this.project)(t,n);if(this.scheduler){var o={subscriber:this,result:i,value:t,index:n};this.destination.add(this.scheduler.schedule(e.dispatch,0,o))}else this.subscribeToProjection(i,t,n)}catch(t){r.error(t)}}else this.buffer.push(t)}},e.prototype.subscribeToProjection=function(t,e,r){this.active++,this.destination.add(lf(t,new uf(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this._next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t&&t.length>0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(cf);var Ib=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new Rb(t,this.callback))},t}(),Rb=function(t){function e(e,r){var n=t.call(this,e)||this;return n.add(new wh(r)),n}return r(e,t),e}(Eh);var Ab=function(){function t(t,e,r,n){this.predicate=t,this.source=e,this.yieldIndex=r,this.thisArg=n}return t.prototype.call=function(t,e){return e.subscribe(new Nb(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),Nb=function(t){function e(e,r,n,i,o){var s=t.call(this,e)||this;return s.predicate=r,s.source=n,s.yieldIndex=i,s.thisArg=o,s.index=0,s}return r(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},e.prototype._next=function(t){var e=this.predicate,r=this.thisArg,n=this.index++;try{e.call(r||this,t,n,this.source)&&this.notifyComplete(this.yieldIndex?n:t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(Eh);var jb=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Ob(t))},t}(),Ob=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype._next=function(t){},e}(Eh);var Tb=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Pb(t))},t}(),Pb=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(Eh);function Lb(t){return function(e){return 0===t?rd():e.lift(new Db(t))}}var Db=function(){function t(t){if(this.total=t,this.total<0)throw new Dd}return t.prototype.call=function(t,e){return e.subscribe(new Bb(t,this.total))},t}(),Bb=function(t){function e(e,r){var n=t.call(this,e)||this;return n.total=r,n.ring=new Array,n.count=0,n}return r(e,t),e.prototype._next=function(t){var e=this.ring,r=this.total,n=this.count++;e.length<r?e.push(t):e[n%r]=t},e.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var r=this.count>=this.total?this.total:this.count,n=this.ring,i=0;i<r;i++){var o=e++%r;t.next(n[o])}t.complete()},e}(Eh);var Fb=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new Ub(t,this.value))},t}(),Ub=function(t){function e(e,r){var n=t.call(this,e)||this;return n.value=r,n}return r(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(Eh);var Vb=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Hb(t))},t}(),Hb=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype._next=function(t){this.destination.next(hd.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(hd.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(hd.createComplete()),t.complete()},e}(Eh);function zb(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(n){return n.lift(new Wb(t,e,r))}}var Wb=function(){function t(t,e,r){void 0===r&&(r=!1),this.accumulator=t,this.seed=e,this.hasSeed=r}return t.prototype.call=function(t,e){return e.subscribe(new qb(t,this.accumulator,this.seed,this.hasSeed))},t}(),qb=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.accumulator=r,o._seed=n,o.hasSeed=i,o.index=0,o}return r(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.accumulator(this.seed,t,r)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(Eh);function Jb(t,e){return arguments.length>=2?function(r){return Ih(zb(t,e),Lb(1),Gy(e))(r)}:function(e){return Ih(zb((function(e,r,n){return t(e,r,n+1)})),Lb(1))(e)}}var $b=function(){function t(t,e,r){this.accumulator=t,this.seed=e,this.concurrent=r}return t.prototype.call=function(t,e){return e.subscribe(new Zb(t,this.accumulator,this.seed,this.concurrent))},t}(),Zb=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.accumulator=r,o.acc=n,o.concurrent=i,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return r(e,t),e.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,r=this.destination,n=void 0;try{n=(0,this.accumulator)(this.acc,t,e)}catch(t){return r.error(t)}this.active++,this._innerSub(n)}else this.buffer.push(t)},e.prototype._innerSub=function(t){var e=new uf(this),r=this.destination;r.add(e);var n=lf(t,e);n!==e&&r.add(n)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(t){var e=this.destination;this.acc=t,this.hasValue=!0,e.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(cf);function Gb(t,e){return function(r){var n;if(n="function"==typeof t?t:function(){return t},"function"==typeof e)return r.lift(new Qb(n,e));var i=Object.create(r,Vh);return i.source=r,i.subjectFactory=n,i}}var Qb=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var r=this.selector,n=this.subjectFactory(),i=r(n).subscribe(t);return i.add(e.subscribe(n)),i},t}();var Yb=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new Kb(t,this.nextSources))},t}(),Kb=function(t){function e(e,r){var n=t.call(this,e)||this;return n.destination=e,n.nextSources=r,n}return r(e,t),e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new uf(this),r=this.destination;r.add(e);var n=lf(t,e);n!==e&&r.add(n)}else this.destination.complete()},e}(cf);var Xb=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new tm(t))},t}(),tm=function(t){function e(e){var r=t.call(this,e)||this;return r.hasPrev=!1,r}return r(e,t),e.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},e}(Eh);var em=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new rm(t,this.count,this.source))},t}(),rm=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.count=r,i.source=n,i}return r(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,r=this.count;if(0===r)return t.prototype.complete.call(this);r>-1&&(this.count=r-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(Eh);var nm=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new im(t,this.notifier,e))},t}(),im=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.notifier=r,i.source=n,i.sourceIsBeingSubscribedTo=!0,i}return r(e,t),e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new Ph;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=lf(e,new uf(this))},e}(cf);var om=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new sm(t,this.count,this.source))},t}(),sm=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.count=r,i.source=n,i}return r(e,t),e.prototype.error=function(e){if(!this.isStopped){var r=this.source,n=this.count;if(0===n)return t.prototype.error.call(this,e);n>-1&&(this.count=n-1),r.subscribe(this._unsubscribeAndRecycle())}},e}(Eh);var am=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new um(t,this.notifier,this.source))},t}(),um=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.notifier=r,i.source=n,i}return r(e,t),e.prototype.error=function(e){if(!this.isStopped){var r=this.errors,n=this.retries,i=this.retriesSubscription;if(n)this.errors=void 0,this.retriesSubscription=void 0;else{r=new Ph;try{n=(0,this.notifier)(r)}catch(e){return t.prototype.error.call(this,e)}i=lf(n,new uf(this))}this._unsubscribeAndRecycle(),this.errors=r,this.retries=n,this.retriesSubscription=i,r.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var t=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=t,this.source.subscribe(this)},e}(cf);var cm=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var r=new lm(t),n=e.subscribe(r);return n.add(lf(this.notifier,new uf(r))),n},t}(),lm=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return r(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(cf);var hm=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new dm(t,this.period,this.scheduler))},t}(),dm=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.period=r,i.scheduler=n,i.hasValue=!1,i.add(n.schedule(fm,r,{subscriber:i,period:r})),i}return r(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(Eh);function fm(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}var pm=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new gm(t,this.compareTo,this.comparator))},t}(),gm=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.compareTo=r,i.comparator=n,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(r.subscribe(new ym(e,i))),i}return r(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var t=this,e=t._a,r=t._b,n=t.comparator;e.length>0&&r.length>0;){var i=e.shift(),o=r.shift(),s=!1;try{s=n?n(i,o):i===o}catch(t){this.destination.error(t)}s||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e}(Eh),ym=function(t){function e(e,r){var n=t.call(this,e)||this;return n.parent=r,n}return r(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(Eh);function bm(){return new Ph}var mm=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new vm(t,this.predicate,this.source))},t}(),vm=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.predicate=r,i.source=n,i.seenValue=!1,i.index=0,i}return r(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new Bd)},e}(Eh);var wm=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new _m(t,this.total))},t}(),_m=function(t){function e(e,r){var n=t.call(this,e)||this;return n.total=r,n.count=0,n}return r(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(Eh);var Sm=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new Dd}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new Eh(t)):e.subscribe(new Em(t,this._skipCount))},t}(),Em=function(t){function e(e,r){var n=t.call(this,e)||this;return n._skipCount=r,n._count=0,n._ring=new Array(r),n}return r(e,t),e.prototype._next=function(t){var e=this._skipCount,r=this._count++;if(r<e)this._ring[r]=t;else{var n=r%e,i=this._ring,o=i[n];i[n]=t,this.destination.next(o)}},e}(Eh);var Mm=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new xm(t,this.notifier))},t}(),xm=function(t){function e(e,r){var n=t.call(this,e)||this;n.hasValue=!1;var i=new uf(n);n.add(i),n.innerSubscription=i;var o=lf(r,i);return o!==i&&(n.add(o),n.innerSubscription=o),n}return r(e,t),e.prototype._next=function(e){this.hasValue&&t.prototype._next.call(this,e)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(cf);var km=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new Cm(t,this.predicate))},t}(),Cm=function(t){function e(e,r){var n=t.call(this,e)||this;return n.predicate=r,n.skipping=!0,n.index=0,n}return r(e,t),e.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},e.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},e}(Eh);var Im=function(t){function e(e,r,n){void 0===r&&(r=0),void 0===n&&(n=Cd);var i=t.call(this)||this;return i.source=e,i.delayTime=r,i.scheduler=n,(!Sf(r)||r<0)&&(i.delayTime=0),n&&"function"==typeof n.schedule||(i.scheduler=Cd),i}return r(e,t),e.create=function(t,r,n){return void 0===r&&(r=0),void 0===n&&(n=Cd),new e(t,r,n)},e.dispatch=function(t){var e=t.source,r=t.subscriber;return this.add(e.subscribe(r))},e.prototype._subscribe=function(t){var r=this.delayTime,n=this.source;return this.scheduler.schedule(e.dispatch,r,{source:n,subscriber:t})},e}(Ah);var Rm=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new Im(e,this.delay,this.scheduler).subscribe(t)},t}();function Am(t,e){return"function"==typeof e?function(r){return r.pipe(Am((function(r,n){return af(t(r,n)).pipe(Ud((function(t,i){return e(r,t,n,i)})))})))}:function(e){return e.lift(new Nm(t))}}var Nm=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new jm(t,this.project))},t}(),jm=function(t){function e(e,r){var n=t.call(this,e)||this;return n.project=r,n.index=0,n}return r(e,t),e.prototype._next=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this._innerSub(e)},e.prototype._innerSub=function(t){var e=this.innerSubscription;e&&e.unsubscribe();var r=new uf(this),n=this.destination;n.add(r),this.innerSubscription=lf(t,r),this.innerSubscription!==r&&n.add(this.innerSubscription)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t){this.destination.next(t)},e}(cf);var Om=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var r=new Tm(t),n=lf(this.notifier,new uf(r));return n&&!r.seenValue?(r.add(n),e.subscribe(r)):r},t}(),Tm=function(t){function e(e){var r=t.call(this,e)||this;return r.seenValue=!1,r}return r(e,t),e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(cf);var Pm=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new Lm(t,this.predicate,this.inclusive))},t}(),Lm=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.predicate=r,i.inclusive=n,i.index=0,i}return r(e,t),e.prototype._next=function(t){var e,r=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void r.error(t)}this.nextOrComplete(t,e)},e.prototype.nextOrComplete=function(t,e){var r=this.destination;Boolean(e)?r.next(t):(this.inclusive&&r.next(t),r.complete())},e}(Eh);var Dm=function(){function t(t,e,r){this.nextOrObserver=t,this.error=e,this.complete=r}return t.prototype.call=function(t,e){return e.subscribe(new Bm(t,this.nextOrObserver,this.error,this.complete))},t}(),Bm=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o._tapNext=Ld,o._tapError=Ld,o._tapComplete=Ld,o._tapError=n||Ld,o._tapComplete=i||Ld,hh(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||Ld,o._tapError=r.error||Ld,o._tapComplete=r.complete||Ld),o}return r(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(Eh),Fm={leading:!0,trailing:!1};var Um=function(){function t(t,e,r){this.durationSelector=t,this.leading=e,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new Vm(t,this.durationSelector,this.leading,this.trailing))},t}(),Vm=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.destination=e,o.durationSelector=r,o._leading=n,o._trailing=i,o._hasValue=!1,o}return r(e,t),e.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},e.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=lf(e,new uf(this)))},e.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},e.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=void 0,e&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(cf);var Hm=function(){function t(t,e,r,n){this.duration=t,this.scheduler=e,this.leading=r,this.trailing=n}return t.prototype.call=function(t,e){return e.subscribe(new zm(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),zm=function(t){function e(e,r,n,i,o){var s=t.call(this,e)||this;return s.duration=r,s.scheduler=n,s.leading=i,s.trailing=o,s._hasTrailingValue=!1,s._trailingValue=null,s}return r(e,t),e.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Wm,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},e}(Eh);function Wm(t){t.subscriber.clearThrottle()}var qm=function(){return function(t,e){this.value=t,this.interval=e}}();function Jm(t,e,r){return void 0===r&&(r=Rd),function(n){var i=Ky(t),o=i?+t-r.now():Math.abs(t);return n.lift(new $m(o,i,e,r))}}var $m=function(){function t(t,e,r,n){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=r,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new Zm(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),Zm=function(t){function e(e,r,n,i,o){var s=t.call(this,e)||this;return s.absoluteTimeout=r,s.waitFor=n,s.withObservable=i,s.scheduler=o,s.scheduleTimeout(),s}return r(e,t),e.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add(lf(e,new uf(t)))},e.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,e)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(cf);var Gm=function(){return function(t,e){this.value=t,this.timestamp=e}}();function Qm(t,e,r){return 0===r?[e]:(t.push(e),t)}var Ym=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var r=new Km(t),n=e.subscribe(r);return n.closed||r.add(lf(this.windowBoundaries,new uf(r))),n},t}(),Km=function(t){function e(e){var r=t.call(this,e)||this;return r.window=new Ph,e.next(r.window),r}return r(e,t),e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(t){this._error(t)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var t=this.window;t&&t.complete();var e=this.destination,r=this.window=new Ph;e.next(r)},e}(cf);var Xm=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new tv(t,this.windowSize,this.startWindowEvery))},t}(),tv=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.destination=e,i.windowSize=r,i.startWindowEvery=n,i.windows=[new Ph],i.count=0,e.next(i.windows[0]),i}return r(e,t),e.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,r=this.destination,n=this.windowSize,i=this.windows,o=i.length,s=0;s<o&&!this.closed;s++)i[s].next(t);var a=this.count-n+1;if(a>=0&&a%e==0&&!this.closed&&i.shift().complete(),++this.count%e==0&&!this.closed){var u=new Ph;i.push(u),r.next(u)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(Eh);var ev=function(){function t(t,e,r,n){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=r,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new nv(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),rv=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return r(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(Ph),nv=function(t){function e(e,r,n,i,o){var s=t.call(this,e)||this;s.destination=e,s.windowTimeSpan=r,s.windowCreationInterval=n,s.maxWindowSize=i,s.scheduler=o,s.windows=[];var a=s.openWindow();if(null!==n&&n>=0){var u={subscriber:s,window:a,context:null},c={windowTimeSpan:r,windowCreationInterval:n,subscriber:s,scheduler:o};s.add(o.schedule(sv,r,u)),s.add(o.schedule(ov,n,c))}else{var l={subscriber:s,window:a,windowTimeSpan:r};s.add(o.schedule(iv,r,l))}return s}return r(e,t),e.prototype._next=function(t){for(var e=this.windows,r=e.length,n=0;n<r;n++){var i=e[n];i.closed||(i.next(t),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new rv;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(Eh);function iv(t){var e=t.subscriber,r=t.windowTimeSpan,n=t.window;n&&e.closeWindow(n),t.window=e.openWindow(),this.schedule(t,r)}function ov(t){var e=t.windowTimeSpan,r=t.subscriber,n=t.scheduler,i=t.windowCreationInterval,o=r.openWindow(),s=this,a={action:s,subscription:null},u={subscriber:r,window:o,context:a};a.subscription=n.schedule(sv,e,u),s.add(a.subscription),s.schedule(t,i)}function sv(t){var e=t.subscriber,r=t.window,n=t.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),e.closeWindow(r)}var av=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new uv(t,this.openings,this.closingSelector))},t}(),uv=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.openings=r,i.closingSelector=n,i.contexts=[],i.add(i.openSubscription=ef(i,r,r)),i}return r(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var r=e.length,n=0;n<r;n++)e[n].window.next(t)},e.prototype._error=function(e){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var o=r[i];o.window.error(e),o.subscription.unsubscribe()}t.prototype._error.call(this,e)},e.prototype._complete=function(){var e=this.contexts;if(this.contexts=null,e)for(var r=e.length,n=-1;++n<r;){var i=e[n];i.window.complete(),i.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,r=-1;++r<e;){var n=t[r];n.window.unsubscribe(),n.subscription.unsubscribe()}},e.prototype.notifyNext=function(t,e,r,n,i){if(t===this.openings){var o=void 0;try{o=(0,this.closingSelector)(e)}catch(t){return this.error(t)}var s=new Ph,a=new wh,u={window:s,subscription:a};this.contexts.push(u);var c=ef(this,o,u);c.closed?this.closeWindow(this.contexts.length-1):(c.context=u,a.add(c)),this.destination.next(s)}else this.closeWindow(this.contexts.indexOf(t))},e.prototype.notifyError=function(t){this.error(t)},e.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},e.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,r=e[t],n=r.window,i=r.subscription;e.splice(t,1),n.complete(),i.unsubscribe()}},e}(Zd);var cv=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new lv(t,this.closingSelector))},t}(),lv=function(t){function e(e,r){var n=t.call(this,e)||this;return n.destination=e,n.closingSelector=r,n.openWindow(),n}return r(e,t),e.prototype.notifyNext=function(t,e,r,n,i){this.openWindow(i)},e.prototype.notifyError=function(t){this._error(t)},e.prototype.notifyComplete=function(t){this.openWindow(t)},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var e=this.window;e&&e.complete();var r,n=this.window=new Ph;this.destination.next(n);try{r=(0,this.closingSelector)()}catch(t){return this.destination.error(t),void this.window.error(t)}this.add(this.closingNotification=ef(this,r))},e}(Zd);var hv=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new dv(t,this.observables,this.project))},t}(),dv=function(t){function e(e,r,n){var i=t.call(this,e)||this;i.observables=r,i.project=n,i.toRespond=[];var o=r.length;i.values=new Array(o);for(var s=0;s<o;s++)i.toRespond.push(s);for(s=0;s<o;s++){var a=r[s];i.add(ef(i,a,void 0,s))}return i}return r(e,t),e.prototype.notifyNext=function(t,e,r){this.values[r]=e;var n=this.toRespond;if(n.length>0){var i=n.indexOf(r);-1!==i&&n.splice(i,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(Zd);var fv=Object.freeze({__proto__:null,audit:_y,auditTime:function(t,e){return void 0===e&&(e=Rd),_y((function(){return Pf(t,e)}))},buffer:function(t){return function(e){return e.lift(new My(t))}},bufferCount:function(t,e){return void 0===e&&(e=null),function(r){return r.lift(new ky(t,e))}},bufferTime:function(t){var e=arguments.length,r=Rd;nd(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],e--);var n=null;e>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(e){return e.lift(new Ry(t,n,i,r))}},bufferToggle:function(t,e){return function(r){return r.lift(new Py(t,e))}},bufferWhen:function(t){return function(e){return e.lift(new Dy(t))}},catchError:function(t){return function(e){var r=new Fy(t),n=e.lift(r);return r.caught=n}},combineAll:function(t){return function(e){return e.lift(new nf(t))}},combineLatest:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=null;return"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&yh(t[0])&&(t=t[0].slice()),function(e){return e.lift.call(af([e].concat(t)),new nf(r))}},concat:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(bf.apply(void 0,[e].concat(t)))}},concatAll:yf,concatMap:Vy,concatMapTo:function(t,e){return Vy((function(){return t}),e)},count:function(t){return function(e){return e.lift(new Hy(t,e))}},debounce:function(t){return function(e){return e.lift(new Wy(t))}},debounceTime:function(t,e){return void 0===e&&(e=Rd),function(r){return r.lift(new Jy(t,e))}},defaultIfEmpty:Gy,delay:function(t,e){void 0===e&&(e=Rd);var r=Ky(t)?+t-e.now():Math.abs(t);return function(t){return t.lift(new Xy(r,e))}},delayWhen:function(t,e){return e?function(r){return new ib(r,e).lift(new rb(t))}:function(e){return e.lift(new rb(t))}},dematerialize:function(){return function(t){return t.lift(new sb)}},distinct:function(t,e){return function(r){return r.lift(new ub(t,e))}},distinctUntilChanged:lb,distinctUntilKeyChanged:function(t,e){return lb((function(r,n){return e?e(r[t],n[t]):r[t]===n[t]}))},elementAt:function(t,e){if(t<0)throw new Dd;var r=arguments.length>=2;return function(n){return n.pipe(If((function(e,r){return r===t})),bb(1),r?Gy(e):fb((function(){return new Dd})))}},endWith:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return bf(e,ud.apply(void 0,t))}},every:function(t,e){return function(r){return r.lift(new wb(t,e,r))}},exhaust:function(){return function(t){return t.lift(new Sb)}},exhaustMap:function t(e,r){return r?function(n){return n.pipe(t((function(t,n){return af(e(t,n)).pipe(Ud((function(e,i){return r(t,e,n,i)})))})))}:function(t){return t.lift(new Mb(e))}},expand:function(t,e,r){return void 0===e&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(n){return n.lift(new kb(t,e,r))}},filter:If,finalize:function(t){return function(e){return e.lift(new Ib(t))}},find:function(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(r){return r.lift(new Ab(t,r,!1,e))}},findIndex:function(t,e){return function(r){return r.lift(new Ab(t,r,!0,e))}},first:function(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?If((function(e,r){return t(e,r,n)})):Ch,bb(1),r?Gy(e):fb((function(){return new Bd})))}},groupBy:function(t,e,r,n){return function(i){return i.lift(new zh(t,e,r,n))}},ignoreElements:function(){return function(t){return t.lift(new jb)}},isEmpty:function(){return function(t){return t.lift(new Tb)}},last:function(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?If((function(e,r){return t(e,r,n)})):Ch,Lb(1),r?Gy(e):fb((function(){return new Bd})))}},map:Ud,mapTo:function(t){return function(e){return e.lift(new Fb(t))}},materialize:function(){return function(t){return t.lift(new Vb)}},max:function(t){var e="function"==typeof t?function(e,r){return t(e,r)>0?e:r}:function(t,e){return t>e?t:e};return Jb(e)},merge:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Mf.apply(void 0,[e].concat(t)))}},mergeAll:gf,mergeMap:hf,flatMap:pf,mergeMapTo:function(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?hf((function(){return t}),e,r):("number"==typeof e&&(r=e),hf((function(){return t}),r))},mergeScan:function(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),function(n){return n.lift(new $b(t,e,r))}},min:function(t){var e="function"==typeof t?function(e,r){return t(e,r)<0?e:r}:function(t,e){return t<e?t:e};return Jb(e)},multicast:Gb,observeOn:function(t,e){return void 0===e&&(e=0),function(r){return r.lift(new dd(t,e))}},onErrorResumeNext:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&yh(t[0])&&(t=t[0]),function(e){return e.lift(new Yb(t))}},pairwise:function(){return function(t){return t.lift(new Xb)}},partition:function(t,e){return function(r){return[If(t,e)(r),If(Cf(t,e))(r)]}},pluck:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.length;if(0===r)throw new Error("list of properties cannot be empty.");return function(e){return Ud(function(t,e){var r=function(r){for(var n=r,i=0;i<e;i++){var o=null!=n?n[t[i]]:void 0;if(void 0===o)return;n=o}return n};return r}(t,r))(e)}},publish:function(t){return t?Gb((function(){return new Ph}),t):Gb(new Ph)},publishBehavior:function(t){return function(e){return Gb(new Zh(t))(e)}},publishLast:function(){return function(t){return Gb(new bd)(t)}},publishReplay:function(t,e,r,n){r&&"function"!=typeof r&&(n=r);var i="function"==typeof r?r:void 0,o=new gd(t,e,n);return function(t){return Gb((function(){return o}),i)(t)}},race:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return 1===t.length&&yh(t[0])&&(t=t[0]),e.lift.call(Nf.apply(void 0,[e].concat(t)))}},reduce:Jb,repeat:function(t){return void 0===t&&(t=-1),function(e){return 0===t?rd():t<0?e.lift(new em(-1,e)):e.lift(new em(t-1,e))}},repeatWhen:function(t){return function(e){return e.lift(new nm(t))}},retry:function(t){return void 0===t&&(t=-1),function(e){return e.lift(new om(t,e))}},retryWhen:function(t){return function(e){return e.lift(new am(t,e))}},refCount:Dh,sample:function(t){return function(e){return e.lift(new cm(t))}},sampleTime:function(t,e){return void 0===e&&(e=Rd),function(r){return r.lift(new hm(t,e))}},scan:zb,sequenceEqual:function(t,e){return function(r){return r.lift(new pm(t,e))}},share:function(){return function(t){return Dh()(Gb(bm)(t))}},shareReplay:function(t,e,r){var n;return n=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(t){return t.lift(function(t){var e,r,n=t.bufferSize,i=void 0===n?Number.POSITIVE_INFINITY:n,o=t.windowTime,s=void 0===o?Number.POSITIVE_INFINITY:o,a=t.refCount,u=t.scheduler,c=0,l=!1,h=!1;return function(t){var n;c++,!e||l?(l=!1,e=new gd(i,s,u),n=e.subscribe(this),r=t.subscribe({next:function(t){e.next(t)},error:function(t){l=!0,e.error(t)},complete:function(){h=!0,r=void 0,e.complete()}}),h&&(r=void 0)):n=e.subscribe(this),this.add((function(){c--,n.unsubscribe(),n=void 0,r&&!h&&a&&0===c&&(r.unsubscribe(),r=void 0,e=void 0)}))}}(n))}},single:function(t){return function(e){return e.lift(new mm(t,e))}},skip:function(t){return function(e){return e.lift(new wm(t))}},skipLast:function(t){return function(e){return e.lift(new Sm(t))}},skipUntil:function(t){return function(e){return e.lift(new Mm(t))}},skipWhile:function(t){return function(e){return e.lift(new km(t))}},startWith:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return nd(r)?(t.pop(),function(e){return bf(t,e,r)}):function(e){return bf(t,e)}},subscribeOn:function(t,e){return void 0===e&&(e=0),function(r){return r.lift(new Rm(t,e))}},switchAll:function(){return Am(Ch)},switchMap:Am,switchMapTo:function(t,e){return e?Am((function(){return t}),e):Am((function(){return t}))},take:bb,takeLast:Lb,takeUntil:function(t){return function(e){return e.lift(new Om(t))}},takeWhile:function(t,e){return void 0===e&&(e=!1),function(r){return r.lift(new Pm(t,e))}},tap:function(t,e,r){return function(n){return n.lift(new Dm(t,e,r))}},throttle:function(t,e){return void 0===e&&(e=Fm),function(r){return r.lift(new Um(t,!!e.leading,!!e.trailing))}},throttleTime:function(t,e,r){return void 0===e&&(e=Rd),void 0===r&&(r=Fm),function(n){return n.lift(new Hm(t,e,r.leading,r.trailing))}},throwIfEmpty:fb,timeInterval:function(t){return void 0===t&&(t=Rd),function(e){return mf((function(){return e.pipe(zb((function(e,r){var n=e.current;return{value:r,current:t.now(),last:n}}),{current:t.now(),value:void 0,last:void 0}),Ud((function(t){var e=t.current,r=t.last,n=t.value;return new qm(n,e-r)})))}))}},timeout:function(t,e){return void 0===e&&(e=Rd),Jm(t,cd(new Fd),e)},timeoutWith:Jm,timestamp:function(t){return void 0===t&&(t=Rd),Ud((function(e){return new Gm(e,t.now())}))},toArray:function(){return Jb(Qm,[])},window:function(t){return function(e){return e.lift(new Ym(t))}},windowCount:function(t,e){return void 0===e&&(e=0),function(r){return r.lift(new Xm(t,e))}},windowTime:function(t){var e=Rd,r=null,n=Number.POSITIVE_INFINITY;return nd(arguments[3])&&(e=arguments[3]),nd(arguments[2])?e=arguments[2]:Sf(arguments[2])&&(n=Number(arguments[2])),nd(arguments[1])?e=arguments[1]:Sf(arguments[1])&&(r=Number(arguments[1])),function(i){return i.lift(new ev(t,r,n,e))}},windowToggle:function(t,e){return function(r){return r.lift(new av(t,e))}},windowWhen:function(t){return function(e){return e.lift(new cv(t))}},withLatestFrom:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var r;"function"==typeof t[t.length-1]&&(r=t.pop());var n=t;return e.lift(new hv(n,r))}},zip:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Df.apply(void 0,[e].concat(t)))}},zipAll:function(t){return function(e){return e.lift(new Bf(t))}}}),pv=e(fv),gv={},yv={};Object.defineProperty(yv,"__esModule",{value:!0}),yv.ClientMessagePublishEvent=yv.ClientMessageSetSessionConfig=yv.ClientMessageGetSessionConfig=yv.ClientMessageIsLinked=yv.ClientMessageHostSession=void 0,yv.ClientMessageHostSession=function(t){return Object.assign({type:"HostSession"},t)},yv.ClientMessageIsLinked=function(t){return Object.assign({type:"IsLinked"},t)},yv.ClientMessageGetSessionConfig=function(t){return Object.assign({type:"GetSessionConfig"},t)},yv.ClientMessageSetSessionConfig=function(t){return Object.assign({type:"SetSessionConfig"},t)},yv.ClientMessagePublishEvent=function(t){return Object.assign({type:"PublishEvent"},t)};var bv={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;const e=Wf,r=pv;var n;!function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"}(n=t.ConnectionState||(t.ConnectionState={}));t.RxWebSocket=class{constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.connectionStateSubject=new e.BehaviorSubject(n.DISCONNECTED),this.incomingDataSubject=new e.Subject,this.url=t.replace(/^http/,"ws")}connect(){return this.webSocket?(0,e.throwError)(new Error("webSocket object is not null")):new e.Observable((t=>{let e;try{this.webSocket=e=new this.WebSocketClass(this.url)}catch(e){return void t.error(e)}this.connectionStateSubject.next(n.CONNECTING),e.onclose=e=>{this.clearWebSocket(),t.error(new Error(`websocket error ${e.code}: ${e.reason}`)),this.connectionStateSubject.next(n.DISCONNECTED)},e.onopen=e=>{t.next(),t.complete(),this.connectionStateSubject.next(n.CONNECTED)},e.onmessage=t=>{this.incomingDataSubject.next(t.data)}})).pipe((0,r.take)(1))}disconnect(){const{webSocket:t}=this;if(t){this.clearWebSocket(),this.connectionStateSubject.next(n.DISCONNECTED);try{t.close()}catch(t){}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,r.flatMap)((t=>{let r;try{r=JSON.parse(t)}catch(t){return(0,e.empty)()}return(0,e.of)(r)})))}sendData(t){const{webSocket:e}=this;if(!e)throw new Error("websocket is not connected");e.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}}(bv);var mv={};Object.defineProperty(mv,"__esModule",{value:!0}),mv.isServerMessageFail=void 0,mv.isServerMessageFail=function(t){return t&&"Fail"===t.type&&"number"==typeof t.id&&"string"==typeof t.sessionId&&"string"==typeof t.error},Object.defineProperty(gv,"__esModule",{value:!0}),gv.WalletSDKConnection=void 0;const vv=Wf,wv=pv,_v=Y,Sv=Vn,Ev=yv,Mv=Q,xv=bv,kv=mv;gv.WalletSDKConnection=class{constructor(t,e,r,n,i=WebSocket){this.sessionId=t,this.sessionKey=e,this.diagnostic=n,this.subscriptions=new vv.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Sv.IntNumber)(1),this.connectedSubject=new vv.BehaviorSubject(!1),this.linkedSubject=new vv.BehaviorSubject(!1),this.sessionConfigSubject=new vv.ReplaySubject(1);const o=new xv.RxWebSocket(r+"/rpc",i);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,wv.tap)((e=>{var r;return null===(r=this.diagnostic)||void 0===r?void 0:r.log(Mv.EVENTS.CONNECTED_STATE_CHANGE,{state:e,sessionIdHash:_v.Session.hash(t)})})),(0,wv.skip)(1),(0,wv.filter)((t=>t===xv.ConnectionState.DISCONNECTED&&!this.destroyed)),(0,wv.delay)(5e3),(0,wv.filter)((t=>!this.destroyed)),(0,wv.flatMap)((t=>o.connect())),(0,wv.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,wv.skip)(2),(0,wv.switchMap)((t=>(0,vv.iif)((()=>t===xv.ConnectionState.CONNECTED),this.authenticate().pipe((0,wv.tap)((t=>this.sendIsLinked())),(0,wv.tap)((t=>this.sendGetSessionConfig())),(0,wv.map)((t=>!0))),(0,vv.of)(!1)))),(0,wv.distinctUntilChanged)(),(0,wv.catchError)((t=>(0,vv.of)(!1)))).subscribe((t=>this.connectedSubject.next(t)))),this.subscriptions.add(o.connectionState$.pipe((0,wv.skip)(1),(0,wv.switchMap)((t=>(0,vv.iif)((()=>t===xv.ConnectionState.CONNECTED),(0,vv.timer)(0,1e4))))).subscribe((t=>0===t?this.updateLastHeartbeat():this.heartbeat()))),this.subscriptions.add(o.incomingData$.pipe((0,wv.filter)((t=>"h"===t))).subscribe((t=>this.updateLastHeartbeat()))),this.subscriptions.add(o.incomingJSONData$.pipe((0,wv.filter)((t=>["IsLinkedOK","Linked"].includes(t.type)))).subscribe((e=>{var r;const n=e;null===(r=this.diagnostic)||void 0===r||r.log(Mv.EVENTS.LINKED,{sessionIdHash:_v.Session.hash(t),linked:n.linked,type:e.type,onlineGuests:n.onlineGuests}),this.linkedSubject.next(n.linked||n.onlineGuests>0)}))),this.subscriptions.add(o.incomingJSONData$.pipe((0,wv.filter)((t=>["GetSessionConfigOK","SessionConfigUpdated"].includes(t.type)))).subscribe((e=>{var r;const n=e;null===(r=this.diagnostic)||void 0===r||r.log(Mv.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:_v.Session.hash(t),metadata_keys:n&&n.metadata?Object.keys(n.metadata):void 0}),this.sessionConfigSubject.next({webhookId:n.webhookId,webhookUrl:n.webhookUrl,metadata:n.metadata})})))}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");null===(t=this.diagnostic)||void 0===t||t.log(Mv.EVENTS.STARTED_CONNECTING,{sessionIdHash:_v.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var t;this.subscriptions.unsubscribe(),this.ws.disconnect(),null===(t=this.diagnostic)||void 0===t||t.log(Mv.EVENTS.DISCONNECTED,{sessionIdHash:_v.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,wv.filter)((t=>t)),(0,wv.take)(1),(0,wv.map)((()=>{})))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,wv.filter)((t=>t)),(0,wv.take)(1),(0,wv.map)((()=>{})))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,wv.filter)((t=>{if("Event"!==t.type)return!1;const e=t;return"string"==typeof e.sessionId&&"string"==typeof e.eventId&&"string"==typeof e.event&&"string"==typeof e.data})),(0,wv.map)((t=>t)))}setSessionMetadata(t,e){const r=(0,Ev.ClientMessageSetSessionConfig)({id:(0,Sv.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[t]:e}});return this.onceConnected$.pipe((0,wv.flatMap)((t=>this.makeRequest(r))),(0,wv.map)((t=>{if((0,kv.isServerMessageFail)(t))throw new Error(t.error||"failed to set session metadata")})))}publishEvent(t,e,r=!1){const n=(0,Ev.ClientMessagePublishEvent)({id:(0,Sv.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:t,data:e,callWebhook:r});return this.onceLinked$.pipe((0,wv.flatMap)((t=>this.makeRequest(n))),(0,wv.map)((t=>{if((0,kv.isServerMessageFail)(t))throw new Error(t.error||"failed to publish event");return t.eventId})))}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(t){}}makeRequest(t,e=6e4){const r=t.id;try{this.sendData(t)}catch(t){return(0,vv.throwError)(t)}return this.ws.incomingJSONData$.pipe((0,wv.timeoutWith)(e,(0,vv.throwError)(new Error(`request ${r} timed out`))),(0,wv.filter)((t=>t.id===r)),(0,wv.take)(1))}authenticate(){const t=(0,Ev.ClientMessageHostSession)({id:(0,Sv.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(t).pipe((0,wv.map)((t=>{if((0,kv.isServerMessageFail)(t))throw new Error(t.error||"failed to authentcate")})))}sendIsLinked(){const t=(0,Ev.ClientMessageIsLinked)({id:(0,Sv.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}sendGetSessionConfig(){const t=(0,Ev.ClientMessageGetSessionConfig)({id:(0,Sv.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}};var Cv={};Object.defineProperty(Cv,"__esModule",{value:!0}),Cv.WalletUIError=void 0;class Iv extends Error{constructor(t,e){super(t),this.message=t,this.errorCode=e}}Cv.WalletUIError=Iv,Iv.UserRejectedRequest=new Iv("User rejected request"),Iv.SwitchEthereumChainUnsupportedChainId=new Iv("Unsupported chainId",4902);var Rv={};Object.defineProperty(Rv,"__esModule",{value:!0}),Rv.decrypt=Rv.encrypt=void 0;const Av=fe;Rv.encrypt=async function(t,e){if(64!==e.length)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,Av.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(t)),s=o.slice(o.byteLength-16),a=o.slice(0,o.byteLength-16),u=new Uint8Array(s),c=new Uint8Array(a),l=new Uint8Array([...r,...u,...c]);return(0,Av.uint8ArrayToHex)(l)},Rv.decrypt=function(t,e){if(64!==e.length)throw Error("secret must be 256 bits");return new Promise(((r,n)=>{!async function(){const i=await crypto.subtle.importKey("raw",(0,Av.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,Av.hexStringToUint8Array)(t),s=o.slice(0,12),a=o.slice(12,28),u=o.slice(28),c=new Uint8Array([...u,...a]),l={name:"AES-GCM",iv:new Uint8Array(s)};try{const t=await window.crypto.subtle.decrypt(l,i,c),e=new TextDecoder;r(e.decode(t))}catch(t){n(t)}}()}))};var Nv={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(t){t.requestEthereumAccounts="requestEthereumAccounts",t.signEthereumMessage="signEthereumMessage",t.signEthereumTransaction="signEthereumTransaction",t.submitEthereumTransaction="submitEthereumTransaction",t.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",t.scanQRCode="scanQRCode",t.generic="generic",t.childRequestEthereumAccounts="childRequestEthereumAccounts",t.addEthereumChain="addEthereumChain",t.switchEthereumChain="switchEthereumChain",t.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",t.watchAsset="watchAsset",t.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))}(Nv);var jv={},Ov={};!function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,(e=t.RelayMessageType||(t.RelayMessageType={})).SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(Ov),Object.defineProperty(jv,"__esModule",{value:!0}),jv.Web3RequestCanceledMessage=void 0;const Tv=Ov;jv.Web3RequestCanceledMessage=function(t){return{type:Tv.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}};var Pv={};Object.defineProperty(Pv,"__esModule",{value:!0}),Pv.Web3RequestMessage=void 0;const Lv=Ov;Pv.Web3RequestMessage=function(t){return Object.assign({type:Lv.RelayMessageType.WEB3_REQUEST},t)};var Dv={};Object.defineProperty(Dv,"__esModule",{value:!0}),Dv.EthereumAddressFromSignedMessageResponse=Dv.SubmitEthereumTransactionResponse=Dv.SignEthereumTransactionResponse=Dv.SignEthereumMessageResponse=Dv.isRequestEthereumAccountsResponse=Dv.SelectProviderResponse=Dv.WatchAssetReponse=Dv.RequestEthereumAccountsResponse=Dv.SwitchEthereumChainResponse=Dv.AddEthereumChainResponse=Dv.ErrorResponse=void 0;const Bv=Nv;Dv.ErrorResponse=function(t,e,r){return{method:t,errorMessage:e,errorCode:r}},Dv.AddEthereumChainResponse=function(t){return{method:Bv.Web3Method.addEthereumChain,result:t}},Dv.SwitchEthereumChainResponse=function(t){return{method:Bv.Web3Method.switchEthereumChain,result:t}},Dv.RequestEthereumAccountsResponse=function(t){return{method:Bv.Web3Method.requestEthereumAccounts,result:t}},Dv.WatchAssetReponse=function(t){return{method:Bv.Web3Method.watchAsset,result:t}},Dv.SelectProviderResponse=function(t){return{method:Bv.Web3Method.selectProvider,result:t}},Dv.isRequestEthereumAccountsResponse=function(t){return t&&t.method===Bv.Web3Method.requestEthereumAccounts},Dv.SignEthereumMessageResponse=function(t){return{method:Bv.Web3Method.signEthereumMessage,result:t}},Dv.SignEthereumTransactionResponse=function(t){return{method:Bv.Web3Method.signEthereumTransaction,result:t}},Dv.SubmitEthereumTransactionResponse=function(t){return{method:Bv.Web3Method.submitEthereumTransaction,result:t}},Dv.EthereumAddressFromSignedMessageResponse=function(t){return{method:Bv.Web3Method.ethereumAddressFromSignedMessage,result:t}};var Fv={};Object.defineProperty(Fv,"__esModule",{value:!0}),Fv.isWeb3ResponseMessage=Fv.Web3ResponseMessage=void 0;const Uv=Ov;Fv.Web3ResponseMessage=function(t){return Object.assign({type:Uv.RelayMessageType.WEB3_RESPONSE},t)},Fv.isWeb3ResponseMessage=function(t){return t&&t.type===Uv.RelayMessageType.WEB3_RESPONSE};var Vv=t&&t.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),Hv=t&&t.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zv=t&&t.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Wv=t&&t.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&Vv(e,t,r);return Hv(e,t),e},qv=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(my,"__esModule",{value:!0}),my.WalletSDKRelay=void 0;const Jv=qv(vy),$v=E,Zv=Wf,Gv=pv,Qv=Q,Yv=gv,Kv=Cv,Xv=Vn,tw=fe,ew=Wv(Rv),rw=Y,nw=ci,iw=Nv,ow=jv,sw=Pv,aw=Dv,uw=Fv;class cw extends nw.WalletSDKRelayAbstract{constructor(t){var e;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new Zv.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new Zv.Subscription,this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:r,ui:n,connection:i}=this.subscribe();if(this._session=r,this.connection=i,this.relayEventManager=t.relayEventManager,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this.diagnostic={log:t.eventListener.onEvent}:this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=null===(e=t.reloadOnDisconnect)||void 0===e||e,this.ui=n}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe((t=>{this.dappDefaultChain!==t&&(this.dappDefaultChain=t)})));const t=rw.Session.load(this.storage)||new rw.Session(this.storage).save(),e=new Yv.WalletSDKConnection(t.id,t.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(e.sessionConfig$.subscribe({next:t=>{this.onSessionConfigChanged(t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Qv.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(e.incomingEvent$.pipe((0,Gv.filter)((t=>"Web3Response"===t.event))).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(e.linked$.pipe((0,Gv.skip)(1),(0,Gv.tap)((t=>{var e;this.isLinked=t;const r=this.storage.getItem(nw.LOCAL_STORAGE_ADDRESSES_KEY);if(t&&(this.session.linked=t),this.isUnlinkedErrorState=!1,r){const n=r.split(" "),i="true"===this.storage.getItem("IsStandaloneSigning");if(""!==n[0]&&!t&&this.session.linked&&!i){this.isUnlinkedErrorState=!0;const t=this.getSessionIdHash();null===(e=this.diagnostic)||void 0===e||e.log(Qv.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:t})}}}))).subscribe()),this.subscriptions.add(e.sessionConfig$.pipe((0,Gv.filter)((t=>!!t.metadata&&"1"===t.metadata.__destroyed))).subscribe((()=>{var t;const r=e.isDestroyed;return null===(t=this.diagnostic)||void 0===t||t.log(Qv.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:r,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()}))),this.subscriptions.add(e.sessionConfig$.pipe((0,Gv.filter)((t=>t.metadata&&void 0!==t.metadata.WalletUsername))).pipe((0,Gv.mergeMap)((e=>ew.decrypt(e.metadata.WalletUsername,t.secret)))).subscribe({next:t=>{this.storage.setItem(nw.WALLET_USER_NAME_KEY,t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Qv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Gv.filter)((t=>t.metadata&&void 0!==t.metadata.AppVersion))).pipe((0,Gv.mergeMap)((e=>ew.decrypt(e.metadata.AppVersion,t.secret)))).subscribe({next:t=>{this.storage.setItem(nw.APP_VERSION_KEY,t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Qv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Gv.filter)((t=>t.metadata&&void 0!==t.metadata.ChainId&&void 0!==t.metadata.JsonRpcUrl))).pipe((0,Gv.mergeMap)((e=>(0,Zv.zip)(ew.decrypt(e.metadata.ChainId,t.secret),ew.decrypt(e.metadata.JsonRpcUrl,t.secret))))).pipe((0,Gv.distinctUntilChanged)()).subscribe({next:([t,e])=>{this.chainCallback&&this.chainCallback(t,e)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Qv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Gv.filter)((t=>t.metadata&&void 0!==t.metadata.EthereumAddress))).pipe((0,Gv.mergeMap)((e=>ew.decrypt(e.metadata.EthereumAddress,t.secret)))).subscribe({next:t=>{this.accountsCallback&&this.accountsCallback([t]),cw.accountRequestCallbackIds.size>0&&(Array.from(cw.accountRequestCallbackIds.values()).forEach((e=>{const r=(0,uw.Web3ResponseMessage)({id:e,response:(0,aw.RequestEthereumAccountsResponse)([t])});this.invokeCallback(Object.assign(Object.assign({},r),{id:e}))})),cw.accountRequestCallbackIds.clear())},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Qv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Gv.filter)((t=>t.metadata&&void 0!==t.metadata.AppSrc))).pipe((0,Gv.mergeMap)((e=>ew.decrypt(e.metadata.AppSrc,t.secret)))).subscribe({next:t=>{this.ui.setAppSrc(t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Qv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const r=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:t,connected$:e.connected$,chainId$:this.dappDefaultChainSubject});return e.connect(),{session:t,ui:r,connection:e}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,Gv.timeout)(1e3),(0,Gv.catchError)((t=>(0,Zv.of)(null)))).subscribe((t=>{var e,r,n;const i=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch(t){null===(e=this.diagnostic)||void 0===e||e.log(Qv.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}null===(r=this.diagnostic)||void 0===r||r.log(Qv.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=rw.Session.load(this.storage);if((null==o?void 0:o.id)===this._session.id?this.storage.clear():o&&(null===(n=this.diagnostic)||void 0===n||n.log(Qv.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:rw.Session.hash(o.id)})),this._reloadOnDisconnect)return void this.ui.reloadUI();this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new Zv.Subscription;const{session:s,ui:a,connection:u}=this.subscribe();this._session=s,this.connection=u,this.ui=a,i&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()}),(t=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(Qv.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})}))}setAppInfo(t,e){this.appName=t,this.appLogoUrl=e}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,e){this.storage.setItem(t,e)}signEthereumMessage(t,e,r,n){return this.sendRequest({method:iw.Web3Method.signEthereumMessage,params:{message:(0,tw.hexStringFromBuffer)(t,!0),address:e,addPrefix:r,typedDataJson:n||null}})}ethereumAddressFromSignedMessage(t,e,r){return this.sendRequest({method:iw.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,tw.hexStringFromBuffer)(t,!0),signature:(0,tw.hexStringFromBuffer)(e,!0),addPrefix:r}})}signEthereumTransaction(t){return this.sendRequest({method:iw.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,tw.bigIntStringFromBN)(t.weiValue),data:(0,tw.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,tw.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,tw.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,tw.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,tw.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:iw.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,tw.bigIntStringFromBN)(t.weiValue),data:(0,tw.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,tw.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,tw.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,tw.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,tw.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,e){return this.sendRequest({method:iw.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,tw.hexStringFromBuffer)(t,!0),chainId:e}})}scanQRCode(t){return this.sendRequest({method:iw.Web3Method.scanQRCode,params:{regExp:t}})}getQRCodeUrl(){return(0,tw.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,e){return this.sendRequest({method:iw.Web3Method.generic,params:{action:e,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let e=null;const r=(0,tw.randomBytesHex)(8),n=n=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,n),null==e||e()};return{promise:new Promise(((i,o)=>{this.ui.isStandalone()||(e=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:n,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(r,(t=>{if(null==e||e(),t.errorMessage)return o(new Error(t.errorMessage));i(t)})),this.ui.isStandalone()?this.sendRequestStandalone(r,t):this.publishWeb3RequestEvent(r,t)})),cancel:n}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChainSubject.next(t)}publishWeb3RequestEvent(t,e){var r;const n=(0,sw.Web3RequestMessage)({id:t,request:e}),i=rw.Session.load(this.storage);null===(r=this.diagnostic)||void 0===r||r.log(Qv.EVENTS.WEB3_REQUEST,{eventId:n.id,method:`relay::${n.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?rw.Session.hash(i.id):"",isSessionMismatched:((null==i?void 0:i.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",n,!0).subscribe({next:t=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(Qv.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:n.id,method:`relay::${n.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?rw.Session.hash(i.id):"",isSessionMismatched:((null==i?void 0:i.id)!==this._session.id).toString()})},error:t=>{this.handleWeb3ResponseMessage((0,uw.Web3ResponseMessage)({id:n.id,response:{method:n.request.method,errorMessage:t.message}}))}}))}publishWeb3RequestCanceledEvent(t){const e=(0,ow.Web3RequestCanceledMessage)(t);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",e,!1).subscribe())}publishEvent(t,e,r){const n=this.session.secret;return new Zv.Observable((t=>{ew.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{origin:location.origin})),n).then((e=>{t.next(e),t.complete()}))})).pipe((0,Gv.mergeMap)((e=>this.connection.publishEvent(t,e,r))))}handleIncomingEvent(t){try{this.subscriptions.add((0,Zv.from)(ew.decrypt(t.data,this.session.secret)).pipe((0,Gv.map)((t=>JSON.parse(t)))).subscribe({next:t=>{const e=(0,uw.isWeb3ResponseMessage)(t)?t:null;e&&this.handleWeb3ResponseMessage(e)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Qv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch(t){return}}handleWeb3ResponseMessage(t){var e;const{response:r}=t;if(null===(e=this.diagnostic)||void 0===e||e.log(Qv.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash()}),(0,aw.isRequestEthereumAccountsResponse)(r))return cw.accountRequestCallbackIds.forEach((e=>this.invokeCallback(Object.assign(Object.assign({},t),{id:e})))),void cw.accountRequestCallbackIds.clear();this.invokeCallback(t)}handleErrorResponse(t,e,r,n){this.handleWeb3ResponseMessage((0,uw.Web3ResponseMessage)({id:t,response:(0,aw.ErrorResponse)(e,(null!=r?r:Kv.WalletUIError.UserRejectedRequest).message,n)}))}invokeCallback(t){const e=this.relayEventManager.callbacks.get(t.id);e&&(e(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:iw.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},e=(0,tw.randomBytesHex)(8),r=r=>{this.publishWeb3RequestCanceledEvent(e),this.handleErrorResponse(e,t.method,r)};return{promise:new Promise(((n,i)=>{var o;this.relayEventManager.callbacks.set(e,(t=>{if(this.ui.hideRequestEthereumAccounts(),t.errorMessage)return i(new Error(t.errorMessage));n(t)}));const s=(null===(o=null===window||void 0===window?void 0:window.navigator)||void 0===o?void 0:o.userAgent)||null;if(s&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(s)){let t;try{t=(0,tw.isInIFrame)()&&window.top?window.top.location:window.location}catch(e){t=window.location}t.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(t.href)}`}else{if(this.ui.inlineAccountsResponse()){const t=t=>{this.handleWeb3ResponseMessage((0,uw.Web3ResponseMessage)({id:e,response:(0,aw.RequestEthereumAccountsResponse)(t)}))};this.ui.requestEthereumAccounts({onCancel:r,onAccounts:t})}else{const t=$v.ethErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>r(t)})}cw.accountRequestCallbackIds.add(e),this.ui.inlineAccountsResponse()||this.ui.isStandalone()||this.publishWeb3RequestEvent(e,t)}})),cancel:r}}selectProvider(t){const e={method:iw.Web3Method.selectProvider,params:{providerOptions:t}},r=(0,tw.randomBytesHex)(8);return{cancel:t=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,t)},promise:new Promise(((e,n)=>{this.relayEventManager.callbacks.set(r,(t=>{if(t.errorMessage)return n(new Error(t.errorMessage));e(t)}));this.ui.selectProvider&&this.ui.selectProvider({onApprove:t=>{this.handleWeb3ResponseMessage((0,uw.Web3ResponseMessage)({id:r,response:(0,aw.SelectProviderResponse)(t)}))},onCancel:t=>{this.handleWeb3ResponseMessage((0,uw.Web3ResponseMessage)({id:r,response:(0,aw.SelectProviderResponse)(Xv.ProviderType.Unselected)}))},providerOptions:t})}))}}watchAsset(t,e,r,n,i,o){const s={method:iw.Web3Method.watchAsset,params:{type:t,options:{address:e,symbol:r,decimals:n,image:i},chainId:o}};let a=null;const u=(0,tw.randomBytesHex)(8),c=t=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,s.method,t),null==a||a()};this.ui.inlineWatchAsset()||(a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:c,onResetConnection:this.resetAndReload}));return{cancel:c,promise:new Promise(((c,l)=>{this.relayEventManager.callbacks.set(u,(t=>{if(null==a||a(),t.errorMessage)return l(new Error(t.errorMessage));c(t)}));const h=t=>{this.handleWeb3ResponseMessage((0,uw.Web3ResponseMessage)({id:u,response:(0,aw.WatchAssetReponse)(!1)}))},d=()=>{this.handleWeb3ResponseMessage((0,uw.Web3ResponseMessage)({id:u,response:(0,aw.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:d,onCancel:h,type:t,address:e,symbol:r,decimals:n,image:i,chainId:o}),this.ui.inlineWatchAsset()||this.ui.isStandalone()||this.publishWeb3RequestEvent(u,s)}))}}addEthereumChain(t,e,r,n,i,o){const s={method:iw.Web3Method.addEthereumChain,params:{chainId:t,rpcUrls:e,blockExplorerUrls:n,chainName:i,iconUrls:r,nativeCurrency:o}};let a=null;const u=(0,tw.randomBytesHex)(8),c=t=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,s.method,t),null==a||a()};this.ui.inlineAddEthereumChain(t)||(a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:c,onResetConnection:this.resetAndReload}));return{promise:new Promise(((e,r)=>{this.relayEventManager.callbacks.set(u,(t=>{if(null==a||a(),t.errorMessage)return r(new Error(t.errorMessage));e(t)}));const n=t=>{this.handleWeb3ResponseMessage((0,uw.Web3ResponseMessage)({id:u,response:(0,aw.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},i=t=>{this.handleWeb3ResponseMessage((0,uw.Web3ResponseMessage)({id:u,response:(0,aw.AddEthereumChainResponse)({isApproved:!0,rpcUrl:t})}))};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:n,onApprove:i,chainId:s.params.chainId,rpcUrls:s.params.rpcUrls,blockExplorerUrls:s.params.blockExplorerUrls,chainName:s.params.chainName,iconUrls:s.params.iconUrls,nativeCurrency:s.params.nativeCurrency}),this.ui.inlineAddEthereumChain(t)||this.ui.isStandalone()||this.publishWeb3RequestEvent(u,s)})),cancel:c}}switchEthereumChain(t,e){const r={method:iw.Web3Method.switchEthereumChain,params:Object.assign({chainId:t},{address:e})},n=(0,tw.randomBytesHex)(8);return{promise:new Promise(((t,e)=>{this.relayEventManager.callbacks.set(n,(r=>r.errorMessage&&r.errorCode?e($v.ethErrors.provider.custom({code:r.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):r.errorMessage?e(new Error(r.errorMessage)):void t(r)));this.ui.switchEthereumChain({onCancel:t=>{if("number"==typeof t){const e=t;this.handleWeb3ResponseMessage((0,uw.Web3ResponseMessage)({id:n,response:(0,aw.ErrorResponse)(iw.Web3Method.switchEthereumChain,Kv.WalletUIError.SwitchEthereumChainUnsupportedChainId.message,e)}))}else t instanceof Kv.WalletUIError?this.handleErrorResponse(n,iw.Web3Method.switchEthereumChain,t,t.errorCode):this.handleWeb3ResponseMessage((0,uw.Web3ResponseMessage)({id:n,response:(0,aw.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:t=>{this.handleWeb3ResponseMessage((0,uw.Web3ResponseMessage)({id:n,response:(0,aw.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:t})}))},chainId:r.params.chainId,address:r.params.address}),this.ui.inlineSwitchEthereumChain()||this.ui.isStandalone()||this.publishWeb3RequestEvent(n,r)})),cancel:t=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,t)}}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return rw.Session.hash(this._session.id)}sendRequestStandalone(t,e){const r=r=>{this.handleErrorResponse(t,e.method,r)},n=e=>{this.handleWeb3ResponseMessage((0,uw.Web3ResponseMessage)({id:t,response:e}))};switch(e.method){case iw.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:e,onSuccess:n,onCancel:r});break;case iw.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:e,onSuccess:n,onCancel:r});break;case iw.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:e,onSuccess:n,onCancel:r});break;case iw.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:e,onSuccess:n});break;default:r()}}onSessionConfigChanged(t){}}cw.accountRequestCallbackIds=new Set,zv([Jv.default],cw.prototype,"resetAndReload",null),zv([Jv.default],cw.prototype,"handleIncomingEvent",null),my.WalletSDKRelay=cw;var lw={};Object.defineProperty(lw,"__esModule",{value:!0}),lw.WalletSDKRelayEventManager=void 0;const hw=fe;lw.WalletSDKRelayEventManager=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,e=(0,hw.prepend0x)(t.toString(16));return this.callbacks.get(e)&&this.callbacks.delete(e),t}};var dw="3.6.6";Object.defineProperty(p,"__esModule",{value:!0}),p.CoinbaseWalletSDK=void 0;const fw=g,pw=y,gw=b,yw=Ol,bw=my,mw=lw,vw=fe,ww=process.env.LINK_API_URL||"https://www.walletlink.org",_w=process.env.SDK_VERSION||dw||"unknown";class Sw{constructor(t){var e,r,n;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const i=t.linkAPIUrl||ww;let o;if(o=t.uiConstructor?t.uiConstructor:t=>new yw.WalletSDKUI(t),void 0===t.overrideIsMetaMask?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=null===(e=t.overrideIsCoinbaseWallet)||void 0===e||e,this._overrideIsCoinbaseBrowser=null!==(r=t.overrideIsCoinbaseBrowser)&&void 0!==r&&r,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this._diagnosticLogger={log:t.eventListener.onEvent}:this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=null===(n=t.reloadOnDisconnect)||void 0===n||n;const s=new URL(i),a=`${s.protocol}//${s.host}`;this._storage=new pw.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",Sw.VERSION),this.walletExtension||this.coinbaseBrowser||(this._relayEventManager=new mw.WalletSDKRelayEventManager,this._relay=new bw.WalletSDKRelay({linkAPIUrl:i,version:_w,darkMode:!!t.darkMode,uiConstructor:o,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(t.appName,t.appLogoUrl),t.headlessMode||this._relay.attachUI())}makeWeb3Provider(t="",e=1){const r=this.walletExtension;if(r)return this.isCipherProvider(r)||r.setProviderInfo(t,e),!1===this._reloadOnDisconnect&&"function"==typeof r.disableReloadOnDisconnect&&r.disableReloadOnDisconnect(),r;const n=this.coinbaseBrowser;if(n)return n;const i=this._relay;if(!i||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||i.setConnectDisabled(!0),new gw.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(i),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:e,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,e){var r;this._appName=t||"DApp",this._appLogoUrl=e||(0,vw.getFavicon)();const n=this.walletExtension;n?this.isCipherProvider(n)||n.setAppInfo(this._appName,this._appLogoUrl):null===(r=this._relay)||void 0===r||r.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const e=this.walletExtension;e?e.close():null===(t=this._relay)||void 0===t||t.resetAndReload()}getQrUrl(){var t,e;return null!==(e=null===(t=this._relay)||void 0===t?void 0:t.getQRCodeUrl())&&void 0!==e?e:null}getCoinbaseWalletLogo(t,e=240){return(0,fw.walletLogo)(t,e)}get walletExtension(){var t;return null!==(t=window.coinbaseWalletExtension)&&void 0!==t?t:window.walletLinkExtension}get coinbaseBrowser(){var t,e;try{const r=null!==(t=window.ethereum)&&void 0!==t?t:null===(e=window.top)||void 0===e?void 0:e.ethereum;if(!r)return;return"isCoinbaseBrowser"in r&&r.isCoinbaseBrowser?r:void 0}catch(t){return}}isCipherProvider(t){return"boolean"==typeof t.isCipher&&t.isCipher}}p.CoinbaseWalletSDK=Sw,Sw.VERSION=_w,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=p,r=b;var n=p;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=b;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,"undefined"!=typeof window&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)}(f);var Ew=n(f);function Mw({chainId:t,rpcUrl:e,appName:r,appLogoUrl:n,darkMode:a},u){return i(this,void 0,void 0,(function*(){if(window.ethereum&&(window.ethereum.isWalletLink||window.ethereum.isToshi))return o(window.ethereum,u);if(!r)throw new Error("walletLink need appName");const i=new Ew({appName:r,appLogoUrl:n,darkMode:a}).makeWeb3Provider(e,t);return yield i.enable(),i.on("connect",u.connect),i.on("disconnect",u.disconnect),i.on("accountsChanged",u.accountsChanged),i.on("chainChanged",u.chainChanged),i.on("message",u.message),s(i)}))}export{Mw as default};
|