@dodoex/wallet-web3 0.0.43-8 → 0.0.43-beta.0

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.
Files changed (141) hide show
  1. package/dist/DefaultJsonRpcProvider-16b86457.js +1 -0
  2. package/dist/__node-resolve_empty-69a251b7.js +1 -0
  3. package/dist/blocto-e35c2bce.js +1 -0
  4. package/dist/bn-bea96c1e.js +1 -0
  5. package/dist/browser-ponyfill-f45b0187.js +1 -0
  6. package/dist/cjs/DefaultJsonRpcProvider-a4216c2c.cjs +1 -0
  7. package/dist/cjs/__node-resolve_empty-112a35f0.cjs +1 -0
  8. package/dist/cjs/blocto-6ce92a3c.cjs +1 -0
  9. package/dist/cjs/bn-4b6ace70.cjs +1 -0
  10. package/dist/cjs/browser-ponyfill-3d00f58c.cjs +1 -0
  11. package/dist/cjs/{draggabilly-e7dba61e.cjs → draggabilly-a516601d.cjs} +1 -1
  12. package/dist/cjs/ethers-79a8b64c.cjs +1 -0
  13. package/dist/cjs/id-aaf275ac.cjs +1 -0
  14. package/dist/cjs/index-0740e7fe.cjs +1 -0
  15. package/dist/cjs/index-2b8f986d.cjs +1 -0
  16. package/dist/cjs/index-3a818183.cjs +9 -0
  17. package/dist/cjs/{index-e8bc54f6.cjs → index-687606ef.cjs} +1 -1
  18. package/dist/{index-0ea58048.js → cjs/index-710e2e08.cjs} +2 -2
  19. package/dist/cjs/index-812ee091.cjs +1 -0
  20. package/dist/cjs/index-8908828b.cjs +1 -0
  21. package/dist/cjs/index-9e7c30e4.cjs +1 -0
  22. package/dist/cjs/index-b508044f.cjs +1 -0
  23. package/dist/cjs/index-bb7b2a27.cjs +15 -0
  24. package/dist/cjs/index-d132f04d.cjs +6 -0
  25. package/dist/cjs/{index-9f2a69d5.cjs → index-df8e5839.cjs} +1 -1
  26. package/dist/cjs/{index-5465ad4e.cjs → index-dfdc6c5b.cjs} +3 -3
  27. package/dist/cjs/{index-35edc6a0.cjs → index-eb09e54d.cjs} +1 -1
  28. package/dist/cjs/index.cjs +1 -1
  29. package/dist/cjs/index.es-a09533e6.cjs +9 -0
  30. package/dist/cjs/{interface-2faf1a27.cjs → interface-401abdcd.cjs} +1 -1
  31. package/dist/cjs/{lib-typedarrays-a6dc0c98.cjs → lib-typedarrays-500eafc3.cjs} +1 -1
  32. package/dist/cjs/{portis-94cbac04.cjs → portis-4b600385.cjs} +1 -1
  33. package/dist/cjs/provider-2af2c824.cjs +1 -0
  34. package/dist/cjs/providers/connector/index.d.ts +43 -175
  35. package/dist/cjs/providers/connector/ledgerUSB/index.d.ts +43 -43
  36. package/dist/cjs/providers/connector/ledgerUSB/provider.d.ts +10 -10
  37. package/dist/cjs/providers/connector/types.d.ts +0 -4
  38. package/dist/cjs/providers/connector/uniPass/index.d.ts +43 -43
  39. package/dist/cjs/providers/connector/uniPass/provider.d.ts +10 -10
  40. package/dist/cjs/providers/wallets/index.d.ts +1 -2
  41. package/dist/cjs/providers/wallets/standalone.d.ts +0 -1
  42. package/dist/cjs/providers/wallets/types.d.ts +0 -1
  43. package/dist/cjs/rainbow-56978b05.cjs +1 -0
  44. package/dist/cjs/{sha224-71bfefb8.cjs → sha224-d64bb467.cjs} +1 -1
  45. package/dist/cjs/sha256-5e38dae7.cjs +1 -0
  46. package/dist/cjs/uAuth-7692d87b.cjs +1 -0
  47. package/dist/cjs/walletConnect-9bf75169.cjs +1 -0
  48. package/dist/cjs/walletLink-2a1920a6.cjs +3 -0
  49. package/dist/{draggabilly-1b0df7fa.js → draggabilly-411a2bfc.js} +1 -1
  50. package/dist/ethers-cb195952.js +1 -0
  51. package/dist/id-44a7ba96.js +1 -0
  52. package/dist/{index-65d96278.js → index-0ee5ef8d.js} +1 -1
  53. package/dist/index-272625f0.js +1 -0
  54. package/dist/{index-62f9e96d.js → index-32a0a636.js} +2 -2
  55. package/dist/index-5bf4cdf3.js +9 -0
  56. package/dist/{index-5259e25a.js → index-64864a90.js} +3 -3
  57. package/dist/{cjs/index-6eab4c71.cjs → index-764c794e.js} +2 -2
  58. package/dist/index-79d77b05.js +1 -0
  59. package/dist/{cjs/index-ea4bfacb.cjs → index-849b2e9b.js} +8 -8
  60. package/dist/index-bacb8b7a.js +1 -0
  61. package/dist/index-c4b7e014.js +1 -0
  62. package/dist/index-d00482ad.js +1 -0
  63. package/dist/index-d8a60005.js +1 -0
  64. package/dist/index-df576275.js +1 -0
  65. package/dist/{index-f08d6a6b.js → index-e0d3617a.js} +1 -1
  66. package/dist/index.es-1a5925ce.js +9 -0
  67. package/dist/index.js +1 -1
  68. package/dist/{interface-73aba78a.js → interface-c0409fdc.js} +1 -1
  69. package/dist/{lib-typedarrays-1c9d6c71.js → lib-typedarrays-89645c3c.js} +1 -1
  70. package/dist/{portis-1576a67e.js → portis-e32a848b.js} +1 -1
  71. package/dist/provider-84d6204f.js +1 -0
  72. package/dist/providers/connector/index.d.ts +43 -175
  73. package/dist/providers/connector/ledgerUSB/index.d.ts +43 -43
  74. package/dist/providers/connector/ledgerUSB/provider.d.ts +10 -10
  75. package/dist/providers/connector/types.d.ts +0 -4
  76. package/dist/providers/connector/uniPass/index.d.ts +43 -43
  77. package/dist/providers/connector/uniPass/provider.d.ts +10 -10
  78. package/dist/providers/wallets/index.d.ts +1 -2
  79. package/dist/providers/wallets/standalone.d.ts +0 -1
  80. package/dist/providers/wallets/types.d.ts +0 -1
  81. package/dist/rainbow-33e0f4ed.js +1 -0
  82. package/dist/sha224-87032d02.js +1 -0
  83. package/dist/sha256-e81cf2ba.js +1 -0
  84. package/dist/uAuth-c2738d4a.js +1 -0
  85. package/dist/walletConnect-8deba348.js +1 -0
  86. package/dist/walletLink-a7c249e1.js +3 -0
  87. package/package.json +3 -10
  88. package/dist/__tslib-d4997183.js +0 -1
  89. package/dist/alchemy-provider-5870b6fa-31ff6f89.js +0 -1
  90. package/dist/alchemy-websocket-provider-213da986-6f09bc45.js +0 -1
  91. package/dist/blocto-f249d88f.js +0 -1
  92. package/dist/ccip-37802a12.js +0 -1
  93. package/dist/cjs/__tslib-56aaef99.cjs +0 -1
  94. package/dist/cjs/alchemy-provider-5870b6fa-9b7efcc2.cjs +0 -1
  95. package/dist/cjs/alchemy-websocket-provider-213da986-dadf0475.cjs +0 -1
  96. package/dist/cjs/blocto-94f2ba99.cjs +0 -1
  97. package/dist/cjs/ccip-d40f1141.cjs +0 -1
  98. package/dist/cjs/ethers-bc588825.cjs +0 -1
  99. package/dist/cjs/id-709283a5.cjs +0 -1
  100. package/dist/cjs/index-0deec6d9.cjs +0 -6
  101. package/dist/cjs/index-1d67f05e.cjs +0 -1
  102. package/dist/cjs/index-30df89d5.cjs +0 -1
  103. package/dist/cjs/index-665434db.cjs +0 -28
  104. package/dist/cjs/index-70269942.cjs +0 -1
  105. package/dist/cjs/index-9eb3debf.cjs +0 -1
  106. package/dist/cjs/index-a9b11111.cjs +0 -1
  107. package/dist/cjs/index-c7785862.cjs +0 -1
  108. package/dist/cjs/index.es-df73405d.cjs +0 -9
  109. package/dist/cjs/provider-0ef6c31a.cjs +0 -1
  110. package/dist/cjs/providers/connector/alchemy/index.d.ts +0 -136
  111. package/dist/cjs/providers/connector/alchemy/provider.d.ts +0 -138
  112. package/dist/cjs/providers/connector/alchemy/signer.d.ts +0 -23
  113. package/dist/cjs/rainbow-6b7a9167.cjs +0 -1
  114. package/dist/cjs/sha256-f8aa1c05.cjs +0 -1
  115. package/dist/cjs/typed-data-84ae13ad.cjs +0 -1
  116. package/dist/cjs/uAuth-d871ce86.cjs +0 -1
  117. package/dist/cjs/walletConnect-56b29a02.cjs +0 -1
  118. package/dist/cjs/walletLink-d0cde82c.cjs +0 -3
  119. package/dist/ethers-c1b1122e.js +0 -1
  120. package/dist/id-ebb9f5ed.js +0 -1
  121. package/dist/index-54e310d4.js +0 -1
  122. package/dist/index-5f8a4bfe.js +0 -15
  123. package/dist/index-6be6f872.js +0 -1
  124. package/dist/index-7cda4f49.js +0 -1
  125. package/dist/index-99e44b6a.js +0 -1
  126. package/dist/index-9fd42ec3.js +0 -1
  127. package/dist/index-f0df1b84.js +0 -28
  128. package/dist/index-f75e193c.js +0 -1
  129. package/dist/index-fe197f34.js +0 -1
  130. package/dist/index.es-183def38.js +0 -9
  131. package/dist/provider-e8d27051.js +0 -1
  132. package/dist/providers/connector/alchemy/index.d.ts +0 -136
  133. package/dist/providers/connector/alchemy/provider.d.ts +0 -138
  134. package/dist/providers/connector/alchemy/signer.d.ts +0 -23
  135. package/dist/rainbow-05a1f2bf.js +0 -1
  136. package/dist/sha224-43f02863.js +0 -1
  137. package/dist/sha256-16ffc229.js +0 -1
  138. package/dist/typed-data-4a7e8c38.js +0 -1
  139. package/dist/uAuth-4a709afd.js +0 -1
  140. package/dist/walletConnect-57302439.js +0 -1
  141. package/dist/walletLink-02254a5d.js +0 -3
@@ -1,3 +0,0 @@
1
- "use strict";var e=require("./index-665434db.cjs"),t=require("events"),n=require("./inherits_browser-50deae74.cjs"),r=require("buffer"),i=require("./index-70269942.cjs"),o=require("./__tslib-56aaef99.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@ethersproject/providers"),require("zustand"),require("@ethersproject/address"),require("@ethersproject/bytes"),require("@ethersproject/properties"),require("@ethersproject/abstract-signer"),require("@ethersproject/abstract-provider"),require("@ethersproject/contracts"),require("@ethersproject/constants"),require("@ethersproject/transactions"),require("util");var a=s(t),c=s(r),u={},l={},h={};Object.defineProperty(h,"__esModule",{value:!0}),h.walletLogo=void 0;h.walletLogo=(e,t)=>{let n;switch(e){case"standard":default:return n=t,`data:image/svg+xml,%3Csvg width='${t}' height='${n}' 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 n=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${n}' 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 n=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' 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 n=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' 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 n=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' 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 n=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' 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 d={};Object.defineProperty(d,"__esModule",{value:!0}),d.ScopedLocalStorage=void 0;d.ScopedLocalStorage=class{constructor(e){this.scope=e}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),t=[];for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n);"string"==typeof r&&r.startsWith(e)&&t.push(r)}t.forEach((e=>localStorage.removeItem(e)))}scopedKey(e){return`${this.scope}:${e}`}};var f={},p={};Object.defineProperty(p,"__esModule",{value:!0});const b=a.default;function y(e,t,n){try{Reflect.apply(e,t,n)}catch(e){setTimeout((()=>{throw e}))}}class g extends b.EventEmitter{emit(e,...t){let n="error"===e;const r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const n=new Error("Unhandled error."+(e?` (${e.message})`:""));throw n.context=e,n}const i=r[e];if(void 0===i)return!1;if("function"==typeof i)y(i,this,t);else{const e=i.length,n=function(e){const t=e.length,n=new Array(t);for(let r=0;r<t;r+=1)n[r]=e[r];return n}(i);for(let r=0;r<e;r+=1)y(n[r],this,t)}return!0}}p.default=g;var m={},v={},_=C;C.default=C,C.stable=A,C.stableStringify=A;var w="[...]",S="[Circular]",E=[],x=[];function k(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function C(e,t,n,r){var i;void 0===r&&(r=k()),I(e,"",0,[],void 0,0,r);try{i=0===x.length?JSON.stringify(e,t,n):JSON.stringify(e,N(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==E.length;){var o=E.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function M(e,t,n,r){var i=Object.getOwnPropertyDescriptor(r,n);void 0!==i.get?i.configurable?(Object.defineProperty(r,n,{value:e}),E.push([r,n,t,i])):x.push([t,n,e]):(r[n]=e,E.push([r,n,t]))}function I(e,t,n,r,i,o,s){var a;if(o+=1,"object"==typeof e&&null!==e){for(a=0;a<r.length;a++)if(r[a]===e)return void M(S,e,t,i);if(void 0!==s.depthLimit&&o>s.depthLimit)return void M(w,e,t,i);if(void 0!==s.edgesLimit&&n+1>s.edgesLimit)return void M(w,e,t,i);if(r.push(e),Array.isArray(e))for(a=0;a<e.length;a++)I(e[a],a,a,r,e,o,s);else{var c=Object.keys(e);for(a=0;a<c.length;a++){var u=c[a];I(e[u],u,a,r,e,o,s)}}r.pop()}}function R(e,t){return e<t?-1:e>t?1:0}function A(e,t,n,r){void 0===r&&(r=k());var i,o=j(e,"",0,[],void 0,0,r)||e;try{i=0===x.length?JSON.stringify(o,t,n):JSON.stringify(o,N(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==E.length;){var s=E.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function j(e,t,n,r,i,o,s){var a;if(o+=1,"object"==typeof e&&null!==e){for(a=0;a<r.length;a++)if(r[a]===e)return void M(S,e,t,i);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==s.depthLimit&&o>s.depthLimit)return void M(w,e,t,i);if(void 0!==s.edgesLimit&&n+1>s.edgesLimit)return void M(w,e,t,i);if(r.push(e),Array.isArray(e))for(a=0;a<e.length;a++)j(e[a],a,a,r,e,o,s);else{var c={},u=Object.keys(e).sort(R);for(a=0;a<u.length;a++){var l=u[a];j(e[l],l,a,r,e,o,s),c[l]=e[l]}if(void 0===i)return c;E.push([i,t,e]),i[t]=c}r.pop()}}function N(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(x.length>0)for(var r=0;r<x.length;r++){var i=x[r];if(i[1]===t&&i[0]===n){n=i[2],x.splice(r,1);break}}return e.call(this,t,n)}}Object.defineProperty(v,"__esModule",{value:!0}),v.EthereumProviderError=v.EthereumRpcError=void 0;const O=_;class T extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==n&&(this.data=n)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return O.default(this.serialize(),P,2)}}v.EthereumRpcError=T;function P(e,t){if("[Circular]"!==t)return t}v.EthereumProviderError=class extends T{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}};var L={},D={};Object.defineProperty(D,"__esModule",{value:!0}),D.errorValues=D.errorCodes=void 0,D.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}},D.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(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=D,n=v,r=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:r,message:s(r)};function s(n,r=i){if(Number.isInteger(n)){const r=n.toString();if(l(t.errorValues,r))return t.errorValues[r].message;if(c(n))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function a(e){if(!Number.isInteger(e))return!1;const n=e.toString();return!!t.errorValues[n]||!!c(e)}function c(e){return e>=-32099&&e<=-32e3}function u(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=s,e.isValidCode=a,e.serializeError=function(e,{fallbackError:t=o,shouldIncludeStack:r=!1}={}){var i,c;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof n.EthereumRpcError)return e.serialize();const h={};if(e&&"object"==typeof e&&!Array.isArray(e)&&l(e,"code")&&a(e.code)){const t=e;h.code=t.code,t.message&&"string"==typeof t.message?(h.message=t.message,l(t,"data")&&(h.data=t.data)):(h.message=s(h.code),h.data={originalError:u(e)})}else{h.code=t.code;const n=null===(i=e)||void 0===i?void 0:i.message;h.message=n&&"string"==typeof n?n:t.message,h.data={originalError:u(e)}}const d=null===(c=e)||void 0===c?void 0:c.stack;return r&&e&&d&&"string"==typeof d&&(h.stack=d),h}}(L);var B={};Object.defineProperty(B,"__esModule",{value:!0}),B.ethErrors=void 0;const F=v,U=L,V=D;function H(e,t){const[n,r]=z(t);return new F.EthereumRpcError(e,n||U.getMessageFromCode(e),r)}function W(e,t){const[n,r]=z(t);return new F.EthereumProviderError(e,n||U.getMessageFromCode(e),r)}function z(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,n]}}return[]}B.ethErrors={rpc:{parse:e=>H(V.errorCodes.rpc.parse,e),invalidRequest:e=>H(V.errorCodes.rpc.invalidRequest,e),invalidParams:e=>H(V.errorCodes.rpc.invalidParams,e),methodNotFound:e=>H(V.errorCodes.rpc.methodNotFound,e),internal:e=>H(V.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return H(t,e)},invalidInput:e=>H(V.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>H(V.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>H(V.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>H(V.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>H(V.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>H(V.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>W(V.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>W(V.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>W(V.errorCodes.provider.unsupportedMethod,e),disconnected:e=>W(V.errorCodes.provider.disconnected,e),chainDisconnected:e=>W(V.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:n,data:r}=e;if(!n||"string"!=typeof n)throw new Error('"message" must be a nonempty string');return new F.EthereumProviderError(t,n,r)}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=v;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const n=L;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const r=B;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return r.ethErrors}});const i=D;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})}(m);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 $={},J={exports:{}},G={exports:{}};
2
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
- !function(e,t){var n=c.default,r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=o),o.prototype=Object.create(r.prototype),i(r,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}(G,G.exports);var Z=G.exports.Buffer;function Q(e,t){this._block=Z.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Q.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=Z.from(e,t));for(var n=this._block,r=this._blockSize,i=e.length,o=this._len,s=0;s<i;){for(var a=o%r,c=Math.min(i-s,r-a),u=0;u<c;u++)n[a+u]=e[s+u];s+=c,(o+=c)%r==0&&this._update(n)}return this._len+=i,this},Q.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},Q.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Y=Q,K=n.inherits_browser.exports,X=Y,ee=G.exports.Buffer,te=[1518500249,1859775393,-1894007588,-899497514],ne=new Array(80);function re(){this.init(),this._w=ne,X.call(this,64,56)}function ie(e){return e<<30|e>>>2}function oe(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}K(re,X),re.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},re.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,c=0;c<16;++c)n[c]=e.readInt32BE(4*c);for(;c<80;++c)n[c]=n[c-3]^n[c-8]^n[c-14]^n[c-16];for(var u=0;u<80;++u){var l=~~(u/20),h=0|((t=r)<<5|t>>>27)+oe(l,i,o,s)+a+n[u]+te[l];a=s,s=o,o=ie(i),i=r,r=h}this._a=r+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},re.prototype._hash=function(){var e=ee.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var se=re,ae=n.inherits_browser.exports,ce=Y,ue=G.exports.Buffer,le=[1518500249,1859775393,-1894007588,-899497514],he=new Array(80);function de(){this.init(),this._w=he,ce.call(this,64,56)}function fe(e){return e<<5|e>>>27}function pe(e){return e<<30|e>>>2}function be(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}ae(de,ce),de.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},de.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,c=0;c<16;++c)n[c]=e.readInt32BE(4*c);for(;c<80;++c)n[c]=(t=n[c-3]^n[c-8]^n[c-14]^n[c-16])<<1|t>>>31;for(var u=0;u<80;++u){var l=~~(u/20),h=fe(r)+be(l,i,o,s)+a+n[u]+le[l]|0;a=s,s=o,o=pe(i),i=r,r=h}this._a=r+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},de.prototype._hash=function(){var e=ue.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var ye=de,ge=n.inherits_browser.exports,me=Y,ve=G.exports.Buffer,_e=[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],we=new Array(64);function Se(){this.init(),this._w=we,me.call(this,64,56)}function Ee(e,t,n){return n^e&(t^n)}function xe(e,t,n){return e&t|n&(e|t)}function ke(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Ce(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Me(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Ie(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}ge(Se,me),Se.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},Se.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,a=0|this._f,c=0|this._g,u=0|this._h,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<64;++l)t[l]=Ie(t[l-2])+t[l-7]+Me(t[l-15])+t[l-16]|0;for(var h=0;h<64;++h){var d=u+Ce(s)+Ee(s,a,c)+_e[h]+t[h]|0,f=ke(n)+xe(n,r,i)|0;u=c,c=a,a=s,s=o+d|0,o=i,i=r,r=n,n=d+f|0}this._a=n+this._a|0,this._b=r+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=c+this._g|0,this._h=u+this._h|0},Se.prototype._hash=function(){var e=ve.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Re=Se,Ae=n.inherits_browser.exports,je=Re,Ne=Y,Oe=G.exports.Buffer,Te=new Array(64);function Pe(){this.init(),this._w=Te,Ne.call(this,64,56)}Ae(Pe,je),Pe.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},Pe.prototype._hash=function(){var e=Oe.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var Le=Pe,De=n.inherits_browser.exports,Be=Y,Fe=G.exports.Buffer,Ue=[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],Ve=new Array(160);function He(){this.init(),this._w=Ve,Be.call(this,128,112)}function We(e,t,n){return n^e&(t^n)}function ze(e,t,n){return e&t|n&(e|t)}function qe(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function $e(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Je(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Ge(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Ze(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Qe(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Ye(e,t){return e>>>0<t>>>0?1:0}De(He,Be),He.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},He.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,a=0|this._fh,c=0|this._gh,u=0|this._hh,l=0|this._al,h=0|this._bl,d=0|this._cl,f=0|this._dl,p=0|this._el,b=0|this._fl,y=0|this._gl,g=0|this._hl,m=0;m<32;m+=2)t[m]=e.readInt32BE(4*m),t[m+1]=e.readInt32BE(4*m+4);for(;m<160;m+=2){var v=t[m-30],_=t[m-30+1],w=Je(v,_),S=Ge(_,v),E=Ze(v=t[m-4],_=t[m-4+1]),x=Qe(_,v),k=t[m-14],C=t[m-14+1],M=t[m-32],I=t[m-32+1],R=S+C|0,A=w+k+Ye(R,S)|0;A=(A=A+E+Ye(R=R+x|0,x)|0)+M+Ye(R=R+I|0,I)|0,t[m]=A,t[m+1]=R}for(var j=0;j<160;j+=2){A=t[j],R=t[j+1];var N=ze(n,r,i),O=ze(l,h,d),T=qe(n,l),P=qe(l,n),L=$e(s,p),D=$e(p,s),B=Ue[j],F=Ue[j+1],U=We(s,a,c),V=We(p,b,y),H=g+D|0,W=u+L+Ye(H,g)|0;W=(W=(W=W+U+Ye(H=H+V|0,V)|0)+B+Ye(H=H+F|0,F)|0)+A+Ye(H=H+R|0,R)|0;var z=P+O|0,q=T+N+Ye(z,P)|0;u=c,g=y,c=a,y=b,a=s,b=p,s=o+W+Ye(p=f+H|0,f)|0,o=i,f=d,i=r,d=h,r=n,h=l,n=W+q+Ye(l=H+z|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+b|0,this._gl=this._gl+y|0,this._hl=this._hl+g|0,this._ah=this._ah+n+Ye(this._al,l)|0,this._bh=this._bh+r+Ye(this._bl,h)|0,this._ch=this._ch+i+Ye(this._cl,d)|0,this._dh=this._dh+o+Ye(this._dl,f)|0,this._eh=this._eh+s+Ye(this._el,p)|0,this._fh=this._fh+a+Ye(this._fl,b)|0,this._gh=this._gh+c+Ye(this._gl,y)|0,this._hh=this._hh+u+Ye(this._hl,g)|0},He.prototype._hash=function(){var e=Fe.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Ke=He,Xe=n.inherits_browser.exports,et=Ke,tt=Y,nt=G.exports.Buffer,rt=new Array(160);function it(){this.init(),this._w=rt,tt.call(this,128,112)}Xe(it,et),it.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},it.prototype._hash=function(){var e=nt.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var ot=it,st=J.exports=function(e){e=e.toLowerCase();var t=st[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};st.sha=se,st.sha1=ye,st.sha224=Le,st.sha256=Re,st.sha384=ot,st.sha512=Ke;var at,ct={},ut="undefined"!=typeof Symbol&&Symbol,lt=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0},ht=Array.prototype.slice,dt=Object.prototype.toString,ft=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==dt.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n,r=ht.call(arguments,1),i=Math.max(0,t.length-r.length),o=[],s=0;s<i;s++)o.push("$"+s);if(n=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof n){var i=t.apply(this,r.concat(ht.call(arguments)));return Object(i)===i?i:this}return t.apply(e,r.concat(ht.call(arguments)))})),t.prototype){var a=function(){};a.prototype=t.prototype,n.prototype=new a,a.prototype=null}return n},pt=Function.prototype.bind||ft,bt=Array.prototype.slice,yt=Object.prototype.toString,gt=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==yt.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n,r=bt.call(arguments,1),i=Math.max(0,t.length-r.length),o=[],s=0;s<i;s++)o.push("$"+s);if(n=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof n){var i=t.apply(this,r.concat(bt.call(arguments)));return Object(i)===i?i:this}return t.apply(e,r.concat(bt.call(arguments)))})),t.prototype){var a=function(){};a.prototype=t.prototype,n.prototype=new a,a.prototype=null}return n},mt=(Function.prototype.bind||gt).call(Function.call,Object.prototype.hasOwnProperty),vt=SyntaxError,_t=Function,wt=TypeError,St=function(e){try{return _t('"use strict"; return ('+e+").constructor;")()}catch(e){}},Et=Object.getOwnPropertyDescriptor;if(Et)try{Et({},"")}catch(op){Et=null}var xt=function(){throw new wt},kt=Et?function(){try{return xt}catch(e){try{return Et(arguments,"callee").get}catch(e){return xt}}}():xt,Ct="function"==typeof ut&&"function"==typeof Symbol&&"symbol"==typeof ut("foo")&&"symbol"==typeof Symbol("bar")&&lt(),Mt=Object.getPrototypeOf||function(e){return e.__proto__},It={},Rt="undefined"==typeof Uint8Array?at:Mt(Uint8Array),At={"%AggregateError%":"undefined"==typeof AggregateError?at:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?at:ArrayBuffer,"%ArrayIteratorPrototype%":Ct?Mt([][Symbol.iterator]()):at,"%AsyncFromSyncIteratorPrototype%":at,"%AsyncFunction%":It,"%AsyncGenerator%":It,"%AsyncGeneratorFunction%":It,"%AsyncIteratorPrototype%":It,"%Atomics%":"undefined"==typeof Atomics?at:Atomics,"%BigInt%":"undefined"==typeof BigInt?at:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?at:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?at:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?at:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?at:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?at:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?at:FinalizationRegistry,"%Function%":_t,"%GeneratorFunction%":It,"%Int8Array%":"undefined"==typeof Int8Array?at:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?at:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?at:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ct?Mt(Mt([][Symbol.iterator]())):at,"%JSON%":"object"==typeof JSON?JSON:at,"%Map%":"undefined"==typeof Map?at:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&Ct?Mt((new Map)[Symbol.iterator]()):at,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?at:Promise,"%Proxy%":"undefined"==typeof Proxy?at:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?at:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?at:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&Ct?Mt((new Set)[Symbol.iterator]()):at,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?at:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ct?Mt(""[Symbol.iterator]()):at,"%Symbol%":Ct?Symbol:at,"%SyntaxError%":vt,"%ThrowTypeError%":kt,"%TypedArray%":Rt,"%TypeError%":wt,"%Uint8Array%":"undefined"==typeof Uint8Array?at:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?at:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?at:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?at:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?at:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?at:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?at:WeakSet};try{null.error}catch(op){var jt=Mt(Mt(op));At["%Error.prototype%"]=jt}var Nt=function e(t){var n;if("%AsyncFunction%"===t)n=St("async function () {}");else if("%GeneratorFunction%"===t)n=St("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=St("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(n=Mt(i.prototype))}return At[t]=n,n},Ot={"%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"]},Tt=pt,Pt=mt,Lt=Tt.call(Function.call,Array.prototype.concat),Dt=Tt.call(Function.apply,Array.prototype.splice),Bt=Tt.call(Function.call,String.prototype.replace),Ft=Tt.call(Function.call,String.prototype.slice),Ut=Tt.call(Function.call,RegExp.prototype.exec),Vt=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ht=/\\(\\)?/g,Wt=function(e,t){var n,r=e;if(Pt(Ot,r)&&(r="%"+(n=Ot[r])[0]+"%"),Pt(At,r)){var i=At[r];if(i===It&&(i=Nt(r)),void 0===i&&!t)throw new wt("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new vt("intrinsic "+e+" does not exist!")},zt=function(e,t){if("string"!=typeof e||0===e.length)throw new wt("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new wt('"allowMissing" argument must be a boolean');if(null===Ut(/^%?[^%]*%?$/,e))throw new vt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=Ft(e,0,1),n=Ft(e,-1);if("%"===t&&"%"!==n)throw new vt("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new vt("invalid intrinsic syntax, expected opening `%`");var r=[];return Bt(e,Vt,(function(e,t,n,i){r[r.length]=n?Bt(i,Ht,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",i=Wt("%"+r+"%",t),o=i.name,s=i.value,a=!1,c=i.alias;c&&(r=c[0],Dt(n,Lt([0,1],c)));for(var u=1,l=!0;u<n.length;u+=1){var h=n[u],d=Ft(h,0,1),f=Ft(h,-1);if(('"'===d||"'"===d||"`"===d||'"'===f||"'"===f||"`"===f)&&d!==f)throw new vt("property names with quotes must have matching quotes");if("constructor"!==h&&l||(a=!0),Pt(At,o="%"+(r+="."+h)+"%"))s=At[o];else if(null!=s){if(!(h in s)){if(!t)throw new wt("base intrinsic for "+e+" exists, but the property is not available.");return}if(Et&&u+1>=n.length){var p=Et(s,h);s=(l=!!p)&&"get"in p&&!("originalValue"in p.get)?p.get:s[h]}else l=Pt(s,h),s=s[h];l&&!a&&(At[o]=s)}}return s},qt={exports:{}},$t=Array.prototype.slice,Jt=Object.prototype.toString,Gt=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==Jt.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n,r=$t.call(arguments,1),i=Math.max(0,t.length-r.length),o=[],s=0;s<i;s++)o.push("$"+s);if(n=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof n){var i=t.apply(this,r.concat($t.call(arguments)));return Object(i)===i?i:this}return t.apply(e,r.concat($t.call(arguments)))})),t.prototype){var a=function(){};a.prototype=t.prototype,n.prototype=new a,a.prototype=null}return n},Zt=Function.prototype.bind||Gt;!function(e){var t=Zt,n=zt,r=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),o=n("%Reflect.apply%",!0)||t.call(i,r),s=n("%Object.getOwnPropertyDescriptor%",!0),a=n("%Object.defineProperty%",!0),c=n("%Math.max%");if(a)try{a({},"a",{value:1})}catch(e){a=null}e.exports=function(e){var n=o(t,i,arguments);s&&a&&(s(n,"length").configurable&&a(n,"length",{value:1+c(0,e.length-(arguments.length-1))}));return n};var u=function(){return o(t,r,arguments)};a?a(e.exports,"apply",{value:u}):e.exports.apply=u}(qt);var Qt=zt,Yt=qt.exports,Kt=Yt(Qt("String.prototype.indexOf")),Xt="function"==typeof Map&&Map.prototype,en=Object.getOwnPropertyDescriptor&&Xt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,tn=Xt&&en&&"function"==typeof en.get?en.get:null,nn=Xt&&Map.prototype.forEach,rn="function"==typeof Set&&Set.prototype,on=Object.getOwnPropertyDescriptor&&rn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,sn=rn&&on&&"function"==typeof on.get?on.get:null,an=rn&&Set.prototype.forEach,cn="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,un="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,ln="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,hn=Boolean.prototype.valueOf,dn=Object.prototype.toString,fn=Function.prototype.toString,pn=String.prototype.match,bn=String.prototype.slice,yn=String.prototype.replace,gn=String.prototype.toUpperCase,mn=String.prototype.toLowerCase,vn=RegExp.prototype.test,_n=Array.prototype.concat,wn=Array.prototype.join,Sn=Array.prototype.slice,En=Math.floor,xn="function"==typeof BigInt?BigInt.prototype.valueOf:null,kn=Object.getOwnPropertySymbols,Cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Mn="function"==typeof Symbol&&"object"==typeof Symbol.iterator,In="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Mn||"symbol")?Symbol.toStringTag:null,Rn=Object.prototype.propertyIsEnumerable,An=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function jn(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||vn.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-En(-e):En(e);if(r!==e){var i=String(r),o=bn.call(t,i.length+1);return yn.call(i,n,"$&_")+"."+yn.call(yn.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yn.call(t,n,"$&_")}var Nn=e.require$$1,On=Nn.custom,Tn=Fn(On)?On:null;function Pn(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function Ln(e){return yn.call(String(e),/"/g,"&quot;")}function Dn(e){return!("[object Array]"!==Hn(e)||In&&"object"==typeof e&&In in e)}function Bn(e){return!("[object RegExp]"!==Hn(e)||In&&"object"==typeof e&&In in e)}function Fn(e){if(Mn)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!Cn)return!1;try{return Cn.call(e),!0}catch(e){}return!1}var Un=Object.prototype.hasOwnProperty||function(e){return e in this};function Vn(e,t){return Un.call(e,t)}function Hn(e){return dn.call(e)}function Wn(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function zn(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return zn(bn.call(e,0,t.maxStringLength),t)+r}return Pn(yn.call(yn.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,qn),"single",t)}function qn(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+gn.call(t.toString(16))}function $n(e){return"Object("+e+")"}function Jn(e){return e+" { ? }"}function Gn(e,t,n,r){return e+" ("+t+") {"+(r?Zn(n,r):wn.call(n,", "))+"}"}function Zn(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+wn.call(e,","+n)+"\n"+t.prev}function Qn(e,t){var n=Dn(e),r=[];if(n){r.length=e.length;for(var i=0;i<e.length;i++)r[i]=Vn(e,i)?t(e[i],e):""}var o,s="function"==typeof kn?kn(e):[];if(Mn){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var c in e)Vn(e,c)&&(n&&String(Number(c))===c&&c<e.length||Mn&&o["$"+c]instanceof Symbol||(vn.call(/[^\w$]/,c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if("function"==typeof kn)for(var u=0;u<s.length;u++)Rn.call(e,s[u])&&r.push("["+t(s[u])+"]: "+t(e[s[u]],e));return r}var Yn=zt,Kn=function(e,t){var n=Qt(e,!!t);return"function"==typeof n&&Kt(e,".prototype.")>-1?Yt(n):n},Xn=function e(t,n,r,i){var o=n||{};if(Vn(o,"quoteStyle")&&"single"!==o.quoteStyle&&"double"!==o.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Vn(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=!Vn(o,"customInspect")||o.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Vn(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(Vn(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===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return zn(t,o);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var c=String(t);return a?jn(t,c):c}if("bigint"==typeof t){var u=String(t)+"n";return a?jn(t,u):u}var l=void 0===o.depth?5:o.depth;if(void 0===r&&(r=0),r>=l&&l>0&&"object"==typeof t)return Dn(t)?"[Array]":"[Object]";var h=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=wn.call(Array(e.indent+1)," ")}return{base:n,prev:wn.call(Array(t+1),n)}}(o,r);if(void 0===i)i=[];else if(Wn(i,t)>=0)return"[Circular]";function d(t,n,s){if(n&&(i=Sn.call(i)).push(n),s){var a={depth:o.depth};return Vn(o,"quoteStyle")&&(a.quoteStyle=o.quoteStyle),e(t,a,r+1,i)}return e(t,o,r+1,i)}if("function"==typeof t&&!Bn(t)){var f=function(e){if(e.name)return e.name;var t=pn.call(fn.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),p=Qn(t,d);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+wn.call(p,", ")+" }":"")}if(Fn(t)){var b=Mn?yn.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Cn.call(t);return"object"!=typeof t||Mn?b:$n(b)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var y="<"+mn.call(String(t.nodeName)),g=t.attributes||[],m=0;m<g.length;m++)y+=" "+g[m].name+"="+Pn(Ln(g[m].value),"double",o);return y+=">",t.childNodes&&t.childNodes.length&&(y+="..."),y+="</"+mn.call(String(t.nodeName))+">"}if(Dn(t)){if(0===t.length)return"[]";var v=Qn(t,d);return h&&!function(e){for(var t=0;t<e.length;t++)if(Wn(e[t],"\n")>=0)return!1;return!0}(v)?"["+Zn(v,h)+"]":"[ "+wn.call(v,", ")+" ]"}if(function(e){return!("[object Error]"!==Hn(e)||In&&"object"==typeof e&&In in e)}(t)){var _=Qn(t,d);return"cause"in Error.prototype||!("cause"in t)||Rn.call(t,"cause")?0===_.length?"["+String(t)+"]":"{ ["+String(t)+"] "+wn.call(_,", ")+" }":"{ ["+String(t)+"] "+wn.call(_n.call("[cause]: "+d(t.cause),_),", ")+" }"}if("object"==typeof t&&s){if(Tn&&"function"==typeof t[Tn]&&Nn)return Nn(t,{depth:l-r});if("symbol"!==s&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!tn||!e||"object"!=typeof e)return!1;try{tn.call(e);try{sn.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var w=[];return nn&&nn.call(t,(function(e,n){w.push(d(n,t,!0)+" => "+d(e,t))})),Gn("Map",tn.call(t),w,h)}if(function(e){if(!sn||!e||"object"!=typeof e)return!1;try{sn.call(e);try{tn.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var S=[];return an&&an.call(t,(function(e){S.push(d(e,t))})),Gn("Set",sn.call(t),S,h)}if(function(e){if(!cn||!e||"object"!=typeof e)return!1;try{cn.call(e,cn);try{un.call(e,un)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Jn("WeakMap");if(function(e){if(!un||!e||"object"!=typeof e)return!1;try{un.call(e,un);try{cn.call(e,cn)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Jn("WeakSet");if(function(e){if(!ln||!e||"object"!=typeof e)return!1;try{return ln.call(e),!0}catch(e){}return!1}(t))return Jn("WeakRef");if(function(e){return!("[object Number]"!==Hn(e)||In&&"object"==typeof e&&In in e)}(t))return $n(d(Number(t)));if(function(e){if(!e||"object"!=typeof e||!xn)return!1;try{return xn.call(e),!0}catch(e){}return!1}(t))return $n(d(xn.call(t)));if(function(e){return!("[object Boolean]"!==Hn(e)||In&&"object"==typeof e&&In in e)}(t))return $n(hn.call(t));if(function(e){return!("[object String]"!==Hn(e)||In&&"object"==typeof e&&In in e)}(t))return $n(d(String(t)));if(!function(e){return!("[object Date]"!==Hn(e)||In&&"object"==typeof e&&In in e)}(t)&&!Bn(t)){var E=Qn(t,d),x=An?An(t)===Object.prototype:t instanceof Object||t.constructor===Object,k=t instanceof Object?"":"null prototype",C=!x&&In&&Object(t)===t&&In in t?bn.call(Hn(t),8,-1):k?"Object":"",M=(x||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(C||k?"["+wn.call(_n.call([],C||[],k||[]),": ")+"] ":"");return 0===E.length?M+"{}":h?M+"{"+Zn(E,h)+"}":M+"{ "+wn.call(E,", ")+" }"}return String(t)},er=Yn("%TypeError%"),tr=Yn("%WeakMap%",!0),nr=Yn("%Map%",!0),rr=Kn("WeakMap.prototype.get",!0),ir=Kn("WeakMap.prototype.set",!0),or=Kn("WeakMap.prototype.has",!0),sr=Kn("Map.prototype.get",!0),ar=Kn("Map.prototype.set",!0),cr=Kn("Map.prototype.has",!0),ur=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},lr=String.prototype.replace,hr=/%20/g,dr="RFC3986",fr={default:dr,formatters:{RFC1738:function(e){return lr.call(e,hr,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:dr},pr=fr,br=Object.prototype.hasOwnProperty,yr=Array.isArray,gr=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),mr=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},vr={arrayToObject:mr,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],o=i.obj[i.prop],s=Object.keys(o),a=0;a<s.length;++a){var c=s[a],u=o[c];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:o,prop:c}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(yr(n)){for(var r=[],i=0;i<n.length;++i)void 0!==n[i]&&r.push(n[i]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,r,i){if(0===e.length)return e;var o=e;if("symbol"==typeof e?o=Symbol.prototype.toString.call(e):"string"!=typeof e&&(o=String(e)),"iso-8859-1"===n)return escape(o).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var s="",a=0;a<o.length;++a){var c=o.charCodeAt(a);45===c||46===c||95===c||126===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||i===pr.RFC1738&&(40===c||41===c)?s+=o.charAt(a):c<128?s+=gr[c]:c<2048?s+=gr[192|c>>6]+gr[128|63&c]:c<55296||c>=57344?s+=gr[224|c>>12]+gr[128|c>>6&63]+gr[128|63&c]:(a+=1,c=65536+((1023&c)<<10|1023&o.charCodeAt(a)),s+=gr[240|c>>18]+gr[128|c>>12&63]+gr[128|c>>6&63]+gr[128|63&c])}return s},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(yr(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(yr(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!br.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var i=t;return yr(t)&&!yr(n)&&(i=mr(t,r)),yr(t)&&yr(n)?(n.forEach((function(n,i){if(br.call(t,i)){var o=t[i];o&&"object"==typeof o&&n&&"object"==typeof n?t[i]=e(o,n,r):t.push(n)}else t[i]=n})),t):Object.keys(n).reduce((function(t,i){var o=n[i];return br.call(t,i)?t[i]=e(t[i],o,r):t[i]=o,t}),i)}},_r=function(){var e,t,n,r={assert:function(e){if(!r.has(e))throw new er("Side channel does not contain "+Xn(e))},get:function(r){if(tr&&r&&("object"==typeof r||"function"==typeof r)){if(e)return rr(e,r)}else if(nr){if(t)return sr(t,r)}else if(n)return function(e,t){var n=ur(e,t);return n&&n.value}(n,r)},has:function(r){if(tr&&r&&("object"==typeof r||"function"==typeof r)){if(e)return or(e,r)}else if(nr){if(t)return cr(t,r)}else if(n)return function(e,t){return!!ur(e,t)}(n,r);return!1},set:function(r,i){tr&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new tr),ir(e,r,i)):nr?(t||(t=new nr),ar(t,r,i)):(n||(n={key:{},next:null}),function(e,t,n){var r=ur(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,r,i))}};return r},wr=vr,Sr=fr,Er=Object.prototype.hasOwnProperty,xr={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},kr=Array.isArray,Cr=Array.prototype.push,Mr=function(e,t){Cr.apply(e,kr(t)?t:[t])},Ir=Date.prototype.toISOString,Rr=Sr.default,Ar={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:wr.encode,encodeValuesOnly:!1,format:Rr,formatter:Sr.formatters[Rr],indices:!1,serializeDate:function(e){return Ir.call(e)},skipNulls:!1,strictNullHandling:!1},jr={},Nr=function e(t,n,r,i,o,s,a,c,u,l,h,d,f,p,b,y){for(var g=t,m=y,v=0,_=!1;void 0!==(m=m.get(jr))&&!_;){var w=m.get(t);if(v+=1,void 0!==w){if(w===v)throw new RangeError("Cyclic object value");_=!0}void 0===m.get(jr)&&(v=0)}if("function"==typeof c?g=c(n,g):g instanceof Date?g=h(g):"comma"===r&&kr(g)&&(g=wr.maybeMap(g,(function(e){return e instanceof Date?h(e):e}))),null===g){if(o)return a&&!p?a(n,Ar.encoder,b,"key",d):n;g=""}if(function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"symbol"==typeof e||"bigint"==typeof e}(g)||wr.isBuffer(g))return a?[f(p?n:a(n,Ar.encoder,b,"key",d))+"="+f(a(g,Ar.encoder,b,"value",d))]:[f(n)+"="+f(String(g))];var S,E=[];if(void 0===g)return E;if("comma"===r&&kr(g))p&&a&&(g=wr.maybeMap(g,a)),S=[{value:g.length>0?g.join(",")||null:void 0}];else if(kr(c))S=c;else{var x=Object.keys(g);S=u?x.sort(u):x}for(var k=i&&kr(g)&&1===g.length?n+"[]":n,C=0;C<S.length;++C){var M=S[C],I="object"==typeof M&&void 0!==M.value?M.value:g[M];if(!s||null!==I){var R=kr(g)?"function"==typeof r?r(k,M):k:k+(l?"."+M:"["+M+"]");y.set(t,v);var A=_r();A.set(jr,y),Mr(E,e(I,R,r,i,o,s,"comma"===r&&p&&kr(g)?null:a,c,u,l,h,d,f,p,b,A))}}return E},Or=vr,Tr=Object.prototype.hasOwnProperty,Pr=Array.isArray,Lr={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Or.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Dr=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},Br=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},Fr=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(i),a=s?i.slice(0,s.index):i,c=[];if(a){if(!n.plainObjects&&Tr.call(Object.prototype,a)&&!n.allowPrototypes)return;c.push(a)}for(var u=0;n.depth>0&&null!==(s=o.exec(i))&&u<n.depth;){if(u+=1,!n.plainObjects&&Tr.call(Object.prototype,s[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(s[1])}return s&&c.push("["+i.slice(s.index)+"]"),function(e,t,n,r){for(var i=r?t:Br(t,n),o=e.length-1;o>=0;--o){var s,a=e[o];if("[]"===a&&n.parseArrays)s=[].concat(i);else{s=n.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(c,10);n.parseArrays||""!==c?!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(s=[])[u]=i:"__proto__"!==c&&(s[c]=i):s={0:i}}i=s}return i}(c,t,n,r)}},Ur=function(e,t){var n,r=e,i=function(e){if(!e)return Ar;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||Ar.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Sr.default;if(void 0!==e.format){if(!Er.call(Sr.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=Sr.formatters[n],i=Ar.filter;return("function"==typeof e.filter||kr(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:Ar.addQueryPrefix,allowDots:void 0===e.allowDots?Ar.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:Ar.charsetSentinel,delimiter:void 0===e.delimiter?Ar.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:Ar.encode,encoder:"function"==typeof e.encoder?e.encoder:Ar.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:Ar.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:Ar.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:Ar.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:Ar.strictNullHandling}}(t);"function"==typeof i.filter?r=(0,i.filter)("",r):kr(i.filter)&&(n=i.filter);var o,s=[];if("object"!=typeof r||null===r)return"";o=t&&t.arrayFormat in xr?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var a=xr[o];if(t&&"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c="comma"===a&&t&&t.commaRoundTrip;n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var u=_r(),l=0;l<n.length;++l){var h=n[l];i.skipNulls&&null===r[h]||Mr(s,Nr(r[h],h,a,c,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,u))}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:""},Vr=function(e,t){var n=function(e){if(!e)return Lr;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?Lr.charset:e.charset;return{allowDots:void 0===e.allowDots?Lr.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:Lr.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:Lr.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:Lr.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:Lr.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:Lr.comma,decoder:"function"==typeof e.decoder?e.decoder:Lr.decoder,delimiter:"string"==typeof e.delimiter||Or.isRegExp(e.delimiter)?e.delimiter:Lr.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:Lr.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:Lr.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:Lr.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:Lr.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:Lr.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var r="string"==typeof e?function(e,t){var n,r={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,s=i.split(t.delimiter,o),a=-1,c=t.charset;if(t.charsetSentinel)for(n=0;n<s.length;++n)0===s[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===s[n]?c="utf-8":"utf8=%26%2310003%3B"===s[n]&&(c="iso-8859-1"),a=n,n=s.length);for(n=0;n<s.length;++n)if(n!==a){var u,l,h=s[n],d=h.indexOf("]="),f=-1===d?h.indexOf("="):d+1;-1===f?(u=t.decoder(h,Lr.decoder,c,"key"),l=t.strictNullHandling?null:""):(u=t.decoder(h.slice(0,f),Lr.decoder,c,"key"),l=Or.maybeMap(Br(h.slice(f+1),t),(function(e){return t.decoder(e,Lr.decoder,c,"value")}))),l&&t.interpretNumericEntities&&"iso-8859-1"===c&&(l=Dr(l)),h.indexOf("[]=")>-1&&(l=Pr(l)?[l]:l),Tr.call(r,u)?r[u]=Or.combine(r[u],l):r[u]=l}return r}(e,n):e,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),s=0;s<o.length;++s){var a=o[s],c=Fr(a,r[a],n,"string"==typeof e);i=Or.merge(i,c,n)}return!0===n.allowSparse?i:Or.compact(i)},Hr={formats:fr,parse:Vr,stringify:Ur},Wr={};!function(e){function t(){return e=>e}var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderType=e.RegExpString=e.IntNumber=e.BigIntString=e.AddressString=e.HexString=e.OpaqueType=void 0,e.OpaqueType=t,e.HexString=e=>e,e.AddressString=e=>e,e.BigIntString=e=>e,e.IntNumber=function(e){return Math.floor(e)},e.RegExpString=e=>e,(n=e.ProviderType||(e.ProviderType={})).CoinbaseWallet="CoinbaseWallet",n.MetaMask="MetaMask",n.Unselected=""}(Wr);var zr=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ct,"__esModule",{value:!0}),ct.isInIFrame=ct.createQrUrl=ct.getFavicon=ct.range=ct.isBigNumber=ct.ensureParsedJSONObject=ct.ensureBN=ct.ensureRegExpString=ct.ensureIntNumber=ct.ensureBuffer=ct.ensureAddressString=ct.ensureEvenLengthHexString=ct.ensureHexString=ct.isHexString=ct.prepend0x=ct.strip0x=ct.has0xPrefix=ct.hexStringFromIntNumber=ct.intNumberFromHexString=ct.bigIntStringFromBN=ct.hexStringFromBuffer=ct.hexStringToUint8Array=ct.uint8ArrayToHex=ct.randomBytesHex=void 0;const qr=zr(e.bn.exports),$r=Hr,Jr=Wr,Gr=/^[0-9]*$/,Zr=/^[a-f0-9]*$/;function Qr(e){return[...e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function Yr(e){return e.startsWith("0x")||e.startsWith("0X")}function Kr(e){return Yr(e)?e.slice(2):e}function Xr(e){return Yr(e)?"0x"+e.slice(2):"0x"+e}function ei(e){if("string"!=typeof e)return!1;const t=Kr(e).toLowerCase();return Zr.test(t)}function ti(e,t=!1){if("string"==typeof e){const n=Kr(e).toLowerCase();if(Zr.test(n))return(0,Jr.HexString)(t?"0x"+n:n)}throw new Error(`"${String(e)}" is not a hexadecimal string`)}function ni(e,t=!1){let n=ti(e,!1);return n.length%2==1&&(n=(0,Jr.HexString)("0"+n)),t?(0,Jr.HexString)("0x"+n):n}function ri(e){if("number"==typeof e&&Number.isInteger(e))return(0,Jr.IntNumber)(e);if("string"==typeof e){if(Gr.test(e))return(0,Jr.IntNumber)(Number(e));if(ei(e))return(0,Jr.IntNumber)(new qr.default(ni(e,!1),16).toNumber())}throw new Error(`Not an integer: ${String(e)}`)}function ii(e){if(null==e||"function"!=typeof e.constructor)return!1;const{constructor:t}=e;return"function"==typeof t.config&&"number"==typeof t.EUCLID}ct.randomBytesHex=function(e){return Qr(crypto.getRandomValues(new Uint8Array(e)))},ct.uint8ArrayToHex=Qr,ct.hexStringToUint8Array=function(e){return new Uint8Array(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))},ct.hexStringFromBuffer=function(e,t=!1){const n=e.toString("hex");return(0,Jr.HexString)(t?"0x"+n:n)},ct.bigIntStringFromBN=function(e){return(0,Jr.BigIntString)(e.toString(10))},ct.intNumberFromHexString=function(e){return(0,Jr.IntNumber)(new qr.default(ni(e,!1),16).toNumber())},ct.hexStringFromIntNumber=function(e){return(0,Jr.HexString)("0x"+new qr.default(e).toString(16))},ct.has0xPrefix=Yr,ct.strip0x=Kr,ct.prepend0x=Xr,ct.isHexString=ei,ct.ensureHexString=ti,ct.ensureEvenLengthHexString=ni,ct.ensureAddressString=function(e){if("string"==typeof e){const t=Kr(e).toLowerCase();if(ei(t)&&40===t.length)return(0,Jr.AddressString)(Xr(t))}throw new Error(`Invalid Ethereum address: ${String(e)}`)},ct.ensureBuffer=function(e){if(Buffer.isBuffer(e))return e;if("string"==typeof e){if(ei(e)){const t=ni(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw new Error(`Not binary data: ${String(e)}`)},ct.ensureIntNumber=ri,ct.ensureRegExpString=function(e){if(e instanceof RegExp)return(0,Jr.RegExpString)(e.toString());throw new Error(`Not a RegExp: ${String(e)}`)},ct.ensureBN=function(e){if(null!==e&&(qr.default.isBN(e)||ii(e)))return new qr.default(e.toString(10),10);if("number"==typeof e)return new qr.default(ri(e));if("string"==typeof e){if(Gr.test(e))return new qr.default(e,10);if(ei(e))return new qr.default(ni(e,!1),16)}throw new Error(`Not an integer: ${String(e)}`)},ct.ensureParsedJSONObject=function(e){if("string"==typeof e)return JSON.parse(e);if("object"==typeof e)return e;throw new Error(`Not a JSON string or an object: ${String(e)}`)},ct.isBigNumber=ii,ct.range=function(e,t){return Array.from({length:t-e},((t,n)=>e+n))},ct.getFavicon=function(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:n}=document.location,r=e?e.getAttribute("href"):null;return!r||r.startsWith("javascript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?t+r:`${t}//${n}${r}`},ct.createQrUrl=function(e,t,n,r,i,o){return`${n}/#/link?${(0,$r.stringify)({[r?"parent-id":"id"]:e,secret:t,server:n,v:i,chainId:o})}`},ct.isInIFrame=function(){try{return null!==window.frameElement}catch(e){return!1}},Object.defineProperty($,"__esModule",{value:!0}),$.Session=void 0;const oi=J.exports,si=ct,ai="session:id",ci="session:secret",ui="session:linked";class li{constructor(e,t,n,r){this._storage=e,this._id=t||(0,si.randomBytesHex)(16),this._secret=n||(0,si.randomBytesHex)(32),this._key=(new oi.sha256).update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!r}static load(e){const t=e.getItem(ai),n=e.getItem(ui),r=e.getItem(ci);return t&&r?new li(e,t,r,"1"===n):null}static hash(e){return(new oi.sha256).update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(ai,this._id),this._storage.setItem(ci,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(ui,this._linked?"1":"0")}}$.Session=li;var hi={};Object.defineProperty(hi,"__esModule",{value:!0}),hi.WalletSDKRelayAbstract=hi.APP_VERSION_KEY=hi.LOCAL_STORAGE_ADDRESSES_KEY=hi.WALLET_USER_NAME_KEY=void 0;const di=m;hi.WALLET_USER_NAME_KEY="walletUsername",hi.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",hi.APP_VERSION_KEY="AppVersion";hi.WalletSDKRelayAbstract=class{async makeEthereumJSONRPCRequest(e,t){if(!t)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(t,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then((e=>e.json())).then((e=>{if(!e)throw di.ethErrors.rpc.parse({});const t=e,{error:n}=t;if(n)throw(0,di.serializeError)(n);return t}))}};var fi,pi,bi={exports:{}},yi=a.default.EventEmitter;function gi(){if(pi)return fi;function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(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(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function o(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}pi=1;var s=c.default.Buffer,a=e.require$$1.inspect,u=a&&a.custom||"inspect";function l(e,t,n){s.prototype.copy.call(e,t,n)}return fi=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,o;return t=e,r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t=s.allocUnsafe(e>>>0),n=this.head,r=0;n;)l(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),0==(e-=o)){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:u,value:function(e,t){return a(this,n(n({},t),{},{depth:0,customInspect:!1}))}}],r&&i(t.prototype,r),o&&i(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}(),fi}function mi(e,t){_i(e,t),vi(e)}function vi(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function _i(e,t){e.emit("error",t)}var wi={destroy:function(e,t){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return r||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(_i,this,e)):process.nextTick(_i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?n._writableState?n._writableState.errorEmitted?process.nextTick(vi,n):(n._writableState.errorEmitted=!0,process.nextTick(mi,n,e)):process.nextTick(mi,n,e):t?(process.nextTick(vi,n),t(e)):process.nextTick(vi,n)})),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(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}},Si={};var Ei={};function xi(e,t,n){n||(n=Error);var r=function(e){var n,r;function i(n,r,i){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,i))||this}return r=e,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,i}(n);r.prototype.name=n.name,r.prototype.code=e,Ei[e]=r}function ki(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}xi("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),xi("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,i,o,s;if("string"==typeof t&&(i="not ",t.substr(!o||o<0?0:+o,i.length)===i)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))s="The ".concat(e," ").concat(r," ").concat(ki(t,"type"));else{var a=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(a," ").concat(r," ").concat(ki(t,"type"))}return s+=". Received type ".concat(typeof n)}),TypeError),xi("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),xi("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),xi("ERR_STREAM_PREMATURE_CLOSE","Premature close"),xi("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),xi("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),xi("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),xi("ERR_STREAM_WRITE_AFTER_END","write after end"),xi("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),xi("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),xi("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Si.codes=Ei;var Ci=Si.codes.ERR_INVALID_OPT_VALUE;var Mi,Ii,Ri,Ai,ji,Ni,Oi={getHighWaterMark:function(e,t,n,r){var i=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,r,n);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new Ci(r?n:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}};function Ti(){if(Ii)return Mi;function t(t){try{if(!e.commonjsGlobal.localStorage)return!1}catch(e){return!1}var n=e.commonjsGlobal.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}return Ii=1,Mi=function(e,n){if(t("noDeprecation"))return e;var r=!1;return function(){if(!r){if(t("throwDeprecation"))throw new Error(n);t("traceDeprecation")?console.trace(n):console.warn(n),r=!0}return e.apply(this,arguments)}},Mi}function Pi(){if(Ai)return Ri;function t(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}var r;Ai=1,Ri=x,x.WritableState=E;var i={deprecate:Ti()},o=yi,s=c.default.Buffer,a=(void 0!==e.commonjsGlobal?e.commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var u,l=wi,h=Oi.getHighWaterMark,d=Si.codes,f=d.ERR_INVALID_ARG_TYPE,p=d.ERR_METHOD_NOT_IMPLEMENTED,b=d.ERR_MULTIPLE_CALLBACK,y=d.ERR_STREAM_CANNOT_PIPE,g=d.ERR_STREAM_DESTROYED,m=d.ERR_STREAM_NULL_VALUES,v=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,w=l.errorOrDestroy;function S(){}function E(e,n,i){r=r||Li(),e=e||{},"boolean"!=typeof i&&(i=n instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new b;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(process.nextTick(i,r),process.nextTick(A,e,t),e._writableState.errorEmitted=!0,w(e,r)):(i(r),e._writableState.errorEmitted=!0,w(e,r),A(e,t))}(e,n,r,t,i);else{var o=I(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||M(e,n),r?process.nextTick(C,e,n,o,i):C(e,n,o,i)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}function x(e){var t=this instanceof(r=r||Li());if(!t&&!u.call(x,this))return new x(e);this._writableState=new E(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function k(e,t,n,r,i,o,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function C(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),A(e,t)}function M(e,n){n.bufferProcessing=!0;var r=n.bufferedRequest;if(e._writev&&r&&r.next){var i=n.bufferedRequestCount,o=new Array(i),s=n.corkedRequestsFree;s.entry=r;for(var a=0,c=!0;r;)o[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;o.allBuffers=c,k(e,n,!0,n.length,o,"",s.finish),n.pendingcb++,n.lastBufferedRequest=null,s.next?(n.corkedRequestsFree=s.next,s.next=null):n.corkedRequestsFree=new t(n),n.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,h=r.callback;if(k(e,n,!1,n.objectMode?1:u.length,u,l,h),r=r.next,n.bufferedRequestCount--,n.writing)break}null===r&&(n.lastBufferedRequest=null)}n.bufferedRequest=r,n.bufferProcessing=!1}function I(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function R(e,t){e._final((function(n){t.pendingcb--,n&&w(e,n),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var n=I(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(R,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}return n.inherits_browser.exports(x,o),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:i.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(e){return!!u.call(this,e)||this===x&&(e&&e._writableState instanceof E)}})):u=function(e){return e instanceof this},x.prototype.pipe=function(){w(this,new y)},x.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,c=!i.objectMode&&(r=e,s.isBuffer(r)||r instanceof a);return c&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"==typeof t&&(n=t,t=null),c?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=S),i.ending?function(e,t){var n=new v;w(e,n),process.nextTick(t,n)}(this,n):(c||function(e,t,n,r){var i;return null===n?i=new m:"string"==typeof n||t.objectMode||(i=new f("chunk",["string","Buffer"],n)),!i||(w(e,i),process.nextTick(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=s.from(t,n));return t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var c=t.objectMode?1:r.length;t.length+=c;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else k(e,t,!1,c,r,i,o);return u}(this,i,c,e,t,n)),o},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||M(this,e))},x.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(e,t,n){n(new p("_write()"))},x.prototype._writev=null,x.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,A(e,t),n&&(t.finished?process.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),x.prototype.destroy=l.destroy,x.prototype._undestroy=l.undestroy,x.prototype._destroy=function(e,t){t(e)},Ri}function Li(){if(Ni)return ji;Ni=1;var e=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};ji=a;var t=Qi(),r=Pi();n.inherits_browser.exports(a,t);for(var i=e(r.prototype),o=0;o<i.length;o++){var s=i[o];a.prototype[s]||(a.prototype[s]=r.prototype[s])}function a(e){if(!(this instanceof a))return new a(e);t.call(this,e),r.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||process.nextTick(u,this)}function u(e){e.end()}return Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),ji}var Di,Bi={};function Fi(){if(Di)return Bi;Di=1;var e=G.exports.Buffer,t=e.isEncoding||function(e){switch((e=""+e)&&e.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 n(n){var r;switch(this.encoding=function(n){var r=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(n);if("string"!=typeof r&&(e.isEncoding===t||!t(n)))throw new Error("Unknown encoding: "+n);return r||n}(n),this.encoding){case"utf16le":this.text=o,this.end=s,r=4;break;case"utf8":this.fillLast=i,r=4;break;case"base64":this.text=a,this.end=c,r=3;break;default:return this.write=u,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(r)}function r(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function i(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function o(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function a(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function l(e){return e&&e.length?this.write(e):""}return Bi.StringDecoder=n,n.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},n.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},n.prototype.text=function(e,t){var n=function(e,t,n){var i=t.length-1;if(i<n)return 0;var o=r(t[i]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--i<n||-2===o)return 0;if(o=r(t[i]),o>=0)return o>0&&(e.lastNeed=o-2),o;if(--i<n||-2===o)return 0;if(o=r(t[i]),o>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},n.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},Bi}var Ui=Si.codes.ERR_STREAM_PREMATURE_CLOSE;function Vi(){}var Hi,Wi,zi,qi,$i,Ji,Gi=function e(t,n,r){if("function"==typeof n)return e(t,null,n);n||(n={}),r=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(r||Vi);var i=n.readable||!1!==n.readable&&t.readable,o=n.writable||!1!==n.writable&&t.writable,s=function(){t.writable||c()},a=t._writableState&&t._writableState.finished,c=function(){o=!1,a=!0,i||r.call(t)},u=t._readableState&&t._readableState.endEmitted,l=function(){i=!1,u=!0,o||r.call(t)},h=function(e){r.call(t,e)},d=function(){var e;return i&&!u?(t._readableState&&t._readableState.ended||(e=new Ui),r.call(t,e)):o&&!a?(t._writableState&&t._writableState.ended||(e=new Ui),r.call(t,e)):void 0},f=function(){t.req.on("finish",c)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?o&&!t._writableState&&(t.on("end",s),t.on("close",s)):(t.on("complete",c),t.on("abort",d),t.req?f():t.on("request",f)),t.on("end",l),t.on("finish",c),!1!==n.error&&t.on("error",h),t.on("close",d),function(){t.removeListener("complete",c),t.removeListener("abort",d),t.removeListener("request",f),t.req&&t.req.removeListener("finish",c),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",c),t.removeListener("end",l),t.removeListener("error",h),t.removeListener("close",d)}};function Zi(){if(Wi)return Hi;var e;function t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Wi=1;var n=Gi,r=Symbol("lastResolve"),i=Symbol("lastReject"),o=Symbol("error"),s=Symbol("ended"),a=Symbol("lastPromise"),c=Symbol("handlePromise"),u=Symbol("stream");function l(e,t){return{value:e,done:t}}function h(e){var t=e[r];if(null!==t){var n=e[u].read();null!==n&&(e[a]=null,e[r]=null,e[i]=null,t(l(n,!1)))}}function d(e){process.nextTick(h,e)}var f=Object.getPrototypeOf((function(){})),p=Object.setPrototypeOf((t(e={get stream(){return this[u]},next:function(){var e=this,t=this[o];if(null!==t)return Promise.reject(t);if(this[s])return Promise.resolve(l(void 0,!0));if(this[u].destroyed)return new Promise((function(t,n){process.nextTick((function(){e[o]?n(e[o]):t(l(void 0,!0))}))}));var n,r=this[a];if(r)n=new Promise(function(e,t){return function(n,r){e.then((function(){t[s]?n(l(void 0,!0)):t[c](n,r)}),r)}}(r,this));else{var i=this[u].read();if(null!==i)return Promise.resolve(l(i,!1));n=new Promise(this[c])}return this[a]=n,n}},Symbol.asyncIterator,(function(){return this})),t(e,"return",(function(){var e=this;return new Promise((function(t,n){e[u].destroy(null,(function(e){e?n(e):t(l(void 0,!0))}))}))})),e),f);return Hi=function(e){var h,f=Object.create(p,(t(h={},u,{value:e,writable:!0}),t(h,r,{value:null,writable:!0}),t(h,i,{value:null,writable:!0}),t(h,o,{value:null,writable:!0}),t(h,s,{value:e._readableState.endEmitted,writable:!0}),t(h,c,{value:function(e,t){var n=f[u].read();n?(f[a]=null,f[r]=null,f[i]=null,e(l(n,!1))):(f[r]=e,f[i]=t)},writable:!0}),h));return f[a]=null,n(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=f[i];return null!==t&&(f[a]=null,f[r]=null,f[i]=null,t(e)),void(f[o]=e)}var n=f[r];null!==n&&(f[a]=null,f[r]=null,f[i]=null,n(l(void 0,!0))),f[s]=!0})),e.on("readable",d.bind(null,f)),f},Hi}function Qi(){if(Ji)return $i;var t;Ji=1,$i=k,k.ReadableState=x,a.default.EventEmitter;var r=function(e,t){return e.listeners(t).length},i=yi,o=c.default.Buffer,s=(void 0!==e.commonjsGlobal?e.commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var u,l=e.require$$1;u=l&&l.debuglog?l.debuglog("stream"):function(){};var h,d,f,p=gi(),b=wi,y=Oi.getHighWaterMark,g=Si.codes,m=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,_=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n.inherits_browser.exports(k,i);var S=b.errorOrDestroy,E=["error","close","destroy","pause","resume"];function x(e,n,r){t=t||Li(),e=e||{},"boolean"!=typeof r&&(r=n instanceof t),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",r),this.buffer=new p,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!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=Fi().StringDecoder),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function k(e){if(t=t||Li(),!(this instanceof k))return new k(e);var n=this instanceof t;this._readableState=new x(e,this,n),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),i.call(this)}function C(e,t,n,r,i){u("readableAddChunk",t);var a,c=e._readableState;if(null===t)c.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?A(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,j(e)))}(e,c);else if(i||(a=function(e,t){var n;r=t,o.isBuffer(r)||r instanceof s||"string"==typeof t||void 0===t||e.objectMode||(n=new m("chunk",["string","Buffer","Uint8Array"],t));var r;return n}(c,t)),a)S(e,a);else if(c.objectMode||t&&t.length>0)if("string"==typeof t||c.objectMode||Object.getPrototypeOf(t)===o.prototype||(t=function(e){return o.from(e)}(t)),r)c.endEmitted?S(e,new w):M(e,c,t,!0);else if(c.ended)S(e,new v);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!n?(t=c.decoder.write(t),c.objectMode||0!==t.length?M(e,c,t,!1):N(e,c)):M(e,c,t,!1)}else r||(c.reading=!1,N(e,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function M(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&A(e)),N(e,t)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=b.destroy,k.prototype._undestroy=b.undestroy,k.prototype._destroy=function(e,t){t(e)},k.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=o.from(e,t),t=""),n=!0),C(this,e,t,!1,n)},k.prototype.unshift=function(e){return C(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){h||(h=Fi().StringDecoder);var t=new h(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var I=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(j,e))}function j(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function N(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(O,e,t))}function O(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(u("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function T(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function P(e){u("readable nexttick read 0"),e.read(0)}function L(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function F(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(U,t,e))}function U(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function V(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}return k.prototype.read=function(e){u("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):A(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&F(this),null;var r,i=t.needReadable;return u("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&u("length less than watermark",i=!0),t.ended||t.reading?u("reading or ended",i=!1):i&&(u("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(n,t))),null===(r=e>0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&F(this)),null!==r&&this.emit("data",r),r},k.prototype._read=function(e){S(this,new _("_read()"))},k.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,u("pipe count=%d opts=%j",i.pipesCount,t);var o=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?a:b;function s(t,r){u("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,u("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",s),n.removeListener("end",a),n.removeListener("end",b),n.removeListener("data",h),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function a(){u("onend"),e.end()}i.endEmitted?process.nextTick(o):n.once("end",o),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&r(e,"data")&&(t.flowing=!0,D(e))}}(n);e.on("drain",c);var l=!1;function h(t){u("ondata");var r=e.write(t);u("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==V(i.pipes,e))&&!l&&(u("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function d(t){u("onerror",t),b(),e.removeListener("error",d),0===r(e,"error")&&S(e,t)}function f(){e.removeListener("finish",p),b()}function p(){u("onfinish"),e.removeListener("close",f),b()}function b(){u("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",d),e.once("close",f),e.once("finish",p),e.emit("pipe",n),i.flowing||(u("pipe resume"),n.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=V(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},k.prototype.on=function(e,t){var n=i.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,u("on readable",r.length,r.reading),r.length?A(this):r.reading||process.nextTick(P,this))),n},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var n=i.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(T,this),n},k.prototype.removeAllListeners=function(e){var t=i.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(T,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(L,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(u("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(u("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<E.length;o++)e.on(E[o],this.emit.bind(this,E[o]));return this._read=function(t){u("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=Zi()),d(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(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=B,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(e,t){return void 0===f&&(f=qi?zi:(qi=1,zi=function(){throw new Error("Readable.from is not available in the browser")})),f(k,e,t)}),$i}var Yi=oo,Ki=Si.codes,Xi=Ki.ERR_METHOD_NOT_IMPLEMENTED,eo=Ki.ERR_MULTIPLE_CALLBACK,to=Ki.ERR_TRANSFORM_ALREADY_TRANSFORMING,no=Ki.ERR_TRANSFORM_WITH_LENGTH_0,ro=Li();function io(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new eo);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function oo(e){if(!(this instanceof oo))return new oo(e);ro.call(this,e),this._transformState={afterTransform:io.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",so)}function so(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?ao(this,null,null):this._flush((function(t,n){ao(e,t,n)}))}function ao(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new no;if(e._transformState.transforming)throw new to;return e.push(null)}n.inherits_browser.exports(oo,ro),oo.prototype.push=function(e,t){return this._transformState.needTransform=!1,ro.prototype.push.call(this,e,t)},oo.prototype._transform=function(e,t,n){n(new Xi("_transform()"))},oo.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},oo.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},oo.prototype._destroy=function(e,t){ro.prototype._destroy.call(this,e,(function(e){t(e)}))};var co,uo=ho,lo=Yi;function ho(e){if(!(this instanceof ho))return new ho(e);lo.call(this,e)}n.inherits_browser.exports(ho,lo),ho.prototype._transform=function(e,t,n){n(null,e)};var fo=Si.codes,po=fo.ERR_MISSING_ARGS,bo=fo.ERR_STREAM_DESTROYED;function yo(e){if(e)throw e}function go(e){e()}function mo(e,t){return e.pipe(t)}var vo=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=function(e){return e.length?"function"!=typeof e[e.length-1]?yo:e.pop():yo}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new po("streams");var o=t.map((function(e,n){var s=n<t.length-1;return function(e,t,n,r){r=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(r);var i=!1;e.on("close",(function(){i=!0})),void 0===co&&(co=Gi),co(e,{readable:t,writable:n},(function(e){if(e)return r(e);i=!0,r()}));var o=!1;return function(t){if(!i&&!o)return o=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void r(t||new bo("pipe"))}}(e,s,n>0,(function(e){r||(r=e),e&&o.forEach(go),s||(o.forEach(go),i(r))}))}));return t.reduce(mo)};!function(e,t){(t=bi.exports=Qi()).Stream=t,t.Readable=t,t.Writable=Pi(),t.Duplex=Li(),t.Transform=Yi,t.PassThrough=uo,t.finished=Gi,t.pipeline=vo}(0,bi.exports);const{Transform:_o}=bi.exports;const{Transform:wo}=bi.exports;const So=e=>class t extends _o{constructor(t,n,r,i,o){super(o),this._rate=t,this._capacity=n,this._delimitedSuffix=r,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(t,n),this._finalized=!1}_transform(e,t,n){let r=null;try{this.update(e,t)}catch(e){r=e}n(r)}_flush(e){let t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}update(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(e)||(e=Buffer.from(e,t)),this._state.absorb(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}},Eo=e=>class t extends wo{constructor(t,n,r,i){super(i),this._rate=t,this._capacity=n,this._delimitedSuffix=r,this._options=i,this._state=new e,this._state.initialize(t,n),this._finalized=!1}_transform(e,t,n){let r=null;try{this.update(e,t)}catch(e){r=e}n(r)}_flush(){}_read(e){this.push(this.squeeze(e))}update(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(e)||(e=Buffer.from(e,t)),this._state.absorb(e),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let n=this._state.squeeze(e);return void 0!==t&&(n=n.toString(t)),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}};var xo={};const ko=[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];xo.p1600=function(e){for(let t=0;t<24;++t){const n=e[0]^e[10]^e[20]^e[30]^e[40],r=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],s=e[4]^e[14]^e[24]^e[34]^e[44],a=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],l=e[8]^e[18]^e[28]^e[38]^e[48],h=e[9]^e[19]^e[29]^e[39]^e[49];let d=l^(i<<1|o>>>31),f=h^(o<<1|i>>>31);const p=e[0]^d,b=e[1]^f,y=e[10]^d,g=e[11]^f,m=e[20]^d,v=e[21]^f,_=e[30]^d,w=e[31]^f,S=e[40]^d,E=e[41]^f;d=n^(s<<1|a>>>31),f=r^(a<<1|s>>>31);const x=e[2]^d,k=e[3]^f,C=e[12]^d,M=e[13]^f,I=e[22]^d,R=e[23]^f,A=e[32]^d,j=e[33]^f,N=e[42]^d,O=e[43]^f;d=i^(c<<1|u>>>31),f=o^(u<<1|c>>>31);const T=e[4]^d,P=e[5]^f,L=e[14]^d,D=e[15]^f,B=e[24]^d,F=e[25]^f,U=e[34]^d,V=e[35]^f,H=e[44]^d,W=e[45]^f;d=s^(l<<1|h>>>31),f=a^(h<<1|l>>>31);const z=e[6]^d,q=e[7]^f,$=e[16]^d,J=e[17]^f,G=e[26]^d,Z=e[27]^f,Q=e[36]^d,Y=e[37]^f,K=e[46]^d,X=e[47]^f;d=c^(n<<1|r>>>31),f=u^(r<<1|n>>>31);const ee=e[8]^d,te=e[9]^f,ne=e[18]^d,re=e[19]^f,ie=e[28]^d,oe=e[29]^f,se=e[38]^d,ae=e[39]^f,ce=e[48]^d,ue=e[49]^f,le=p,he=b,de=g<<4|y>>>28,fe=y<<4|g>>>28,pe=m<<3|v>>>29,be=v<<3|m>>>29,ye=w<<9|_>>>23,ge=_<<9|w>>>23,me=S<<18|E>>>14,ve=E<<18|S>>>14,_e=x<<1|k>>>31,we=k<<1|x>>>31,Se=M<<12|C>>>20,Ee=C<<12|M>>>20,xe=I<<10|R>>>22,ke=R<<10|I>>>22,Ce=j<<13|A>>>19,Me=A<<13|j>>>19,Ie=N<<2|O>>>30,Re=O<<2|N>>>30,Ae=P<<30|T>>>2,je=T<<30|P>>>2,Ne=L<<6|D>>>26,Oe=D<<6|L>>>26,Te=F<<11|B>>>21,Pe=B<<11|F>>>21,Le=U<<15|V>>>17,De=V<<15|U>>>17,Be=W<<29|H>>>3,Fe=H<<29|W>>>3,Ue=z<<28|q>>>4,Ve=q<<28|z>>>4,He=J<<23|$>>>9,We=$<<23|J>>>9,ze=G<<25|Z>>>7,qe=Z<<25|G>>>7,$e=Q<<21|Y>>>11,Je=Y<<21|Q>>>11,Ge=X<<24|K>>>8,Ze=K<<24|X>>>8,Qe=ee<<27|te>>>5,Ye=te<<27|ee>>>5,Ke=ne<<20|re>>>12,Xe=re<<20|ne>>>12,et=oe<<7|ie>>>25,tt=ie<<7|oe>>>25,nt=se<<8|ae>>>24,rt=ae<<8|se>>>24,it=ce<<14|ue>>>18,ot=ue<<14|ce>>>18;e[0]=le^~Se&Te,e[1]=he^~Ee&Pe,e[10]=Ue^~Ke&pe,e[11]=Ve^~Xe&be,e[20]=_e^~Ne&ze,e[21]=we^~Oe&qe,e[30]=Qe^~de&xe,e[31]=Ye^~fe&ke,e[40]=Ae^~He&et,e[41]=je^~We&tt,e[2]=Se^~Te&$e,e[3]=Ee^~Pe&Je,e[12]=Ke^~pe&Ce,e[13]=Xe^~be&Me,e[22]=Ne^~ze&nt,e[23]=Oe^~qe&rt,e[32]=de^~xe&Le,e[33]=fe^~ke&De,e[42]=He^~et&ye,e[43]=We^~tt&ge,e[4]=Te^~$e&it,e[5]=Pe^~Je&ot,e[14]=pe^~Ce&Be,e[15]=be^~Me&Fe,e[24]=ze^~nt&me,e[25]=qe^~rt&ve,e[34]=xe^~Le&Ge,e[35]=ke^~De&Ze,e[44]=et^~ye&Ie,e[45]=tt^~ge&Re,e[6]=$e^~it&le,e[7]=Je^~ot&he,e[16]=Ce^~Be&Ue,e[17]=Me^~Fe&Ve,e[26]=nt^~me&_e,e[27]=rt^~ve&we,e[36]=Le^~Ge&Qe,e[37]=De^~Ze&Ye,e[46]=ye^~Ie&Ae,e[47]=ge^~Re&je,e[8]=it^~le&Se,e[9]=ot^~he&Ee,e[18]=Be^~Ue&Ke,e[19]=Fe^~Ve&Xe,e[28]=me^~_e&Ne,e[29]=ve^~we&Oe,e[38]=Ge^~Qe&de,e[39]=Ze^~Ye&fe,e[48]=Ie^~Ae&He,e[49]=Re^~je&We,e[0]^=ko[2*t],e[1]^=ko[2*t+1]}};const Co=xo;function Mo(){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}Mo.prototype.initialize=function(e,t){for(let e=0;e<50;++e)this.state[e]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},Mo.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(Co.p1600(this.state),this.count=0)},Mo.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<this.count%4*8,0!=(128&e)&&this.count===this.blockSize-1&&Co.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,Co.p1600(this.state),this.count=0,this.squeezing=!0},Mo.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let n=0;n<e;++n)t[n]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(Co.p1600(this.state),this.count=0);return t},Mo.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Io=function(e){const t=So(e),n=Eo(e);return function(e,r){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,r);case"keccak256":return new t(1088,512,null,256,r);case"keccak384":return new t(832,768,null,384,r);case"keccak512":return new t(576,1024,null,512,r);case"sha3-224":return new t(1152,448,6,224,r);case"sha3-256":return new t(1088,512,6,256,r);case"sha3-384":return new t(832,768,6,384,r);case"sha3-512":return new t(576,1024,6,512,r);case"shake128":return new n(1344,256,31,r);case"shake256":return new n(1088,512,31,r);default:throw new Error("Invald algorithm: "+e)}}}(Mo);const Ro=Io,Ao=e.bn.exports;function jo(e){return Buffer.allocUnsafe(e).fill(0)}function No(e,t,n){const r=jo(t);return e=Oo(e),n?e.length<t?(e.copy(r),r):e.slice(0,t):e.length<t?(e.copy(r,t-e.length),r):e.slice(-t)}function Oo(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if("string"==typeof e)e=To(e)?Buffer.from((t=Po(e)).length%2?"0"+t:t,"hex"):Buffer.from(e);else if("number"==typeof e)e=intToBuffer(e);else if(null==e)e=Buffer.allocUnsafe(0);else if(Ao.isBN(e))e=e.toArrayLike(Buffer);else{if(!e.toArray)throw new Error("invalid type");e=Buffer.from(e.toArray())}var t;return e}function To(e){return"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]*$/)}function Po(e){return"string"==typeof e&&e.startsWith("0x")?e.slice(2):e}var Lo={zeros:jo,setLength:No,setLengthRight:function(e,t){return No(e,t,!0)},isHexString:To,stripHexPrefix:Po,toBuffer:Oo,bufferToHex:function(e){return"0x"+(e=Oo(e)).toString("hex")},keccak:function(e,t){return e=Oo(e),t||(t=256),Ro("keccak"+t).update(e).digest()}};const Do=Lo,Bo=e.bn.exports;function Fo(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e}function Uo(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function Vo(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Ho(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":parseInt(t[2],10):null}function Wo(e){var t=typeof e;if("string"===t)return Do.isHexString(e)?new Bo(Do.stripHexPrefix(e),16):new Bo(e,10);if("number"===t)return new Bo(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function zo(e,t){var n,r,i,o;if("address"===e)return zo("uint160",Wo(t));if("bool"===e)return zo("uint8",t?1:0);if("string"===e)return zo("bytes",new Buffer(t,"utf8"));if(function(e){return e.lastIndexOf("]")===e.length-1}(e)){if(void 0===t.length)throw new Error("Not an array?");if("dynamic"!==(n=Ho(e))&&0!==n&&t.length>n)throw new Error("Elements exceed array size: "+n);for(o in i=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)i.push(zo(e,t[o]));if("dynamic"===n){var s=zo("uint256",t.length);i.unshift(s)}return Buffer.concat(i)}if("bytes"===e)return t=new Buffer(t),i=Buffer.concat([zo("uint256",t.length),t]),t.length%32!=0&&(i=Buffer.concat([i,Do.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if((n=Uo(e))<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return Do.setLengthRight(t,32)}if(e.startsWith("uint")){if((n=Uo(e))%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if((r=Wo(t)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());if(r<0)throw new Error("Supplied uint is negative");return r.toArrayLike(Buffer,"be",32)}if(e.startsWith("int")){if((n=Uo(e))%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if((r=Wo(t)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());return r.toTwos(256).toArrayLike(Buffer,"be",32)}if(e.startsWith("ufixed")){if(n=Vo(e),(r=Wo(t))<0)throw new Error("Supplied ufixed is negative");return zo("uint256",r.mul(new Bo(2).pow(new Bo(n[1]))))}if(e.startsWith("fixed"))return n=Vo(e),zo("int256",Wo(t).mul(new Bo(2).pow(new Bo(n[1]))));throw new Error("Unsupported or invalid type: "+e)}function qo(e){return"string"===e||"bytes"===e||"dynamic"===Ho(e)}function $o(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var n,r,i=[],o=0;o<e.length;o++){var s=Fo(e[o]),a=t[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(Do.setLength(a,20));else if(s.startsWith("bytes")){if((n=Uo(s))<1||n>32)throw new Error("Invalid bytes<N> width: "+n);i.push(Do.setLengthRight(a,n))}else if(s.startsWith("uint")){if((n=Uo(s))%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if((r=Wo(a)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());i.push(r.toArrayLike(Buffer,"be",n/8))}else{if(!s.startsWith("int"))throw new Error("Unsupported or invalid type: "+s);if((n=Uo(s))%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if((r=Wo(a)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());i.push(r.toTwos(n).toArrayLike(Buffer,"be",n/8))}}return Buffer.concat(i)}var Jo={rawEncode:function(e,t){var n=[],r=[],i=32*e.length;for(var o in e){var s=Fo(e[o]),a=zo(s,t[o]);qo(s)?(n.push(zo("uint256",i)),r.push(a),i+=a.length):n.push(a)}return Buffer.concat(n.concat(r))},solidityPack:$o,soliditySHA3:function(e,t){return Do.keccak($o(e,t))}};const Go=Lo,Zo=Jo,Qo={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"]},Yo={encodeData(e,t,n,r=!0){const i=["bytes32"],o=[this.hashType(e,n)];if(r){const s=(e,t,i)=>{if(void 0!==n[t])return["bytes32",null==i?"0x0000000000000000000000000000000000000000000000000000000000000000":Go.keccak(this.encodeData(t,i,n,r))];if(void 0===i)throw new Error(`missing value for field ${e} of type ${t}`);if("bytes"===t)return["bytes32",Go.keccak(i)];if("string"===t)return"string"==typeof i&&(i=Buffer.from(i,"utf8")),["bytes32",Go.keccak(i)];if(t.lastIndexOf("]")===t.length-1){const n=t.slice(0,t.lastIndexOf("[")),r=i.map((t=>s(e,n,t)));return["bytes32",Go.keccak(Zo.rawEncode(r.map((([e])=>e)),r.map((([,e])=>e))))]}return[t,i]};for(const r of n[e]){const[e,n]=s(r.name,r.type,t[r.name]);i.push(e),o.push(n)}}else for(const s of n[e]){let e=t[s.name];if(void 0!==e)if("bytes"===s.type)i.push("bytes32"),e=Go.keccak(e),o.push(e);else if("string"===s.type)i.push("bytes32"),"string"==typeof e&&(e=Buffer.from(e,"utf8")),e=Go.keccak(e),o.push(e);else if(void 0!==n[s.type])i.push("bytes32"),e=Go.keccak(this.encodeData(s.type,e,n,r)),o.push(e);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(s.type),o.push(e)}}return Zo.rawEncode(i,o)},encodeType(e,t){let n="",r=this.findTypeDependencies(e,t).filter((t=>t!==e));r=[e].concat(r.sort());for(const e of r){if(!t[e])throw new Error("No type definition specified: "+e);n+=e+"("+t[e].map((({name:e,type:t})=>t+" "+e)).join(",")+")"}return n},findTypeDependencies(e,t,n=[]){if(e=e.match(/^\w*/)[0],n.includes(e)||void 0===t[e])return n;n.push(e);for(const r of t[e])for(const e of this.findTypeDependencies(r.type,t,n))!n.includes(e)&&n.push(e);return n},hashStruct(e,t,n,r=!0){return Go.keccak(this.encodeData(e,t,n,r))},hashType(e,t){return Go.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const n in Qo.properties)e[n]&&(t[n]=e[n]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const n=this.sanitizeData(e),r=[Buffer.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,t)),"EIP712Domain"!==n.primaryType&&r.push(this.hashStruct(n.primaryType,n.message,n.types,t)),Go.keccak(Buffer.concat(r))}};var Ko={TYPED_MESSAGE_SCHEMA:Qo,TypedDataUtils:Yo,hashForSignTypedDataLegacy:function(e){return function(e){const t=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!e.length)throw t;const n=e.map((function(e){return"bytes"===e.type?Go.toBuffer(e.value):e.value})),r=e.map((function(e){return e.type})),i=e.map((function(e){if(!e.name)throw t;return e.type+" "+e.name}));return Zo.soliditySHA3(["bytes32","bytes32"],[Zo.soliditySHA3(new Array(e.length).fill("string"),i),Zo.soliditySHA3(r,n)])}(e.data)},hashForSignTypedData_v3:function(e){return Yo.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return Yo.hash(e.data)}};var Xo={};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.filterFromParam=Xo.FilterPolyfill=void 0;const es=Wr,ts=ct,ns={jsonrpc:"2.0",id:0};function rs(e){return{fromBlock:os(e.fromBlock),toBlock:os(e.toBlock),addresses:void 0===e.address?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}function is(e){const t={fromBlock:ss(e.fromBlock),toBlock:ss(e.toBlock),topics:e.topics};return null!==e.addresses&&(t.address=e.addresses),t}function os(e){if(void 0===e||"latest"===e||"pending"===e)return"latest";if("earliest"===e)return(0,es.IntNumber)(0);if((0,ts.isHexString)(e))return(0,ts.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function ss(e){return"latest"===e?e:(0,ts.hexStringFromIntNumber)(e)}function as(){return Object.assign(Object.assign({},ns),{error:{code:-32e3,message:"filter not found"}})}function cs(){return Object.assign(Object.assign({},ns),{result:[]})}Xo.FilterPolyfill=class{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,es.IntNumber)(1),this.provider=e}async newFilter(e){const t=rs(e),n=this.makeFilterId(),r=await this.setInitialCursorPosition(n,t.fromBlock);return console.log(`Installing new log filter(${n}):`,t,"initial cursor position:",r),this.logFilters.set(n,t),this.setFilterTimeout(n),(0,ts.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),t=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,t),this.blockFilters.add(e),this.setFilterTimeout(e),(0,ts.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),t=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,t),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,ts.hexStringFromIntNumber)(e)}uninstallFilter(e){const t=(0,ts.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${t})`),this.deleteFilter(t),!0}getFilterChanges(e){const t=(0,ts.intNumberFromHexString)(e);return this.timeouts.has(t)&&this.setFilterTimeout(t),this.logFilters.has(t)?this.getLogFilterChanges(t):this.blockFilters.has(t)?this.getBlockFilterChanges(t):this.pendingTransactionFilters.has(t)?this.getPendingTransactionFilterChanges(t):Promise.resolve(as())}async getFilterLogs(e){const t=(0,ts.intNumberFromHexString)(e),n=this.logFilters.get(t);return n?this.sendAsyncPromise(Object.assign(Object.assign({},ns),{method:"eth_getLogs",params:[is(n)]})):as()}makeFilterId(){return(0,es.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise(((t,n)=>{this.provider.sendAsync(e,((e,r)=>e?n(e):Array.isArray(r)||null==r?n(new Error(`unexpected response received: ${JSON.stringify(r)}`)):void t(r)))}))}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const t=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!t)return as();const r=await this.getCurrentBlockHeight(),i="latest"===t.toBlock?r:t.toBlock;if(n>r)return cs();if(n>t.toBlock)return cs();console.log(`Fetching logs from ${n} to ${i} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},ns),{method:"eth_getLogs",params:[is(Object.assign(Object.assign({},t),{fromBlock:n,toBlock:i}))]}));if(Array.isArray(o.result)){const t=o.result.map((e=>(0,ts.intNumberFromHexString)(e.blockNumber||"0x0"))),r=Math.max(...t);if(r&&r>n){const t=(0,es.IntNumber)(r+1);console.log(`Moving cursor position for filter (${e}) from ${n} to ${t}`),this.cursors.set(e,t)}}return o}async getBlockFilterChanges(e){const t=this.cursors.get(e);if(!t)return as();const n=await this.getCurrentBlockHeight();if(t>n)return cs();console.log(`Fetching blocks from ${t} to ${n} for filter (${e})`);const r=(await Promise.all((0,ts.range)(t,n+1).map((e=>this.getBlockHashByNumber((0,es.IntNumber)(e)))))).filter((e=>!!e)),i=(0,es.IntNumber)(t+r.length);return console.log(`Moving cursor position for filter (${e}) from ${t} to ${i}`),this.cursors.set(e,i),Object.assign(Object.assign({},ns),{result:r})}async getPendingTransactionFilterChanges(e){return Promise.resolve(cs())}async setInitialCursorPosition(e,t){const n=await this.getCurrentBlockHeight(),r="number"==typeof t&&t>n?t:n;return this.cursors.set(e,r),r}setFilterTimeout(e){const t=this.timeouts.get(e);t&&window.clearTimeout(t);const n=window.setTimeout((()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)}),3e5);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},ns),{method:"eth_blockNumber",params:[]}));return(0,ts.intNumberFromHexString)((0,ts.ensureHexString)(e))}async getBlockHashByNumber(e){const t=await this.sendAsyncPromise(Object.assign(Object.assign({},ns),{method:"eth_getBlockByNumber",params:[(0,ts.hexStringFromIntNumber)(e),!1]}));return t.result&&"string"==typeof t.result.hash?(0,ts.ensureHexString)(t.result.hash):null}},Xo.filterFromParam=rs;var us={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.JSONRPCMethod=void 0,(t=e.JSONRPCMethod||(e.JSONRPCMethod={})).eth_accounts="eth_accounts",t.eth_coinbase="eth_coinbase",t.net_version="net_version",t.eth_chainId="eth_chainId",t.eth_uninstallFilter="eth_uninstallFilter",t.eth_requestAccounts="eth_requestAccounts",t.eth_sign="eth_sign",t.eth_ecRecover="eth_ecRecover",t.personal_sign="personal_sign",t.personal_ecRecover="personal_ecRecover",t.eth_signTransaction="eth_signTransaction",t.eth_sendRawTransaction="eth_sendRawTransaction",t.eth_sendTransaction="eth_sendTransaction",t.eth_signTypedData_v1="eth_signTypedData_v1",t.eth_signTypedData_v2="eth_signTypedData_v2",t.eth_signTypedData_v3="eth_signTypedData_v3",t.eth_signTypedData_v4="eth_signTypedData_v4",t.eth_signTypedData="eth_signTypedData",t.cbWallet_arbitrary="walletlink_arbitrary",t.wallet_addEthereumChain="wallet_addEthereumChain",t.wallet_switchEthereumChain="wallet_switchEthereumChain",t.wallet_watchAsset="wallet_watchAsset",t.eth_subscribe="eth_subscribe",t.eth_unsubscribe="eth_unsubscribe",t.eth_newFilter="eth_newFilter",t.eth_newBlockFilter="eth_newBlockFilter",t.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",t.eth_getFilterChanges="eth_getFilterChanges",t.eth_getFilterLogs="eth_getFilterLogs"}(us);var ls={},hs={},ds={},fs=function(e){var t=(e=e||{}).max||Number.MAX_SAFE_INTEGER,n=void 0!==e.start?e.start:Math.floor(Math.random()*t);return function(){return n%=t,n++}};const ps=(e,t)=>function(){const n=t.promiseModule,r=new Array(arguments.length);for(let e=0;e<arguments.length;e++)r[e]=arguments[e];return new n(((n,i)=>{t.errorFirst?r.push((function(e,r){if(t.multiArgs){const t=new Array(arguments.length-1);for(let e=1;e<arguments.length;e++)t[e-1]=arguments[e];e?(t.unshift(e),i(t)):n(t)}else e?i(e):n(r)})):r.push((function(e){if(t.multiArgs){const e=new Array(arguments.length-1);for(let t=0;t<arguments.length;t++)e[t]=arguments[t];n(e)}else n(e)})),e.apply(this,r)}))};var bs={},ys=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bs,"__esModule",{value:!0}),bs.BaseBlockTracker=void 0;const gs=ys(p),ms=(e,t)=>e+t,vs=["sync","latest"];class _s extends gs.default{constructor(e){super(),this._blockResetDuration=e.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((e=>this.once("latest",e)))}removeAllListeners(e){return e?super.removeAllListeners(e):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(e){vs.includes(e)&&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 vs.map((e=>this.listenerCount(e))).reduce(ms)}_newPotentialLatest(e){const t=this._currentBlock;t&&ws(e)<=ws(t)||this._setCurrentBlock(e)}_setCurrentBlock(e){const t=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}_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 ws(e){return Number.parseInt(e,16)}bs.BaseBlockTracker=_s;var Ss={},Es={},xs={};class ks extends TypeError{constructor(e,t){let n;const{message:r,explanation:i,...o}=e,{path:s}=e,a=0===s.length?r:`At path: ${s.join(".")} -- ${r}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...t()])}}function Cs(e){return"object"==typeof e&&null!=e}function Ms(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function Is(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function Rs(e,t,n,r){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:s}=n,{refinement:a,message:c=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${Is(r)}\``}=e;return{value:r,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...e,message:c}}function*As(e,t,n,r){(function(e){return Cs(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const i of e){const e=Rs(i,t,n,r);e&&(yield e)}}function*js(e,t,n={}){const{path:r=[],branch:i=[e],coerce:o=!1,mask:s=!1}=n,a={path:r,branch:i};if(o&&(e=t.coercer(e,a),s&&"type"!==t.type&&Cs(t.schema)&&Cs(e)&&!Array.isArray(e)))for(const n in e)void 0===t.schema[n]&&delete e[n];let c="valid";for(const r of t.validator(e,a))r.explanation=n.message,c="not_valid",yield[r,void 0];for(let[u,l,h]of t.entries(e,a)){const t=js(l,h,{path:void 0===u?r:[...r,u],branch:void 0===u?i:[...i,l],coerce:o,mask:s,message:n.message});for(const n of t)n[0]?(c=null!=n[0].refinement?"not_refined":"not_valid",yield[n[0],void 0]):o&&(l=n[1],void 0===u?e=l:e instanceof Map?e.set(u,l):e instanceof Set?e.add(l):Cs(e)&&(void 0!==l||u in e)&&(e[u]=l))}if("not_valid"!==c)for(const r of t.refiner(e,a))r.explanation=n.message,c="not_refined",yield[r,void 0];"valid"===c&&(yield[void 0,e])}class Ns{constructor(e){const{type:t,schema:n,validator:r,refiner:i,coercer:o=(e=>e),entries:s=function*(){}}=e;this.type=t,this.schema=n,this.entries=s,this.coercer=o,this.validator=r?(e,t)=>As(r(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>As(i(e,t),t,this,e):()=>[]}assert(e,t){return Os(e,this,t)}create(e,t){return Ts(e,this,t)}is(e){return Ls(e,this)}mask(e,t){return Ps(e,this,t)}validate(e,t={}){return Ds(e,this,t)}}function Os(e,t,n){const r=Ds(e,t,{message:n});if(r[0])throw r[0]}function Ts(e,t,n){const r=Ds(e,t,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function Ps(e,t,n){const r=Ds(e,t,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function Ls(e,t){return!Ds(e,t)[0]}function Ds(e,t,n={}){const r=js(e,t,n),i=function(e){const{done:t,value:n}=e.next();return t?void 0:n}(r);if(i[0]){const e=new ks(i[0],(function*(){for(const e of r)e[0]&&(yield e[0])}));return[e,void 0]}return[void 0,i[1]]}function Bs(e,t){return new Ns({type:e,schema:null,validator:t})}function Fs(){return Bs("never",(()=>!1))}function Us(e){const t=e?Object.keys(e):[],n=Fs();return new Ns({type:"object",schema:e||null,*entries(r){if(e&&Cs(r)){const i=new Set(Object.keys(r));for(const n of t)i.delete(n),yield[n,r[n],e[n]];for(const e of i)yield[e,r[e],n]}},validator:e=>Cs(e)||`Expected an object, but received: ${Is(e)}`,coercer:e=>Cs(e)?{...e}:e})}function Vs(e){return new Ns({...e,validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)})}function Hs(){return Bs("string",(e=>"string"==typeof e||`Expected a string, but received: ${Is(e)}`))}function Ws(e){const t=Object.keys(e);return new Ns({type:"type",schema:e,*entries(n){if(Cs(n))for(const r of t)yield[r,n[r],e[r]]},validator:e=>Cs(e)||`Expected an object, but received: ${Is(e)}`,coercer:e=>Cs(e)?{...e}:e})}function zs(){return Bs("unknown",(()=>!0))}function qs(e,t,n){return new Ns({...e,coercer:(r,i)=>Ls(r,t)?e.coercer(n(r,i),i):e.coercer(r,i)})}function $s(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Js(e,t,n){return new Ns({...e,*refiner(r,i){yield*e.refiner(r,i);const o=As(n(r,i),i,e,r);for(const e of o)yield{...e,refinement:t}}})}var Gs=Object.freeze({__proto__:null,Struct:Ns,StructError:ks,any:function(){return Bs("any",(()=>!0))},array:function(e){return new Ns({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${Is(e)}`})},assert:Os,assign:function(...e){const t="type"===e[0].type,n=e.map((e=>e.schema)),r=Object.assign({},...n);return t?Ws(r):Us(r)},bigint:function(){return Bs("bigint",(e=>"bigint"==typeof e))},boolean:function(){return Bs("boolean",(e=>"boolean"==typeof e))},coerce:qs,create:Ts,date:function(){return Bs("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Is(e)}`))},defaulted:function(e,t,n={}){return qs(e,zs(),(e=>{const r="function"==typeof t?t():t;if(void 0===e)return r;if(!n.strict&&Ms(e)&&Ms(r)){const t={...e};let n=!1;for(const e in r)void 0===t[e]&&(t[e]=r[e],n=!0);if(n)return t}return e}))},define:Bs,deprecated:function(e,t){return new Ns({...e,refiner:(t,n)=>void 0===t||e.refiner(t,n),validator:(n,r)=>void 0===n||(t(n,r),e.validator(n,r))})},dynamic:function(e){return new Ns({type:"dynamic",schema:null,*entries(t,n){const r=e(t,n);yield*r.entries(t,n)},validator:(t,n)=>e(t,n).validator(t,n),coercer:(t,n)=>e(t,n).coercer(t,n),refiner:(t,n)=>e(t,n).refiner(t,n)})},empty:function(e){return Js(e,"empty",(t=>{const n=$s(t);return 0===n||`Expected an empty ${e.type} but received one with a size of \`${n}\``}))},enums:function(e){const t={},n=e.map((e=>Is(e))).join();for(const n of e)t[n]=n;return new Ns({type:"enums",schema:t,validator:t=>e.includes(t)||`Expected one of \`${n}\`, but received: ${Is(t)}`})},func:function(){return Bs("func",(e=>"function"==typeof e||`Expected a function, but received: ${Is(e)}`))},instance:function(e){return Bs("instance",(t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Is(t)}`))},integer:function(){return Bs("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Is(e)}`))},intersection:function(e){return new Ns({type:"intersection",schema:null,*entries(t,n){for(const r of e)yield*r.entries(t,n)},*validator(t,n){for(const r of e)yield*r.validator(t,n)},*refiner(t,n){for(const r of e)yield*r.refiner(t,n)}})},is:Ls,lazy:function(e){let t;return new Ns({type:"lazy",schema:null,*entries(n,r){t??(t=e()),yield*t.entries(n,r)},validator:(n,r)=>(t??(t=e()),t.validator(n,r)),coercer:(n,r)=>(t??(t=e()),t.coercer(n,r)),refiner:(n,r)=>(t??(t=e()),t.refiner(n,r))})},literal:function(e){const t=Is(e),n=typeof e;return new Ns({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?e:null,validator:n=>n===e||`Expected the literal \`${t}\`, but received: ${Is(n)}`})},map:function(e,t){return new Ns({type:"map",schema:null,*entries(n){if(e&&t&&n instanceof Map)for(const[r,i]of n.entries())yield[r,r,e],yield[r,i,t]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${Is(e)}`})},mask:Ps,max:function(e,t,n={}){const{exclusive:r}=n;return Js(e,"max",(n=>r?n<t:n<=t||`Expected a ${e.type} less than ${r?"":"or equal to "}${t} but received \`${n}\``))},min:function(e,t,n={}){const{exclusive:r}=n;return Js(e,"min",(n=>r?n>t:n>=t||`Expected a ${e.type} greater than ${r?"":"or equal to "}${t} but received \`${n}\``))},never:Fs,nonempty:function(e){return Js(e,"nonempty",(t=>$s(t)>0||`Expected a nonempty ${e.type} but received an empty one`))},nullable:function(e){return new Ns({...e,validator:(t,n)=>null===t||e.validator(t,n),refiner:(t,n)=>null===t||e.refiner(t,n)})},number:function(){return Bs("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${Is(e)}`))},object:Us,omit:function(e,t){const{schema:n}=e,r={...n};for(const e of t)delete r[e];return"type"===e.type?Ws(r):Us(r)},optional:Vs,partial:function(e){const t=e instanceof Ns?{...e.schema}:{...e};for(const e in t)t[e]=Vs(t[e]);return Us(t)},pattern:function(e,t){return Js(e,"pattern",(n=>t.test(n)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${n}"`))},pick:function(e,t){const{schema:n}=e,r={};for(const e of t)r[e]=n[e];return Us(r)},record:function(e,t){return new Ns({type:"record",schema:null,*entries(n){if(Cs(n))for(const r in n){const i=n[r];yield[r,r,e],yield[r,i,t]}},validator:e=>Cs(e)||`Expected an object, but received: ${Is(e)}`})},refine:Js,regexp:function(){return Bs("regexp",(e=>e instanceof RegExp))},set:function(e){return new Ns({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const n of t)yield[n,n,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${Is(e)}`})},size:function(e,t,n=t){const r=`Expected a ${e.type}`,i=t===n?`of \`${t}\``:`between \`${t}\` and \`${n}\``;return Js(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return t<=e&&e<=n||`${r} ${i} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:o}=e;return t<=o&&o<=n||`${r} with a size ${i} but received one with a size of \`${o}\``}{const{length:o}=e;return t<=o&&o<=n||`${r} with a length ${i} but received one with a length of \`${o}\``}}))},string:Hs,struct:function(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Bs(e,t)},trimmed:function(e){return qs(e,Hs(),(e=>e.trim()))},tuple:function(e){const t=Fs();return new Ns({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(e.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],e[i]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${Is(e)}`})},type:Ws,union:function(e){const t=e.map((e=>e.type)).join(" | ");return new Ns({type:"union",schema:null,coercer(t){for(const n of e){const[e,r]=n.validate(t,{coerce:!0});if(!e)return r}return t},validator(n,r){const i=[];for(const t of e){const[...e]=js(n,t,r),[o]=e;if(!o[0])return[];for(const[t]of e)t&&i.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Is(n)}`,...i]}})},unknown:zs,validate:Ds}),Zs=e.getAugmentedNamespace(Gs);Object.defineProperty(xs,"__esModule",{value:!0}),xs.assertExhaustive=xs.assertStruct=xs.assert=xs.AssertionError=void 0;const Qs=Zs;function Ys(e,t){return n=e,Boolean("string"==typeof(null===(i=null===(r=null==n?void 0:n.prototype)||void 0===r?void 0:r.constructor)||void 0===i?void 0:i.name))?new e({message:t}):e({message:t});var n,r,i}class Ks extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}xs.AssertionError=Ks,xs.assert=function(e,t="Assertion failed.",n=Ks){if(!e){if(t instanceof Error)throw t;throw Ys(n,t)}},xs.assertStruct=function(e,t,n="Assertion failed",r=Ks){try{(0,Qs.assert)(e,t)}catch(e){throw Ys(r,`${n}: ${function(e){const t=function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(e)}.`)}},xs.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")};var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.base64=void 0;const ea=Zs,ta=xs;Xs.base64=(e,t={})=>{var n,r;const i=null!==(n=t.paddingRequired)&&void 0!==n&&n,o=null!==(r=t.characterSet)&&void 0!==r?r:"base64";let s,a;return"base64"===o?s=String.raw`[A-Za-z0-9+\/]`:((0,ta.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,ea.pattern)(e,a)};var na={},ra={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=Zs,n=xs;function r(n){return(0,t.is)(n,e.HexStruct)}function i(n){return(0,t.is)(n,e.StrictHexStruct)}e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu),e.isHexString=r,e.isStrictHexString=i,e.assertIsHexString=function(e){(0,n.assert)(r(e),"Value must be a hexadecimal string.")},e.assertIsStrictHexString=function(e){(0,n.assert)(i(e),'Value must be a hexadecimal string, starting with "0x".')},e.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},e.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}}(ra),Object.defineProperty(na,"__esModule",{value:!0}),na.createDataView=na.concatBytes=na.valueToBytes=na.stringToBytes=na.numberToBytes=na.signedBigIntToBytes=na.bigIntToBytes=na.hexToBytes=na.bytesToString=na.bytesToNumber=na.bytesToSignedBigInt=na.bytesToBigInt=na.bytesToHex=na.assertIsBytes=na.isBytes=void 0;const ia=xs,oa=ra,sa=48,aa=58,ca=87;const ua=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function la(e){return e instanceof Uint8Array}function ha(e){(0,ia.assert)(la(e),"Value must be a Uint8Array.")}function da(e){if(ha(e),0===e.length)return"0x";const t=ua(),n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=t[e[r]];return(0,oa.add0x)(n.join(""))}function fa(e){ha(e);const t=da(e);return BigInt(t)}function pa(e){var t;if("0x"===(null===(t=null==e?void 0:e.toLowerCase)||void 0===t?void 0:t.call(e)))return new Uint8Array;(0,oa.assertIsHexString)(e);const n=(0,oa.remove0x)(e).toLowerCase(),r=n.length%2==0?n:`0${n}`,i=new Uint8Array(r.length/2);for(let e=0;e<i.length;e++){const t=r.charCodeAt(2*e),n=r.charCodeAt(2*e+1),o=t-(t<aa?sa:ca),s=n-(n<aa?sa:ca);i[e]=16*o+s}return i}function ba(e){(0,ia.assert)("bigint"==typeof e,"Value must be a bigint."),(0,ia.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");return pa(e.toString(16))}function ya(e){(0,ia.assert)("number"==typeof e,"Value must be a number."),(0,ia.assert)(e>=0,"Value must be a non-negative number."),(0,ia.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return pa(e.toString(16))}function ga(e){return(0,ia.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function ma(e){if("bigint"==typeof e)return ba(e);if("number"==typeof e)return ya(e);if("string"==typeof e)return e.startsWith("0x")?pa(e):ga(e);if(la(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}na.isBytes=la,na.assertIsBytes=ha,na.bytesToHex=da,na.bytesToBigInt=fa,na.bytesToSignedBigInt=function(e){ha(e);let t=BigInt(0);for(const n of e)t=(t<<BigInt(8))+BigInt(n);return BigInt.asIntN(8*e.length,t)},na.bytesToNumber=function(e){ha(e);const t=fa(e);return(0,ia.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},na.bytesToString=function(e){return ha(e),(new TextDecoder).decode(e)},na.hexToBytes=pa,na.bigIntToBytes=ba,na.signedBigIntToBytes=function(e,t){(0,ia.assert)("bigint"==typeof e,"Value must be a bigint."),(0,ia.assert)("number"==typeof t,"Byte length must be a number."),(0,ia.assert)(t>0,"Byte length must be greater than 0."),(0,ia.assert)(function(e,t){(0,ia.assert)(t>0);const n=e>>BigInt(31);return!((~e&n)+(e&~n)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let n=e;const r=new Uint8Array(t);for(let e=0;e<r.length;e++)r[e]=Number(BigInt.asUintN(8,n)),n>>=BigInt(8);return r.reverse()},na.numberToBytes=ya,na.stringToBytes=ga,na.valueToBytes=ma,na.concatBytes=function(e){const t=new Array(e.length);let n=0;for(let r=0;r<e.length;r++){const i=ma(e[r]);t[r]=i,n+=i.length}const r=new Uint8Array(n);for(let e=0,n=0;e<t.length;e++)r.set(t[e],n),n+=t[e].length;return r},na.createDataView=function(e){if("undefined"!=typeof Buffer&&e instanceof Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)};var va={};Object.defineProperty(va,"__esModule",{value:!0}),va.ChecksumStruct=void 0;const _a=Zs,wa=Xs;va.ChecksumStruct=(0,_a.size)((0,wa.base64)((0,_a.string)(),{paddingRequired:!0}),44,44);var Sa={};Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.createHex=Sa.createBytes=Sa.createBigInt=Sa.createNumber=void 0;const Ea=Zs,xa=xs,ka=na,Ca=ra,Ma=(0,Ea.union)([(0,Ea.number)(),(0,Ea.bigint)(),(0,Ea.string)(),Ca.StrictHexStruct]),Ia=(0,Ea.coerce)((0,Ea.number)(),Ma,Number),Ra=(0,Ea.coerce)((0,Ea.bigint)(),Ma,BigInt);(0,Ea.union)([Ca.StrictHexStruct,(0,Ea.instance)(Uint8Array)]);const Aa=(0,Ea.coerce)((0,Ea.instance)(Uint8Array),(0,Ea.union)([Ca.StrictHexStruct]),ka.hexToBytes),ja=(0,Ea.coerce)(Ca.StrictHexStruct,(0,Ea.instance)(Uint8Array),ka.bytesToHex);Sa.createNumber=function(e){try{const t=(0,Ea.create)(e,Ia);return(0,xa.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof Ea.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},Sa.createBigInt=function(e){try{return(0,Ea.create)(e,Ra)}catch(e){if(e instanceof Ea.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},Sa.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,Ea.create)(e,Aa)}catch(e){if(e instanceof Ea.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},Sa.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,Ea.create)(e,ja)}catch(e){if(e instanceof Ea.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}};var Na,Oa,Ta={},Pa=e.commonjsGlobal&&e.commonjsGlobal.__classPrivateFieldSet||function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n},La=e.commonjsGlobal&&e.commonjsGlobal.__classPrivateFieldGet||function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.FrozenSet=Ta.FrozenMap=void 0;class Da{constructor(e){Na.set(this,void 0),Pa(this,Na,new Map(e),"f"),Object.freeze(this)}get size(){return La(this,Na,"f").size}[(Na=new WeakMap,Symbol.iterator)](){return La(this,Na,"f")[Symbol.iterator]()}entries(){return La(this,Na,"f").entries()}forEach(e,t){return La(this,Na,"f").forEach(((n,r,i)=>e.call(t,n,r,this)))}get(e){return La(this,Na,"f").get(e)}has(e){return La(this,Na,"f").has(e)}keys(){return La(this,Na,"f").keys()}values(){return La(this,Na,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}Ta.FrozenMap=Da;class Ba{constructor(e){Oa.set(this,void 0),Pa(this,Oa,new Set(e),"f"),Object.freeze(this)}get size(){return La(this,Oa,"f").size}[(Oa=new WeakMap,Symbol.iterator)](){return La(this,Oa,"f")[Symbol.iterator]()}entries(){return La(this,Oa,"f").entries()}forEach(e,t){return La(this,Oa,"f").forEach(((n,r,i)=>e.call(t,n,r,this)))}has(e){return La(this,Oa,"f").has(e)}keys(){return La(this,Oa,"f").keys()}values(){return La(this,Oa,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}Ta.FrozenSet=Ba,Object.freeze(Da),Object.freeze(Da.prototype),Object.freeze(Ba),Object.freeze(Ba.prototype);var Fa={},Ua={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0,e.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},e.isNullOrUndefined=function(e){return null==e},e.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)};var t;function n(e){return e.charCodeAt(0)<=127}e.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),(t=e.JsonSize||(e.JsonSize={}))[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date",e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,e.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},e.isASCII=n,e.calculateStringSize=function(t){var r;return t.split("").reduce(((e,t)=>n(t)?e+1:e+2),0)+(null!==(r=t.match(e.ESCAPE_CHARACTERS_REGEXP))&&void 0!==r?r:[]).length},e.calculateNumberSize=function(e){return e.toString().length}}(Ua),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateJsonAndGetSize=e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.isValidJson=e.JsonStruct=void 0;const t=Zs,n=xs,r=Ua;function i(e,t=!1){const n=new Set;return function e(t,i){if(void 0===t)return[!1,0];if(null===t)return[!0,i?0:r.JsonSize.Null];const o=typeof t;try{if("function"===o)return[!1,0];if("string"===o||t instanceof String)return[!0,i?0:(0,r.calculateStringSize)(t)+2*r.JsonSize.Quote];if("boolean"===o||t instanceof Boolean)return i?[!0,0]:[!0,1==t?r.JsonSize.True:r.JsonSize.False];if("number"===o||t instanceof Number)return i?[!0,0]:[!0,(0,r.calculateNumberSize)(t)];if(t instanceof Date)return i?[!0,0]:[!0,isNaN(t.getDate())?r.JsonSize.Null:r.JsonSize.Date+2*r.JsonSize.Quote]}catch(e){return[!1,0]}if(!(0,r.isPlainObject)(t)&&!Array.isArray(t))return[!1,0];if(n.has(t))return[!1,0];n.add(t);try{return[!0,Object.entries(t).reduce(((o,[s,a],c,u)=>{let[l,h]=e(a,i);if(!l)throw new Error("JSON validation did not pass. Validation process stopped.");if(n.delete(t),i)return 0;return o+(Array.isArray(t)?0:s.length+r.JsonSize.Comma+2*r.JsonSize.Colon)+h+(c<u.length-1?r.JsonSize.Comma:0)}),i?0:2*r.JsonSize.Wrapper)]}catch(e){return[!1,0]}}(e,t)}e.JsonStruct=(0,t.define)("Json",(e=>{const[t]=i(e,!0);return!!t||"Expected a valid JSON-serializable value"})),e.isValidJson=function(n){return(0,t.is)(n,e.JsonStruct)},e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]),e.isJsonRpcNotification=function(n){return(0,t.is)(n,e.JsonRpcNotificationStruct)},e.assertIsJsonRpcNotification=function(t,r){(0,n.assertStruct)(t,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",r)},e.isJsonRpcRequest=function(n){return(0,t.is)(n,e.JsonRpcRequestStruct)},e.assertIsJsonRpcRequest=function(t,r){(0,n.assertStruct)(t,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",r)},e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]),e.isPendingJsonRpcResponse=function(n){return(0,t.is)(n,e.PendingJsonRpcResponseStruct)},e.assertIsPendingJsonRpcResponse=function(t,r){(0,n.assertStruct)(t,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",r)},e.isJsonRpcResponse=function(n){return(0,t.is)(n,e.JsonRpcResponseStruct)},e.assertIsJsonRpcResponse=function(t,r){(0,n.assertStruct)(t,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",r)},e.isJsonRpcSuccess=function(n){return(0,t.is)(n,e.JsonRpcSuccessStruct)},e.assertIsJsonRpcSuccess=function(t,r){(0,n.assertStruct)(t,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",r)},e.isJsonRpcFailure=function(n){return(0,t.is)(n,e.JsonRpcFailureStruct)},e.assertIsJsonRpcFailure=function(t,r){(0,n.assertStruct)(t,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",r)},e.isJsonRpcError=function(n){return(0,t.is)(n,e.JsonRpcErrorStruct)},e.assertIsJsonRpcError=function(t,r){(0,n.assertStruct)(t,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",r)},e.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:n,permitNull:r}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},e);return e=>Boolean("number"==typeof e&&(n||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||r&&null===e)},e.validateJsonAndGetSize=i}(Fa);var Va,Ha,Wa={},za={exports:{}};function qa(){if(Ha)return Va;Ha=1;var e=1e3,t=60*e,n=60*t,r=24*n,i=7*r,o=365.25*r;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}return Va=function(a,c){c=c||{};var u=typeof a;if("string"===u&&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 c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(a);if("number"===u&&isFinite(a))return c.long?function(i){var o=Math.abs(i);if(o>=r)return s(i,o,r,"day");if(o>=n)return s(i,o,n,"hour");if(o>=t)return s(i,o,t,"minute");if(o>=e)return s(i,o,e,"second");return i+" ms"}(a):function(i){var o=Math.abs(i);if(o>=r)return Math.round(i/r)+"d";if(o>=n)return Math.round(i/n)+"h";if(o>=t)return Math.round(i/t)+"m";if(o>=e)return Math.round(i/e)+"s";return i+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},Va}var $a=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=qa(),t.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(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};!function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.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+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})(),t.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"],t.log=console.debug||console.log||(()=>{}),e.exports=$a(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(za,za.exports);var Ja=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.createModuleLogger=Wa.createProjectLogger=void 0;const Ga=(0,Ja(za.exports).default)("metamask");Wa.createProjectLogger=function(e){return Ga.extend(e)},Wa.createModuleLogger=function(e,t){return e.extend(t)};var Za={};Object.defineProperty(Za,"__esModule",{value:!0}),Za.hexToBigInt=Za.hexToNumber=Za.bigIntToHex=Za.numberToHex=void 0;const Qa=xs,Ya=ra;Za.numberToHex=e=>((0,Qa.assert)("number"==typeof e,"Value must be a number."),(0,Qa.assert)(e>=0,"Value must be a non-negative number."),(0,Qa.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Ya.add0x)(e.toString(16)));Za.bigIntToHex=e=>((0,Qa.assert)("bigint"==typeof e,"Value must be a bigint."),(0,Qa.assert)(e>=0,"Value must be a non-negative bigint."),(0,Ya.add0x)(e.toString(16)));Za.hexToNumber=e=>{(0,Ya.assertIsHexString)(e);const t=parseInt(e,16);return(0,Qa.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Za.hexToBigInt=e=>((0,Ya.assertIsHexString)(e),BigInt((0,Ya.add0x)(e)));var Ka={};Object.defineProperty(Ka,"__esModule",{value:!0});var Xa={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,(t=e.Duration||(e.Duration={}))[t.Millisecond=1]="Millisecond",t[t.Second=1e3]="Second",t[t.Minute=6e4]="Minute",t[t.Hour=36e5]="Hour",t[t.Day=864e5]="Day",t[t.Week=6048e5]="Week",t[t.Year=31536e6]="Year";const n=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};e.inMilliseconds=function(e,t){return n(e,"count"),e*t},e.timeSince=function(e){return n(e,"timestamp"),Date.now()-e}}(Xa);var ec={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=i.semver,n=Zs,r=xs;e.VersionStruct=(0,n.refine)((0,n.string)(),"Version",(e=>null!==(0,t.valid)(e)||`Expected SemVer version, got "${e}"`)),e.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",(e=>null!==(0,t.validRange)(e)||`Expected SemVer range, got "${e}"`)),e.isValidSemVerVersion=function(t){return(0,n.is)(t,e.VersionStruct)},e.isValidSemVerRange=function(t){return(0,n.is)(t,e.VersionRangeStruct)},e.assertIsSemVerVersion=function(t){(0,r.assertStruct)(t,e.VersionStruct)},e.assertIsSemVerRange=function(t){(0,r.assertStruct)(t,e.VersionRangeStruct)},e.gtVersion=function(e,n){return(0,t.gt)(e,n)},e.gtRange=function(e,n){return(0,t.gtr)(e,n)},e.satisfiesVersionRange=function(e,n){return(0,t.satisfies)(e,n,{includePrerelease:!0})}}(ec),function(t){var n=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(xs,t),r(Xs,t),r(na,t),r(va,t),r(Sa,t),r(Ta,t),r(ra,t),r(Fa,t),r(Wa,t),r(Ua,t),r(Za,t),r(Ka,t),r(Xa,t),r(ec,t)}(Es),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Es;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")}(Ss);var tc=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ds,"__esModule",{value:!0}),ds.PollingBlockTracker=void 0;const nc=tc(fs),rc=tc(((e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const n=e=>{const n=t=>"string"==typeof t?e===t:t.test(e);return t.include?t.include.some(n):!t.exclude.some(n)};let r;r="function"==typeof e?function(){return t.excludeMain?e.apply(this,arguments):ps(e,t).apply(this,arguments)}:Object.create(Object.getPrototypeOf(e));for(const i in e){const o=e[i];r[i]="function"==typeof o&&n(i)?ps(o,t):o}return r})),ic=bs,oc=(0,Ss.createModuleLogger)(Ss.projectLogger,"polling-block-tracker"),sc=(0,nc.default)();class ac extends ic.BaseBlockTracker{constructor(e={}){var t;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:null!==(t=e.blockResetDuration)&&void 0!==t?t:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||2e4,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=void 0===e.keepEventLoopActive||e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const e=cc(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await e}catch(t){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${null!==(e=t.stack)&&void 0!==e?e:t}`);try{this.emit("error",n)}catch(e){console.error(n)}const r=cc(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:sc(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),oc("Making request",e);const t=await(0,rc.default)((t=>this._provider.sendAsync(e,t)))();if(oc("Got response",t),t.error)throw new Error(`PollingBlockTracker - encountered error fetching block:\n${t.error.message}`);return t.result}}function cc(e,t){return new Promise((n=>{const r=setTimeout(n,e);r.unref&&t&&r.unref()}))}ds.PollingBlockTracker=ac;var uc={},lc=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(uc,"__esModule",{value:!0}),uc.SubscribeBlockTracker=void 0;const hc=lc(fs),dc=bs,fc=(0,hc.default)();class pc extends dc.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(void 0===this._subscriptionId||null===this._subscriptionId)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(null!==this._subscriptionId&&void 0!==this._subscriptionId)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...t){return new Promise(((n,r)=>{this._provider.sendAsync({id:fc(),method:e,params:t,jsonrpc:"2.0"},((e,t)=>{e?r(e):n(t.result)}))}))}_handleSubData(e,t){var n;"eth_subscription"===t.method&&(null===(n=t.params)||void 0===n?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(t.params.result.number)}}uc.SubscribeBlockTracker=pc;var bc={};Object.defineProperty(bc,"__esModule",{value:!0}),function(t){var n=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(ds,t),r(uc,t),r(bc,t)}(hs);var yc={},gc={},mc={};Object.defineProperty(mc,"__esModule",{value:!0}),mc.getUniqueId=void 0;const vc=4294967295;let _c=Math.floor(Math.random()*vc);mc.getUniqueId=function(){return _c=(_c+1)%vc,_c},Object.defineProperty(gc,"__esModule",{value:!0}),gc.createIdRemapMiddleware=void 0;const wc=mc;gc.createIdRemapMiddleware=function(){return(e,t,n,r)=>{const i=e.id,o=wc.getUniqueId();e.id=o,t.id=o,n((n=>{e.id=i,t.id=i,n()}))}};var Sc={};Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.createAsyncMiddleware=void 0,Sc.createAsyncMiddleware=function(e){return async(t,n,r,i)=>{let o;const s=new Promise((e=>{o=e}));let a=null,c=!1;const u=async()=>{c=!0,r((e=>{a=e,o()})),await s};try{await e(t,n,u),c?(await s,a(null)):i(null)}catch(e){a?a(e):i(e)}}};var Ec={};Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.createScaffoldMiddleware=void 0,Ec.createScaffoldMiddleware=function(e){return(t,n,r,i)=>{const o=e[t.method];return void 0===o?r():"function"==typeof o?o(t,n,r,i):(n.result=o,i())}};var xc={},kc={},Cc={};Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.EthereumProviderError=Cc.EthereumRpcError=void 0;const Mc=_;class Ic extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==n&&(this.data=n)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return Mc.default(this.serialize(),Rc,2)}}Cc.EthereumRpcError=Ic;function Rc(e,t){if("[Circular]"!==t)return t}Cc.EthereumProviderError=class extends Ic{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}};var Ac={},jc={};Object.defineProperty(jc,"__esModule",{value:!0}),jc.errorValues=jc.errorCodes=void 0,jc.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}},jc.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(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=jc,n=Cc,r=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:r,message:s(r)};function s(n,r=i){if(Number.isInteger(n)){const r=n.toString();if(l(t.errorValues,r))return t.errorValues[r].message;if(c(n))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function a(e){if(!Number.isInteger(e))return!1;const n=e.toString();return!!t.errorValues[n]||!!c(e)}function c(e){return e>=-32099&&e<=-32e3}function u(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=s,e.isValidCode=a,e.serializeError=function(e,{fallbackError:t=o,shouldIncludeStack:r=!1}={}){var i,c;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof n.EthereumRpcError)return e.serialize();const h={};if(e&&"object"==typeof e&&!Array.isArray(e)&&l(e,"code")&&a(e.code)){const t=e;h.code=t.code,t.message&&"string"==typeof t.message?(h.message=t.message,l(t,"data")&&(h.data=t.data)):(h.message=s(h.code),h.data={originalError:u(e)})}else{h.code=t.code;const n=null===(i=e)||void 0===i?void 0:i.message;h.message=n&&"string"==typeof n?n:t.message,h.data={originalError:u(e)}}const d=null===(c=e)||void 0===c?void 0:c.stack;return r&&e&&d&&"string"==typeof d&&(h.stack=d),h}}(Ac);var Nc={};Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.ethErrors=void 0;const Oc=Cc,Tc=Ac,Pc=jc;function Lc(e,t){const[n,r]=Bc(t);return new Oc.EthereumRpcError(e,n||Tc.getMessageFromCode(e),r)}function Dc(e,t){const[n,r]=Bc(t);return new Oc.EthereumProviderError(e,n||Tc.getMessageFromCode(e),r)}function Bc(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,n]}}return[]}Nc.ethErrors={rpc:{parse:e=>Lc(Pc.errorCodes.rpc.parse,e),invalidRequest:e=>Lc(Pc.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Lc(Pc.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Lc(Pc.errorCodes.rpc.methodNotFound,e),internal:e=>Lc(Pc.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Lc(t,e)},invalidInput:e=>Lc(Pc.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Lc(Pc.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Lc(Pc.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Lc(Pc.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Lc(Pc.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Lc(Pc.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Dc(Pc.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>Dc(Pc.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>Dc(Pc.errorCodes.provider.unsupportedMethod,e),disconnected:e=>Dc(Pc.errorCodes.provider.disconnected,e),chainDisconnected:e=>Dc(Pc.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:n,data:r}=e;if(!n||"string"!=typeof n)throw new Error('"message" must be a nonempty string');return new Oc.EthereumProviderError(t,n,r)}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Cc;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const n=Ac;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const r=Nc;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return r.ethErrors}});const i=jc;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})}(kc);var Fc=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xc,"__esModule",{value:!0}),xc.JsonRpcEngine=void 0;const Uc=Fc(p),Vc=kc;class Hc extends Uc.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,t){if(t&&"function"!=typeof t)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,n,r)=>{try{const[i,o,s]=await Hc._runAllMiddleware(e,t,this._middleware);return o?(await Hc._runReturnHandlers(s),r(i)):n((async e=>{try{await Hc._runReturnHandlers(s)}catch(t){return e(t)}return e()}))}catch(e){return r(e)}}}async _handleBatch(e,t){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,n):n}catch(e){if(t)return t(e);throw e}}_promiseHandle(e){return new Promise((t=>{this._handle(e,((e,n)=>{t(n)}))}))}async _handle(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){const n=new Vc.EthereumRpcError(Vc.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof e,{request:e});return t(n,{id:void 0,jsonrpc:"2.0",error:n})}if("string"!=typeof e.method){const n=new Vc.EthereumRpcError(Vc.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof e.method,{request:e});return t(n,{id:e.id,jsonrpc:"2.0",error:n})}const n=Object.assign({},e),r={id:n.id,jsonrpc:n.jsonrpc};let i=null;try{await this._processRequest(n,r)}catch(e){i=e}return i&&(delete r.result,r.error||(r.error=Vc.serializeError(i))),t(i,r)}async _processRequest(e,t){const[n,r,i]=await Hc._runAllMiddleware(e,t,this._middleware);if(Hc._checkForCompletion(e,t,r),await Hc._runReturnHandlers(i),n)throw n}static async _runAllMiddleware(e,t,n){const r=[];let i=null,o=!1;for(const s of n)if([i,o]=await Hc._runMiddleware(e,t,s,r),o)break;return[i,o,r.reverse()]}static _runMiddleware(e,t,n,r){return new Promise((i=>{const o=e=>{const n=e||t.error;n&&(t.error=Vc.serializeError(n)),i([n,!0])},s=n=>{t.error?o(t.error):(n&&("function"!=typeof n&&o(new Vc.EthereumRpcError(Vc.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof n}" for request:\n${Wc(e)}`,{request:e})),r.push(n)),i([null,!1]))};try{n(e,t,s,o)}catch(e){o(e)}}))}static async _runReturnHandlers(e){for(const t of e)await new Promise(((e,n)=>{t((t=>t?n(t):e()))}))}static _checkForCompletion(e,t,n){if(!("result"in t)&&!("error"in t))throw new Vc.EthereumRpcError(Vc.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:\n${Wc(e)}`,{request:e});if(!n)throw new Vc.EthereumRpcError(Vc.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:\n${Wc(e)}`,{request:e})}}function Wc(e){return JSON.stringify(e,null,2)}xc.JsonRpcEngine=Hc;var zc={};Object.defineProperty(zc,"__esModule",{value:!0}),zc.mergeMiddleware=void 0;const qc=xc;zc.mergeMiddleware=function(e){const t=new qc.JsonRpcEngine;return e.forEach((e=>t.push(e))),t.asMiddleware()},function(t){var n=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(gc,t),r(Sc,t),r(Ec,t),r(mc,t),r(xc,t),r(zc,t)}(yc);var $c={},Jc={},Gc={};Object.defineProperty(Gc,"__esModule",{value:!0});var Zc=o.require$$0,Qc=function(){function e(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return e.prototype.acquire=function(){var e=this,t=this.isLocked(),n=new Promise((function(t){return e._queue.push(t)}));return t||this._dispatch(),n},e.prototype.runExclusive=function(e){return Zc.__awaiter(this,void 0,void 0,(function(){var t,n,r;return Zc.__generator(this,(function(i){switch(i.label){case 0:return[4,this.acquire()];case 1:t=i.sent(),n=t[0],r=t[1],i.label=2;case 2:return i.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,i.sent()];case 4:return r(),[7];case 5:return[2]}}))}))},e.prototype.isLocked=function(){return this._value<=0},e.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 e=this._currentReleaser;this._currentReleaser=void 0,e()}},e.prototype._dispatch=function(){var e=this,t=this._queue.shift();if(t){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},t([this._value--,this._currentReleaser])}},e}();Gc.default=Qc,Object.defineProperty(Jc,"__esModule",{value:!0});var Yc=o.require$$0,Kc=Gc,Xc=function(){function e(){this._semaphore=new Kc.default(1)}return e.prototype.acquire=function(){return Yc.__awaiter(this,void 0,void 0,(function(){var e;return Yc.__generator(this,(function(t){switch(t.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=t.sent(),[2,e[1]]}}))}))},e.prototype.runExclusive=function(e){return this._semaphore.runExclusive((function(){return e()}))},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();Jc.default=Xc;var eu={};Object.defineProperty(eu,"__esModule",{value:!0}),eu.withTimeout=void 0;var tu=o.require$$0;eu.withTimeout=function(e,t,n){var r=this;return void 0===n&&(n=new Error("timeout")),{acquire:function(){return new Promise((function(i,o){return tu.__awaiter(r,void 0,void 0,(function(){var r,s;return tu.__generator(this,(function(a){switch(a.label){case 0:return r=!1,setTimeout((function(){r=!0,o(n)}),t),[4,e.acquire()];case 1:return s=a.sent(),r?(Array.isArray(s)?s[1]:s)():i(s),[2]}}))}))}))},runExclusive:function(e){return tu.__awaiter(this,void 0,void 0,(function(){var t,n;return tu.__generator(this,(function(r){switch(r.label){case 0:t=function(){},r.label=1;case 1:return r.trys.push([1,,7,8]),[4,this.acquire()];case 2:return n=r.sent(),Array.isArray(n)?(t=n[1],[4,e(n[0])]):[3,4];case 3:return[2,r.sent()];case 4:return t=n,[4,e()];case 5:return[2,r.sent()];case 6:return[3,8];case 7:return t(),[7];case 8:return[2]}}))}))},release:function(){e.release()},isLocked:function(){return e.isLocked()}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=Jc;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var n=Gc;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return n.default}});var r=eu;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return r.withTimeout}})}($c);var nu=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)ru.call(n,r)&&(e[r]=n[r])}return e},ru=Object.prototype.hasOwnProperty;const iu=nu,ou=fs();var su=au;function au(e){this.currentProvider=e}function cu(e){return function(){var t=[].slice.call(arguments),n=t.pop();this.sendAsync({method:e,params:t},n)}}function uu(e,t){return function(){var n=[].slice.call(arguments),r=n.pop();n.length<e&&n.push("latest"),this.sendAsync({method:t,params:n},r)}}au.prototype.getBalance=uu(2,"eth_getBalance"),au.prototype.getCode=uu(2,"eth_getCode"),au.prototype.getTransactionCount=uu(2,"eth_getTransactionCount"),au.prototype.getStorageAt=uu(3,"eth_getStorageAt"),au.prototype.call=uu(2,"eth_call"),au.prototype.protocolVersion=cu("eth_protocolVersion"),au.prototype.syncing=cu("eth_syncing"),au.prototype.coinbase=cu("eth_coinbase"),au.prototype.mining=cu("eth_mining"),au.prototype.hashrate=cu("eth_hashrate"),au.prototype.gasPrice=cu("eth_gasPrice"),au.prototype.accounts=cu("eth_accounts"),au.prototype.blockNumber=cu("eth_blockNumber"),au.prototype.getBlockTransactionCountByHash=cu("eth_getBlockTransactionCountByHash"),au.prototype.getBlockTransactionCountByNumber=cu("eth_getBlockTransactionCountByNumber"),au.prototype.getUncleCountByBlockHash=cu("eth_getUncleCountByBlockHash"),au.prototype.getUncleCountByBlockNumber=cu("eth_getUncleCountByBlockNumber"),au.prototype.sign=cu("eth_sign"),au.prototype.sendTransaction=cu("eth_sendTransaction"),au.prototype.sendRawTransaction=cu("eth_sendRawTransaction"),au.prototype.estimateGas=cu("eth_estimateGas"),au.prototype.getBlockByHash=cu("eth_getBlockByHash"),au.prototype.getBlockByNumber=cu("eth_getBlockByNumber"),au.prototype.getTransactionByHash=cu("eth_getTransactionByHash"),au.prototype.getTransactionByBlockHashAndIndex=cu("eth_getTransactionByBlockHashAndIndex"),au.prototype.getTransactionByBlockNumberAndIndex=cu("eth_getTransactionByBlockNumberAndIndex"),au.prototype.getTransactionReceipt=cu("eth_getTransactionReceipt"),au.prototype.getUncleByBlockHashAndIndex=cu("eth_getUncleByBlockHashAndIndex"),au.prototype.getUncleByBlockNumberAndIndex=cu("eth_getUncleByBlockNumberAndIndex"),au.prototype.getCompilers=cu("eth_getCompilers"),au.prototype.compileLLL=cu("eth_compileLLL"),au.prototype.compileSolidity=cu("eth_compileSolidity"),au.prototype.compileSerpent=cu("eth_compileSerpent"),au.prototype.newFilter=cu("eth_newFilter"),au.prototype.newBlockFilter=cu("eth_newBlockFilter"),au.prototype.newPendingTransactionFilter=cu("eth_newPendingTransactionFilter"),au.prototype.uninstallFilter=cu("eth_uninstallFilter"),au.prototype.getFilterChanges=cu("eth_getFilterChanges"),au.prototype.getFilterLogs=cu("eth_getFilterLogs"),au.prototype.getLogs=cu("eth_getLogs"),au.prototype.getWork=cu("eth_getWork"),au.prototype.submitWork=cu("eth_submitWork"),au.prototype.submitHashrate=cu("eth_submitHashrate"),au.prototype.sendAsync=function(e,t){var n;this.currentProvider.sendAsync((n=e,iu({id:ou(),jsonrpc:"2.0",params:[]},n)),(function(e,n){if(!e&&n.error&&(e=new Error("EthQuery - RPC Error - "+n.error.message)),e)return t(e);t(null,n.result)}))};const lu=(e,t,n,r)=>function(...i){return new(0,t.promiseModule)(((o,s)=>{t.multiArgs?i.push(((...e)=>{t.errorFirst?e[0]?s(e):(e.shift(),o(e)):o(e)})):t.errorFirst?i.push(((e,t)=>{e?s(e):o(t)})):i.push(o);const a=this===n?r:this;Reflect.apply(e,a,i)}))},hu=new WeakMap;const du=p.default;var fu=class extends du{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach((e=>this.emit("update",e)))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};const pu=fu;var bu={minBlockRef:function(...e){return yu(e)[0]},maxBlockRef:function(...e){const t=yu(e);return t[t.length-1]},sortBlockRefs:yu,bnToHex:function(e){return"0x"+e.toString(16)},blockRefIsNumber:function(e){return e&&!["earliest","latest","pending"].includes(e)},hexToInt:gu,incrementHexInt:function(e){if(null==e)return e;return mu(gu(e)+1)},intToHex:mu,unsafeRandomBytes:function(e){let t="0x";for(let n=0;n<e;n++)t+=vu(),t+=vu();return t}};function yu(e){return e.sort(((e,t)=>"latest"===e||"earliest"===t?1:"latest"===t||"earliest"===e?-1:gu(e)-gu(t)))}function gu(e){return null==e?e:Number.parseInt(e,16)}function mu(e){if(null==e)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function vu(){return Math.floor(16*Math.random()).toString(16)}const _u=su,wu=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const n=typeof e;if(null===e||"object"!==n&&"function"!==n)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===e?"null":n}\``);const r=new WeakMap,i=new Proxy(e,{apply(e,n,o){const s=r.get(e);if(s)return Reflect.apply(s,n,o);const a=t.excludeMain?e:lu(e,t,i,e);return r.set(e,a),Reflect.apply(a,n,o)},get(e,n){const o=e[n];if(!((e,n)=>{let r=hu.get(e);if(r||(r={},hu.set(e,r)),n in r)return r[n];const i=e=>"string"==typeof e||"symbol"==typeof n?n===e:e.test(n),o=Reflect.getOwnPropertyDescriptor(e,n),s=void 0===o||o.writable||o.configurable,a=(t.include?t.include.some(i):!t.exclude.some(i))&&s;return r[n]=a,a})(e,n)||o===Function.prototype[n])return o;const s=r.get(o);if(s)return s;if("function"==typeof o){const n=lu(o,t,i,e);return r.set(o,n),n}return o}});return i},Su=class extends pu{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}},{bnToHex:Eu,hexToInt:xu,incrementHexInt:ku,minBlockRef:Cu,blockRefIsNumber:Mu}=bu;var Iu=class extends Su{constructor({provider:e,params:t}){super(),this.type="log",this.ethQuery=new _u(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},t),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map((e=>e.toLowerCase())))}async initialize({currentBlock:e}){let t=this.params.fromBlock;["latest","pending"].includes(t)&&(t=e),"earliest"===t&&(t="0x0"),this.params.fromBlock=t;const n=Cu(this.params.toBlock,e),r=Object.assign({},this.params,{toBlock:n}),i=await this._fetchLogs(r);this.addInitialResults(i)}async update({oldBlock:e,newBlock:t}){const n=t;let r;r=e?ku(e):t;const i=Object.assign({},this.params,{fromBlock:r,toBlock:n}),o=(await this._fetchLogs(i)).filter((e=>this.matchLog(e)));this.addResults(o)}async _fetchLogs(e){return await wu((t=>this.ethQuery.getLogs(e,t)))()}matchLog(e){if(xu(this.params.fromBlock)>=xu(e.blockNumber))return!1;if(Mu(this.params.toBlock)&&xu(this.params.toBlock)<=xu(e.blockNumber))return!1;const t=e.address&&e.address.toLowerCase();if(this.params.address&&t&&!this.params.address.includes(t))return!1;const n=this.params.topics.every(((t,n)=>{let r=e.topics[n];if(!r)return!1;r=r.toLowerCase();let i=Array.isArray(t)?t:[t];if(i.includes(null))return!0;i=i.map((e=>e.toLowerCase()));return i.includes(r)}));return n}},Ru=async function({provider:e,fromBlock:t,toBlock:n}){t||(t=n);const r=Au(t),i=Au(n),o=Array(i-r+1).fill().map(((e,t)=>r+t)).map(ju);return await Promise.all(o.map((t=>async function(e,t,n){for(let r=0;r<3;r++)try{return await Nu(e,{id:1,jsonrpc:"2.0",method:t,params:n})}catch(e){console.error(`provider.sendAsync failed: ${e.stack||e.message||e}`)}throw new Error(`Block not found for params: ${JSON.stringify(n)}`)}(e,"eth_getBlockByNumber",[t,!1]))))};function Au(e){return null==e?e:Number.parseInt(e,16)}function ju(e){if(null==e)return e;return"0x"+e.toString(16)}function Nu(e,t){return new Promise(((n,r)=>{e.sendAsync(t,((e,t)=>{e?r(e):t.error?r(t.error):t.result?n(t.result):r(new Error("Result was empty"))}))}))}const Ou=fu,Tu=Ru,{incrementHexInt:Pu}=bu;var Lu=class extends Ou{constructor({provider:e,params:t}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:t}){const n=t,r=Pu(e),i=(await Tu({provider:this.provider,fromBlock:r,toBlock:n})).map((e=>e.hash));this.addResults(i)}};const Du=fu,Bu=Ru,{incrementHexInt:Fu}=bu;var Uu=class extends Du{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const t=e,n=Fu(e),r=await Bu({provider:this.provider,fromBlock:n,toBlock:t}),i=[];for(const e of r)i.push(...e.transactions);this.addResults(i)}};const Vu=$c.Mutex,{createAsyncMiddleware:Hu,createScaffoldMiddleware:Wu}=yc,zu=Iu,qu=Lu,$u=Uu,{intToHex:Ju,hexToInt:Gu}=bu;var Zu=function({blockTracker:e,provider:t}){let n=0,r={};const i=new Vu,o=function({mutex:e}){return t=>async(n,r,i,o)=>{(await e.acquire())(),t(n,r,i,o)}}({mutex:i}),s=Wu({eth_newFilter:o(Qu(c)),eth_newBlockFilter:o(Qu(u)),eth_newPendingTransactionFilter:o(Qu(l)),eth_uninstallFilter:o(Yu(f)),eth_getFilterChanges:o(Yu(h)),eth_getFilterLogs:o(Yu(d))}),a=async({oldBlock:e,newBlock:t})=>{if(0===r.length)return;const n=await i.acquire();try{await Promise.all(Ku(r).map((async n=>{try{await n.update({oldBlock:e,newBlock:t})}catch(e){console.error(e)}})))}catch(e){console.error(e)}n()};return s.newLogFilter=c,s.newBlockFilter=u,s.newPendingTransactionFilter=l,s.uninstallFilter=f,s.getFilterChanges=h,s.getFilterLogs=d,s.destroy=()=>{!async function(){const e=Ku(r).length;r={},b({prevFilterCount:e,newFilterCount:0})}()},s;async function c(e){const n=new zu({provider:t,params:e});return await p(n),n}async function u(){const e=new qu({provider:t});return await p(e),e}async function l(){const e=new $u({provider:t});return await p(e),e}async function h(e){const t=Gu(e),n=r[t];if(!n)throw new Error(`No filter for index "${t}"`);return n.getChangesAndClear()}async function d(e){const t=Gu(e),n=r[t];if(!n)throw new Error(`No filter for index "${t}"`);let i=[];return"log"===n.type&&(i=n.getAllResults()),i}async function f(e){const t=Gu(e),n=r[t],i=Boolean(n);return i&&await async function(e){const t=Ku(r).length;delete r[e];const n=Ku(r).length;b({prevFilterCount:t,newFilterCount:n})}(t),i}async function p(t){const i=Ku(r).length,o=await e.getLatestBlock();await t.initialize({currentBlock:o}),n++,r[n]=t,t.id=n,t.idHex=Ju(n);return b({prevFilterCount:i,newFilterCount:Ku(r).length}),n}function b({prevFilterCount:t,newFilterCount:n}){0===t&&n>0?e.on("sync",a):t>0&&0===n&&e.removeListener("sync",a)}};function Qu(e){return Yu((async(...t)=>{const n=await e(...t);return Ju(n.id)}))}function Yu(e){return Hu((async(t,n)=>{const r=await e.apply(null,t.params);n.result=r}))}function Ku(e,t){const n=[];for(let t in e)n.push(e[t]);return n}const Xu=p.default,{createAsyncMiddleware:el,createScaffoldMiddleware:tl}=yc,nl=Zu,{unsafeRandomBytes:rl,incrementHexInt:il}=bu,ol=Ru;var sl=function({blockTracker:e,provider:t}){const n={},r=nl({blockTracker:e,provider:t});let i=!1;const o=new Xu,s=tl({eth_subscribe:el((async function(o,s){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const c=o.params[0],u=rl(16);let l;switch(c){case"newHeads":l=h({subId:u});break;case"logs":const e=o.params[1];l=d({subId:u,filter:await r.newLogFilter(e)});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${c}"`)}return n[u]=l,void(s.result=u);function h({subId:n}){const r={type:c,destroy:async()=>{e.removeListener("sync",r.update)},update:async({oldBlock:e,newBlock:r})=>{const i=r,o=il(e);(await ol({provider:t,fromBlock:o,toBlock:i})).map(al).filter((e=>null!==e)).forEach((e=>{a(n,e)}))}};return e.on("sync",r.update),r}function d({subId:e,filter:t}){t.on("update",(t=>a(e,t)));return{type:c,destroy:async()=>await r.uninstallFilter(t.idHex)}}})),eth_unsubscribe:el((async function(e,t){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const r=e.params[0],o=n[r];if(!o)return void(t.result=!1);delete n[r],await o.destroy(),t.result=!0}))});return s.destroy=function(){o.removeAllListeners();for(const e in n)n[e].destroy(),delete n[e];i=!0},{events:o,middleware:s};function a(e,t){o.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:e,result:t}})}};function al(e){return null==e?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(ls,"__esModule",{value:!0}),ls.SubscriptionManager=void 0;const cl=hs,ul=sl,ll=()=>{};ls.SubscriptionManager=class{constructor(e){const t=new cl.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:r}=ul({blockTracker:t,provider:e});this.events=n,this.subscriptionMiddleware=r}async handleRequest(e){const t={};return await this.subscriptionMiddleware(e,t,ll,ll),t}destroy(){this.subscriptionMiddleware.destroy()}};var hl=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(f,"__esModule",{value:!0}),f.CoinbaseWalletProvider=void 0;const dl=hl(p),fl=hl(e.bn.exports),pl=m,bl=q,yl=$,gl=hi,ml=ct,vl=hl(Ko),_l=Xo,wl=us,Sl=ls,El="DefaultChainId",xl="DefaultJsonRpcUrl";class kl extends dl.default{constructor(e){var t,n;super(),this._filterPolyfill=new _l.FilterPolyfill(this),this._subscriptionManager=new Sl.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=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=null===(t=e.overrideIsCoinbaseWallet)||void 0===t||t,this.isCoinbaseBrowser=null!==(n=e.overrideIsCoinbaseBrowser)&&void 0!==n&&n,this.qrUrl=e.qrUrl,this.supportsAddressSwitching=e.supportsAddressSwitching,this.isLedger=e.isLedger;const r=this.getChainId(),i=(0,ml.prepend0x)(r.toString(16));this.emit("connect",{chainIdStr:i});const o=this._storage.getItem(gl.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const e=o.split(" ");""!==e[0]&&(this._addresses=e.map((e=>(0,ml.ensureAddressString)(e))),this.emit("accountsChanged",e))}this._subscriptionManager.events.on("notification",(e=>{this.emit("message",{type:e.method,data:e.params})})),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",(e=>{var t;if(e.origin===location.origin&&e.source===window&&"walletLinkMessage"===e.data.type){if("defaultChainChanged"===e.data.data.action||"dappChainSwitched"===e.data.data.action){const n=e.data.data.chainId,r=null!==(t=e.data.data.jsonRpcUrl)&&void 0!==t?t:this.jsonRpcUrl;this.updateProviderInfo(r,Number(n))}"addressChanged"===e.data.data.action&&this._setAddresses([e.data.data.address])}}))}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,ml.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 e;return null!==(e=this._storage.getItem(xl))&&void 0!==e?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(xl,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,t){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=t,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,t){this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(El,t.toString(10));!((0,ml.ensureIntNumber)(t)!==n)&&this.hasMadeFirstChainChangedEmission||(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,t,n,r,i,o){const s=await this.initializeRelay();return!!(await s.watchAsset(e,t,n,r,i,null==o?void 0:o.toString()).promise).result}async addEthereumChain(e,t,n,r,i,o){var s,a;if((0,ml.ensureIntNumber)(e)===this.getChainId())return!1;const c=await this.initializeRelay(),u=c.inlineAddEthereumChain(e.toString());this._isAuthorized()||u||await c.requestEthereumAccounts().promise;const l=await c.addEthereumChain(e.toString(),t,i,n,r,o).promise;return!0===(null===(s=l.result)||void 0===s?void 0:s.isApproved)&&this.updateProviderInfo(t[0],e),!0===(null===(a=l.result)||void 0===a?void 0:a.isApproved)}async switchEthereumChain(e){const t=await this.initializeRelay(),n=await t.switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if(n.errorCode)throw pl.ethErrors.provider.custom({code:n.errorCode});const r=n.result;r.isApproved&&r.rpcUrl.length>0&&this.updateProviderInfo(r.rpcUrl,e)}setAppInfo(e,t){this.initializeRelay().then((n=>n.setAppInfo(e,t)))}async enable(){var e;return null===(e=this.diagnostic)||void 0===e||e.log(bl.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?yl.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this._send(wl.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(e,t){if("string"==typeof e){const n={jsonrpc:"2.0",id:0,method:e,params:Array.isArray(t)?t:void 0!==t?[t]:[]};return this._sendRequestAsync(n).then((e=>e.result))}if("function"==typeof t){const n=e,r=t;return this._sendAsync(n,r)}if(Array.isArray(e)){return e.map((e=>this._sendRequest(e)))}const n=e;return this._sendRequest(n)}async sendAsync(e,t){if("function"!=typeof t)throw new Error("callback is required");if(Array.isArray(e)){const n=t;return void this._sendMultipleRequestsAsync(e).then((e=>n(null,e))).catch((e=>n(e,null)))}const n=t;return this._sendRequestAsync(e).then((e=>n(null,e))).catch((e=>n(e,null)))}async request(e){if(!e||"object"!=typeof e||Array.isArray(e))throw pl.ethErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:t,params:n}=e;if("string"!=typeof t||0===t.length)throw pl.ethErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(void 0!==n&&!Array.isArray(n)&&("object"!=typeof n||null===n))throw pl.ethErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const r=void 0===n?[]:n,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:t,params:r,jsonrpc:"2.0",id:i})).result}async scanQRCode(e){const t=await this.initializeRelay(),n=await t.scanQRCode((0,ml.ensureRegExpString)(e)).promise;if("string"!=typeof n.result)throw new Error("result was not a string");return n.result}async genericRequest(e,t){const n=await this.initializeRelay(),r=await n.genericRequest(e,t).promise;if("string"!=typeof r.result)throw new Error("result was not a string");return r.result}async selectProvider(e){const t=await this.initializeRelay(),n=await t.selectProvider(e).promise;if("string"!=typeof n.result)throw new Error("result was not a string");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const t={jsonrpc:"2.0",id:e.id},{method:n}=e;if(t.result=this._handleSynchronousMethods(e),void 0===t.result)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return t}_setAddresses(e,t){if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map((e=>(0,ml.ensureAddressString)(e)));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&!1===this.supportsAddressSwitching&&!t||(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(gl.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" "))))}_sendRequestAsync(e){return new Promise(((t,n)=>{try{const r=this._handleSynchronousMethods(e);if(void 0!==r)return t({jsonrpc:"2.0",id:e.id,result:r});const i=this._handleAsynchronousFilterMethods(e);if(void 0!==i)return void i.then((n=>t(Object.assign(Object.assign({},n),{id:e.id})))).catch((e=>n(e)));const o=this._handleSubscriptionMethods(e);if(void 0!==o)return void o.then((n=>t({jsonrpc:"2.0",id:e.id,result:n.result}))).catch((e=>n(e)))}catch(e){return n(e)}this._handleAsynchronousMethods(e).then((n=>n&&t(Object.assign(Object.assign({},n),{id:e.id})))).catch((e=>n(e)))}))}_sendMultipleRequestsAsync(e){return Promise.all(e.map((e=>this._sendRequestAsync(e))))}_handleSynchronousMethods(e){const{method:t}=e,n=e.params||[];switch(t){case wl.JSONRPCMethod.eth_accounts:return this._eth_accounts();case wl.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case wl.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case wl.JSONRPCMethod.net_version:return this._net_version();case wl.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:t}=e,n=e.params||[];switch(t){case wl.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case wl.JSONRPCMethod.eth_sign:return this._eth_sign(n);case wl.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case wl.JSONRPCMethod.personal_sign:return this._personal_sign(n);case wl.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case wl.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case wl.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case wl.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case wl.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case wl.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case wl.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case wl.JSONRPCMethod.eth_signTypedData_v4:case wl.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case wl.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(n);case wl.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(n);case wl.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(n);case wl.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(e){const{method:t}=e,n=e.params||[];switch(t){case wl.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case wl.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case wl.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case wl.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case wl.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case wl.JSONRPCMethod.eth_subscribe:case wl.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const t=(0,ml.ensureAddressString)(e);return this._addresses.map((e=>(0,ml.ensureAddressString)(e))).includes(t)}catch(e){}return!1}_ensureKnownAddress(e){var t;if(!this._isKnownAddress(e))throw null===(t=this.diagnostic)||void 0===t||t.log(bl.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const t=e.from?(0,ml.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(t);return{fromAddress:t,toAddress:e.to?(0,ml.ensureAddressString)(e.to):null,weiValue:null!=e.value?(0,ml.ensureBN)(e.value):new fl.default(0),data:e.data?(0,ml.ensureBuffer)(e.data):Buffer.alloc(0),nonce:null!=e.nonce?(0,ml.ensureIntNumber)(e.nonce):null,gasPriceInWei:null!=e.gasPrice?(0,ml.ensureBN)(e.gasPrice):null,maxFeePerGas:null!=e.maxFeePerGas?(0,ml.ensureBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?(0,ml.ensureBN)(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?(0,ml.ensureBN)(e.gas):null,chainId:this.getChainId()}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw pl.ethErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw pl.ethErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,t,n,r){this._ensureKnownAddress(t);try{const i=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await i.signEthereumMessage(e,t,n,r).promise).result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw pl.ethErrors.provider.userRejectedRequest("User denied message signature");throw e}}async _ethereumAddressFromSignedMessage(e,t,n){const r=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await r.ethereumAddressFromSignedMessage(e,t,n).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,ml.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(El);if(!e)return(0,ml.ensureIntNumber)(this._chainIdFromOpts);const t=parseInt(e,10);return(0,ml.ensureIntNumber)(t)}async _eth_requestAccounts(){var e;if(null===(e=this.diagnostic)||void 0===e||e.log(bl.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?yl.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let t;try{const e=await this.initializeRelay();t=await e.requestEthereumAccounts().promise}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw pl.ethErrors.provider.userRejectedRequest("User denied account authorization");throw e}if(!t.result)throw new Error("accounts received is empty");return this._setAddresses(t.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const t=(0,ml.ensureAddressString)(e[0]),n=(0,ml.ensureBuffer)(e[1]);return this._signEthereumMessage(n,t,!1)}_eth_ecRecover(e){const t=(0,ml.ensureBuffer)(e[0]),n=(0,ml.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!1)}_personal_sign(e){this._requireAuthorization();const t=(0,ml.ensureBuffer)(e[0]),n=(0,ml.ensureAddressString)(e[1]);return this._signEthereumMessage(t,n,!0)}_personal_ecRecover(e){const t=(0,ml.ensureBuffer)(e[0]),n=(0,ml.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const e=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await e.signEthereumTransaction(t).promise).result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw pl.ethErrors.provider.userRejectedRequest("User denied transaction signature");throw e}}async _eth_sendRawTransaction(e){const t=(0,ml.ensureBuffer)(e[0]),n=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await n.submitEthereumTransaction(t,this.getChainId()).promise).result}}async _eth_sendTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const e=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await e.signAndSubmitEthereumTransaction(t).promise).result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw pl.ethErrors.provider.userRejectedRequest("User denied transaction signature");throw e}}async _eth_signTypedData_v1(e){this._requireAuthorization();const t=(0,ml.ensureParsedJSONObject)(e[0]),n=(0,ml.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const r=vl.default.hashForSignTypedDataLegacy({data:t}),i=JSON.stringify(t,null,2);return this._signEthereumMessage(r,n,!1,i)}async _eth_signTypedData_v3(e){this._requireAuthorization();const t=(0,ml.ensureAddressString)(e[0]),n=(0,ml.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const r=vl.default.hashForSignTypedData_v3({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(r,t,!1,i)}async _eth_signTypedData_v4(e){this._requireAuthorization();const t=(0,ml.ensureAddressString)(e[0]),n=(0,ml.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const r=vl.default.hashForSignTypedData_v4({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(r,t,!1,i)}async _cbwallet_arbitrary(e){const t=e[0],n=e[1];if("string"!=typeof n)throw new Error("parameter must be a string");if("object"!=typeof t||null===t)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(t,n)}}async _wallet_addEthereumChain(e){var t,n,r,i;const o=e[0];if(0===(null===(t=o.rpcUrls)||void 0===t?void 0:t.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 pl.ethErrors.provider.custom({code:0,message:"chainName is a required field"});if(!o.nativeCurrency)throw pl.ethErrors.provider.custom({code:0,message:"nativeCurrency is a required field"});const s=parseInt(o.chainId,16);return await this.addEthereumChain(s,null!==(n=o.rpcUrls)&&void 0!==n?n:[],null!==(r=o.blockExplorerUrls)&&void 0!==r?r:[],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(e){const t=e[0];return await this.switchEthereumChain(parseInt(t.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const t=Array.isArray(e)?e[0]:e;if(!t.type)throw pl.ethErrors.rpc.invalidParams({message:"Type is required"});if("ERC20"!==(null==t?void 0:t.type))throw pl.ethErrors.rpc.invalidParams({message:`Asset of type '${t.type}' is not supported`});if(!(null==t?void 0:t.options))throw pl.ethErrors.rpc.invalidParams({message:"Options are required"});if(!(null==t?void 0:t.options.address))throw pl.ethErrors.rpc.invalidParams({message:"Address is required"});const n=this.getChainId(),{address:r,symbol:i,image:o,decimals:s}=t.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(t.type,r,i,s,o,n)}}_eth_uninstallFilter(e){const t=(0,ml.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(t)}async _eth_newFilter(e){const t=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(t)}}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(e){const t=(0,ml.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(t)}_eth_getFilterLogs(e){const t=(0,ml.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(t)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then((e=>(e.setAccountsCallback(((e,t)=>this._setAddresses(e,t))),e.setChainCallback(((e,t)=>{this.updateProviderInfo(t,parseInt(e,10))})),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e)))}}f.CoinbaseWalletProvider=kl;var Cl,Ml,Il,Rl,Al,jl,Nl,Ol,Tl,Pl={},Ll={},Dl={},Bl=[],Fl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Ul(e,t){for(var n in t)e[n]=t[n];return e}function Vl(e){var t=e.parentNode;t&&t.removeChild(e)}function Hl(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Cl.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Wl(e,s,r,i,null)}function Wl(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Il:i};return null==i&&null!=Ml.vnode&&Ml.vnode(o),o}function zl(e){return e.children}function ql(e,t){this.props=e,this.context=t}function $l(e,t){if(null==t)return e.__?$l(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?$l(e):null}function Jl(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Jl(e)}}function Gl(e){(!e.__d&&(e.__d=!0)&&Al.push(e)&&!Zl.__r++||jl!==Ml.debounceRendering)&&((jl=Ml.debounceRendering)||Nl)(Zl)}function Zl(){var e,t,n,r,i,o,s,a;for(Al.sort(Ol);e=Al.shift();)e.__d&&(t=Al.length,r=void 0,i=void 0,s=(o=(n=e).__v).__e,(a=n.__P)&&(r=[],(i=Ul({},o)).__v=o.__v+1,ih(a,o,i,n.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,r,null==s?$l(o):s,o.__h),oh(r,o),o.__e!=s&&Jl(o)),Al.length>t&&Al.sort(Ol));Zl.__r=0}function Ql(e,t,n,r,i,o,s,a,c,u){var l,h,d,f,p,b,y,g=r&&r.__k||Bl,m=g.length;for(n.__k=[],l=0;l<t.length;l++)if(null!=(f=n.__k[l]=null==(f=t[l])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Wl(null,f,null,null,f):Array.isArray(f)?Wl(zl,{children:f},null,null,null):f.__b>0?Wl(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(d=g[l])||d&&f.key==d.key&&f.type===d.type)g[l]=void 0;else for(h=0;h<m;h++){if((d=g[h])&&f.key==d.key&&f.type===d.type){g[h]=void 0;break}d=null}ih(e,f,d=d||Dl,i,o,s,a,c,u),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==b&&(b=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=c=Yl(f,c,e):c=Kl(e,f,d,g,p,c),"function"==typeof n.type&&(n.__d=c)):c&&d.__e==c&&c.parentNode!=e&&(c=$l(d))}for(n.__e=b,l=m;l--;)null!=g[l]&&("function"==typeof n.type&&null!=g[l].__e&&g[l].__e==n.__d&&(n.__d=Xl(r).nextSibling),ch(g[l],g[l]));if(y)for(l=0;l<y.length;l++)ah(y[l],y[++l],y[++l])}function Yl(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?Yl(r,t,n):Kl(n,r,r,i,r.__e,t));return t}function Kl(e,t,n,r,i,o){var s,a,c;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),s=null;else{for(a=o,c=0;(a=a.nextSibling)&&c<r.length;c+=1)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function Xl(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=Xl(n)))return r;return null}function eh(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Fl.test(t)?n:n+"px"}function th(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||eh(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||eh(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?rh:nh,o):e.removeEventListener(t,o?rh:nh,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function nh(e){return this.l[e.type+!1](Ml.event?Ml.event(e):e)}function rh(e){return this.l[e.type+!0](Ml.event?Ml.event(e):e)}function ih(e,t,n,r,i,o,s,a,c){var u,l,h,d,f,p,b,y,g,m,v,_,w,S,E,x=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(c=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(u=Ml.__b)&&u(t);try{e:if("function"==typeof x){if(y=t.props,g=(u=x.contextType)&&r[u.__c],m=u?g?g.props.value:u.__:r,n.__c?b=(l=t.__c=n.__c).__=l.__E:("prototype"in x&&x.prototype.render?t.__c=l=new x(y,m):(t.__c=l=new ql(y,m),l.constructor=x,l.render=uh),g&&g.sub(l),l.props=y,l.state||(l.state={}),l.context=m,l.__n=r,h=l.__d=!0,l.__h=[],l._sb=[]),null==l.__s&&(l.__s=l.state),null!=x.getDerivedStateFromProps&&(l.__s==l.state&&(l.__s=Ul({},l.__s)),Ul(l.__s,x.getDerivedStateFromProps(y,l.__s))),d=l.props,f=l.state,l.__v=t,h)null==x.getDerivedStateFromProps&&null!=l.componentWillMount&&l.componentWillMount(),null!=l.componentDidMount&&l.__h.push(l.componentDidMount);else{if(null==x.getDerivedStateFromProps&&y!==d&&null!=l.componentWillReceiveProps&&l.componentWillReceiveProps(y,m),!l.__e&&null!=l.shouldComponentUpdate&&!1===l.shouldComponentUpdate(y,l.__s,m)||t.__v===n.__v){for(t.__v!==n.__v&&(l.props=y,l.state=l.__s,l.__d=!1),l.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),v=0;v<l._sb.length;v++)l.__h.push(l._sb[v]);l._sb=[],l.__h.length&&s.push(l);break e}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=e,_=Ml.__r,w=0,"prototype"in x&&x.prototype.render){for(l.state=l.__s,l.__d=!1,_&&_(t),u=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,_&&_(t),u=l.render(l.props,l.state,l.context),l.state=l.__s}while(l.__d&&++w<25);l.state=l.__s,null!=l.getChildContext&&(r=Ul(Ul({},r),l.getChildContext())),h||null==l.getSnapshotBeforeUpdate||(p=l.getSnapshotBeforeUpdate(d,f)),E=null!=u&&u.type===zl&&null==u.key?u.props.children:u,Ql(e,Array.isArray(E)?E:[E],t,n,r,i,o,s,a,c),l.base=t.__e,t.__h=null,l.__h.length&&s.push(l),b&&(l.__E=l.__=null),l.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=sh(n.__e,t,n,r,i,o,s,c);(u=Ml.diffed)&&u(t)}catch(e){t.__v=null,(c||null!=o)&&(t.__e=a,t.__h=!!c,o[o.indexOf(a)]=null),Ml.__e(e,t,n)}}function oh(e,t){Ml.__c&&Ml.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Ml.__e(e,t.__v)}}))}function sh(e,t,n,r,i,o,s,a){var c,u,l,h=n.props,d=t.props,f=t.type,p=0;if("svg"===f&&(i=!0),null!=o)for(;p<o.length;p++)if((c=o[p])&&"setAttribute"in c==!!f&&(f?c.localName===f:3===c.nodeType)){e=c,o[p]=null;break}if(null==e){if(null===f)return document.createTextNode(d);e=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&&e.data===d||(e.data=d);else{if(o=o&&Cl.call(e.childNodes),u=(h=n.props||Dl).dangerouslySetInnerHTML,l=d.dangerouslySetInnerHTML,!a){if(null!=o)for(h={},p=0;p<e.attributes.length;p++)h[e.attributes[p].name]=e.attributes[p].value;(l||u)&&(l&&(u&&l.__html==u.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||th(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||th(e,o,t[o],n[o],r)}(e,d,h,i,a),l)t.__k=[];else if(p=t.props.children,Ql(e,Array.isArray(p)?p:[p],t,n,r,i&&"foreignObject"!==f,o,s,o?o[0]:n.__k&&$l(n,0),a),null!=o)for(p=o.length;p--;)null!=o[p]&&Vl(o[p]);a||("value"in d&&void 0!==(p=d.value)&&(p!==e.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&th(e,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==e.checked&&th(e,"checked",p,h.checked,!1))}return e}function ah(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Ml.__e(e,n)}}function ch(e,t,n){var r,i;if(Ml.unmount&&Ml.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||ah(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Ml.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&ch(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Vl(e.__e),e.__=e.__e=e.__d=void 0}function uh(e,t,n){return this.constructor(e,n)}function lh(e,t,n){var r,i,o;Ml.__&&Ml.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],ih(t,e=(!r&&n||t).__k=Hl(zl,null,[e]),i||Dl,Dl,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Cl.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),oh(o,e)}Cl=Bl.slice,Ml={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},Il=0,Rl=function(e){return null!=e&&void 0===e.constructor},ql.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Ul({},this.state),"function"==typeof e&&(e=e(Ul({},n),this.props)),e&&Ul(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Gl(this))},ql.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Gl(this))},ql.prototype.render=zl,Al=[],Nl="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ol=function(e,t){return e.__v.__b-t.__v.__b},Zl.__r=0,Tl=0;var hh=Object.freeze({__proto__:null,Component:ql,Fragment:zl,cloneElement:function(e,t,n){var r,i,o,s=Ul({},e.props);for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];return arguments.length>2&&(s.children=arguments.length>3?Cl.call(arguments,2):n),Wl(e.type,s,r||e.key,i||e.ref,null)},createContext:function(e,t){var n={__c:t="__cC"+Tl++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,Gl(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},createElement:Hl,createRef:function(){return{current:null}},h:Hl,hydrate:function e(t,n){lh(t,n,e)},get isValidElement(){return Rl},get options(){return Ml},render:lh,toChildArray:function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,n)})):n.push(t)),n}}),dh=e.getAugmentedNamespace(hh);function fh(e){return"function"==typeof e}var ph=!1,bh={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;ph=e},get useDeprecatedSynchronousErrorHandling(){return ph}};function yh(e){setTimeout((function(){throw e}),0)}var gh={closed:!0,next:function(e){},error:function(e){if(bh.useDeprecatedSynchronousErrorHandling)throw e;yh(e)},complete:function(){}},mh=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();function vh(e){return null!==e&&"object"==typeof e}var _h=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),wh=_h,Sh=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this,r=n._parentOrParents,i=n._ctorUnsubscribe,o=n._unsubscribe,s=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof e)r.remove(this);else if(null!==r)for(var a=0;a<r.length;++a){r[a].remove(this)}if(fh(o)){i&&(this._unsubscribe=void 0);try{o.call(this)}catch(e){t=e instanceof wh?Eh(e.errors):[e]}}if(mh(s)){a=-1;for(var c=s.length;++a<c;){var u=s[a];if(vh(u))try{u.unsubscribe()}catch(e){t=t||[],e instanceof wh?t=t.concat(Eh(e.errors)):t.push(e)}}}if(t)throw new wh(t)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(typeof t){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=n._parentOrParents;if(null===i)n._parentOrParents=this;else if(i instanceof e){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[n]:o.push(n),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function Eh(e){return e.reduce((function(e,t){return e.concat(t instanceof wh?t.errors:t)}),[])}var xh=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),kh=function(t){function n(e,r,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(!e){o.destination=gh;break}if("object"==typeof e){e instanceof n?(o.syncErrorThrowable=e.syncErrorThrowable,o.destination=e,e.add(o)):(o.syncErrorThrowable=!0,o.destination=new Ch(o,e));break}default:o.syncErrorThrowable=!0,o.destination=new Ch(o,e,r,i)}return o}return e.__extends(n,t),n.prototype[xh]=function(){return this},n.create=function(e,t,r){var i=new n(e,t,r);return i.syncErrorThrowable=!1,i},n.prototype.next=function(e){this.isStopped||this._next(e)},n.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},n}(Sh),Ch=function(t){function n(e,n,r,i){var o,s=t.call(this)||this;s._parentSubscriber=e;var a=s;return fh(n)?o=n:n&&(o=n.next,r=n.error,i=n.complete,n!==gh&&(fh((a=Object.create(n)).unsubscribe)&&s.add(a.unsubscribe.bind(a)),a.unsubscribe=s.unsubscribe.bind(s))),s._context=a,s._next=o,s._error=r,s._complete=i,s}return e.__extends(n,t),n.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;bh.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},n.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=bh.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):yh(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;yh(e)}}},n.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};bh.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},n.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),bh.useDeprecatedSynchronousErrorHandling)throw e;yh(e)}},n.prototype.__tryOrSetError=function(e,t,n){if(!bh.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return bh.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(yh(t),!0)}return!1},n.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},n}(kh);function Mh(e){for(;e;){var t=e,n=t.closed,r=t.destination,i=t.isStopped;if(n||i)return!1;e=r&&r instanceof kh?r:null}return!0}var Ih=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function Rh(e){return e}function Ah(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return jh(e)}function jh(e){return 0===e.length?Rh:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var Nh=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,i=function(e,t,n){if(e){if(e instanceof kh)return e;if(e[xh])return e[xh]()}return e||t||n?new kh(e,t,n):new kh(gh)}(e,t,n);if(r?i.add(r.call(i,this.source)):i.add(this.source||bh.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),bh.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){bh.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),Mh(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=Oh(t))((function(t,r){var i;i=n.subscribe((function(t){try{e(t)}catch(e){r(e),i&&i.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[Ih]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:jh(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Oh(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function Oh(e){if(e||(e=bh.Promise||Promise),!e)throw new Error("no Promise impl found");return e}var Th=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),Ph=function(t){function n(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return e.__extends(n,t),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},n}(Sh),Lh=function(t){function n(e){var n=t.call(this,e)||this;return n.destination=e,n}return e.__extends(n,t),n}(kh),Dh=function(t){function n(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return e.__extends(n,t),n.prototype[xh]=function(){return new Lh(this)},n.prototype.lift=function(e){var t=new Bh(this,this);return t.operator=e,t},n.prototype.next=function(e){if(this.closed)throw new Th;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),i=0;i<n;i++)r[i].next(e)},n.prototype.error=function(e){if(this.closed)throw new Th;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),i=0;i<n;i++)r[i].error(e);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Th;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},n.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},n.prototype._trySubscribe=function(e){if(this.closed)throw new Th;return t.prototype._trySubscribe.call(this,e)},n.prototype._subscribe=function(e){if(this.closed)throw new Th;return this.hasError?(e.error(this.thrownError),Sh.EMPTY):this.isStopped?(e.complete(),Sh.EMPTY):(this.observers.push(e),new Ph(this,e))},n.prototype.asObservable=function(){var e=new Nh;return e.source=this,e},n.create=function(e,t){return new Bh(e,t)},n}(Nh),Bh=function(t){function n(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return e.__extends(n,t),n.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},n.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},n.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},n.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):Sh.EMPTY},n}(Dh);function Fh(){return function(e){return e.lift(new Uh(e))}}var Uh=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var n=this.connectable;n._refCount++;var r=new Vh(e,n),i=t.subscribe(r);return r.closed||(r.connection=n.connect()),i},e}(),Vh=function(t){function n(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return e.__extends(n,t),n.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;if(t<=0)this.connection=null;else if(e._refCount=t-1,t>1)this.connection=null;else{var n=this.connection,r=e._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},n}(kh),Hh=function(t){function n(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return e.__extends(n,t),n.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},n.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},n.prototype.connect=function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new Sh).add(this.source.subscribe(new zh(this.getSubject(),this))),e.closed&&(this._connection=null,e=Sh.EMPTY)),e},n.prototype.refCount=function(){return Fh()(this)},n}(Nh),Wh=function(){var e=Hh.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}}(),zh=function(t){function n(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return e.__extends(n,t),n.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},n.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},n.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},n}(Lh);var qh=function(){function e(e,t,n,r){this.keySelector=e,this.elementSelector=t,this.durationSelector=n,this.subjectSelector=r}return e.prototype.call=function(e,t){return t.subscribe(new $h(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),$h=function(t){function n(e,n,r,i,o){var s=t.call(this,e)||this;return s.keySelector=n,s.elementSelector=r,s.durationSelector=i,s.subjectSelector=o,s.groups=null,s.attemptedToUnsubscribe=!1,s.count=0,s}return e.__extends(n,t),n.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(e){return void this.error(e)}this._group(e,t)},n.prototype._group=function(e,t){var n=this.groups;n||(n=this.groups=new Map);var r,i=n.get(t);if(this.elementSelector)try{r=this.elementSelector(e)}catch(e){this.error(e)}else r=e;if(!i){i=this.subjectSelector?this.subjectSelector():new Dh,n.set(t,i);var o=new Gh(t,i,this);if(this.destination.next(o),this.durationSelector){var s=void 0;try{s=this.durationSelector(new Gh(t,i))}catch(e){return void this.error(e)}this.add(s.subscribe(new Jh(t,i,this)))}}i.closed||i.next(r)},n.prototype._error=function(e){var t=this.groups;t&&(t.forEach((function(t,n){t.error(e)})),t.clear()),this.destination.error(e)},n.prototype._complete=function(){var e=this.groups;e&&(e.forEach((function(e,t){e.complete()})),e.clear()),this.destination.complete()},n.prototype.removeGroup=function(e){this.groups.delete(e)},n.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},n}(kh),Jh=function(t){function n(e,n,r){var i=t.call(this,n)||this;return i.key=e,i.group=n,i.parent=r,i}return e.__extends(n,t),n.prototype._next=function(e){this.complete()},n.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},n}(kh),Gh=function(t){function n(e,n,r){var i=t.call(this)||this;return i.key=e,i.groupSubject=n,i.refCountSubscription=r,i}return e.__extends(n,t),n.prototype._subscribe=function(e){var t=new Sh,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&t.add(new Zh(n)),t.add(r.subscribe(e)),t},n}(Nh),Zh=function(t){function n(e){var n=t.call(this)||this;return n.parent=e,e.count++,n}return e.__extends(n,t),n.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())},n}(Sh),Qh=function(t){function n(e){var n=t.call(this)||this;return n._value=e,n}return e.__extends(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Th;return this._value},n.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},n}(Dh),Yh=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return e.__extends(n,t),n.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},n.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),setInterval(e.flush.bind(e,this),n)},n.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)},n.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(e,t){var n=!1,r=void 0;try{this.work(e)}catch(e){n=!0,r=!!e&&e||new Error(e)}if(n)return this.unsubscribe(),r},n.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},n}(function(t){function n(e,n){return t.call(this)||this}return e.__extends(n,t),n.prototype.schedule=function(e,t){return this},n}(Sh)),Kh=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return e.__extends(n,t),n.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},n.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},n.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},n}(Yh),Xh=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=function(){return Date.now()},e}(),ed=function(t){function n(e,r){void 0===r&&(r=Xh.now);var i=t.call(this,e,(function(){return n.delegate&&n.delegate!==i?n.delegate.now():r()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return e.__extends(n,t),n.prototype.schedule=function(e,r,i){return void 0===r&&(r=0),n.delegate&&n.delegate!==this?n.delegate.schedule(e,r,i):t.prototype.schedule.call(this,e,r,i)},n.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},n}(Xh),td=new(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n}(ed))(Kh),nd=td,rd=new Nh((function(e){return e.complete()}));function id(e){return e?function(e){return new Nh((function(t){return e.schedule((function(){return t.complete()}))}))}(e):rd}function od(e){return e&&"function"==typeof e.schedule}var sd,ad=function(e){return function(t){for(var n=0,r=e.length;n<r&&!t.closed;n++)t.next(e[n]);t.complete()}};function cd(e,t){return new Nh((function(n){var r=new Sh,i=0;return r.add(t.schedule((function(){i!==e.length?(n.next(e[i++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}function ud(e,t){return t?cd(e,t):new Nh(ad(e))}function ld(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return od(n)?(e.pop(),cd(e,n)):ud(e)}function hd(e,t){return new Nh(t?function(n){return t.schedule(dd,0,{error:e,subscriber:n})}:function(t){return t.error(e)})}function dd(e){var t=e.error;e.subscriber.error(t)}sd||(sd={});var fd=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}},e.prototype.accept=function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){switch(this.kind){case"N":return ld(this.value);case"E":return hd(this.error);case"C":return id()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}();var pd=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new bd(e,this.scheduler,this.delay))},e}(),bd=function(t){function n(e,n,r){void 0===r&&(r=0);var i=t.call(this,e)||this;return i.scheduler=n,i.delay=r,i}return e.__extends(n,t),n.dispatch=function(e){var t=e.notification,n=e.destination;t.observe(n),this.unsubscribe()},n.prototype.scheduleMessage=function(e){this.destination.add(this.scheduler.schedule(n.dispatch,this.delay,new yd(e,this.destination)))},n.prototype._next=function(e){this.scheduleMessage(fd.createNext(e))},n.prototype._error=function(e){this.scheduleMessage(fd.createError(e)),this.unsubscribe()},n.prototype._complete=function(){this.scheduleMessage(fd.createComplete()),this.unsubscribe()},n}(kh),yd=function(){return function(e,t){this.notification=e,this.destination=t}}(),gd=function(t){function n(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var i=t.call(this)||this;return i.scheduler=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=e<1?1:e,i._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return e.__extends(n,t),n.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var n=this._events;n.push(e),n.length>this._bufferSize&&n.shift()}t.prototype.next.call(this,e)},n.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new md(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},n.prototype._subscribe=function(e){var t,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=r.length;if(this.closed)throw new Th;if(this.isStopped||this.hasError?t=Sh.EMPTY:(this.observers.push(e),t=new Ph(this,e)),i&&e.add(e=new bd(e,i)),n)for(var s=0;s<o&&!e.closed;s++)e.next(r[s]);else for(s=0;s<o&&!e.closed;s++)e.next(r[s].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),t},n.prototype._getNow=function(){return(this.scheduler||nd).now()},n.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,o=0;o<i&&!(e-r[o].time<n);)o++;return i>t&&(o=Math.max(o,i-t)),o>0&&r.splice(0,o),r},n}(Dh),md=function(){return function(e,t){this.time=e,this.value=t}}(),vd=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return e.__extends(n,t),n.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),Sh.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),Sh.EMPTY):t.prototype._subscribe.call(this,e)},n.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},n.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},n.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},n}(Dh),_d=1,wd=function(){return Promise.resolve()}(),Sd={};function Ed(e){return e in Sd&&(delete Sd[e],!0)}var xd=function(e){var t=_d++;return Sd[t]=!0,wd.then((function(){return Ed(t)&&e()})),t},kd=function(e){Ed(e)},Cd=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return e.__extends(n,t),n.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=xd(e.flush.bind(e,null))))},n.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(kd(n),e.scheduled=void 0)},n}(Yh),Md=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,i=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this.active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},n}(ed),Id=new Md(Cd),Rd=Id,Ad=new ed(Yh),jd=Ad,Nd=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return e.__extends(n,t),n.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},n.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(cancelAnimationFrame(n),e.scheduled=void 0)},n}(Yh),Od=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,i=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this.active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},n}(ed),Td=new Od(Nd),Pd=Td,Ld=function(t){function n(e,n){void 0===e&&(e=Dd),void 0===n&&(n=Number.POSITIVE_INFINITY);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return e.__extends(n,t),n.prototype.flush=function(){for(var e,t,n=this.actions,r=this.maxFrames;(t=n[0])&&t.delay<=r&&(n.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=n.shift();)t.unsubscribe();throw e}},n.frameTimeFactor=10,n}(ed),Dd=function(t){function n(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return e.__extends(n,t),n.prototype.schedule=function(e,r){if(void 0===r&&(r=0),!this.id)return t.prototype.schedule.call(this,e,r);this.active=!1;var i=new n(this.scheduler,this.work);return this.add(i),i.schedule(e,r)},n.prototype.requestAsyncId=function(e,t,r){void 0===r&&(r=0),this.delay=e.frame+r;var i=e.actions;return i.push(this),i.sort(n.sortActions),!0},n.prototype.recycleAsyncId=function(e,t,n){},n.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},n.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},n}(Yh);function Bd(){}var Fd=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}(),Ud=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e}(),Vd=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return e.prototype=Object.create(Error.prototype),e}();function Hd(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new Wd(e,t))}}var Wd=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new zd(e,this.project,this.thisArg))},e}(),zd=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return e.__extends(n,t),n.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},n}(kh);function qd(e){var t=this,n=e.args,r=e.subscriber,i=e.params,o=i.callbackFunc,s=i.context,a=i.scheduler,c=i.subject;if(!c){c=i.subject=new vd;try{o.apply(s,n.concat([function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.length<=1?e[0]:e;t.add(a.schedule($d,0,{value:r,subject:c}))}]))}catch(e){c.error(e)}}this.add(c.subscribe(r))}function $d(e){var t=e.value,n=e.subject;n.next(t),n.complete()}function Jd(e){var t=this,n=e.params,r=e.subscriber,i=e.context,o=n.callbackFunc,s=n.args,a=n.scheduler,c=n.subject;if(!c){c=n.subject=new vd;try{o.apply(i,s.concat([function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.shift();if(r)t.add(a.schedule(Zd,0,{err:r,subject:c}));else{var i=e.length<=1?e[0]:e;t.add(a.schedule(Gd,0,{value:i,subject:c}))}}]))}catch(e){this.add(a.schedule(Zd,0,{err:e,subject:c}))}}this.add(c.subscribe(r))}function Gd(e){var t=e.value,n=e.subject;n.next(t),n.complete()}function Zd(e){var t=e.err;e.subject.error(t)}var Qd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(t)},n.prototype.notifyError=function(e,t){this.destination.error(e)},n.prototype.notifyComplete=function(e){this.destination.complete()},n}(kh),Yd=function(t){function n(e,n,r){var i=t.call(this)||this;return i.parent=e,i.outerValue=n,i.outerIndex=r,i.index=0,i}return e.__extends(n,t),n.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},n.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},n.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},n}(kh);function Kd(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var Xd=Kd(),ef=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function tf(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}var nf=function(e){if(e&&"function"==typeof e[Ih])return r=e,function(e){var t=r[Ih]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)};if(ef(e))return ad(e);if(tf(e))return n=e,function(e){return n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,yh),e};if(e&&"function"==typeof e[Xd])return t=e,function(e){for(var n=t[Xd]();;){var r=void 0;try{r=n.next()}catch(t){return e.error(t),e}if(r.done){e.complete();break}if(e.next(r.value),e.closed)break}return"function"==typeof n.return&&e.add((function(){n.return&&n.return()})),e};var t,n,r,i=vh(e)?"an invalid object":"'"+e+"'";throw new TypeError("You provided "+i+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function rf(e,t,n,r,i){if(void 0===i&&(i=new Yd(e,n,r)),!i.closed)return t instanceof Nh?t.subscribe(i):nf(t)(i)}var of={};var sf=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new af(e,this.resultSelector))},e}(),af=function(t){function n(e,n){var r=t.call(this,e)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return e.__extends(n,t),n.prototype._next=function(e){this.values.push(of),this.observables.push(e)},n.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var n=0;n<t;n++){var r=e[n];this.add(rf(this,r,void 0,n))}}},n.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},n.prototype.notifyNext=function(e,t,n){var r=this.values,i=r[n],o=this.toRespond?i===of?--this.toRespond:this.toRespond:0;r[n]=t,0===o&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(r.slice()))},n.prototype._tryResultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},n}(Qd);function cf(e,t){if(null!=e){if(function(e){return e&&"function"==typeof e[Ih]}(e))return function(e,t){return new Nh((function(n){var r=new Sh;return r.add(t.schedule((function(){var i=e[Ih]();r.add(i.subscribe({next:function(e){r.add(t.schedule((function(){return n.next(e)})))},error:function(e){r.add(t.schedule((function(){return n.error(e)})))},complete:function(){r.add(t.schedule((function(){return n.complete()})))}}))}))),r}))}(e,t);if(tf(e))return function(e,t){return new Nh((function(n){var r=new Sh;return r.add(t.schedule((function(){return e.then((function(e){r.add(t.schedule((function(){n.next(e),r.add(t.schedule((function(){return n.complete()})))})))}),(function(e){r.add(t.schedule((function(){return n.error(e)})))}))}))),r}))}(e,t);if(ef(e))return cd(e,t);if(function(e){return e&&"function"==typeof e[Xd]}(e)||"string"==typeof e)return function(e,t){if(!e)throw new Error("Iterable cannot be null");return new Nh((function(n){var r,i=new Sh;return i.add((function(){r&&"function"==typeof r.return&&r.return()})),i.add(t.schedule((function(){r=e[Xd](),i.add(t.schedule((function(){if(!n.closed){var e,t;try{var i=r.next();e=i.value,t=i.done}catch(e){return void n.error(e)}t?n.complete():(n.next(e),this.schedule())}})))}))),i}))}(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}function uf(e,t){return t?cf(e,t):e instanceof Nh?e:new Nh(nf(e))}var lf=function(t){function n(e){var n=t.call(this)||this;return n.parent=e,n}return e.__extends(n,t),n.prototype._next=function(e){this.parent.notifyNext(e)},n.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},n.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},n}(kh),hf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype.notifyNext=function(e){this.destination.next(e)},n.prototype.notifyError=function(e){this.destination.error(e)},n.prototype.notifyComplete=function(){this.destination.complete()},n}(kh);function df(e,t){if(!t.closed){if(e instanceof Nh)return e.subscribe(t);var n;try{n=nf(e)(t)}catch(e){t.error(e)}return n}}function ff(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof t?function(r){return r.pipe(ff((function(n,r){return uf(e(n,r)).pipe(Hd((function(e,i){return t(n,e,r,i)})))}),n))}:("number"==typeof t&&(n=t),function(t){return t.lift(new pf(e,n))})}var pf=function(){function e(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new bf(e,this.project,this.concurrent))},e}(),bf=function(t){function n(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return e.__extends(n,t),n.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},n.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){return void this.destination.error(e)}this.active++,this._innerSub(t)},n.prototype._innerSub=function(e){var t=new lf(this),n=this.destination;n.add(t);var r=df(e,t);r!==t&&n.add(r)},n.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},n.prototype.notifyNext=function(e){this.destination.next(e)},n.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},n}(hf),yf=ff;function gf(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),ff(Rh,e)}function mf(){return gf(1)}function vf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return mf()(ld.apply(void 0,e))}function _f(e){return new Nh((function(t){var n;try{n=e()}catch(e){return void t.error(e)}return(n?uf(n):id()).subscribe(t)}))}function wf(e,t){return new Nh((function(n){var r=e.length;if(0!==r)for(var i=new Array(r),o=0,s=0,a=function(a){var c=uf(e[a]),u=!1;n.add(c.subscribe({next:function(e){u||(u=!0,s++),i[a]=e},error:function(e){return n.error(e)},complete:function(){++o!==r&&u||(s===r&&n.next(t?t.reduce((function(e,t,n){return e[t]=i[n],e}),{}):i),n.complete())}}))},c=0;c<r;c++)a(c);else n.complete()}))}function Sf(e,t,n,r,i){var o;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(e)){var s=e;e.addEventListener(t,n,i),o=function(){return s.removeEventListener(t,n,i)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(e)){var a=e;e.on(t,n),o=function(){return a.off(t,n)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(e)){var c=e;e.addListener(t,n),o=function(){return c.removeListener(t,n)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var u=0,l=e.length;u<l;u++)Sf(e[u],t,n,r,i)}r.add(o)}function Ef(e){var t=e.subscriber,n=e.condition;if(!t.closed){if(e.needIterate)try{e.state=e.iterate(e.state)}catch(e){return void t.error(e)}else e.needIterate=!0;if(n){var r=void 0;try{r=n(e.state)}catch(e){return void t.error(e)}if(!r)return void t.complete();if(t.closed)return}var i;try{i=e.resultSelector(e.state)}catch(e){return void t.error(e)}if(!t.closed&&(t.next(i),!t.closed))return this.schedule(e)}}function xf(e){return!mh(e)&&e-parseFloat(e)+1>=0}function kf(e){var t=e.subscriber,n=e.counter,r=e.period;t.next(n),this.schedule({subscriber:t,counter:n+1,period:r},r)}function Cf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Number.POSITIVE_INFINITY,r=null,i=e[e.length-1];return od(i)?(r=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(n=e.pop())):"number"==typeof i&&(n=e.pop()),null===r&&1===e.length&&e[0]instanceof Nh?e[0]:gf(n)(ud(e,r))}var Mf=new Nh(Bd);function If(e){var t=e.keys,n=e.index,r=e.subscriber,i=e.subscription,o=e.obj;if(!r.closed)if(n<t.length){var s=t[n];r.next([s,o[s]]),i.add(this.schedule({keys:t,index:n+1,subscriber:r,subscription:i,obj:o}))}else r.complete()}function Rf(e,t){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=e,n.thisArg=t,n}function Af(e,t){return function(n){return n.lift(new jf(e,t))}}var jf=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new Nf(e,this.predicate,this.thisArg))},e}(),Nf=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return e.__extends(n,t),n.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}t&&this.destination.next(e)},n}(kh);function Of(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){if(!mh(e[0]))return e[0];e=e[0]}return ud(e,void 0).lift(new Tf)}var Tf=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Pf(e))},e}(),Pf=function(t){function n(e){var n=t.call(this,e)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return e.__extends(n,t),n.prototype._next=function(e){this.observables.push(e)},n.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(var n=0;n<t&&!this.hasFirst;n++){var r=rf(this,e[n],void 0,n);this.subscriptions&&this.subscriptions.push(r),this.add(r)}this.observables=null}},n.prototype.notifyNext=function(e,t,n){if(!this.hasFirst){this.hasFirst=!0;for(var r=0;r<this.subscriptions.length;r++)if(r!==n){var i=this.subscriptions[r];i.unsubscribe(),this.remove(i)}this.subscriptions=null}this.destination.next(t)},n}(Qd);function Lf(e){var t=e.start,n=e.index,r=e.count,i=e.subscriber;n>=r?i.complete():(i.next(t),i.closed||(e.index=n+1,e.start=t+1,this.schedule(e)))}function Df(e,t,n){void 0===e&&(e=0);var r=-1;return xf(t)?r=Number(t)<1?1:Number(t):od(t)&&(n=t),od(n)||(n=jd),new Nh((function(t){var i=xf(e)?e:+e-n.now();return n.schedule(Bf,i,{index:0,period:r,subscriber:t})}))}function Bf(e){var t=e.index,n=e.period,r=e.subscriber;if(r.next(t),!r.closed){if(-1===n)return r.complete();e.index=t+1,this.schedule(e,n)}}function Ff(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return"function"==typeof n&&e.pop(),ud(e,void 0).lift(new Uf(n))}var Uf=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new Vf(e,this.resultSelector))},e}(),Vf=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.resultSelector=n,i.iterators=[],i.active=0,i.resultSelector="function"==typeof n?n:void 0,i}return e.__extends(n,t),n.prototype._next=function(e){var t=this.iterators;mh(e)?t.push(new Wf(e)):"function"==typeof e[Xd]?t.push(new Hf(e[Xd]())):t.push(new zf(this.destination,this,e))},n.prototype._complete=function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0!==t){this.active=t;for(var n=0;n<t;n++){var r=e[n];if(r.stillUnsubscribed)this.destination.add(r.subscribe());else this.active--}}else this.destination.complete()},n.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},n.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,n=this.destination,r=0;r<t;r++){if("function"==typeof(s=e[r]).hasValue&&!s.hasValue())return}var i=!1,o=[];for(r=0;r<t;r++){var s,a=(s=e[r]).next();if(s.hasCompleted()&&(i=!0),a.done)return void n.complete();o.push(a.value)}this.resultSelector?this._tryresultSelector(o):n.next(o),i&&n.complete()},n.prototype._tryresultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},n}(kh),Hf=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return Boolean(e&&e.done)},e}(),Wf=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[Xd]=function(){return this},e.prototype.next=function(e){var t=this.index++,n=this.array;return t<this.length?{value:n[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),zf=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.parent=n,i.observable=r,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return e.__extends(n,t),n.prototype[Xd]=function(){return this},n.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},n.prototype.hasValue=function(){return this.buffer.length>0},n.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},n.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},n.prototype.notifyNext=function(e){this.buffer.push(e),this.parent.checkIterators()},n.prototype.subscribe=function(){return df(this.observable,new lf(this))},n}(hf),qf=Object.freeze({__proto__:null,Observable:Nh,ConnectableObservable:Hh,GroupedObservable:Gh,observable:Ih,Subject:Dh,BehaviorSubject:Qh,ReplaySubject:gd,AsyncSubject:vd,asap:Rd,asapScheduler:Id,async:jd,asyncScheduler:Ad,queue:nd,queueScheduler:td,animationFrame:Pd,animationFrameScheduler:Td,VirtualTimeScheduler:Ld,VirtualAction:Dd,Scheduler:Xh,Subscription:Sh,Subscriber:kh,Notification:fd,get NotificationKind(){return sd},pipe:Ah,noop:Bd,identity:Rh,isObservable:function(e){return!!e&&(e instanceof Nh||"function"==typeof e.lift&&"function"==typeof e.subscribe)},ArgumentOutOfRangeError:Fd,EmptyError:Ud,ObjectUnsubscribedError:Th,UnsubscriptionError:wh,TimeoutError:Vd,bindCallback:function e(t,n,r){if(n){if(!od(n))return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return e(t,r).apply(void 0,i).pipe(Hd((function(e){return mh(e)?n.apply(void 0,e):n(e)})))};r=n}return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i,o=this,s={context:o,subject:i,callbackFunc:t,scheduler:r};return new Nh((function(n){if(r){var a={args:e,subscriber:n,params:s};return r.schedule(qd,0,a)}if(!i){i=new vd;try{t.apply(o,e.concat([function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.next(e.length<=1?e[0]:e),i.complete()}]))}catch(e){Mh(i)?i.error(e):console.warn(e)}}return i.subscribe(n)}))}},bindNodeCallback:function e(t,n,r){if(n){if(!od(n))return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return e(t,r).apply(void 0,i).pipe(Hd((function(e){return mh(e)?n.apply(void 0,e):n(e)})))};r=n}return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i={subject:void 0,args:e,callbackFunc:t,scheduler:r,context:this};return new Nh((function(n){var o=i.context,s=i.subject;if(r)return r.schedule(Jd,0,{params:i,subscriber:n,context:o});if(!s){s=i.subject=new vd;try{t.apply(o,e.concat([function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.shift();n?s.error(n):(s.next(e.length<=1?e[0]:e),s.complete())}]))}catch(e){Mh(s)?s.error(e):console.warn(e)}}return s.subscribe(n)}))}},combineLatest:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=void 0,r=void 0;return od(e[e.length-1])&&(r=e.pop()),"function"==typeof e[e.length-1]&&(n=e.pop()),1===e.length&&mh(e[0])&&(e=e[0]),ud(e,r).lift(new sf(n))},concat:vf,defer:_f,empty:id,forkJoin:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){var n=e[0];if(mh(n))return wf(n,null);if(vh(n)&&Object.getPrototypeOf(n)===Object.prototype){var r=Object.keys(n);return wf(r.map((function(e){return n[e]})),r)}}if("function"==typeof e[e.length-1]){var i=e.pop();return wf(e=1===e.length&&mh(e[0])?e[0]:e,null).pipe(Hd((function(e){return i.apply(void 0,e)})))}return wf(e,null)},from:uf,fromEvent:function e(t,n,r,i){return fh(r)&&(i=r,r=void 0),i?e(t,n,r).pipe(Hd((function(e){return mh(e)?i.apply(void 0,e):i(e)}))):new Nh((function(e){Sf(t,n,(function(t){arguments.length>1?e.next(Array.prototype.slice.call(arguments)):e.next(t)}),e,r)}))},fromEventPattern:function e(t,n,r){return r?e(t,n).pipe(Hd((function(e){return mh(e)?r.apply(void 0,e):r(e)}))):new Nh((function(e){var r,i=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1===t.length?t[0]:t)};try{r=t(i)}catch(t){return void e.error(t)}if(fh(n))return function(){return n(i,r)}}))},generate:function(e,t,n,r,i){var o,s;if(1==arguments.length){var a=e;s=a.initialState,t=a.condition,n=a.iterate,o=a.resultSelector||Rh,i=a.scheduler}else void 0===r||od(r)?(s=e,o=Rh,i=r):(s=e,o=r);return new Nh((function(e){var r=s;if(i)return i.schedule(Ef,0,{subscriber:e,iterate:n,condition:t,resultSelector:o,state:r});for(;;){if(t){var a=void 0;try{a=t(r)}catch(t){return void e.error(t)}if(!a){e.complete();break}}var c=void 0;try{c=o(r)}catch(t){return void e.error(t)}if(e.next(c),e.closed)break;try{r=n(r)}catch(t){return void e.error(t)}}}))},iif:function(e,t,n){return void 0===t&&(t=rd),void 0===n&&(n=rd),_f((function(){return e()?t:n}))},interval:function(e,t){return void 0===e&&(e=0),void 0===t&&(t=jd),(!xf(e)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=jd),new Nh((function(n){return n.add(t.schedule(kf,e,{subscriber:n,counter:0,period:e})),n}))},merge:Cf,never:function(){return Mf},of:ld,onErrorResumeNext:function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(0===t.length)return rd;var r=t[0],i=t.slice(1);return 1===t.length&&mh(r)?e.apply(void 0,r):new Nh((function(t){var n=function(){return t.add(e.apply(void 0,i).subscribe(t))};return uf(r).subscribe({next:function(e){t.next(e)},error:n,complete:n})}))},pairs:function(e,t){return new Nh(t?function(n){var r=Object.keys(e),i=new Sh;return i.add(t.schedule(If,0,{keys:r,index:0,subscriber:n,subscription:i,obj:e})),i}:function(t){for(var n=Object.keys(e),r=0;r<n.length&&!t.closed;r++){var i=n[r];e.hasOwnProperty(i)&&t.next([i,e[i]])}t.complete()})},partition:function(e,t,n){return[Af(t,n)(new Nh(nf(e))),Af(Rf(t,n))(new Nh(nf(e)))]},race:Of,range:function(e,t,n){return void 0===e&&(e=0),new Nh((function(r){void 0===t&&(t=e,e=0);var i=0,o=e;if(n)return n.schedule(Lf,0,{index:i,count:t,start:e,subscriber:r});for(;;){if(i++>=t){r.complete();break}if(r.next(o++),r.closed)break}}))},throwError:hd,timer:Df,using:function(e,t){return new Nh((function(n){var r,i;try{r=e()}catch(e){return void n.error(e)}try{i=t(r)}catch(e){return void n.error(e)}var o=(i?uf(i):rd).subscribe(n);return function(){o.unsubscribe(),r&&r.unsubscribe()}}))},zip:Ff,scheduled:cf,EMPTY:rd,NEVER:Mf,config:bh}),$f=e.getAugmentedNamespace(qf),Jf={};function Gf(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Gf(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Zf(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Gf(e))&&(r&&(r+=" "),r+=t);return r}var Qf,Yf,Kf,Xf,ep=Object.freeze({__proto__:null,clsx:Zf,default:Zf}),tp=e.getAugmentedNamespace(ep),np=0,rp=[],ip=[],op=Ml.__b,sp=Ml.__r,ap=Ml.diffed,cp=Ml.__c,up=Ml.unmount;function lp(e,t){Ml.__h&&Ml.__h(Yf,e,np||t),np=0;var n=Yf.__H||(Yf.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:ip}),n.__[e]}function hp(e){return np=1,dp(wp,e)}function dp(e,t,n){var r=lp(Qf++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):wp(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Yf,!Yf.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!o||o.call(this,e,t,n))};Yf.u=!0;var o=Yf.shouldComponentUpdate,s=Yf.componentWillUpdate;Yf.componentWillUpdate=function(e,t,n){if(this.__e){var r=o;o=void 0,i(e,t,n),o=r}s&&s.call(this,e,t,n)},Yf.shouldComponentUpdate=i}return r.__N||r.__}function fp(e,t){var n=lp(Qf++,4);!Ml.__s&&_p(n.__H,t)&&(n.__=e,n.i=t,Yf.__h.push(n))}function pp(e,t){var n=lp(Qf++,7);return _p(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function bp(){for(var e;e=rp.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(mp),e.__H.__h.forEach(vp),e.__H.__h=[]}catch(t){e.__H.__h=[],Ml.__e(t,e.__v)}}Ml.__b=function(e){Yf=null,op&&op(e)},Ml.__r=function(e){sp&&sp(e),Qf=0;var t=(Yf=e.__c).__H;t&&(Kf===Yf?(t.__h=[],Yf.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=ip,e.__N=e.i=void 0}))):(t.__h.forEach(mp),t.__h.forEach(vp),t.__h=[])),Kf=Yf},Ml.diffed=function(e){ap&&ap(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==rp.push(t)&&Xf===Ml.requestAnimationFrame||((Xf=Ml.requestAnimationFrame)||gp)(bp)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==ip&&(e.__=e.__V),e.i=void 0,e.__V=ip}))),Kf=Yf=null},Ml.__c=function(e,t){t.some((function(e){try{e.__h.forEach(mp),e.__h=e.__h.filter((function(e){return!e.__||vp(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Ml.__e(n,e.__v)}})),cp&&cp(e,t)},Ml.unmount=function(e){up&&up(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{mp(e)}catch(e){t=e}})),n.__H=void 0,t&&Ml.__e(t,n.__v))};var yp="function"==typeof requestAnimationFrame;function gp(e){var t,n=function(){clearTimeout(r),yp&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);yp&&(t=requestAnimationFrame(n))}function mp(e){var t=Yf,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Yf=t}function vp(e){var t=Yf;e.__c=e.__(),Yf=t}function _p(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function wp(e,t){return"function"==typeof t?t(e):t}var Sp=Object.freeze({__proto__:null,useCallback:function(e,t){return np=8,pp((function(){return e}),t)},useContext:function(e){var t=Yf.context[e.__c],n=lp(Qf++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Yf)),t.props.value):e.__},useDebugValue:function(e,t){Ml.useDebugValue&&Ml.useDebugValue(t?t(e):e)},useEffect:function(e,t){var n=lp(Qf++,3);!Ml.__s&&_p(n.__H,t)&&(n.__=e,n.i=t,Yf.__H.__h.push(n))},useErrorBoundary:function(e){var t=lp(Qf++,10),n=hp();return t.__=e,Yf.componentDidCatch||(Yf.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]},useId:function(){var e=lp(Qf++,11);if(!e.__){for(var t=Yf.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__},useImperativeHandle:function(e,t,n){np=6,fp((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))},useLayoutEffect:fp,useMemo:pp,useReducer:dp,useRef:function(e){return np=5,pp((function(){return{current:e}}),[])},useState:hp}),Ep=e.getAugmentedNamespace(Sp),xp={},kp={};Object.defineProperty(kp,"__esModule",{value:!0}),kp.LIB_VERSION=void 0,kp.LIB_VERSION="3.6.6";var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0}),Cp.CloseIcon=void 0;const Mp=dh;Cp.CloseIcon=function(e){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"},e),(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 Ip={};Object.defineProperty(Ip,"__esModule",{value:!0}),Ip.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0}),Rp.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.QRCodeIcon=void 0;const jp=dh;Ap.QRCodeIcon=function(e){return(0,jp.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,jp.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,jp.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,jp.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,jp.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,jp.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,jp.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,jp.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,jp.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,jp.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))};var Np={};Object.defineProperty(Np,"__esModule",{value:!0});Np.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 Op={};Object.defineProperty(Op,"__esModule",{value:!0}),Op.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 Tp={};Object.defineProperty(Tp,"__esModule",{value:!0}),Tp.StatusDotIcon=void 0;const Pp=dh;Tp.StatusDotIcon=function(e){return(0,Pp.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,Pp.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 Lp={};function Dp(e){this.mode=Fp.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,n=this.data.length;t<n;t++){var r=[],i=this.data.charCodeAt(t);i>65536?(r[0]=240|(1835008&i)>>>18,r[1]=128|(258048&i)>>>12,r[2]=128|(4032&i)>>>6,r[3]=128|63&i):i>2048?(r[0]=224|(61440&i)>>>12,r[1]=128|(4032&i)>>>6,r[2]=128|63&i):i>128?(r[0]=192|(1984&i)>>>6,r[1]=128|63&i):r[0]=i,this.parsedData.push(r)}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 Bp(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Dp.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,n=this.parsedData.length;t<n;t++)e.put(this.parsedData[t],8)}},Bp.prototype={addData:function(e){var t=new Dp(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++)this.modules[n][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=Bp.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(this.modules[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},getBestMaskPattern:function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=Kp.getLostPoint(this);(0==n||e>r)&&(e=r,t=n)}return t},createMovieClip:function(e,t,n){var r=e.createEmptyMovieClip(t,n);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]&&(r.beginFill(0,100),r.moveTo(a,o),r.lineTo(a+1,o),r.lineTo(a+1,o+1),r.lineTo(a,o+1),r.endFill())}return r},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)null==this.modules[6][t]&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=Kp.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var n=0;n<e.length;n++){var r=e[t],i=e[n];if(null==this.modules[r][i])for(var o=-2;o<=2;o++)for(var s=-2;s<=2;s++)this.modules[r+o][i+s]=-2==o||2==o||-2==s||2==s||0==o&&0==s}},setupTypeNumber:function(e){for(var t=Kp.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var r=!e&&1==(t>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(n=0;n<18;n++){r=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},setupTypeInfo:function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=Kp.getBCHTypeInfo(n),i=0;i<15;i++){var o=!e&&1==(r>>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=!e&&1==(r>>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]=!e},mapData:function(e,t){for(var n=-1,r=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[r][s-a]){var c=!1;o<e.length&&(c=1==(e[o]>>>i&1)),Kp.getMask(t,r,s-a)&&(c=!c),this.modules[r][s-a]=c,-1==--i&&(o++,i=7)}if((r+=n)<0||this.moduleCount<=r){r-=n,n=-n;break}}}},Bp.PAD0=236,Bp.PAD1=17,Bp.createData=function(e,t,n){for(var r=nb.getRSBlocks(e,t),i=new rb,o=0;o<n.length;o++){var s=n[o];i.put(s.mode,4),i.put(s.getLength(),Kp.getLengthInBits(s.mode,e)),s.write(i)}var a=0;for(o=0;o<r.length;o++)a+=r[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(Bp.PAD0,8),i.getLengthInBits()>=8*a));)i.put(Bp.PAD1,8);return Bp.createBytes(i,r)},Bp.createBytes=function(e,t){for(var n=0,r=0,i=0,o=new Array(t.length),s=new Array(t.length),a=0;a<t.length;a++){var c=t[a].dataCount,u=t[a].totalCount-c;r=Math.max(r,c),i=Math.max(i,u),o[a]=new Array(c);for(var l=0;l<o[a].length;l++)o[a][l]=255&e.buffer[l+n];n+=c;var h=Kp.getErrorCorrectPolynomial(u),d=new tb(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<t.length;l++)p+=t[l].totalCount;var b=new Array(p),y=0;for(l=0;l<r;l++)for(a=0;a<t.length;a++)l<o[a].length&&(b[y++]=o[a][l]);for(l=0;l<i;l++)for(a=0;a<t.length;a++)l<s[a].length&&(b[y++]=s[a][l]);return b};for(var Fp={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Up=1,Vp=0,Hp=3,Wp=2,zp=0,qp=1,$p=2,Jp=3,Gp=4,Zp=5,Qp=6,Yp=7,Kp={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(e){for(var t=e<<10;Kp.getBCHDigit(t)-Kp.getBCHDigit(Kp.G15)>=0;)t^=Kp.G15<<Kp.getBCHDigit(t)-Kp.getBCHDigit(Kp.G15);return(e<<10|t)^Kp.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;Kp.getBCHDigit(t)-Kp.getBCHDigit(Kp.G18)>=0;)t^=Kp.G18<<Kp.getBCHDigit(t)-Kp.getBCHDigit(Kp.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return Kp.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case zp:return(t+n)%2==0;case qp:return t%2==0;case $p:return n%3==0;case Jp:return(t+n)%3==0;case Gp:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case Zp:return t*n%2+t*n%3==0;case Qp:return(t*n%2+t*n%3)%2==0;case Yp:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new tb([1],0),n=0;n<e;n++)t=t.multiply(new tb([1,Xp.gexp(n)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case Fp.MODE_NUMBER:return 10;case Fp.MODE_ALPHA_NUM:return 9;case Fp.MODE_8BIT_BYTE:case Fp.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case Fp.MODE_NUMBER:return 12;case Fp.MODE_ALPHA_NUM:return 11;case Fp.MODE_8BIT_BYTE:return 16;case Fp.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else{if(!(t<41))throw new Error("type:"+t);switch(e){case Fp.MODE_NUMBER:return 14;case Fp.MODE_ALPHA_NUM:return 13;case Fp.MODE_8BIT_BYTE:return 16;case Fp.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}}},getLostPoint:function(e){for(var t=e.getModuleCount(),n=0,r=0;r<t;r++)for(var i=0;i<t;i++){for(var o=0,s=e.isDark(r,i),a=-1;a<=1;a++)if(!(r+a<0||t<=r+a))for(var c=-1;c<=1;c++)i+c<0||t<=i+c||0==a&&0==c||s==e.isDark(r+a,i+c)&&o++;o>5&&(n+=3+o-5)}for(r=0;r<t-1;r++)for(i=0;i<t-1;i++){var u=0;e.isDark(r,i)&&u++,e.isDark(r+1,i)&&u++,e.isDark(r,i+1)&&u++,e.isDark(r+1,i+1)&&u++,0!=u&&4!=u||(n+=3)}for(r=0;r<t;r++)for(i=0;i<t-6;i++)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(i=0;i<t;i++)for(r=0;r<t-6;r++)e.isDark(r,i)&&!e.isDark(r+1,i)&&e.isDark(r+2,i)&&e.isDark(r+3,i)&&e.isDark(r+4,i)&&!e.isDark(r+5,i)&&e.isDark(r+6,i)&&(n+=40);var l=0;for(i=0;i<t;i++)for(r=0;r<t;r++)e.isDark(r,i)&&l++;return n+=10*(Math.abs(100*l/t/t-50)/5)}},Xp={glog:function(e){if(e<1)throw new Error("glog("+e+")");return Xp.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return Xp.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},eb=0;eb<8;eb++)Xp.EXP_TABLE[eb]=1<<eb;for(eb=8;eb<256;eb++)Xp.EXP_TABLE[eb]=Xp.EXP_TABLE[eb-4]^Xp.EXP_TABLE[eb-5]^Xp.EXP_TABLE[eb-6]^Xp.EXP_TABLE[eb-8];for(eb=0;eb<255;eb++)Xp.LOG_TABLE[Xp.EXP_TABLE[eb]]=eb;function tb(e,t){if(null==e.length)throw new Error(e.length+"/"+t);for(var n=0;n<e.length&&0==e[n];)n++;this.num=new Array(e.length-n+t);for(var r=0;r<e.length-n;r++)this.num[r]=e[r+n]}function nb(e,t){this.totalCount=e,this.dataCount=t}function rb(){this.buffer=[],this.length=0}tb.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),n=0;n<this.getLength();n++)for(var r=0;r<e.getLength();r++)t[n+r]^=Xp.gexp(Xp.glog(this.get(n))+Xp.glog(e.get(r)));return new tb(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=Xp.glog(this.get(0))-Xp.glog(e.get(0)),n=new Array(this.getLength()),r=0;r<this.getLength();r++)n[r]=this.get(r);for(r=0;r<e.getLength();r++)n[r]^=Xp.gexp(Xp.glog(e.get(r))+t);return new tb(n,0).mod(e)}},nb.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]],nb.getRSBlocks=function(e,t){var n=nb.getRsBlockTable(e,t);if(null==n)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var r=n.length/3,i=[],o=0;o<r;o++)for(var s=n[3*o+0],a=n[3*o+1],c=n[3*o+2],u=0;u<s;u++)i.push(new nb(a,c));return i},nb.getRsBlockTable=function(e,t){switch(t){case Up:return nb.RS_BLOCK_TABLE[4*(e-1)+0];case Vp:return nb.RS_BLOCK_TABLE[4*(e-1)+1];case Hp:return nb.RS_BLOCK_TABLE[4*(e-1)+2];case Wp:return nb.RS_BLOCK_TABLE[4*(e-1)+3];default:return}},rb.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var ib=[[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 ob(e){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 e&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];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 n=this.options.content,r=function(e,t){for(var n=function(e){var t=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=e?3:0)}(e),r=1,i=0,o=0,s=ib.length;o<=s;o++){var a=ib[o];if(!a)throw new Error("Content too long: expected "+i+" but got "+n);switch(t){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: "+t)}if(n<=i)break;r++}if(r>ib.length)throw new Error("Content too long");return r}(n,this.options.ecl),i=function(e){switch(e){case"L":return Up;case"M":return Vp;case"Q":return Hp;case"H":return Wp;default:throw new Error("Unknwon error correction level: "+e)}}(this.options.ecl);this.qrcode=new Bp(r,i),this.qrcode.addData(n),this.qrcode.make()}ob.prototype.svg=function(e){var t=this.options||{},n=this.qrcode.modules;void 0===e&&(e={container:t.container||"svg"});for(var r=void 0===t.pretty||!!t.pretty,i=r?" ":"",o=r?"\r\n":"",s=t.width,a=t.height,c=n.length,u=s/(c+2*t.padding),l=a/(c+2*t.padding),h=void 0!==t.join&&!!t.join,d=void 0!==t.swap&&!!t.swap,f=void 0===t.xmlDeclaration||!!t.xmlDeclaration,p=void 0!==t.predefined&&!!t.predefined,b=p?i+'<defs><path id="qrmodule" d="M0 0 h'+l+" v"+u+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+o:"",y=i+'<rect x="0" y="0" width="'+s+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+o,g="",m="",v=0;v<c;v++)for(var _=0;_<c;_++){if(n[_][v]){var w=_*u+t.padding*u,S=v*l+t.padding*l;if(d){var E=w;w=S,S=E}if(h){var x=u+w,k=l+S;w=Number.isInteger(w)?Number(w):w.toFixed(2),S=Number.isInteger(S)?Number(S):S.toFixed(2),x=Number.isInteger(x)?Number(x):x.toFixed(2),m+="M"+w+","+S+" V"+(k=Number.isInteger(k)?Number(k):k.toFixed(2))+" H"+x+" V"+S+" H"+w+" Z "}else g+=p?i+'<use x="'+w.toString()+'" y="'+S.toString()+'" href="#qrmodule" />'+o:i+'<rect x="'+w.toString()+'" y="'+S.toString()+'" width="'+u+'" height="'+l+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+o}}h&&(g=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+m+'" />');let C="";if(void 0!==this.options.image&&this.options.image.svg){const e=s*this.options.image.width/100,t=a*this.options.image.height/100;C+=`<svg x="${s/2-e/2}" y="${a/2-t/2}" width="${e}" height="${t}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,C+=this.options.image.svg+o,C+="</svg>"}var M="";switch(e.container){case"svg":f&&(M+='<?xml version="1.0" standalone="yes"?>'+o),M+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+s+'" height="'+a+'">'+o,M+=b+y+g,M+=C,M+="</svg>";break;case"svg-viewbox":f&&(M+='<?xml version="1.0" standalone="yes"?>'+o),M+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+s+" "+a+'">'+o,M+=b+y+g,M+=C,M+="</svg>";break;case"g":M+='<g width="'+s+'" height="'+a+'">'+o,M+=b+y+g,M+=C,M+="</g>";break;default:M+=(b+y+g+C).replace(/^\s+/,"")}return M};var sb=ob,ab=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Lp,"__esModule",{value:!0}),Lp.QRCode=void 0;const cb=dh,ub=Ep,lb=ab(sb);Lp.QRCode=e=>{const[t,n]=(0,ub.useState)("");return(0,ub.useEffect)((()=>{var t,r;const i=new lb.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:null!==(t=e.width)&&void 0!==t?t:256,height:null!==(r=e.height)&&void 0!==r?r:256,padding:0,image:e.image}),o=Buffer.from(i.svg(),"utf8").toString("base64");n(`data:image/svg+xml;base64,${o}`)})),t?(0,cb.h)("img",{src:t,alt:"QR Code"}):null};var hb={},db={};Object.defineProperty(db,"__esModule",{value:!0}),db.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 fb=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hb,"__esModule",{value:!0}),hb.Spinner=void 0;const pb=dh,bb=fb(db);hb.Spinner=e=>{var t;const n=null!==(t=e.size)&&void 0!==t?t:64,r=e.color||"#000";return(0,pb.h)("div",{class:"-cbwsdk-spinner"},(0,pb.h)("style",null,bb.default),(0,pb.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:n,height:n}},(0,pb.h)("circle",{style:{cx:50,cy:50,r:45,stroke:r}})))};var yb={};Object.defineProperty(yb,"__esModule",{value:!0}),yb.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 gb=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xp,"__esModule",{value:!0}),xp.CoinbaseAppSteps=xp.CoinbaseWalletSteps=xp.ConnectItem=xp.ConnectContent=void 0;const mb=gb(tp),vb=dh,_b=Ep,wb=ct,Sb=kp,Eb=Cp,xb=gb(Ip),kb=gb(Rp),Cb=Ap,Mb=gb(Np),Ib=gb(Op),Rb=Tp,Ab=Lp,jb=hb,Nb=gb(yb),Ob={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:kb.default,steps:Lb},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:xb.default,steps:Db}},Tb=e=>"light"===e?"#FFFFFF":"#0A0B0D";function Pb({title:e,description:t,icon:n,selected:r,theme:i,onClick:o}){return(0,vb.h)("div",{onClick:o,class:(0,mb.default)("-cbwsdk-connect-item",i,{selected:r})},(0,vb.h)("div",null,(0,vb.h)("img",{src:n,alt:e})),(0,vb.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,vb.h)("h3",{class:"-cbwsdk-connect-item-title"},e),(0,vb.h)("p",{class:"-cbwsdk-connect-item-description"},t)))}function Lb({theme:e}){return(0,vb.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,vb.h)("li",{class:(0,mb.default)("-cbwsdk-wallet-steps-item",e)},(0,vb.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,vb.h)("li",{class:(0,mb.default)("-cbwsdk-wallet-steps-item",e)},(0,vb.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,vb.h)("span",null,"Tap ",(0,vb.h)("strong",null,"Scan")," "),(0,vb.h)("span",{class:(0,mb.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,vb.h)(Cb.QRCodeIcon,{fill:Tb(e)})))))}function Db({theme:e}){return(0,vb.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,vb.h)("li",{class:(0,mb.default)("-cbwsdk-wallet-steps-item",e)},(0,vb.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,vb.h)("li",{class:(0,mb.default)("-cbwsdk-wallet-steps-item",e)},(0,vb.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,vb.h)("span",null,"Tap ",(0,vb.h)("strong",null,"More")),(0,vb.h)("span",{class:(0,mb.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,vb.h)(Rb.StatusDotIcon,{fill:Tb(e)})),(0,vb.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,vb.h)("strong",null,"Scan")),(0,vb.h)("span",{class:(0,mb.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,vb.h)(Cb.QRCodeIcon,{fill:Tb(e)})))))}xp.ConnectContent=function(e){const{theme:t}=e,[n,r]=(0,_b.useState)("coinbase-wallet-app"),i=(0,_b.useCallback)((e=>{r(e)}),[]),o=(0,wb.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId);if(!n)return null;const s=Ob[n].steps,a="coinbase-app"===n;return(0,vb.h)("div",{"data-testid":"connect-content",class:(0,mb.default)("-cbwsdk-connect-content",t)},(0,vb.h)("style",null,Nb.default),(0,vb.h)("div",{class:"-cbwsdk-connect-content-header"},(0,vb.h)("h2",{class:(0,mb.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with one of our mobile apps"),e.onCancel&&(0,vb.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,vb.h)(Eb.CloseIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,vb.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,vb.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,vb.h)("div",null,Object.entries(Ob).map((([e,r])=>(0,vb.h)(Pb,{key:e,title:r.title,description:r.description,icon:r.icon,selected:n===e,onClick:()=>i(e),theme:t})))),a&&(0,vb.h)("div",{class:(0,mb.default)("-cbwsdk-connect-content-update-app",t)},"Don’t see a ",(0,vb.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,vb.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,vb.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,vb.h)(Ab.QRCode,{content:o,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:(c=n,"coinbase-app"===c?Mb.default:Ib.default),width:25,height:25}}),(0,vb.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Sb.LIB_VERSION}),(0,vb.h)("input",{type:"hidden",value:o})),(0,vb.h)(s,{theme:t}),!e.isConnected&&(0,vb.h)("div",{"data-testid":"connecting-spinner",class:(0,mb.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,vb.h)(jb.Spinner,{size:36,color:"dark"===t?"#FFF":"#000"}),(0,vb.h)("p",null,"Connecting...")))));var c},xp.ConnectItem=Pb,xp.CoinbaseWalletSteps=Lb,xp.CoinbaseAppSteps=Db;var Bb={},Fb={};Object.defineProperty(Fb,"__esModule",{value:!0}),Fb.ArrowLeftIcon=void 0;const Ub=dh;Fb.ArrowLeftIcon=function(e){return(0,Ub.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ub.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 Vb={};Object.defineProperty(Vb,"__esModule",{value:!0}),Vb.LaptopIcon=void 0;const Hb=dh;Vb.LaptopIcon=function(e){return(0,Hb.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Hb.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Hb.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 Wb={};Object.defineProperty(Wb,"__esModule",{value:!0}),Wb.SafeIcon=void 0;const zb=dh;Wb.SafeIcon=function(e){return(0,zb.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,zb.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 qb={};Object.defineProperty(qb,"__esModule",{value:!0}),qb.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 $b=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bb,"__esModule",{value:!0}),Bb.TryExtensionContent=void 0;const Jb=$b(tp),Gb=dh,Zb=Ep,Qb=Fb,Yb=Vb,Kb=Wb,Xb=$b(qb);Bb.TryExtensionContent=function({theme:e}){const[t,n]=(0,Zb.useState)(!1),r=(0,Zb.useCallback)((()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")}),[]),i=(0,Zb.useCallback)((()=>{t?window.location.reload():(r(),n(!0))}),[r,t]);return(0,Gb.h)("div",{class:(0,Jb.default)("-cbwsdk-try-extension",e)},(0,Gb.h)("style",null,Xb.default),(0,Gb.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Gb.h)("h3",{class:(0,Jb.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Gb.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Gb.h)("button",{class:(0,Jb.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,Gb.h)("div",null,!t&&(0,Gb.h)(Qb.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:"light"===e?"#0052FF":"#588AF5"})))),(0,Gb.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Gb.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Gb.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Gb.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Gb.h)("span",{class:(0,Jb.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Gb.h)(Yb.LaptopIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,Gb.h)("div",{class:(0,Jb.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Gb.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Gb.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Gb.h)("span",{class:(0,Jb.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Gb.h)(Kb.SafeIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,Gb.h)("div",{class:(0,Jb.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))};var ey={};Object.defineProperty(ey,"__esModule",{value:!0}),ey.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 ty=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jf,"__esModule",{value:!0}),Jf.ConnectDialog=void 0;const ny=ty(tp),ry=dh,iy=Ep,oy=xp,sy=Bb,ay=ty(ey);Jf.ConnectDialog=e=>{const{isOpen:t,darkMode:n}=e,[r,i]=(0,iy.useState)(!t),[o,s]=(0,iy.useState)(!t);(0,iy.useEffect)((()=>{const e=[window.setTimeout((()=>{s(!t)}),10)];return t?i(!1):e.push(window.setTimeout((()=>{i(!0)}),360)),()=>{e.forEach(window.clearTimeout)}}),[e.isOpen]);const a=n?"dark":"light";return(0,ry.h)("div",{class:(0,ny.default)("-cbwsdk-connect-dialog-container",r&&"-cbwsdk-connect-dialog-container-hidden")},(0,ry.h)("style",null,ay.default),(0,ry.h)("div",{class:(0,ny.default)("-cbwsdk-connect-dialog-backdrop",a,o&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,ry.h)("div",{class:"-cbwsdk-connect-dialog"},(0,ry.h)("div",{class:(0,ny.default)("-cbwsdk-connect-dialog-box",o&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,ry.h)(oy.ConnectContent,{theme:a,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,ry.h)(sy.TryExtensionContent,{theme:a}))))},Object.defineProperty(Ll,"__esModule",{value:!0}),Ll.LinkFlow=void 0;const cy=dh,uy=$f,ly=Jf;Ll.LinkFlow=class{constructor(e){this.extensionUI$=new uy.BehaviorSubject({}),this.subscriptions=new uy.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection,this.connected$=e.connected$,this.chainId$=e.chainId$}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe((e=>{this.isConnected!==e&&(this.isConnected=e,this.render())}))),this.subscriptions.add(this.chainId$.subscribe((e=>{this.chainId!==e&&(this.chainId=e,this.render())})))}detach(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,cy.render)(null,this.root),null===(e=this.root.parentElement)||void 0===e||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const e=this.extensionUI$.subscribe((()=>{this.root&&(0,cy.render)((0,cy.h)(ly.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(e)}};var hy={},dy={};Object.defineProperty(dy,"__esModule",{value:!0}),dy.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(t){var n=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=n(tp),i=dh,o=Ep,s=n(dy);function a(e){return"coinbase-app"===e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}t.Snackbar=class{constructor(e){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=e.darkMode}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){const t=this.nextItemKey++;return this.items.set(t,e),this.render(),()=>{this.items.delete(t),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,i.render)((0,i.h)("div",null,(0,i.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map((([e,n])=>(0,i.h)(t.SnackbarInstance,Object.assign({},n,{key:e})))))),this.root)}};t.SnackbarContainer=e=>(0,i.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,i.h)("style",null,s.default),(0,i.h)("div",{class:"-cbwsdk-snackbar"},e.children));t.SnackbarInstance=({autoExpand:e,message:t,menuItems:n,appSrc:s})=>{const[c,u]=(0,o.useState)(!0),[l,h]=(0,o.useState)(null!=e&&e);(0,o.useEffect)((()=>{const e=[window.setTimeout((()=>{u(!1)}),1),window.setTimeout((()=>{h(!0)}),1e4)];return()=>{e.forEach(window.clearTimeout)}}));return(0,i.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",c&&"-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"},t),(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"}))),n&&n.length>0&&(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},n.map(((e,t)=>(0,i.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,i.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,i.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info))))))}}(hy);var fy={},py={};Object.defineProperty(py,"__esModule",{value:!0}),py.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 by=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fy,"__esModule",{value:!0}),fy.injectCssReset=void 0;const yy=by(py);fy.injectCssReset=function(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(yy.default)),document.documentElement.appendChild(e)},Object.defineProperty(Pl,"__esModule",{value:!0}),Pl.WalletSDKUI=void 0;const gy=Ll,my=hy,vy=fy;Pl.WalletSDKUI=class{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new my.Snackbar({darkMode:e.darkMode}),this.linkFlow=new gy.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,connected$:e.connected$,chainId$:e.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.linkFlow.attach(t),this.snackbar.attach(t),this.attached=!0,(0,vy.injectCssReset)()}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(e){}watchAsset(e){}switchEthereumChain(e){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(e){}signEthereumTransaction(e){}submitEthereumTransaction(e){}ethereumAddressFromSignedMessage(e){}showConnecting(e){let t;return t=e.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:e.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:e.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:e.onResetConnection}]},this.snackbar.presentItem(t)}setAppSrc(e){this.appSrc=e}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(e){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return null!==(e=this.standalone)&&void 0!==e&&e}};var _y,wy={},Sy={};function Ey(e,t,n){if(!n||typeof n.value!==_y.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+t+"> is not a method!");return{configurable:_y.boolTrue,get:function(){var e=n.value.bind(this);return Object.defineProperty(this,t,{value:e,configurable:_y.boolTrue,writable:_y.boolTrue}),e}}}function xy(e){return function(t){return t.lift(new ky(e))}}Object.defineProperty(Sy,"__esModule",{value:!0}),function(e){e.typeOfFunction="function",e.boolTrue=!0}(_y||(_y={})),Sy.bind=Ey,Sy.default=Ey;var ky=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new Cy(e,this.durationSelector))},e}(),Cy=function(t){function n(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return e.__extends(n,t),n.prototype._next=function(e){if(this.value=e,this.hasValue=!0,!this.throttled){var t=void 0;try{t=(0,this.durationSelector)(e)}catch(e){return this.destination.error(e)}var n=df(t,new lf(this));!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},n.prototype.clearThrottle=function(){var e=this,t=e.value,n=e.hasValue,r=e.throttled;r&&(this.remove(r),this.throttled=void 0,r.unsubscribe()),n&&(this.value=void 0,this.hasValue=!1,this.destination.next(t))},n.prototype.notifyNext=function(){this.clearThrottle()},n.prototype.notifyComplete=function(){this.clearThrottle()},n}(hf);var My=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e,t){return t.subscribe(new Iy(e,this.closingNotifier))},e}(),Iy=function(t){function n(e,n){var r=t.call(this,e)||this;return r.buffer=[],r.add(df(n,new lf(r))),r}return e.__extends(n,t),n.prototype._next=function(e){this.buffer.push(e)},n.prototype.notifyNext=function(){var e=this.buffer;this.buffer=[],this.destination.next(e)},n}(hf);var Ry=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t,this.subscriberClass=t&&e!==t?jy:Ay}return e.prototype.call=function(e,t){return t.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},e}(),Ay=function(t){function n(e,n){var r=t.call(this,e)||this;return r.bufferSize=n,r.buffer=[],r}return e.__extends(n,t),n.prototype._next=function(e){var t=this.buffer;t.push(e),t.length==this.bufferSize&&(this.destination.next(t),this.buffer=[])},n.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},n}(kh),jy=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.bufferSize=n,i.startBufferEvery=r,i.buffers=[],i.count=0,i}return e.__extends(n,t),n.prototype._next=function(e){var t=this,n=t.bufferSize,r=t.startBufferEvery,i=t.buffers,o=t.count;this.count++,o%r==0&&i.push([]);for(var s=i.length;s--;){var a=i[s];a.push(e),a.length===n&&(i.splice(s,1),this.destination.next(a))}},n.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var r=e.shift();r.length>0&&n.next(r)}t.prototype._complete.call(this)},n}(kh);var Ny=function(){function e(e,t,n,r){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new Ty(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),Oy=function(){return function(){this.buffer=[]}}(),Ty=function(t){function n(e,n,r,i,o){var s=t.call(this,e)||this;s.bufferTimeSpan=n,s.bufferCreationInterval=r,s.maxBufferSize=i,s.scheduler=o,s.contexts=[];var a=s.openContext();if(s.timespanOnly=null==r||r<0,s.timespanOnly){var c={subscriber:s,context:a,bufferTimeSpan:n};s.add(a.closeAction=o.schedule(Py,n,c))}else{var u={subscriber:s,context:a},l={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:s,scheduler:o};s.add(a.closeAction=o.schedule(Dy,n,u)),s.add(o.schedule(Ly,r,l))}return s}return e.__extends(n,t),n.prototype._next=function(e){for(var t,n=this.contexts,r=n.length,i=0;i<r;i++){var o=n[i],s=o.buffer;s.push(e),s.length==this.maxBufferSize&&(t=o)}t&&this.onBufferFull(t)},n.prototype._error=function(e){this.contexts.length=0,t.prototype._error.call(this,e)},n.prototype._complete=function(){for(var e=this.contexts,n=this.destination;e.length>0;){var r=e.shift();n.next(r.buffer)}t.prototype._complete.call(this)},n.prototype._unsubscribe=function(){this.contexts=null},n.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:e,bufferTimeSpan:n};this.add(e.closeAction=this.scheduler.schedule(Py,n,r))}},n.prototype.openContext=function(){var e=new Oy;return this.contexts.push(e),e},n.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},n}(kh);function Py(e){var t=e.subscriber,n=e.context;n&&t.closeContext(n),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function Ly(e){var t=e.bufferCreationInterval,n=e.bufferTimeSpan,r=e.subscriber,i=e.scheduler,o=r.openContext();r.closed||(r.add(o.closeAction=i.schedule(Dy,n,{subscriber:r,context:o})),this.schedule(e,t))}function Dy(e){var t=e.subscriber,n=e.context;t.closeContext(n)}var By=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new Fy(e,this.openings,this.closingSelector))},e}(),Fy=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.closingSelector=r,i.contexts=[],i.add(rf(i,n)),i}return e.__extends(n,t),n.prototype._next=function(e){for(var t=this.contexts,n=t.length,r=0;r<n;r++)t[r].buffer.push(e)},n.prototype._error=function(e){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},n.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},n.prototype.notifyNext=function(e,t){e?this.closeBuffer(e):this.openBuffer(t)},n.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},n.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e);t&&this.trySubscribe(t)}catch(e){this._error(e)}},n.prototype.closeBuffer=function(e){var t=this.contexts;if(t&&e){var n=e.buffer,r=e.subscription;this.destination.next(n),t.splice(t.indexOf(e),1),this.remove(r),r.unsubscribe()}},n.prototype.trySubscribe=function(e){var t=this.contexts,n=new Sh,r={buffer:[],subscription:n};t.push(r);var i=rf(this,e,r);!i||i.closed?this.closeBuffer(r):(i.context=r,this.add(i),n.add(i))},n}(Qd);var Uy=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new Vy(e,this.closingSelector))},e}(),Vy=function(t){function n(e,n){var r=t.call(this,e)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return e.__extends(n,t),n.prototype._next=function(e){this.buffer.push(e)},n.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},n.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},n.prototype.notifyNext=function(){this.openBuffer()},n.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},n.prototype.openBuffer=function(){var e=this.closingSubscription;e&&(this.remove(e),e.unsubscribe());var t,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{t=(0,this.closingSelector)()}catch(e){return this.error(e)}e=new Sh,this.closingSubscription=e,this.add(e),this.subscribing=!0,e.add(df(t,new lf(this))),this.subscribing=!1},n}(hf);var Hy=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new Wy(e,this.selector,this.caught))},e}(),Wy=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.selector=n,i.caught=r,i}return e.__extends(n,t),n.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var r=new lf(this);this.add(r);var i=df(n,r);i!==r&&this.add(i)}},n}(hf);function zy(e,t){return ff(e,t,1)}var qy=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new $y(e,this.predicate,this.source))},e}(),$y=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.count=0,i.index=0,i}return e.__extends(n,t),n.prototype._next=function(e){this.predicate?this._tryPredicate(e):this.count++},n.prototype._tryPredicate=function(e){var t;try{t=this.predicate(e,this.index++,this.source)}catch(e){return void this.destination.error(e)}t&&this.count++},n.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},n}(kh);var Jy=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new Gy(e,this.durationSelector))},e}(),Gy=function(t){function n(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return e.__extends(n,t),n.prototype._next=function(e){try{var t=this.durationSelector.call(this,e);t&&this._tryNext(e,t)}catch(e){this.destination.error(e)}},n.prototype._complete=function(){this.emitValue(),this.destination.complete()},n.prototype._tryNext=function(e,t){var n=this.durationSubscription;this.value=e,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=df(t,new lf(this)))&&!n.closed&&this.add(this.durationSubscription=n)},n.prototype.notifyNext=function(){this.emitValue()},n.prototype.notifyComplete=function(){this.emitValue()},n.prototype.emitValue=function(){if(this.hasValue){var e=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,e)}},n}(hf);var Zy=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new Qy(e,this.dueTime,this.scheduler))},e}(),Qy=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return e.__extends(n,t),n.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Yy,this.dueTime,this))},n.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},n.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},n.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},n}(kh);function Yy(e){e.debouncedNext()}function Ky(e){return void 0===e&&(e=null),function(t){return t.lift(new Xy(e))}}var Xy=function(){function e(e){this.defaultValue=e}return e.prototype.call=function(e,t){return t.subscribe(new eg(e,this.defaultValue))},e}(),eg=function(t){function n(e,n){var r=t.call(this,e)||this;return r.defaultValue=n,r.isEmpty=!0,r}return e.__extends(n,t),n.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},n.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},n}(kh);function tg(e){return e instanceof Date&&!isNaN(+e)}var ng=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new rg(e,this.delay,this.scheduler))},e}(),rg=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.delay=n,i.scheduler=r,i.queue=[],i.active=!1,i.errored=!1,i}return e.__extends(n,t),n.dispatch=function(e){for(var t=e.source,n=t.queue,r=e.scheduler,i=e.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){var o=Math.max(0,n[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1},n.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(n.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},n.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,n=new ig(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}},n.prototype._next=function(e){this.scheduleNotification(fd.createNext(e))},n.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()},n.prototype._complete=function(){this.scheduleNotification(fd.createComplete()),this.unsubscribe()},n}(kh),ig=function(){return function(e,t){this.time=e,this.notification=t}}();var og=function(){function e(e){this.delayDurationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new sg(e,this.delayDurationSelector))},e}(),sg=function(t){function n(e,n){var r=t.call(this,e)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return e.__extends(n,t),n.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(e),this.removeSubscription(i),this.tryComplete()},n.prototype.notifyError=function(e,t){this._error(e)},n.prototype.notifyComplete=function(e){var t=this.removeSubscription(e);t&&this.destination.next(t),this.tryComplete()},n.prototype._next=function(e){var t=this.index++;try{var n=this.delayDurationSelector(e,t);n&&this.tryDelay(n,e)}catch(e){this.destination.error(e)}},n.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},n.prototype.removeSubscription=function(e){e.unsubscribe();var t=this.delayNotifierSubscriptions.indexOf(e);return-1!==t&&this.delayNotifierSubscriptions.splice(t,1),e.outerValue},n.prototype.tryDelay=function(e,t){var n=rf(this,e,t);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},n.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},n}(Qd),ag=function(t){function n(e,n){var r=t.call(this)||this;return r.source=e,r.subscriptionDelay=n,r}return e.__extends(n,t),n.prototype._subscribe=function(e){this.subscriptionDelay.subscribe(new cg(e,this.source))},n}(Nh),cg=function(t){function n(e,n){var r=t.call(this)||this;return r.parent=e,r.source=n,r.sourceSubscribed=!1,r}return e.__extends(n,t),n.prototype._next=function(e){this.subscribeToSource()},n.prototype._error=function(e){this.unsubscribe(),this.parent.error(e)},n.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},n.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},n}(kh);var ug=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new lg(e))},e}(),lg=function(t){function n(e){return t.call(this,e)||this}return e.__extends(n,t),n.prototype._next=function(e){e.observe(this.destination)},n}(kh);var hg=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new dg(e,this.keySelector,this.flushes))},e}(),dg=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.keySelector=n,i.values=new Set,r&&i.add(df(r,new lf(i))),i}return e.__extends(n,t),n.prototype.notifyNext=function(){this.values.clear()},n.prototype.notifyError=function(e){this._error(e)},n.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},n.prototype._useKeySelector=function(e){var t,n=this.destination;try{t=this.keySelector(e)}catch(e){return void n.error(e)}this._finalizeNext(t,e)},n.prototype._finalizeNext=function(e,t){var n=this.values;n.has(e)||(n.add(e),this.destination.next(t))},n}(hf);function fg(e,t){return function(n){return n.lift(new pg(e,t))}}var pg=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new bg(e,this.compare,this.keySelector))},e}(),bg=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return e.__extends(n,t),n.prototype.compare=function(e,t){return e===t},n.prototype._next=function(e){var t;try{var n=this.keySelector;t=n?n(e):e}catch(e){return this.destination.error(e)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;r||(this.key=t,this.destination.next(e))},n}(kh);function yg(e){return void 0===e&&(e=vg),function(t){return t.lift(new gg(e))}}var gg=function(){function e(e){this.errorFactory=e}return e.prototype.call=function(e,t){return t.subscribe(new mg(e,this.errorFactory))},e}(),mg=function(t){function n(e,n){var r=t.call(this,e)||this;return r.errorFactory=n,r.hasValue=!1,r}return e.__extends(n,t),n.prototype._next=function(e){this.hasValue=!0,this.destination.next(e)},n.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var e=void 0;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)},n}(kh);function vg(){return new Ud}function _g(e){return function(t){return 0===e?id():t.lift(new wg(e))}}var wg=function(){function e(e){if(this.total=e,this.total<0)throw new Fd}return e.prototype.call=function(e,t){return t.subscribe(new Sg(e,this.total))},e}(),Sg=function(t){function n(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return e.__extends(n,t),n.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},n}(kh);var Eg=function(){function e(e,t,n){this.predicate=e,this.thisArg=t,this.source=n}return e.prototype.call=function(e,t){return t.subscribe(new xg(e,this.predicate,this.thisArg,this.source))},e}(),xg=function(t){function n(e,n,r,i){var o=t.call(this,e)||this;return o.predicate=n,o.thisArg=r,o.source=i,o.index=0,o.thisArg=r||o,o}return e.__extends(n,t),n.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},n.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(e){return void this.destination.error(e)}t||this.notifyComplete(!1)},n.prototype._complete=function(){this.notifyComplete(!0)},n}(kh);var kg=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Cg(e))},e}(),Cg=function(t){function n(e){var n=t.call(this,e)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return e.__extends(n,t),n.prototype._next=function(e){this.hasSubscription||(this.hasSubscription=!0,this.add(df(e,new lf(this))))},n.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},n.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},n}(hf);var Mg=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new Ig(e,this.project))},e}(),Ig=function(t){function n(e,n){var r=t.call(this,e)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return e.__extends(n,t),n.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},n.prototype.tryNext=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){return void this.destination.error(e)}this.hasSubscription=!0,this._innerSub(t)},n.prototype._innerSub=function(e){var t=new lf(this),n=this.destination;n.add(t);var r=df(e,t);r!==t&&n.add(r)},n.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},n.prototype.notifyNext=function(e){this.destination.next(e)},n.prototype.notifyError=function(e){this.destination.error(e)},n.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},n}(hf);var Rg=function(){function e(e,t,n){this.project=e,this.concurrent=t,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new Ag(e,this.project,this.concurrent,this.scheduler))},e}(),Ag=function(t){function n(e,n,r,i){var o=t.call(this,e)||this;return o.project=n,o.concurrent=r,o.scheduler=i,o.index=0,o.active=0,o.hasCompleted=!1,r<Number.POSITIVE_INFINITY&&(o.buffer=[]),o}return e.__extends(n,t),n.dispatch=function(e){var t=e.subscriber,n=e.result,r=e.value,i=e.index;t.subscribeToProjection(n,r,i)},n.prototype._next=function(e){var t=this.destination;if(t.closed)this._complete();else{var r=this.index++;if(this.active<this.concurrent){t.next(e);try{var i=(0,this.project)(e,r);if(this.scheduler){var o={subscriber:this,result:i,value:e,index:r};this.destination.add(this.scheduler.schedule(n.dispatch,0,o))}else this.subscribeToProjection(i,e,r)}catch(e){t.error(e)}}else this.buffer.push(e)}},n.prototype.subscribeToProjection=function(e,t,n){this.active++,this.destination.add(df(e,new lf(this)))},n.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},n.prototype.notifyNext=function(e){this._next(e)},n.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},n}(hf);var jg=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new Ng(e,this.callback))},e}(),Ng=function(t){function n(e,n){var r=t.call(this,e)||this;return r.add(new Sh(n)),r}return e.__extends(n,t),n}(kh);var Og=function(){function e(e,t,n,r){this.predicate=e,this.source=t,this.yieldIndex=n,this.thisArg=r}return e.prototype.call=function(e,t){return t.subscribe(new Tg(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}(),Tg=function(t){function n(e,n,r,i,o){var s=t.call(this,e)||this;return s.predicate=n,s.source=r,s.yieldIndex=i,s.thisArg=o,s.index=0,s}return e.__extends(n,t),n.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete(),this.unsubscribe()},n.prototype._next=function(e){var t=this.predicate,n=this.thisArg,r=this.index++;try{t.call(n||this,e,r,this.source)&&this.notifyComplete(this.yieldIndex?r:e)}catch(e){this.destination.error(e)}},n.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},n}(kh);var Pg=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Lg(e))},e}(),Lg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e.__extends(n,t),n.prototype._next=function(e){},n}(kh);var Dg=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Bg(e))},e}(),Bg=function(t){function n(e){return t.call(this,e)||this}return e.__extends(n,t),n.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},n.prototype._next=function(e){this.notifyComplete(!1)},n.prototype._complete=function(){this.notifyComplete(!0)},n}(kh);function Fg(e){return function(t){return 0===e?id():t.lift(new Ug(e))}}var Ug=function(){function e(e){if(this.total=e,this.total<0)throw new Fd}return e.prototype.call=function(e,t){return t.subscribe(new Vg(e,this.total))},e}(),Vg=function(t){function n(e,n){var r=t.call(this,e)||this;return r.total=n,r.ring=new Array,r.count=0,r}return e.__extends(n,t),n.prototype._next=function(e){var t=this.ring,n=this.total,r=this.count++;t.length<n?t.push(e):t[r%n]=e},n.prototype._complete=function(){var e=this.destination,t=this.count;if(t>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i<n;i++){var o=t++%n;e.next(r[o])}e.complete()},n}(kh);var Hg=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new Wg(e,this.value))},e}(),Wg=function(t){function n(e,n){var r=t.call(this,e)||this;return r.value=n,r}return e.__extends(n,t),n.prototype._next=function(e){this.destination.next(this.value)},n}(kh);var zg=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new qg(e))},e}(),qg=function(t){function n(e){return t.call(this,e)||this}return e.__extends(n,t),n.prototype._next=function(e){this.destination.next(fd.createNext(e))},n.prototype._error=function(e){var t=this.destination;t.next(fd.createError(e)),t.complete()},n.prototype._complete=function(){var e=this.destination;e.next(fd.createComplete()),e.complete()},n}(kh);function $g(e,t){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new Jg(e,t,n))}}var Jg=function(){function e(e,t,n){void 0===n&&(n=!1),this.accumulator=e,this.seed=t,this.hasSeed=n}return e.prototype.call=function(e,t){return t.subscribe(new Gg(e,this.accumulator,this.seed,this.hasSeed))},e}(),Gg=function(t){function n(e,n,r,i){var o=t.call(this,e)||this;return o.accumulator=n,o._seed=r,o.hasSeed=i,o.index=0,o}return e.__extends(n,t),Object.defineProperty(n.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),n.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},n.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.accumulator(this.seed,e,n)}catch(e){this.destination.error(e)}this.seed=t,this.destination.next(t)},n}(kh);function Zg(e,t){return arguments.length>=2?function(n){return Ah($g(e,t),Fg(1),Ky(t))(n)}:function(t){return Ah($g((function(t,n,r){return e(t,n,r+1)})),Fg(1))(t)}}var Qg=function(){function e(e,t,n){this.accumulator=e,this.seed=t,this.concurrent=n}return e.prototype.call=function(e,t){return t.subscribe(new Yg(e,this.accumulator,this.seed,this.concurrent))},e}(),Yg=function(t){function n(e,n,r,i){var o=t.call(this,e)||this;return o.accumulator=n,o.acc=r,o.concurrent=i,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return e.__extends(n,t),n.prototype._next=function(e){if(this.active<this.concurrent){var t=this.index++,n=this.destination,r=void 0;try{r=(0,this.accumulator)(this.acc,e,t)}catch(e){return n.error(e)}this.active++,this._innerSub(r)}else this.buffer.push(e)},n.prototype._innerSub=function(e){var t=new lf(this),n=this.destination;n.add(t);var r=df(e,t);r!==t&&n.add(r)},n.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()},n.prototype.notifyNext=function(e){var t=this.destination;this.acc=e,this.hasValue=!0,t.next(e)},n.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},n}(hf);function Kg(e,t){return function(n){var r;if(r="function"==typeof e?e:function(){return e},"function"==typeof t)return n.lift(new Xg(r,t));var i=Object.create(n,Wh);return i.source=n,i.subjectFactory=r,i}}var Xg=function(){function e(e,t){this.subjectFactory=e,this.selector=t}return e.prototype.call=function(e,t){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(e);return i.add(t.subscribe(r)),i},e}();var em=function(){function e(e){this.nextSources=e}return e.prototype.call=function(e,t){return t.subscribe(new tm(e,this.nextSources))},e}(),tm=function(t){function n(e,n){var r=t.call(this,e)||this;return r.destination=e,r.nextSources=n,r}return e.__extends(n,t),n.prototype.notifyError=function(){this.subscribeToNextSource()},n.prototype.notifyComplete=function(){this.subscribeToNextSource()},n.prototype._error=function(e){this.subscribeToNextSource(),this.unsubscribe()},n.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},n.prototype.subscribeToNextSource=function(){var e=this.nextSources.shift();if(e){var t=new lf(this),n=this.destination;n.add(t);var r=df(e,t);r!==t&&n.add(r)}else this.destination.complete()},n}(hf);var nm=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new rm(e))},e}(),rm=function(t){function n(e){var n=t.call(this,e)||this;return n.hasPrev=!1,n}return e.__extends(n,t),n.prototype._next=function(e){var t;this.hasPrev?t=[this.prev,e]:this.hasPrev=!0,this.prev=e,t&&this.destination.next(t)},n}(kh);var im=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new om(e,this.count,this.source))},e}(),om=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.count=n,i.source=r,i}return e.__extends(n,t),n.prototype.complete=function(){if(!this.isStopped){var e=this.source,n=this.count;if(0===n)return t.prototype.complete.call(this);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},n}(kh);var sm=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new am(e,this.notifier,t))},e}(),am=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i.sourceIsBeingSubscribedTo=!0,i}return e.__extends(n,t),n.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},n.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},n.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)}},n.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription;e&&(e.unsubscribe(),this.notifications=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},n.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},n.prototype.subscribeToRetries=function(){var e;this.notifications=new Dh;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=df(e,new lf(this))},n}(hf);var cm=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new um(e,this.count,this.source))},e}(),um=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.count=n,i.source=r,i}return e.__extends(n,t),n.prototype.error=function(e){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return t.prototype.error.call(this,e);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},n}(kh);var lm=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new hm(e,this.notifier,this.source))},e}(),hm=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i}return e.__extends(n,t),n.prototype.error=function(e){if(!this.isStopped){var n=this.errors,r=this.retries,i=this.retriesSubscription;if(r)this.errors=void 0,this.retriesSubscription=void 0;else{n=new Dh;try{r=(0,this.notifier)(n)}catch(e){return t.prototype.error.call(this,e)}i=df(r,new lf(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=i,n.next(e)}},n.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},n.prototype.notifyNext=function(){var e=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=e,this.source.subscribe(this)},n}(hf);var dm=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new fm(e),r=t.subscribe(n);return r.add(df(this.notifier,new lf(n))),r},e}(),fm=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return e.__extends(n,t),n.prototype._next=function(e){this.value=e,this.hasValue=!0},n.prototype.notifyNext=function(){this.emitValue()},n.prototype.notifyComplete=function(){this.emitValue()},n.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},n}(hf);var pm=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new bm(e,this.period,this.scheduler))},e}(),bm=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.period=n,i.scheduler=r,i.hasValue=!1,i.add(r.schedule(ym,n,{subscriber:i,period:n})),i}return e.__extends(n,t),n.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},n.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},n}(kh);function ym(e){var t=e.subscriber,n=e.period;t.notifyNext(),this.schedule(e,n)}var gm=function(){function e(e,t){this.compareTo=e,this.comparator=t}return e.prototype.call=function(e,t){return t.subscribe(new mm(e,this.compareTo,this.comparator))},e}(),mm=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.compareTo=n,i.comparator=r,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(n.subscribe(new vm(e,i))),i}return e.__extends(n,t),n.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},n.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},n.prototype.checkValues=function(){for(var e=this,t=e._a,n=e._b,r=e.comparator;t.length>0&&n.length>0;){var i=t.shift(),o=n.shift(),s=!1;try{s=r?r(i,o):i===o}catch(e){this.destination.error(e)}s||this.emit(!1)}},n.prototype.emit=function(e){var t=this.destination;t.next(e),t.complete()},n.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},n.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},n}(kh),vm=function(t){function n(e,n){var r=t.call(this,e)||this;return r.parent=n,r}return e.__extends(n,t),n.prototype._next=function(e){this.parent.nextB(e)},n.prototype._error=function(e){this.parent.error(e),this.unsubscribe()},n.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},n}(kh);function _m(){return new Dh}var wm=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new Sm(e,this.predicate,this.source))},e}(),Sm=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.seenValue=!1,i.index=0,i}return e.__extends(n,t),n.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},n.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},n.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(e){this.destination.error(e)}},n.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new Ud)},n}(kh);var Em=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new xm(e,this.total))},e}(),xm=function(t){function n(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return e.__extends(n,t),n.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},n}(kh);var km=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new Fd}return e.prototype.call=function(e,t){return 0===this._skipCount?t.subscribe(new kh(e)):t.subscribe(new Cm(e,this._skipCount))},e}(),Cm=function(t){function n(e,n){var r=t.call(this,e)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return e.__extends(n,t),n.prototype._next=function(e){var t=this._skipCount,n=this._count++;if(n<t)this._ring[n]=e;else{var r=n%t,i=this._ring,o=i[r];i[r]=e,this.destination.next(o)}},n}(kh);var Mm=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new Im(e,this.notifier))},e}(),Im=function(t){function n(e,n){var r=t.call(this,e)||this;r.hasValue=!1;var i=new lf(r);r.add(i),r.innerSubscription=i;var o=df(n,i);return o!==i&&(r.add(o),r.innerSubscription=o),r}return e.__extends(n,t),n.prototype._next=function(e){this.hasValue&&t.prototype._next.call(this,e)},n.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},n.prototype.notifyComplete=function(){},n}(hf);var Rm=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new Am(e,this.predicate))},e}(),Am=function(t){function n(e,n){var r=t.call(this,e)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return e.__extends(n,t),n.prototype._next=function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)},n.prototype.tryCallPredicate=function(e){try{var t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(e){this.destination.error(e)}},n}(kh);var jm=function(t){function n(e,n,r){void 0===n&&(n=0),void 0===r&&(r=Rd);var i=t.call(this)||this;return i.source=e,i.delayTime=n,i.scheduler=r,(!xf(n)||n<0)&&(i.delayTime=0),r&&"function"==typeof r.schedule||(i.scheduler=Rd),i}return e.__extends(n,t),n.create=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Rd),new n(e,t,r)},n.dispatch=function(e){var t=e.source,n=e.subscriber;return this.add(t.subscribe(n))},n.prototype._subscribe=function(e){var t=this.delayTime,r=this.source;return this.scheduler.schedule(n.dispatch,t,{source:r,subscriber:e})},n}(Nh);var Nm=function(){function e(e,t){this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return new jm(t,this.delay,this.scheduler).subscribe(e)},e}();function Om(e,t){return"function"==typeof t?function(n){return n.pipe(Om((function(n,r){return uf(e(n,r)).pipe(Hd((function(e,i){return t(n,e,r,i)})))})))}:function(t){return t.lift(new Tm(e))}}var Tm=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new Pm(e,this.project))},e}(),Pm=function(t){function n(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return e.__extends(n,t),n.prototype._next=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){return void this.destination.error(e)}this._innerSub(t)},n.prototype._innerSub=function(e){var t=this.innerSubscription;t&&t.unsubscribe();var n=new lf(this),r=this.destination;r.add(n),this.innerSubscription=df(e,n),this.innerSubscription!==n&&r.add(this.innerSubscription)},n.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},n.prototype._unsubscribe=function(){this.innerSubscription=void 0},n.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},n.prototype.notifyNext=function(e){this.destination.next(e)},n}(hf);var Lm=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new Dm(e),r=df(this.notifier,new lf(n));return r&&!n.seenValue?(n.add(r),t.subscribe(n)):n},e}(),Dm=function(t){function n(e){var n=t.call(this,e)||this;return n.seenValue=!1,n}return e.__extends(n,t),n.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},n.prototype.notifyComplete=function(){},n}(hf);var Bm=function(){function e(e,t){this.predicate=e,this.inclusive=t}return e.prototype.call=function(e,t){return t.subscribe(new Fm(e,this.predicate,this.inclusive))},e}(),Fm=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.inclusive=r,i.index=0,i}return e.__extends(n,t),n.prototype._next=function(e){var t,n=this.destination;try{t=this.predicate(e,this.index++)}catch(e){return void n.error(e)}this.nextOrComplete(e,t)},n.prototype.nextOrComplete=function(e,t){var n=this.destination;Boolean(t)?n.next(e):(this.inclusive&&n.next(e),n.complete())},n}(kh);var Um=function(){function e(e,t,n){this.nextOrObserver=e,this.error=t,this.complete=n}return e.prototype.call=function(e,t){return t.subscribe(new Vm(e,this.nextOrObserver,this.error,this.complete))},e}(),Vm=function(t){function n(e,n,r,i){var o=t.call(this,e)||this;return o._tapNext=Bd,o._tapError=Bd,o._tapComplete=Bd,o._tapError=r||Bd,o._tapComplete=i||Bd,fh(n)?(o._context=o,o._tapNext=n):n&&(o._context=n,o._tapNext=n.next||Bd,o._tapError=n.error||Bd,o._tapComplete=n.complete||Bd),o}return e.__extends(n,t),n.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.next(e)},n.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)},n.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()},n}(kh),Hm={leading:!0,trailing:!1};var Wm=function(){function e(e,t,n){this.durationSelector=e,this.leading=t,this.trailing=n}return e.prototype.call=function(e,t){return t.subscribe(new zm(e,this.durationSelector,this.leading,this.trailing))},e}(),zm=function(t){function n(e,n,r,i){var o=t.call(this,e)||this;return o.destination=e,o.durationSelector=n,o._leading=r,o._trailing=i,o._hasValue=!1,o}return e.__extends(n,t),n.prototype._next=function(e){this._hasValue=!0,this._sendValue=e,this._throttled||(this._leading?this.send():this.throttle(e))},n.prototype.send=function(){var e=this._hasValue,t=this._sendValue;e&&(this.destination.next(t),this.throttle(t)),this._hasValue=!1,this._sendValue=void 0},n.prototype.throttle=function(e){var t=this.tryDurationSelector(e);t&&this.add(this._throttled=df(t,new lf(this)))},n.prototype.tryDurationSelector=function(e){try{return this.durationSelector(e)}catch(e){return this.destination.error(e),null}},n.prototype.throttlingDone=function(){var e=this._throttled,t=this._trailing;e&&e.unsubscribe(),this._throttled=void 0,t&&this.send()},n.prototype.notifyNext=function(){this.throttlingDone()},n.prototype.notifyComplete=function(){this.throttlingDone()},n}(hf);var qm=function(){function e(e,t,n,r){this.duration=e,this.scheduler=t,this.leading=n,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new $m(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),$m=function(t){function n(e,n,r,i,o){var s=t.call(this,e)||this;return s.duration=n,s.scheduler=r,s.leading=i,s.trailing=o,s._hasTrailingValue=!1,s._trailingValue=null,s}return e.__extends(n,t),n.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Jm,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},n.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},n.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},n}(kh);function Jm(e){e.subscriber.clearThrottle()}var Gm=function(){return function(e,t){this.value=e,this.interval=t}}();function Zm(e,t,n){return void 0===n&&(n=jd),function(r){var i=tg(e),o=i?+e-n.now():Math.abs(e);return r.lift(new Qm(o,i,t,n))}}var Qm=function(){function e(e,t,n,r){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new Ym(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),Ym=function(t){function n(e,n,r,i,o){var s=t.call(this,e)||this;return s.absoluteTimeout=n,s.waitFor=r,s.withObservable=i,s.scheduler=o,s.scheduleTimeout(),s}return e.__extends(n,t),n.dispatchTimeout=function(e){var t=e.withObservable;e._unsubscribeAndRecycle(),e.add(df(t,new lf(e)))},n.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(n.dispatchTimeout,this.waitFor,this))},n.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,e)},n.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},n}(hf);var Km=function(){return function(e,t){this.value=e,this.timestamp=t}}();function Xm(e,t,n){return 0===n?[t]:(e.push(t),e)}var ev=function(){function e(e){this.windowBoundaries=e}return e.prototype.call=function(e,t){var n=new tv(e),r=t.subscribe(n);return r.closed||n.add(df(this.windowBoundaries,new lf(n))),r},e}(),tv=function(t){function n(e){var n=t.call(this,e)||this;return n.window=new Dh,e.next(n.window),n}return e.__extends(n,t),n.prototype.notifyNext=function(){this.openWindow()},n.prototype.notifyError=function(e){this._error(e)},n.prototype.notifyComplete=function(){this._complete()},n.prototype._next=function(e){this.window.next(e)},n.prototype._error=function(e){this.window.error(e),this.destination.error(e)},n.prototype._complete=function(){this.window.complete(),this.destination.complete()},n.prototype._unsubscribe=function(){this.window=null},n.prototype.openWindow=function(){var e=this.window;e&&e.complete();var t=this.destination,n=this.window=new Dh;t.next(n)},n}(hf);var nv=function(){function e(e,t){this.windowSize=e,this.startWindowEvery=t}return e.prototype.call=function(e,t){return t.subscribe(new rv(e,this.windowSize,this.startWindowEvery))},e}(),rv=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.destination=e,i.windowSize=n,i.startWindowEvery=r,i.windows=[new Dh],i.count=0,e.next(i.windows[0]),i}return e.__extends(n,t),n.prototype._next=function(e){for(var t=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,i=this.windows,o=i.length,s=0;s<o&&!this.closed;s++)i[s].next(e);var a=this.count-r+1;if(a>=0&&a%t==0&&!this.closed&&i.shift().complete(),++this.count%t==0&&!this.closed){var c=new Dh;i.push(c),n.next(c)}},n.prototype._error=function(e){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},n.prototype._complete=function(){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},n.prototype._unsubscribe=function(){this.count=0,this.windows=null},n}(kh);var iv=function(){function e(e,t,n,r){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new sv(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),ov=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return e.__extends(n,t),n.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(n.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),n}(Dh),sv=function(t){function n(e,n,r,i,o){var s=t.call(this,e)||this;s.destination=e,s.windowTimeSpan=n,s.windowCreationInterval=r,s.maxWindowSize=i,s.scheduler=o,s.windows=[];var a=s.openWindow();if(null!==r&&r>=0){var c={subscriber:s,window:a,context:null},u={windowTimeSpan:n,windowCreationInterval:r,subscriber:s,scheduler:o};s.add(o.schedule(uv,n,c)),s.add(o.schedule(cv,r,u))}else{var l={subscriber:s,window:a,windowTimeSpan:n};s.add(o.schedule(av,n,l))}return s}return e.__extends(n,t),n.prototype._next=function(e){for(var t=this.windows,n=t.length,r=0;r<n;r++){var i=t[r];i.closed||(i.next(e),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},n.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},n.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift();t.closed||t.complete()}this.destination.complete()},n.prototype.openWindow=function(){var e=new ov;return this.windows.push(e),this.destination.next(e),e},n.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},n}(kh);function av(e){var t=e.subscriber,n=e.windowTimeSpan,r=e.window;r&&t.closeWindow(r),e.window=t.openWindow(),this.schedule(e,n)}function cv(e){var t=e.windowTimeSpan,n=e.subscriber,r=e.scheduler,i=e.windowCreationInterval,o=n.openWindow(),s=this,a={action:s,subscription:null},c={subscriber:n,window:o,context:a};a.subscription=r.schedule(uv,t,c),s.add(a.subscription),s.schedule(e,i)}function uv(e){var t=e.subscriber,n=e.window,r=e.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),t.closeWindow(n)}var lv=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new hv(e,this.openings,this.closingSelector))},e}(),hv=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(i.openSubscription=rf(i,n,n)),i}return e.__extends(n,t),n.prototype._next=function(e){var t=this.contexts;if(t)for(var n=t.length,r=0;r<n;r++)t[r].window.next(e)},n.prototype._error=function(e){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var o=n[i];o.window.error(e),o.subscription.unsubscribe()}t.prototype._error.call(this,e)},n.prototype._complete=function(){var e=this.contexts;if(this.contexts=null,e)for(var n=e.length,r=-1;++r<n;){var i=e[r];i.window.complete(),i.subscription.unsubscribe()}t.prototype._complete.call(this)},n.prototype._unsubscribe=function(){var e=this.contexts;if(this.contexts=null,e)for(var t=e.length,n=-1;++n<t;){var r=e[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},n.prototype.notifyNext=function(e,t,n,r,i){if(e===this.openings){var o=void 0;try{o=(0,this.closingSelector)(t)}catch(e){return this.error(e)}var s=new Dh,a=new Sh,c={window:s,subscription:a};this.contexts.push(c);var u=rf(this,o,c);u.closed?this.closeWindow(this.contexts.length-1):(u.context=c,a.add(u)),this.destination.next(s)}else this.closeWindow(this.contexts.indexOf(e))},n.prototype.notifyError=function(e){this.error(e)},n.prototype.notifyComplete=function(e){e!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(e.context))},n.prototype.closeWindow=function(e){if(-1!==e){var t=this.contexts,n=t[e],r=n.window,i=n.subscription;t.splice(e,1),r.complete(),i.unsubscribe()}},n}(Qd);var dv=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new fv(e,this.closingSelector))},e}(),fv=function(t){function n(e,n){var r=t.call(this,e)||this;return r.destination=e,r.closingSelector=n,r.openWindow(),r}return e.__extends(n,t),n.prototype.notifyNext=function(e,t,n,r,i){this.openWindow(i)},n.prototype.notifyError=function(e){this._error(e)},n.prototype.notifyComplete=function(e){this.openWindow(e)},n.prototype._next=function(e){this.window.next(e)},n.prototype._error=function(e){this.window.error(e),this.destination.error(e),this.unsubscribeClosingNotification()},n.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},n.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},n.prototype.openWindow=function(e){void 0===e&&(e=null),e&&(this.remove(e),e.unsubscribe());var t=this.window;t&&t.complete();var n,r=this.window=new Dh;this.destination.next(r);try{n=(0,this.closingSelector)()}catch(e){return this.destination.error(e),void this.window.error(e)}this.add(this.closingNotification=rf(this,n))},n}(Qd);var pv=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new bv(e,this.observables,this.project))},e}(),bv=function(t){function n(e,n,r){var i=t.call(this,e)||this;i.observables=n,i.project=r,i.toRespond=[];var o=n.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=n[s];i.add(rf(i,a,void 0,s))}return i}return e.__extends(n,t),n.prototype.notifyNext=function(e,t,n){this.values[n]=t;var r=this.toRespond;if(r.length>0){var i=r.indexOf(n);-1!==i&&r.splice(i,1)}},n.prototype.notifyComplete=function(){},n.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},n.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},n}(Qd);var yv=Object.freeze({__proto__:null,audit:xy,auditTime:function(e,t){return void 0===t&&(t=jd),xy((function(){return Df(e,t)}))},buffer:function(e){return function(t){return t.lift(new My(e))}},bufferCount:function(e,t){return void 0===t&&(t=null),function(n){return n.lift(new Ry(e,t))}},bufferTime:function(e){var t=arguments.length,n=jd;od(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],t--);var r=null;t>=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return t>=3&&(i=arguments[2]),function(t){return t.lift(new Ny(e,r,i,n))}},bufferToggle:function(e,t){return function(n){return n.lift(new By(e,t))}},bufferWhen:function(e){return function(t){return t.lift(new Uy(e))}},catchError:function(e){return function(t){var n=new Hy(e),r=t.lift(n);return n.caught=r}},combineAll:function(e){return function(t){return t.lift(new sf(e))}},combineLatest:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=null;return"function"==typeof e[e.length-1]&&(n=e.pop()),1===e.length&&mh(e[0])&&(e=e[0].slice()),function(t){return t.lift.call(uf([t].concat(e)),new sf(n))}},concat:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(vf.apply(void 0,[t].concat(e)))}},concatAll:mf,concatMap:zy,concatMapTo:function(e,t){return zy((function(){return e}),t)},count:function(e){return function(t){return t.lift(new qy(e,t))}},debounce:function(e){return function(t){return t.lift(new Jy(e))}},debounceTime:function(e,t){return void 0===t&&(t=jd),function(n){return n.lift(new Zy(e,t))}},defaultIfEmpty:Ky,delay:function(e,t){void 0===t&&(t=jd);var n=tg(e)?+e-t.now():Math.abs(e);return function(e){return e.lift(new ng(n,t))}},delayWhen:function(e,t){return t?function(n){return new ag(n,t).lift(new og(e))}:function(t){return t.lift(new og(e))}},dematerialize:function(){return function(e){return e.lift(new ug)}},distinct:function(e,t){return function(n){return n.lift(new hg(e,t))}},distinctUntilChanged:fg,distinctUntilKeyChanged:function(e,t){return fg((function(n,r){return t?t(n[e],r[e]):n[e]===r[e]}))},elementAt:function(e,t){if(e<0)throw new Fd;var n=arguments.length>=2;return function(r){return r.pipe(Af((function(t,n){return n===e})),_g(1),n?Ky(t):yg((function(){return new Fd})))}},endWith:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return vf(t,ld.apply(void 0,e))}},every:function(e,t){return function(n){return n.lift(new Eg(e,t,n))}},exhaust:function(){return function(e){return e.lift(new kg)}},exhaustMap:function e(t,n){return n?function(r){return r.pipe(e((function(e,r){return uf(t(e,r)).pipe(Hd((function(t,i){return n(e,t,r,i)})))})))}:function(e){return e.lift(new Mg(t))}},expand:function(e,t,n){return void 0===t&&(t=Number.POSITIVE_INFINITY),t=(t||0)<1?Number.POSITIVE_INFINITY:t,function(r){return r.lift(new Rg(e,t,n))}},filter:Af,finalize:function(e){return function(t){return t.lift(new jg(e))}},find:function(e,t){if("function"!=typeof e)throw new TypeError("predicate is not a function");return function(n){return n.lift(new Og(e,n,!1,t))}},findIndex:function(e,t){return function(n){return n.lift(new Og(e,n,!0,t))}},first:function(e,t){var n=arguments.length>=2;return function(r){return r.pipe(e?Af((function(t,n){return e(t,n,r)})):Rh,_g(1),n?Ky(t):yg((function(){return new Ud})))}},groupBy:function(e,t,n,r){return function(i){return i.lift(new qh(e,t,n,r))}},ignoreElements:function(){return function(e){return e.lift(new Pg)}},isEmpty:function(){return function(e){return e.lift(new Dg)}},last:function(e,t){var n=arguments.length>=2;return function(r){return r.pipe(e?Af((function(t,n){return e(t,n,r)})):Rh,Fg(1),n?Ky(t):yg((function(){return new Ud})))}},map:Hd,mapTo:function(e){return function(t){return t.lift(new Hg(e))}},materialize:function(){return function(e){return e.lift(new zg)}},max:function(e){var t="function"==typeof e?function(t,n){return e(t,n)>0?t:n}:function(e,t){return e>t?e:t};return Zg(t)},merge:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(Cf.apply(void 0,[t].concat(e)))}},mergeAll:gf,mergeMap:ff,flatMap:yf,mergeMapTo:function(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof t?ff((function(){return e}),t,n):("number"==typeof t&&(n=t),ff((function(){return e}),n))},mergeScan:function(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new Qg(e,t,n))}},min:function(e){var t="function"==typeof e?function(t,n){return e(t,n)<0?t:n}:function(e,t){return e<t?e:t};return Zg(t)},multicast:Kg,observeOn:function(e,t){return void 0===t&&(t=0),function(n){return n.lift(new pd(e,t))}},onErrorResumeNext:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length&&mh(e[0])&&(e=e[0]),function(t){return t.lift(new em(e))}},pairwise:function(){return function(e){return e.lift(new nm)}},partition:function(e,t){return function(n){return[Af(e,t)(n),Af(Rf(e,t))(n)]}},pluck:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.length;if(0===n)throw new Error("list of properties cannot be empty.");return function(t){return Hd(function(e,t){var n=function(n){for(var r=n,i=0;i<t;i++){var o=null!=r?r[e[i]]:void 0;if(void 0===o)return;r=o}return r};return n}(e,n))(t)}},publish:function(e){return e?Kg((function(){return new Dh}),e):Kg(new Dh)},publishBehavior:function(e){return function(t){return Kg(new Qh(e))(t)}},publishLast:function(){return function(e){return Kg(new vd)(e)}},publishReplay:function(e,t,n,r){n&&"function"!=typeof n&&(r=n);var i="function"==typeof n?n:void 0,o=new gd(e,t,r);return function(e){return Kg((function(){return o}),i)(e)}},race:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return 1===e.length&&mh(e[0])&&(e=e[0]),t.lift.call(Of.apply(void 0,[t].concat(e)))}},reduce:Zg,repeat:function(e){return void 0===e&&(e=-1),function(t){return 0===e?id():e<0?t.lift(new im(-1,t)):t.lift(new im(e-1,t))}},repeatWhen:function(e){return function(t){return t.lift(new sm(e))}},retry:function(e){return void 0===e&&(e=-1),function(t){return t.lift(new cm(e,t))}},retryWhen:function(e){return function(t){return t.lift(new lm(e,t))}},refCount:Fh,sample:function(e){return function(t){return t.lift(new dm(e))}},sampleTime:function(e,t){return void 0===t&&(t=jd),function(n){return n.lift(new pm(e,t))}},scan:$g,sequenceEqual:function(e,t){return function(n){return n.lift(new gm(e,t))}},share:function(){return function(e){return Fh()(Kg(_m)(e))}},shareReplay:function(e,t,n){var r;return r=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:n},function(e){return e.lift(function(e){var t,n,r=e.bufferSize,i=void 0===r?Number.POSITIVE_INFINITY:r,o=e.windowTime,s=void 0===o?Number.POSITIVE_INFINITY:o,a=e.refCount,c=e.scheduler,u=0,l=!1,h=!1;return function(e){var r;u++,!t||l?(l=!1,t=new gd(i,s,c),r=t.subscribe(this),n=e.subscribe({next:function(e){t.next(e)},error:function(e){l=!0,t.error(e)},complete:function(){h=!0,n=void 0,t.complete()}}),h&&(n=void 0)):r=t.subscribe(this),this.add((function(){u--,r.unsubscribe(),r=void 0,n&&!h&&a&&0===u&&(n.unsubscribe(),n=void 0,t=void 0)}))}}(r))}},single:function(e){return function(t){return t.lift(new wm(e,t))}},skip:function(e){return function(t){return t.lift(new Em(e))}},skipLast:function(e){return function(t){return t.lift(new km(e))}},skipUntil:function(e){return function(t){return t.lift(new Mm(e))}},skipWhile:function(e){return function(t){return t.lift(new Rm(e))}},startWith:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return od(n)?(e.pop(),function(t){return vf(e,t,n)}):function(t){return vf(e,t)}},subscribeOn:function(e,t){return void 0===t&&(t=0),function(n){return n.lift(new Nm(e,t))}},switchAll:function(){return Om(Rh)},switchMap:Om,switchMapTo:function(e,t){return t?Om((function(){return e}),t):Om((function(){return e}))},take:_g,takeLast:Fg,takeUntil:function(e){return function(t){return t.lift(new Lm(e))}},takeWhile:function(e,t){return void 0===t&&(t=!1),function(n){return n.lift(new Bm(e,t))}},tap:function(e,t,n){return function(r){return r.lift(new Um(e,t,n))}},throttle:function(e,t){return void 0===t&&(t=Hm),function(n){return n.lift(new Wm(e,!!t.leading,!!t.trailing))}},throttleTime:function(e,t,n){return void 0===t&&(t=jd),void 0===n&&(n=Hm),function(r){return r.lift(new qm(e,t,n.leading,n.trailing))}},throwIfEmpty:yg,timeInterval:function(e){return void 0===e&&(e=jd),function(t){return _f((function(){return t.pipe($g((function(t,n){var r=t.current;return{value:n,current:e.now(),last:r}}),{current:e.now(),value:void 0,last:void 0}),Hd((function(e){var t=e.current,n=e.last,r=e.value;return new Gm(r,t-n)})))}))}},timeout:function(e,t){return void 0===t&&(t=jd),Zm(e,hd(new Vd),t)},timeoutWith:Zm,timestamp:function(e){return void 0===e&&(e=jd),Hd((function(t){return new Km(t,e.now())}))},toArray:function(){return Zg(Xm,[])},window:function(e){return function(t){return t.lift(new ev(e))}},windowCount:function(e,t){return void 0===t&&(t=0),function(n){return n.lift(new nv(e,t))}},windowTime:function(e){var t=jd,n=null,r=Number.POSITIVE_INFINITY;return od(arguments[3])&&(t=arguments[3]),od(arguments[2])?t=arguments[2]:xf(arguments[2])&&(r=Number(arguments[2])),od(arguments[1])?t=arguments[1]:xf(arguments[1])&&(n=Number(arguments[1])),function(i){return i.lift(new iv(e,n,r,t))}},windowToggle:function(e,t){return function(n){return n.lift(new lv(e,t))}},windowWhen:function(e){return function(t){return t.lift(new dv(e))}},withLatestFrom:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n;"function"==typeof e[e.length-1]&&(n=e.pop());var r=e;return t.lift(new pv(r,n))}},zip:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(Ff.apply(void 0,[t].concat(e)))}},zipAll:function(e){return function(t){return t.lift(new Uf(e))}}}),gv=e.getAugmentedNamespace(yv),mv={},vv={};Object.defineProperty(vv,"__esModule",{value:!0}),vv.ClientMessagePublishEvent=vv.ClientMessageSetSessionConfig=vv.ClientMessageGetSessionConfig=vv.ClientMessageIsLinked=vv.ClientMessageHostSession=void 0,vv.ClientMessageHostSession=function(e){return Object.assign({type:"HostSession"},e)},vv.ClientMessageIsLinked=function(e){return Object.assign({type:"IsLinked"},e)},vv.ClientMessageGetSessionConfig=function(e){return Object.assign({type:"GetSessionConfig"},e)},vv.ClientMessageSetSessionConfig=function(e){return Object.assign({type:"SetSessionConfig"},e)},vv.ClientMessagePublishEvent=function(e){return Object.assign({type:"PublishEvent"},e)};var _v={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RxWebSocket=e.ConnectionState=void 0;const t=$f,n=gv;var r;!function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(r=e.ConnectionState||(e.ConnectionState={}));e.RxWebSocket=class{constructor(e,n=WebSocket){this.WebSocketClass=n,this.webSocket=null,this.connectionStateSubject=new t.BehaviorSubject(r.DISCONNECTED),this.incomingDataSubject=new t.Subject,this.url=e.replace(/^http/,"ws")}connect(){return this.webSocket?(0,t.throwError)(new Error("webSocket object is not null")):new t.Observable((e=>{let t;try{this.webSocket=t=new this.WebSocketClass(this.url)}catch(t){return void e.error(t)}this.connectionStateSubject.next(r.CONNECTING),t.onclose=t=>{this.clearWebSocket(),e.error(new Error(`websocket error ${t.code}: ${t.reason}`)),this.connectionStateSubject.next(r.DISCONNECTED)},t.onopen=t=>{e.next(),e.complete(),this.connectionStateSubject.next(r.CONNECTED)},t.onmessage=e=>{this.incomingDataSubject.next(e.data)}})).pipe((0,n.take)(1))}disconnect(){const{webSocket:e}=this;if(e){this.clearWebSocket(),this.connectionStateSubject.next(r.DISCONNECTED);try{e.close()}catch(e){}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,n.flatMap)((e=>{let n;try{n=JSON.parse(e)}catch(e){return(0,t.empty)()}return(0,t.of)(n)})))}sendData(e){const{webSocket:t}=this;if(!t)throw new Error("websocket is not connected");t.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}}(_v);var wv={};Object.defineProperty(wv,"__esModule",{value:!0}),wv.isServerMessageFail=void 0,wv.isServerMessageFail=function(e){return e&&"Fail"===e.type&&"number"==typeof e.id&&"string"==typeof e.sessionId&&"string"==typeof e.error},Object.defineProperty(mv,"__esModule",{value:!0}),mv.WalletSDKConnection=void 0;const Sv=$f,Ev=gv,xv=$,kv=Wr,Cv=vv,Mv=q,Iv=_v,Rv=wv;mv.WalletSDKConnection=class{constructor(e,t,n,r,i=WebSocket){this.sessionId=e,this.sessionKey=t,this.diagnostic=r,this.subscriptions=new Sv.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,kv.IntNumber)(1),this.connectedSubject=new Sv.BehaviorSubject(!1),this.linkedSubject=new Sv.BehaviorSubject(!1),this.sessionConfigSubject=new Sv.ReplaySubject(1);const o=new Iv.RxWebSocket(n+"/rpc",i);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,Ev.tap)((t=>{var n;return null===(n=this.diagnostic)||void 0===n?void 0:n.log(Mv.EVENTS.CONNECTED_STATE_CHANGE,{state:t,sessionIdHash:xv.Session.hash(e)})})),(0,Ev.skip)(1),(0,Ev.filter)((e=>e===Iv.ConnectionState.DISCONNECTED&&!this.destroyed)),(0,Ev.delay)(5e3),(0,Ev.filter)((e=>!this.destroyed)),(0,Ev.flatMap)((e=>o.connect())),(0,Ev.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,Ev.skip)(2),(0,Ev.switchMap)((e=>(0,Sv.iif)((()=>e===Iv.ConnectionState.CONNECTED),this.authenticate().pipe((0,Ev.tap)((e=>this.sendIsLinked())),(0,Ev.tap)((e=>this.sendGetSessionConfig())),(0,Ev.map)((e=>!0))),(0,Sv.of)(!1)))),(0,Ev.distinctUntilChanged)(),(0,Ev.catchError)((e=>(0,Sv.of)(!1)))).subscribe((e=>this.connectedSubject.next(e)))),this.subscriptions.add(o.connectionState$.pipe((0,Ev.skip)(1),(0,Ev.switchMap)((e=>(0,Sv.iif)((()=>e===Iv.ConnectionState.CONNECTED),(0,Sv.timer)(0,1e4))))).subscribe((e=>0===e?this.updateLastHeartbeat():this.heartbeat()))),this.subscriptions.add(o.incomingData$.pipe((0,Ev.filter)((e=>"h"===e))).subscribe((e=>this.updateLastHeartbeat()))),this.subscriptions.add(o.incomingJSONData$.pipe((0,Ev.filter)((e=>["IsLinkedOK","Linked"].includes(e.type)))).subscribe((t=>{var n;const r=t;null===(n=this.diagnostic)||void 0===n||n.log(Mv.EVENTS.LINKED,{sessionIdHash:xv.Session.hash(e),linked:r.linked,type:t.type,onlineGuests:r.onlineGuests}),this.linkedSubject.next(r.linked||r.onlineGuests>0)}))),this.subscriptions.add(o.incomingJSONData$.pipe((0,Ev.filter)((e=>["GetSessionConfigOK","SessionConfigUpdated"].includes(e.type)))).subscribe((t=>{var n;const r=t;null===(n=this.diagnostic)||void 0===n||n.log(Mv.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:xv.Session.hash(e),metadata_keys:r&&r.metadata?Object.keys(r.metadata):void 0}),this.sessionConfigSubject.next({webhookId:r.webhookId,webhookUrl:r.webhookUrl,metadata:r.metadata})})))}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");null===(e=this.diagnostic)||void 0===e||e.log(Mv.EVENTS.STARTED_CONNECTING,{sessionIdHash:xv.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),null===(e=this.diagnostic)||void 0===e||e.log(Mv.EVENTS.DISCONNECTED,{sessionIdHash:xv.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,Ev.filter)((e=>e)),(0,Ev.take)(1),(0,Ev.map)((()=>{})))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,Ev.filter)((e=>e)),(0,Ev.take)(1),(0,Ev.map)((()=>{})))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,Ev.filter)((e=>{if("Event"!==e.type)return!1;const t=e;return"string"==typeof t.sessionId&&"string"==typeof t.eventId&&"string"==typeof t.event&&"string"==typeof t.data})),(0,Ev.map)((e=>e)))}setSessionMetadata(e,t){const n=(0,Cv.ClientMessageSetSessionConfig)({id:(0,kv.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[e]:t}});return this.onceConnected$.pipe((0,Ev.flatMap)((e=>this.makeRequest(n))),(0,Ev.map)((e=>{if((0,Rv.isServerMessageFail)(e))throw new Error(e.error||"failed to set session metadata")})))}publishEvent(e,t,n=!1){const r=(0,Cv.ClientMessagePublishEvent)({id:(0,kv.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:t,callWebhook:n});return this.onceLinked$.pipe((0,Ev.flatMap)((e=>this.makeRequest(r))),(0,Ev.map)((e=>{if((0,Rv.isServerMessageFail)(e))throw new Error(e.error||"failed to publish event");return e.eventId})))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(e){}}makeRequest(e,t=6e4){const n=e.id;try{this.sendData(e)}catch(e){return(0,Sv.throwError)(e)}return this.ws.incomingJSONData$.pipe((0,Ev.timeoutWith)(t,(0,Sv.throwError)(new Error(`request ${n} timed out`))),(0,Ev.filter)((e=>e.id===n)),(0,Ev.take)(1))}authenticate(){const e=(0,Cv.ClientMessageHostSession)({id:(0,kv.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,Ev.map)((e=>{if((0,Rv.isServerMessageFail)(e))throw new Error(e.error||"failed to authentcate")})))}sendIsLinked(){const e=(0,Cv.ClientMessageIsLinked)({id:(0,kv.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}sendGetSessionConfig(){const e=(0,Cv.ClientMessageGetSessionConfig)({id:(0,kv.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}};var Av={};Object.defineProperty(Av,"__esModule",{value:!0}),Av.WalletUIError=void 0;class jv extends Error{constructor(e,t){super(e),this.message=e,this.errorCode=t}}Av.WalletUIError=jv,jv.UserRejectedRequest=new jv("User rejected request"),jv.SwitchEthereumChainUnsupportedChainId=new jv("Unsupported chainId",4902);var Nv={};Object.defineProperty(Nv,"__esModule",{value:!0}),Nv.decrypt=Nv.encrypt=void 0;const Ov=ct;Nv.encrypt=async function(e,t){if(64!==t.length)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.importKey("raw",(0,Ov.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},r,i.encode(e)),s=o.slice(o.byteLength-16),a=o.slice(0,o.byteLength-16),c=new Uint8Array(s),u=new Uint8Array(a),l=new Uint8Array([...n,...c,...u]);return(0,Ov.uint8ArrayToHex)(l)},Nv.decrypt=function(e,t){if(64!==t.length)throw Error("secret must be 256 bits");return new Promise(((n,r)=>{!async function(){const i=await crypto.subtle.importKey("raw",(0,Ov.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,Ov.hexStringToUint8Array)(e),s=o.slice(0,12),a=o.slice(12,28),c=o.slice(28),u=new Uint8Array([...c,...a]),l={name:"AES-GCM",iv:new Uint8Array(s)};try{const e=await window.crypto.subtle.decrypt(l,i,u),t=new TextDecoder;n(t.decode(e))}catch(e){r(e)}}()}))};var Tv={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(e.Web3Method||(e.Web3Method={}))}(Tv);var Pv={},Lv={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.RelayMessageType=void 0,(t=e.RelayMessageType||(e.RelayMessageType={})).SESSION_ID_REQUEST="SESSION_ID_REQUEST",t.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",t.LINKED="LINKED",t.UNLINKED="UNLINKED",t.WEB3_REQUEST="WEB3_REQUEST",t.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",t.WEB3_RESPONSE="WEB3_RESPONSE"}(Lv),Object.defineProperty(Pv,"__esModule",{value:!0}),Pv.Web3RequestCanceledMessage=void 0;const Dv=Lv;Pv.Web3RequestCanceledMessage=function(e){return{type:Dv.RelayMessageType.WEB3_REQUEST_CANCELED,id:e}};var Bv={};Object.defineProperty(Bv,"__esModule",{value:!0}),Bv.Web3RequestMessage=void 0;const Fv=Lv;Bv.Web3RequestMessage=function(e){return Object.assign({type:Fv.RelayMessageType.WEB3_REQUEST},e)};var Uv={};Object.defineProperty(Uv,"__esModule",{value:!0}),Uv.EthereumAddressFromSignedMessageResponse=Uv.SubmitEthereumTransactionResponse=Uv.SignEthereumTransactionResponse=Uv.SignEthereumMessageResponse=Uv.isRequestEthereumAccountsResponse=Uv.SelectProviderResponse=Uv.WatchAssetReponse=Uv.RequestEthereumAccountsResponse=Uv.SwitchEthereumChainResponse=Uv.AddEthereumChainResponse=Uv.ErrorResponse=void 0;const Vv=Tv;Uv.ErrorResponse=function(e,t,n){return{method:e,errorMessage:t,errorCode:n}},Uv.AddEthereumChainResponse=function(e){return{method:Vv.Web3Method.addEthereumChain,result:e}},Uv.SwitchEthereumChainResponse=function(e){return{method:Vv.Web3Method.switchEthereumChain,result:e}},Uv.RequestEthereumAccountsResponse=function(e){return{method:Vv.Web3Method.requestEthereumAccounts,result:e}},Uv.WatchAssetReponse=function(e){return{method:Vv.Web3Method.watchAsset,result:e}},Uv.SelectProviderResponse=function(e){return{method:Vv.Web3Method.selectProvider,result:e}},Uv.isRequestEthereumAccountsResponse=function(e){return e&&e.method===Vv.Web3Method.requestEthereumAccounts},Uv.SignEthereumMessageResponse=function(e){return{method:Vv.Web3Method.signEthereumMessage,result:e}},Uv.SignEthereumTransactionResponse=function(e){return{method:Vv.Web3Method.signEthereumTransaction,result:e}},Uv.SubmitEthereumTransactionResponse=function(e){return{method:Vv.Web3Method.submitEthereumTransaction,result:e}},Uv.EthereumAddressFromSignedMessageResponse=function(e){return{method:Vv.Web3Method.ethereumAddressFromSignedMessage,result:e}};var Hv={};Object.defineProperty(Hv,"__esModule",{value:!0}),Hv.isWeb3ResponseMessage=Hv.Web3ResponseMessage=void 0;const Wv=Lv;Hv.Web3ResponseMessage=function(e){return Object.assign({type:Wv.RelayMessageType.WEB3_RESPONSE},e)},Hv.isWeb3ResponseMessage=function(e){return e&&e.type===Wv.RelayMessageType.WEB3_RESPONSE};var zv=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),qv=e.commonjsGlobal&&e.commonjsGlobal.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),$v=e.commonjsGlobal&&e.commonjsGlobal.__decorate||function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Jv=e.commonjsGlobal&&e.commonjsGlobal.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&zv(t,e,n);return qv(t,e),t},Gv=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wy,"__esModule",{value:!0}),wy.WalletSDKRelay=void 0;const Zv=Gv(Sy),Qv=m,Yv=$f,Kv=gv,Xv=q,e_=mv,t_=Av,n_=Wr,r_=ct,i_=Jv(Nv),o_=$,s_=hi,a_=Tv,c_=Pv,u_=Bv,l_=Uv,h_=Hv;class d_ extends s_.WalletSDKRelayAbstract{constructor(e){var t;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new Yv.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new Yv.Subscription,this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:r,connection:i}=this.subscribe();if(this._session=n,this.connection=i,this.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this.diagnostic={log:e.eventListener.onEvent}:this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=null===(t=e.reloadOnDisconnect)||void 0===t||t,this.ui=r}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe((e=>{this.dappDefaultChain!==e&&(this.dappDefaultChain=e)})));const e=o_.Session.load(this.storage)||new o_.Session(this.storage).save(),t=new e_.WalletSDKConnection(e.id,e.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(t.sessionConfig$.subscribe({next:e=>{this.onSessionConfigChanged(e)},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(Xv.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(t.incomingEvent$.pipe((0,Kv.filter)((e=>"Web3Response"===e.event))).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(t.linked$.pipe((0,Kv.skip)(1),(0,Kv.tap)((e=>{var t;this.isLinked=e;const n=this.storage.getItem(s_.LOCAL_STORAGE_ADDRESSES_KEY);if(e&&(this.session.linked=e),this.isUnlinkedErrorState=!1,n){const r=n.split(" "),i="true"===this.storage.getItem("IsStandaloneSigning");if(""!==r[0]&&!e&&this.session.linked&&!i){this.isUnlinkedErrorState=!0;const e=this.getSessionIdHash();null===(t=this.diagnostic)||void 0===t||t.log(Xv.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:e})}}}))).subscribe()),this.subscriptions.add(t.sessionConfig$.pipe((0,Kv.filter)((e=>!!e.metadata&&"1"===e.metadata.__destroyed))).subscribe((()=>{var e;const n=t.isDestroyed;return null===(e=this.diagnostic)||void 0===e||e.log(Xv.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:n,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()}))),this.subscriptions.add(t.sessionConfig$.pipe((0,Kv.filter)((e=>e.metadata&&void 0!==e.metadata.WalletUsername))).pipe((0,Kv.mergeMap)((t=>i_.decrypt(t.metadata.WalletUsername,e.secret)))).subscribe({next:e=>{this.storage.setItem(s_.WALLET_USER_NAME_KEY,e)},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(Xv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(t.sessionConfig$.pipe((0,Kv.filter)((e=>e.metadata&&void 0!==e.metadata.AppVersion))).pipe((0,Kv.mergeMap)((t=>i_.decrypt(t.metadata.AppVersion,e.secret)))).subscribe({next:e=>{this.storage.setItem(s_.APP_VERSION_KEY,e)},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(Xv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(t.sessionConfig$.pipe((0,Kv.filter)((e=>e.metadata&&void 0!==e.metadata.ChainId&&void 0!==e.metadata.JsonRpcUrl))).pipe((0,Kv.mergeMap)((t=>(0,Yv.zip)(i_.decrypt(t.metadata.ChainId,e.secret),i_.decrypt(t.metadata.JsonRpcUrl,e.secret))))).pipe((0,Kv.distinctUntilChanged)()).subscribe({next:([e,t])=>{this.chainCallback&&this.chainCallback(e,t)},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(Xv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(t.sessionConfig$.pipe((0,Kv.filter)((e=>e.metadata&&void 0!==e.metadata.EthereumAddress))).pipe((0,Kv.mergeMap)((t=>i_.decrypt(t.metadata.EthereumAddress,e.secret)))).subscribe({next:e=>{this.accountsCallback&&this.accountsCallback([e]),d_.accountRequestCallbackIds.size>0&&(Array.from(d_.accountRequestCallbackIds.values()).forEach((t=>{const n=(0,h_.Web3ResponseMessage)({id:t,response:(0,l_.RequestEthereumAccountsResponse)([e])});this.invokeCallback(Object.assign(Object.assign({},n),{id:t}))})),d_.accountRequestCallbackIds.clear())},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(Xv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(t.sessionConfig$.pipe((0,Kv.filter)((e=>e.metadata&&void 0!==e.metadata.AppSrc))).pipe((0,Kv.mergeMap)((t=>i_.decrypt(t.metadata.AppSrc,e.secret)))).subscribe({next:e=>{this.ui.setAppSrc(e)},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(Xv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const n=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:e,connected$:t.connected$,chainId$:this.dappDefaultChainSubject});return t.connect(),{session:e,ui:n,connection:t}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,Kv.timeout)(1e3),(0,Kv.catchError)((e=>(0,Yv.of)(null)))).subscribe((e=>{var t,n,r;const i=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch(e){null===(t=this.diagnostic)||void 0===t||t.log(Xv.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}null===(n=this.diagnostic)||void 0===n||n.log(Xv.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=o_.Session.load(this.storage);if((null==o?void 0:o.id)===this._session.id?this.storage.clear():o&&(null===(r=this.diagnostic)||void 0===r||r.log(Xv.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o_.Session.hash(o.id)})),this._reloadOnDisconnect)return void this.ui.reloadUI();this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new Yv.Subscription;const{session:s,ui:a,connection:c}=this.subscribe();this._session=s,this.connection=c,this.ui=a,i&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()}),(e=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Xv.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})}))}setAppInfo(e,t){this.appName=e,this.appLogoUrl=t}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,t){this.storage.setItem(e,t)}signEthereumMessage(e,t,n,r){return this.sendRequest({method:a_.Web3Method.signEthereumMessage,params:{message:(0,r_.hexStringFromBuffer)(e,!0),address:t,addPrefix:n,typedDataJson:r||null}})}ethereumAddressFromSignedMessage(e,t,n){return this.sendRequest({method:a_.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,r_.hexStringFromBuffer)(e,!0),signature:(0,r_.hexStringFromBuffer)(t,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:a_.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,r_.bigIntStringFromBN)(e.weiValue),data:(0,r_.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,r_.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,r_.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,r_.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,r_.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:a_.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,r_.bigIntStringFromBN)(e.weiValue),data:(0,r_.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,r_.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,r_.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,r_.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,r_.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:a_.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,r_.hexStringFromBuffer)(e,!0),chainId:t}})}scanQRCode(e){return this.sendRequest({method:a_.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,r_.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,t){return this.sendRequest({method:a_.Web3Method.generic,params:{action:t,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let t=null;const n=(0,r_.randomBytesHex)(8),r=r=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,r),null==t||t()};return{promise:new Promise(((i,o)=>{this.ui.isStandalone()||(t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:r,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,(e=>{if(null==t||t(),e.errorMessage)return o(new Error(e.errorMessage));i(e)})),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)})),cancel:r}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChainSubject.next(e)}publishWeb3RequestEvent(e,t){var n;const r=(0,u_.Web3RequestMessage)({id:e,request:t}),i=o_.Session.load(this.storage);null===(n=this.diagnostic)||void 0===n||n.log(Xv.EVENTS.WEB3_REQUEST,{eventId:r.id,method:`relay::${r.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?o_.Session.hash(i.id):"",isSessionMismatched:((null==i?void 0:i.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",r,!0).subscribe({next:e=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Xv.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:r.id,method:`relay::${r.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?o_.Session.hash(i.id):"",isSessionMismatched:((null==i?void 0:i.id)!==this._session.id).toString()})},error:e=>{this.handleWeb3ResponseMessage((0,h_.Web3ResponseMessage)({id:r.id,response:{method:r.request.method,errorMessage:e.message}}))}}))}publishWeb3RequestCanceledEvent(e){const t=(0,c_.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",t,!1).subscribe())}publishEvent(e,t,n){const r=this.session.secret;return new Yv.Observable((e=>{i_.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin})),r).then((t=>{e.next(t),e.complete()}))})).pipe((0,Kv.mergeMap)((t=>this.connection.publishEvent(e,t,n))))}handleIncomingEvent(e){try{this.subscriptions.add((0,Yv.from)(i_.decrypt(e.data,this.session.secret)).pipe((0,Kv.map)((e=>JSON.parse(e)))).subscribe({next:e=>{const t=(0,h_.isWeb3ResponseMessage)(e)?e:null;t&&this.handleWeb3ResponseMessage(t)},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(Xv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch(e){return}}handleWeb3ResponseMessage(e){var t;const{response:n}=e;if(null===(t=this.diagnostic)||void 0===t||t.log(Xv.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,l_.isRequestEthereumAccountsResponse)(n))return d_.accountRequestCallbackIds.forEach((t=>this.invokeCallback(Object.assign(Object.assign({},e),{id:t})))),void d_.accountRequestCallbackIds.clear();this.invokeCallback(e)}handleErrorResponse(e,t,n,r){this.handleWeb3ResponseMessage((0,h_.Web3ResponseMessage)({id:e,response:(0,l_.ErrorResponse)(t,(null!=n?n:t_.WalletUIError.UserRejectedRequest).message,r)}))}invokeCallback(e){const t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:a_.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},t=(0,r_.randomBytesHex)(8),n=n=>{this.publishWeb3RequestCanceledEvent(t),this.handleErrorResponse(t,e.method,n)};return{promise:new Promise(((r,i)=>{var o;this.relayEventManager.callbacks.set(t,(e=>{if(this.ui.hideRequestEthereumAccounts(),e.errorMessage)return i(new Error(e.errorMessage));r(e)}));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 e;try{e=(0,r_.isInIFrame)()&&window.top?window.top.location:window.location}catch(t){e=window.location}e.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(e.href)}`}else{if(this.ui.inlineAccountsResponse()){const e=e=>{this.handleWeb3ResponseMessage((0,h_.Web3ResponseMessage)({id:t,response:(0,l_.RequestEthereumAccountsResponse)(e)}))};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:e})}else{const e=Qv.ethErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(e)})}d_.accountRequestCallbackIds.add(t),this.ui.inlineAccountsResponse()||this.ui.isStandalone()||this.publishWeb3RequestEvent(t,e)}})),cancel:n}}selectProvider(e){const t={method:a_.Web3Method.selectProvider,params:{providerOptions:e}},n=(0,r_.randomBytesHex)(8);return{cancel:e=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,e)},promise:new Promise(((t,r)=>{this.relayEventManager.callbacks.set(n,(e=>{if(e.errorMessage)return r(new Error(e.errorMessage));t(e)}));this.ui.selectProvider&&this.ui.selectProvider({onApprove:e=>{this.handleWeb3ResponseMessage((0,h_.Web3ResponseMessage)({id:n,response:(0,l_.SelectProviderResponse)(e)}))},onCancel:e=>{this.handleWeb3ResponseMessage((0,h_.Web3ResponseMessage)({id:n,response:(0,l_.SelectProviderResponse)(n_.ProviderType.Unselected)}))},providerOptions:e})}))}}watchAsset(e,t,n,r,i,o){const s={method:a_.Web3Method.watchAsset,params:{type:e,options:{address:t,symbol:n,decimals:r,image:i},chainId:o}};let a=null;const c=(0,r_.randomBytesHex)(8),u=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,s.method,e),null==a||a()};this.ui.inlineWatchAsset()||(a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}));return{cancel:u,promise:new Promise(((u,l)=>{this.relayEventManager.callbacks.set(c,(e=>{if(null==a||a(),e.errorMessage)return l(new Error(e.errorMessage));u(e)}));const h=e=>{this.handleWeb3ResponseMessage((0,h_.Web3ResponseMessage)({id:c,response:(0,l_.WatchAssetReponse)(!1)}))},d=()=>{this.handleWeb3ResponseMessage((0,h_.Web3ResponseMessage)({id:c,response:(0,l_.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:d,onCancel:h,type:e,address:t,symbol:n,decimals:r,image:i,chainId:o}),this.ui.inlineWatchAsset()||this.ui.isStandalone()||this.publishWeb3RequestEvent(c,s)}))}}addEthereumChain(e,t,n,r,i,o){const s={method:a_.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:t,blockExplorerUrls:r,chainName:i,iconUrls:n,nativeCurrency:o}};let a=null;const c=(0,r_.randomBytesHex)(8),u=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,s.method,e),null==a||a()};this.ui.inlineAddEthereumChain(e)||(a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}));return{promise:new Promise(((t,n)=>{this.relayEventManager.callbacks.set(c,(e=>{if(null==a||a(),e.errorMessage)return n(new Error(e.errorMessage));t(e)}));const r=e=>{this.handleWeb3ResponseMessage((0,h_.Web3ResponseMessage)({id:c,response:(0,l_.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},i=e=>{this.handleWeb3ResponseMessage((0,h_.Web3ResponseMessage)({id:c,response:(0,l_.AddEthereumChainResponse)({isApproved:!0,rpcUrl:e})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:r,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(e)||this.ui.isStandalone()||this.publishWeb3RequestEvent(c,s)})),cancel:u}}switchEthereumChain(e,t){const n={method:a_.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:t})},r=(0,r_.randomBytesHex)(8);return{promise:new Promise(((e,t)=>{this.relayEventManager.callbacks.set(r,(n=>n.errorMessage&&n.errorCode?t(Qv.ethErrors.provider.custom({code:n.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):n.errorMessage?t(new Error(n.errorMessage)):void e(n)));this.ui.switchEthereumChain({onCancel:e=>{if("number"==typeof e){const t=e;this.handleWeb3ResponseMessage((0,h_.Web3ResponseMessage)({id:r,response:(0,l_.ErrorResponse)(a_.Web3Method.switchEthereumChain,t_.WalletUIError.SwitchEthereumChainUnsupportedChainId.message,t)}))}else e instanceof t_.WalletUIError?this.handleErrorResponse(r,a_.Web3Method.switchEthereumChain,e,e.errorCode):this.handleWeb3ResponseMessage((0,h_.Web3ResponseMessage)({id:r,response:(0,l_.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:e=>{this.handleWeb3ResponseMessage((0,h_.Web3ResponseMessage)({id:r,response:(0,l_.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:e})}))},chainId:n.params.chainId,address:n.params.address}),this.ui.inlineSwitchEthereumChain()||this.ui.isStandalone()||this.publishWeb3RequestEvent(r,n)})),cancel:e=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,n.method,e)}}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return o_.Session.hash(this._session.id)}sendRequestStandalone(e,t){const n=n=>{this.handleErrorResponse(e,t.method,n)},r=t=>{this.handleWeb3ResponseMessage((0,h_.Web3ResponseMessage)({id:e,response:t}))};switch(t.method){case a_.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:t,onSuccess:r,onCancel:n});break;case a_.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:t,onSuccess:r,onCancel:n});break;case a_.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:t,onSuccess:r,onCancel:n});break;case a_.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:t,onSuccess:r});break;default:n()}}onSessionConfigChanged(e){}}d_.accountRequestCallbackIds=new Set,$v([Zv.default],d_.prototype,"resetAndReload",null),$v([Zv.default],d_.prototype,"handleIncomingEvent",null),wy.WalletSDKRelay=d_;var f_={};Object.defineProperty(f_,"__esModule",{value:!0}),f_.WalletSDKRelayEventManager=void 0;const p_=ct;f_.WalletSDKRelayEventManager=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,t=(0,p_.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}};var b_="3.6.6";Object.defineProperty(l,"__esModule",{value:!0}),l.CoinbaseWalletSDK=void 0;const y_=h,g_=d,m_=f,v_=Pl,__=wy,w_=f_,S_=ct,E_=process.env.LINK_API_URL||"https://www.walletlink.org",x_=process.env.SDK_VERSION||b_||"unknown";class k_{constructor(e){var t,n,r;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const i=e.linkAPIUrl||E_;let o;if(o=e.uiConstructor?e.uiConstructor:e=>new v_.WalletSDKUI(e),void 0===e.overrideIsMetaMask?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=null===(t=e.overrideIsCoinbaseWallet)||void 0===t||t,this._overrideIsCoinbaseBrowser=null!==(n=e.overrideIsCoinbaseBrowser)&&void 0!==n&&n,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this._diagnosticLogger={log:e.eventListener.onEvent}:this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=null===(r=e.reloadOnDisconnect)||void 0===r||r;const s=new URL(i),a=`${s.protocol}//${s.host}`;this._storage=new g_.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",k_.VERSION),this.walletExtension||this.coinbaseBrowser||(this._relayEventManager=new w_.WalletSDKRelayEventManager,this._relay=new __.WalletSDKRelay({linkAPIUrl:i,version:x_,darkMode:!!e.darkMode,uiConstructor:o,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(e.appName,e.appLogoUrl),e.headlessMode||this._relay.attachUI())}makeWeb3Provider(e="",t=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,t),!1===this._reloadOnDisconnect&&"function"==typeof n.disableReloadOnDisconnect&&n.disableReloadOnDisconnect(),n;const r=this.coinbaseBrowser;if(r)return r;const i=this._relay;if(!i||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||i.setConnectDisabled(!0),new m_.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(i),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:t,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,t){var n;this._appName=e||"DApp",this._appLogoUrl=t||(0,S_.getFavicon)();const r=this.walletExtension;r?this.isCipherProvider(r)||r.setAppInfo(this._appName,this._appLogoUrl):null===(n=this._relay)||void 0===n||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const t=this.walletExtension;t?t.close():null===(e=this._relay)||void 0===e||e.resetAndReload()}getQrUrl(){var e,t;return null!==(t=null===(e=this._relay)||void 0===e?void 0:e.getQRCodeUrl())&&void 0!==t?t:null}getCoinbaseWalletLogo(e,t=240){return(0,y_.walletLogo)(e,t)}get walletExtension(){var e;return null!==(e=window.coinbaseWalletExtension)&&void 0!==e?e:window.walletLinkExtension}get coinbaseBrowser(){var e,t;try{const n=null!==(e=window.ethereum)&&void 0!==e?e:null===(t=window.top)||void 0===t?void 0:t.ethereum;if(!n)return;return"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch(e){return}}isCipherProvider(e){return"boolean"==typeof e.isCipher&&e.isCipher}}l.CoinbaseWalletSDK=k_,k_.VERSION=x_,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=l,n=f;var r=l;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return r.CoinbaseWalletSDK}});var i=f;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,"undefined"!=typeof window&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=n.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=n.CoinbaseWalletProvider)}(u);var C_=e.getDefaultExportFromCjs(u);exports.default=function({chainId:t,rpcUrl:n,appName:r,appLogoUrl:i,darkMode:o},s){return e.__awaiter(this,void 0,void 0,(function*(){if(window.ethereum&&(window.ethereum.isWalletLink||window.ethereum.isToshi))return e.injectedConnect(window.ethereum,s);if(!r)throw new Error("walletLink need appName");const a=new C_({appName:r,appLogoUrl:i,darkMode:o}).makeWeb3Provider(n,t);return yield a.enable(),a.on("connect",s.connect),a.on("disconnect",s.disconnect),a.on("accountsChanged",s.accountsChanged),a.on("chainChanged",s.chainChanged),a.on("message",s.message),e.convertWeb3Provider(a)}))};