@dodoex/wallet-web3 0.0.3-4 → 0.0.3

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 (97) hide show
  1. package/dist/blocto-09c42911.js +1 -0
  2. package/dist/cjs/blocto-95d84f4a.cjs +1 -0
  3. package/dist/cjs/contract/index.d.ts +12 -2
  4. package/dist/cjs/core/index.d.ts +2 -2
  5. package/dist/cjs/helpers/index.d.ts +4 -0
  6. package/dist/cjs/helpers/transactions.d.ts +5 -5
  7. package/dist/cjs/index-33b5a892.cjs +1 -0
  8. package/dist/cjs/index-7616317c.cjs +1 -0
  9. package/dist/cjs/index-bd7c2ca6.cjs +1 -0
  10. package/dist/cjs/index.cjs +1 -1
  11. package/dist/cjs/index.d.ts +1 -0
  12. package/dist/cjs/portis-a8c212e5.cjs +1 -0
  13. package/dist/cjs/provider-34824dd2.cjs +1 -0
  14. package/dist/cjs/providers/connector/blocto.d.ts +3 -0
  15. package/dist/cjs/providers/connector/index.d.ts +5 -0
  16. package/dist/cjs/providers/connector/ledgerUSB/index.d.ts +129 -1
  17. package/dist/cjs/providers/connector/ledgerUSB/provider.d.ts +131 -1
  18. package/dist/cjs/providers/connector/ledgerUSB/signer.d.ts +22 -0
  19. package/dist/cjs/providers/connector/types.d.ts +3 -0
  20. package/dist/cjs/providers/wallets/index.d.ts +24 -30
  21. package/dist/cjs/providers/wallets/injected.d.ts +1 -0
  22. package/dist/cjs/providers/wallets/standalone.d.ts +1 -0
  23. package/dist/cjs/providers/wallets/types.d.ts +22 -1
  24. package/dist/cjs/state.d.ts +3 -0
  25. package/dist/cjs/uAuth-3b336a62.cjs +1 -0
  26. package/dist/cjs/walletConnect-c200349c.cjs +1 -0
  27. package/dist/cjs/walletLink-e8ab4662.cjs +1 -0
  28. package/dist/contract/index.d.ts +12 -2
  29. package/dist/core/index.d.ts +2 -2
  30. package/dist/helpers/index.d.ts +4 -0
  31. package/dist/helpers/transactions.d.ts +5 -5
  32. package/dist/index-8b910e3a.js +1 -0
  33. package/dist/index-e0b0ac4b.js +1 -0
  34. package/dist/index-e0e540ee.js +1 -0
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.js +1 -1
  37. package/dist/portis-0205480c.js +1 -0
  38. package/dist/provider-211c7536.js +1 -0
  39. package/dist/providers/connector/blocto.d.ts +3 -0
  40. package/dist/providers/connector/index.d.ts +5 -0
  41. package/dist/providers/connector/ledgerUSB/index.d.ts +129 -1
  42. package/dist/providers/connector/ledgerUSB/provider.d.ts +131 -1
  43. package/dist/providers/connector/ledgerUSB/signer.d.ts +22 -0
  44. package/dist/providers/connector/types.d.ts +3 -0
  45. package/dist/providers/wallets/index.d.ts +24 -30
  46. package/dist/providers/wallets/injected.d.ts +1 -0
  47. package/dist/providers/wallets/standalone.d.ts +1 -0
  48. package/dist/providers/wallets/types.d.ts +22 -1
  49. package/dist/state.d.ts +3 -0
  50. package/dist/uAuth-53d868f9.js +1 -0
  51. package/dist/walletConnect-808e2ee8.js +1 -0
  52. package/dist/walletLink-cb602ab1.js +1 -0
  53. package/package.json +2 -1
  54. package/dist/_commonjsHelpers-70de2c37.js +0 -1
  55. package/dist/bn-16003306.js +0 -1
  56. package/dist/cjs/_commonjsHelpers-66ecbaf8.cjs +0 -1
  57. package/dist/cjs/bn-1bd77809.cjs +0 -1
  58. package/dist/cjs/elliptic-174586a6.cjs +0 -1
  59. package/dist/cjs/hash-121fdd2c.cjs +0 -1
  60. package/dist/cjs/index-0eeb697b.cjs +0 -22
  61. package/dist/cjs/index-33e57d81.cjs +0 -1
  62. package/dist/cjs/index-3a14a931.cjs +0 -3
  63. package/dist/cjs/index-5976e357.cjs +0 -1
  64. package/dist/cjs/index-6d7369f7.cjs +0 -1
  65. package/dist/cjs/index-a26b6945.cjs +0 -1
  66. package/dist/cjs/index-a9081fe4.cjs +0 -1
  67. package/dist/cjs/index-f7522058.cjs +0 -1
  68. package/dist/cjs/inherits-6d52d55b.cjs +0 -1
  69. package/dist/cjs/interface-6a2093d7.cjs +0 -1
  70. package/dist/cjs/node-ponyfill-c08c51bf.cjs +0 -1
  71. package/dist/cjs/portis-8c790653.cjs +0 -1
  72. package/dist/cjs/provider-95f3425c.cjs +0 -1
  73. package/dist/cjs/sha256-21fccd26.cjs +0 -1
  74. package/dist/cjs/sha3-499f6bea.cjs +0 -10
  75. package/dist/cjs/uAuth-692ecdf6.cjs +0 -1
  76. package/dist/cjs/walletConnect-14d9d490.cjs +0 -1
  77. package/dist/cjs/walletLink-b99948b8.cjs +0 -1
  78. package/dist/elliptic-1100204f.js +0 -1
  79. package/dist/hash-4b8ad136.js +0 -1
  80. package/dist/index-3a9d1d45.js +0 -22
  81. package/dist/index-5c16deff.js +0 -1
  82. package/dist/index-632fbf92.js +0 -1
  83. package/dist/index-9547c0cf.js +0 -1
  84. package/dist/index-9af08480.js +0 -2
  85. package/dist/index-a2c8f38f.js +0 -1
  86. package/dist/index-afc4ce88.js +0 -1
  87. package/dist/index-e3ab6de5.js +0 -1
  88. package/dist/inherits-e2363129.js +0 -1
  89. package/dist/interface-36a3c8cf.js +0 -1
  90. package/dist/node-ponyfill-bda9b4f4.js +0 -1
  91. package/dist/portis-f89a1cba.js +0 -1
  92. package/dist/provider-1ecbc0fa.js +0 -1
  93. package/dist/sha256-8f7b3565.js +0 -1
  94. package/dist/sha3-a5661517.js +0 -9
  95. package/dist/uAuth-1f7b3a0a.js +0 -1
  96. package/dist/walletConnect-ac756ff6.js +0 -1
  97. package/dist/walletLink-c286f908.js +0 -1
@@ -1 +0,0 @@
1
- import{f as t,_ as e,a as n,d as r,i}from"./index-afc4ce88.js";import{c as s,g as o,a}from"./_commonjsHelpers-70de2c37.js";import{f as u,s as c,p as l,d as h}from"./index-e3ab6de5.js";import{i as d}from"./inherits-e2363129.js";import{s as f,r as p,j as b,a as y,b as g}from"./index-9af08480.js";import m from"util";import v from"stream";import w from"events";import _ from"buffer";import{d as S}from"./index-632fbf92.js";import"@ethersproject/providers";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/address";import"zustand";import"tty";import"os";var M={},E={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.walletLogo=void 0;k.walletLogo=(t,e)=>{let n;switch(t){case"standard":default:return n=e,`data:image/svg+xml,%3Csvg width='${e}' 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=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' 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 x={};Object.defineProperty(x,"__esModule",{value:!0}),x.ScopedLocalStorage=void 0;x.ScopedLocalStorage=class{constructor(t){this.scope=t}setItem(t,e){localStorage.setItem(this.scopedKey(t),e)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),e=[];for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n);"string"==typeof r&&r.startsWith(t)&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}scopedKey(t){return`${this.scope}:${t}`}};var C={},I={exports:{}};!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var s;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:require("buffer").Buffer}catch(t){}function o(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function a(t,e,n){var r=o(t,n);return n-1>=e&&(r|=o(t,n-1)<<4),r}function u(t,e,r,i){for(var s=0,o=0,a=Math.min(t.length,r),u=e;u<a;u++){var c=t.charCodeAt(u)-48;s*=i,o=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&o<i,"Invalid character"),s+=o}return s}function c(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var s,o,a=0;if("be"===r)for(i=t.length-1,s=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(i=0,s=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,s=0,o=0;if("be"===n)for(r=t.length-1;r>=e;r-=2)i=a(t,e,r)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)i=a(t,e,r)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var s=t.length-n,o=s%r,a=Math.min(s,s-o)+n,c=0,l=n;l<a;l+=r)c=u(t,l,l+r,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var h=1;for(c=u(t,l,t.length,e),l=0;l<o;l++)h*=e;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype._move=function(t){c(t,this)},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],s=0|e.words[0],o=i*s,a=67108863&o,u=o/67108864|0;n.words[0]=a;for(var c=1;c<r;c++){for(var l=u>>>26,h=67108863&u,d=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=d;f++){var p=c-f|0;l+=(o=(i=0|t.words[p])*(s=0|e.words[f])+h)/67108864|0,h=67108863&o}n.words[c]=0|h,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,s=0,o=0;o<this.length;o++){var a=this.words[o],u=(16777215&(a<<i|s)).toString(16);s=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==s||o!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==s&&(r=s.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modrn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:h[c-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},s&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),s=r||Math.max(1,i);n(i<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,s);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,i),o},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,s=0;i<this.length;i++){var o=this.words[i]<<s|r;t[n++]=255&o,n<t.length&&(t[n++]=o>>8&255),n<t.length&&(t[n++]=o>>16&255),6===s?(n<t.length&&(t[n++]=o>>24&255),r=0,s=0):(r=o>>>24,s+=2)}if(n<t.length)for(t[n++]=r;n<t.length;)t[n++]=0},i.prototype._toArrayLikeBE=function(t,e){for(var n=t.length-1,r=0,i=0,s=0;i<this.length;i++){var o=this.words[i]<<s|r;t[n--]=255&o,n>=0&&(t[n--]=o>>8&255),n>=0&&(t[n--]=o>>16&255),6===s?(n>=0&&(t[n--]=o>>24&255),r=0,s=0):(r=o>>>24,s+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},i.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this._strip()},i.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},i.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var i=0,s=0;s<r.length;s++)e=(0|n.words[s])+(0|r.words[s])+i,this.words[s]=67108863&e,i=e>>>26;for(;0!==i&&s<n.length;s++)e=(0|n.words[s])+i,this.words[s]=67108863&e,i=e>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;s<n.length;s++)this.words[s]=n.words[s];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var s=0,o=0;o<r.length;o++)s=(e=(0|n.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<n.length;o++)s=(e=(0|n.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var b=function(t,e,n){var r,i,s,o=t.words,a=e.words,u=n.words,c=0,l=0|o[0],h=8191&l,d=l>>>13,f=0|o[1],p=8191&f,b=f>>>13,y=0|o[2],g=8191&y,m=y>>>13,v=0|o[3],w=8191&v,_=v>>>13,S=0|o[4],M=8191&S,E=S>>>13,k=0|o[5],x=8191&k,C=k>>>13,I=0|o[6],A=8191&I,N=I>>>13,R=0|o[7],T=8191&R,j=R>>>13,O=0|o[8],L=8191&O,P=O>>>13,D=0|o[9],B=8191&D,F=D>>>13,W=0|a[0],U=8191&W,H=W>>>13,V=0|a[1],z=8191&V,q=V>>>13,Z=0|a[2],G=8191&Z,$=Z>>>13,Q=0|a[3],Y=8191&Q,J=Q>>>13,K=0|a[4],X=8191&K,tt=K>>>13,et=0|a[5],nt=8191&et,rt=et>>>13,it=0|a[6],st=8191&it,ot=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191&lt,dt=lt>>>13,ft=0|a[9],pt=8191&ft,bt=ft>>>13;n.negative=t.negative^e.negative,n.length=19;var yt=(c+(r=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(d,U)|0))<<13)|0;c=((s=Math.imul(d,H))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(p,U),i=(i=Math.imul(p,H))+Math.imul(b,U)|0,s=Math.imul(b,H);var gt=(c+(r=r+Math.imul(h,z)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(d,z)|0))<<13)|0;c=((s=s+Math.imul(d,q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(g,U),i=(i=Math.imul(g,H))+Math.imul(m,U)|0,s=Math.imul(m,H),r=r+Math.imul(p,z)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(b,z)|0,s=s+Math.imul(b,q)|0;var mt=(c+(r=r+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,$)|0)+Math.imul(d,G)|0))<<13)|0;c=((s=s+Math.imul(d,$)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(w,U),i=(i=Math.imul(w,H))+Math.imul(_,U)|0,s=Math.imul(_,H),r=r+Math.imul(g,z)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(m,z)|0,s=s+Math.imul(m,q)|0,r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,G)|0,s=s+Math.imul(b,$)|0;var vt=(c+(r=r+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,Y)|0))<<13)|0;c=((s=s+Math.imul(d,J)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(M,U),i=(i=Math.imul(M,H))+Math.imul(E,U)|0,s=Math.imul(E,H),r=r+Math.imul(w,z)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(_,z)|0,s=s+Math.imul(_,q)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(m,G)|0,s=s+Math.imul(m,$)|0,r=r+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,s=s+Math.imul(b,J)|0;var wt=(c+(r=r+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,X)|0))<<13)|0;c=((s=s+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(x,U),i=(i=Math.imul(x,H))+Math.imul(C,U)|0,s=Math.imul(C,H),r=r+Math.imul(M,z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(E,z)|0,s=s+Math.imul(E,q)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,G)|0,s=s+Math.imul(_,$)|0,r=r+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,J)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,X)|0,s=s+Math.imul(b,tt)|0;var _t=(c+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(d,nt)|0))<<13)|0;c=((s=s+Math.imul(d,rt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(A,U),i=(i=Math.imul(A,H))+Math.imul(N,U)|0,s=Math.imul(N,H),r=r+Math.imul(x,z)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(C,z)|0,s=s+Math.imul(C,q)|0,r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(E,G)|0,s=s+Math.imul(E,$)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,J)|0,r=r+Math.imul(g,X)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(m,X)|0,s=s+Math.imul(m,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(b,nt)|0,s=s+Math.imul(b,rt)|0;var St=(c+(r=r+Math.imul(h,st)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(d,st)|0))<<13)|0;c=((s=s+Math.imul(d,ot)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(T,U),i=(i=Math.imul(T,H))+Math.imul(j,U)|0,s=Math.imul(j,H),r=r+Math.imul(A,z)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(N,z)|0,s=s+Math.imul(N,q)|0,r=r+Math.imul(x,G)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(C,G)|0,s=s+Math.imul(C,$)|0,r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(E,Y)|0,s=s+Math.imul(E,J)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,X)|0,s=s+Math.imul(_,tt)|0,r=r+Math.imul(g,nt)|0,i=(i=i+Math.imul(g,rt)|0)+Math.imul(m,nt)|0,s=s+Math.imul(m,rt)|0,r=r+Math.imul(p,st)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(b,st)|0,s=s+Math.imul(b,ot)|0;var Mt=(c+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,ut)|0))<<13)|0;c=((s=s+Math.imul(d,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(L,U),i=(i=Math.imul(L,H))+Math.imul(P,U)|0,s=Math.imul(P,H),r=r+Math.imul(T,z)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(j,z)|0,s=s+Math.imul(j,q)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(N,G)|0,s=s+Math.imul(N,$)|0,r=r+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(C,Y)|0,s=s+Math.imul(C,J)|0,r=r+Math.imul(M,X)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(E,X)|0,s=s+Math.imul(E,tt)|0,r=r+Math.imul(w,nt)|0,i=(i=i+Math.imul(w,rt)|0)+Math.imul(_,nt)|0,s=s+Math.imul(_,rt)|0,r=r+Math.imul(g,st)|0,i=(i=i+Math.imul(g,ot)|0)+Math.imul(m,st)|0,s=s+Math.imul(m,ot)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(b,ut)|0,s=s+Math.imul(b,ct)|0;var Et=(c+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((s=s+Math.imul(d,dt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,U),i=(i=Math.imul(B,H))+Math.imul(F,U)|0,s=Math.imul(F,H),r=r+Math.imul(L,z)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(P,z)|0,s=s+Math.imul(P,q)|0,r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(j,G)|0,s=s+Math.imul(j,$)|0,r=r+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(N,Y)|0,s=s+Math.imul(N,J)|0,r=r+Math.imul(x,X)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(C,X)|0,s=s+Math.imul(C,tt)|0,r=r+Math.imul(M,nt)|0,i=(i=i+Math.imul(M,rt)|0)+Math.imul(E,nt)|0,s=s+Math.imul(E,rt)|0,r=r+Math.imul(w,st)|0,i=(i=i+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,r=r+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(m,ut)|0,s=s+Math.imul(m,ct)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,s=s+Math.imul(b,dt)|0;var kt=(c+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((s=s+Math.imul(d,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(B,z),i=(i=Math.imul(B,q))+Math.imul(F,z)|0,s=Math.imul(F,q),r=r+Math.imul(L,G)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(P,G)|0,s=s+Math.imul(P,$)|0,r=r+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(j,Y)|0,s=s+Math.imul(j,J)|0,r=r+Math.imul(A,X)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(N,X)|0,s=s+Math.imul(N,tt)|0,r=r+Math.imul(x,nt)|0,i=(i=i+Math.imul(x,rt)|0)+Math.imul(C,nt)|0,s=s+Math.imul(C,rt)|0,r=r+Math.imul(M,st)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(E,st)|0,s=s+Math.imul(E,ot)|0,r=r+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,s=s+Math.imul(_,ct)|0,r=r+Math.imul(g,ht)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(m,ht)|0,s=s+Math.imul(m,dt)|0;var xt=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((s=s+Math.imul(b,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(B,G),i=(i=Math.imul(B,$))+Math.imul(F,G)|0,s=Math.imul(F,$),r=r+Math.imul(L,Y)|0,i=(i=i+Math.imul(L,J)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,J)|0,r=r+Math.imul(T,X)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(j,X)|0,s=s+Math.imul(j,tt)|0,r=r+Math.imul(A,nt)|0,i=(i=i+Math.imul(A,rt)|0)+Math.imul(N,nt)|0,s=s+Math.imul(N,rt)|0,r=r+Math.imul(x,st)|0,i=(i=i+Math.imul(x,ot)|0)+Math.imul(C,st)|0,s=s+Math.imul(C,ot)|0,r=r+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(E,ut)|0,s=s+Math.imul(E,ct)|0,r=r+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,dt)|0;var Ct=(c+(r=r+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,bt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((s=s+Math.imul(m,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,Y),i=(i=Math.imul(B,J))+Math.imul(F,Y)|0,s=Math.imul(F,J),r=r+Math.imul(L,X)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(P,X)|0,s=s+Math.imul(P,tt)|0,r=r+Math.imul(T,nt)|0,i=(i=i+Math.imul(T,rt)|0)+Math.imul(j,nt)|0,s=s+Math.imul(j,rt)|0,r=r+Math.imul(A,st)|0,i=(i=i+Math.imul(A,ot)|0)+Math.imul(N,st)|0,s=s+Math.imul(N,ot)|0,r=r+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(C,ut)|0,s=s+Math.imul(C,ct)|0,r=r+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(E,ht)|0,s=s+Math.imul(E,dt)|0;var It=(c+(r=r+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((s=s+Math.imul(_,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(B,X),i=(i=Math.imul(B,tt))+Math.imul(F,X)|0,s=Math.imul(F,tt),r=r+Math.imul(L,nt)|0,i=(i=i+Math.imul(L,rt)|0)+Math.imul(P,nt)|0,s=s+Math.imul(P,rt)|0,r=r+Math.imul(T,st)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(j,st)|0,s=s+Math.imul(j,ot)|0,r=r+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(N,ut)|0,s=s+Math.imul(N,ct)|0,r=r+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(C,ht)|0,s=s+Math.imul(C,dt)|0;var At=(c+(r=r+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,bt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((s=s+Math.imul(E,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(B,nt),i=(i=Math.imul(B,rt))+Math.imul(F,nt)|0,s=Math.imul(F,rt),r=r+Math.imul(L,st)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,r=r+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(j,ut)|0,s=s+Math.imul(j,ct)|0,r=r+Math.imul(A,ht)|0,i=(i=i+Math.imul(A,dt)|0)+Math.imul(N,ht)|0,s=s+Math.imul(N,dt)|0;var Nt=(c+(r=r+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((s=s+Math.imul(C,bt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(B,st),i=(i=Math.imul(B,ot))+Math.imul(F,st)|0,s=Math.imul(F,ot),r=r+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(P,ut)|0,s=s+Math.imul(P,ct)|0,r=r+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,dt)|0)+Math.imul(j,ht)|0,s=s+Math.imul(j,dt)|0;var Rt=(c+(r=r+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,bt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((s=s+Math.imul(N,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(B,ut),i=(i=Math.imul(B,ct))+Math.imul(F,ut)|0,s=Math.imul(F,ct),r=r+Math.imul(L,ht)|0,i=(i=i+Math.imul(L,dt)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,dt)|0;var Tt=(c+(r=r+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,bt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((s=s+Math.imul(j,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(B,ht),i=(i=Math.imul(B,dt))+Math.imul(F,ht)|0,s=Math.imul(F,dt);var jt=(c+(r=r+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,bt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((s=s+Math.imul(P,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ot=(c+(r=Math.imul(B,pt))|0)+((8191&(i=(i=Math.imul(B,bt))+Math.imul(F,pt)|0))<<13)|0;return c=((s=Math.imul(F,bt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=yt,u[1]=gt,u[2]=mt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=St,u[7]=Mt,u[8]=Et,u[9]=kt,u[10]=xt,u[11]=Ct,u[12]=It,u[13]=At,u[14]=Nt,u[15]=Rt,u[16]=Tt,u[17]=jt,u[18]=Ot,0!==c&&(u[19]=c,n.length++),n};function y(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,s=0;s<n.length-1;s++){var o=i;i=0;for(var a=67108863&r,u=Math.min(s,e.length-1),c=Math.max(0,s-t.length+1);c<=u;c++){var l=s-c,h=(0|t.words[l])*(0|e.words[c]),d=67108863&h;a=67108863&(d=d+a|0),i+=(o=(o=o+(h/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}n.words[s]=a,r=o,o=i}return 0!==r?n.words[s]=r:n.length--,n._strip()}function g(t,e,n){return y(t,e,n)}Math.imul||(b=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?b(this,t,e):n<63?p(this,t,e):n<1024?y(this,t,e):g(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),g(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var s=(0|this.words[i])*t,o=(67108863&s)+(67108863&r);r>>=26,r+=s/67108864|0,r+=o>>>26,this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,i=n%26;e[n]=t.words[r]>>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var s=n.sqr();r<e.length;r++,s=s.sqr())0!==e[r]&&(n=n.mul(s));return n},i.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,u=(0|this.words[e])-a<<r;this.words[e]=u|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,u=r;if(i-=o,i=Math.max(0,i),u){for(var c=0;c<o;c++)u.words[c]=this.words[c];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-s|h>>>s,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},i.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,r){var i,s,o=t.length+r;this._expand(o);var a=0;for(i=0;i<t.length;i++){s=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((s-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&s}for(;i<this.length-r;i++)a=(s=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&s;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(s=-(0|this.words[i])+a)>>26,this.words[i]=67108863&s;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),s=t,o=0|s.words[s.length-1];0!=(n=26-this._countBits(o))&&(s=s.ushln(n),r.iushln(n),o=0|s.words[s.length-1]);var a,u=r.length-s.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=r.clone()._ishlnsubmul(s,1,u);0===l.negative&&(r=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var d=67108864*(0|r.words[s.length+h])+(0|r.words[s.length+h-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(s,d,h);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(s,1,h),r.isZero()||(r.negative^=1);a&&(a.words[h]=d)}return a&&a._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(s=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:s,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(s=a.div.neg()),{div:s,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var s,o,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),s=n.cmp(r);return s<0||1===i&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,s=this.length-1;s>=0;s--)i=(r*i+(0|this.words[s]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var s=(0|this.words[i])+67108864*r;this.words[i]=s/t|0,r=s%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var s=new i(1),o=new i(0),a=new i(0),u=new i(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(s.isOdd()||o.isOdd())&&(s.iadd(l),o.isub(h)),s.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a),o.isub(u)):(r.isub(e),a.isub(s),u.isub(o))}return{a:a,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var s,o=new i(1),a=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(s=0===e.cmpn(1)?o:a).cmpn(0)<0&&s.iadd(t),s},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var s=e;e=n,n=s}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var s=i,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){r<i?e=-1:r>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new E(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},r(w,v),w.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&n,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(o&n)<<4|s>>>22,s=o}s>>>=22,t.words[i-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r(_,v),r(S,v),r(M,v),M.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,i=67108863&r;r>>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new _;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return m[t]=e,e},E.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var s=this.m.subn(1),o=0;!s.isZero()&&0===s.andln(1);)o++,s.iushrn(1);n(!s.isZero());var a=new i(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,s),d=this.pow(t,s.addn(1).iushrn(1)),f=this.pow(t,s),p=o;0!==f.cmp(a);){for(var b=f,y=0;0!==b.cmp(a);y++)b=b.redSqr();n(y<p);var g=this.pow(h,new i(1).iushln(p-y-1));d=d.redMul(g),h=g.redSqr(),f=f.redMul(h),p=y}return d},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var s=n[0],o=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;r>=0;r--){for(var c=e.words[r],l=u-1;l>=0;l--){var h=c>>l&1;s!==n[0]&&(s=this.sqr(s)),0!==h||0!==o?(o<<=1,o|=h,(4==++a||0===r&&0===l)&&(s=this.mul(s,n[o]),a=0,o=0)):a=0}u=26}return s},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new k(t)},r(k,E),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=n.isub(r).iushrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):s.cmpn(0)<0&&(o=s.iadd(this.m)),o._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(I,s);var A={},N={};Object.defineProperty(N,"__esModule",{value:!0}),N.EthereumProviderError=N.EthereumRpcError=void 0;const R=u;class T extends Error{constructor(t,e,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a nonempty string.');super(e),this.code=t,void 0!==n&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return R.default(this.serialize(),j,2)}}N.EthereumRpcError=T;function j(t,e){if("[Circular]"!==e)return e}N.EthereumProviderError=class extends T{constructor(t,e,n){if(!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,n)}};var O={},L={};Object.defineProperty(L,"__esModule",{value:!0}),L.errorValues=L.errorCodes=void 0,L.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}},L.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=L,n=N,r=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:r,message:o(r)};function o(n,r=i){if(Number.isInteger(n)){const r=n.toString();if(l(e.errorValues,r))return e.errorValues[r].message;if(u(n))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function a(t){if(!Number.isInteger(t))return!1;const n=t.toString();return!!e.errorValues[n]||!!u(t)}function u(t){return t>=-32099&&t<=-32e3}function c(t){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({},t):t}function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=o,t.isValidCode=a,t.serializeError=function(t,{fallbackError:e=s,shouldIncludeStack:r=!1}={}){var i,u;if(!e||!Number.isInteger(e.code)||"string"!=typeof e.message)throw new Error("Must provide fallback error with integer number code and string message.");if(t instanceof n.EthereumRpcError)return t.serialize();const h={};if(t&&"object"==typeof t&&!Array.isArray(t)&&l(t,"code")&&a(t.code)){const e=t;h.code=e.code,e.message&&"string"==typeof e.message?(h.message=e.message,l(e,"data")&&(h.data=e.data)):(h.message=o(h.code),h.data={originalError:c(t)})}else{h.code=e.code;const n=null===(i=t)||void 0===i?void 0:i.message;h.message=n&&"string"==typeof n?n:e.message,h.data={originalError:c(t)}}const d=null===(u=t)||void 0===u?void 0:u.stack;return r&&t&&d&&"string"==typeof d&&(h.stack=d),h}}(O);var P={};Object.defineProperty(P,"__esModule",{value:!0}),P.ethErrors=void 0;const D=N,B=O,F=L;function W(t,e){const[n,r]=H(e);return new D.EthereumRpcError(t,n||B.getMessageFromCode(t),r)}function U(t,e){const[n,r]=H(e);return new D.EthereumProviderError(t,n||B.getMessageFromCode(t),r)}function H(t){if(t){if("string"==typeof t)return[t];if("object"==typeof t&&!Array.isArray(t)){const{message:e,data:n}=t;if(e&&"string"!=typeof e)throw new Error("Must specify string message.");return[e||void 0,n]}}return[]}P.ethErrors={rpc:{parse:t=>W(F.errorCodes.rpc.parse,t),invalidRequest:t=>W(F.errorCodes.rpc.invalidRequest,t),invalidParams:t=>W(F.errorCodes.rpc.invalidParams,t),methodNotFound:t=>W(F.errorCodes.rpc.methodNotFound,t),internal:t=>W(F.errorCodes.rpc.internal,t),server:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return W(e,t)},invalidInput:t=>W(F.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>W(F.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>W(F.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>W(F.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>W(F.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>W(F.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>U(F.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>U(F.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>U(F.errorCodes.provider.unsupportedMethod,t),disconnected:t=>U(F.errorCodes.provider.disconnected,t),chainDisconnected:t=>U(F.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:n,data:r}=t;if(!n||"string"!=typeof n)throw new Error('"message" must be a nonempty string');return new D.EthereumProviderError(e,n,r)}}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=N;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const n=O;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const r=P;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return r.ethErrors}});const i=L;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})}(A);var V={};Object.defineProperty(V,"__esModule",{value:!0}),V.EVENTS=void 0,V.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 z={},q={exports:{}},Z=f.exports.Buffer;function G(t,e){this._block=Z.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}G.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=Z.from(t,e));for(var n=this._block,r=this._blockSize,i=t.length,s=this._len,o=0;o<i;){for(var a=s%r,u=Math.min(i-o,r-a),c=0;c<u;c++)n[a+c]=t[o+c];o+=u,(s+=u)%r==0&&this._update(n)}return this._len+=i,this},G.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var 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 s=this._hash();return t?s.toString(t):s},G.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var $=G,Q=d.exports,Y=$,J=f.exports.Buffer,K=[1518500249,1859775393,-1894007588,-899497514],X=new Array(80);function tt(){this.init(),this._w=X,Y.call(this,64,56)}function et(t){return t<<30|t>>>2}function nt(t,e,n,r){return 0===t?e&n|~e&r:2===t?e&n|e&r|n&r:e^n^r}Q(tt,Y),tt.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},tt.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,s=0|this._c,o=0|this._d,a=0|this._e,u=0;u<16;++u)n[u]=t.readInt32BE(4*u);for(;u<80;++u)n[u]=n[u-3]^n[u-8]^n[u-14]^n[u-16];for(var c=0;c<80;++c){var l=~~(c/20),h=0|((e=r)<<5|e>>>27)+nt(l,i,s,o)+a+n[c]+K[l];a=o,o=s,s=et(i),i=r,r=h}this._a=r+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0},tt.prototype._hash=function(){var t=J.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var rt=tt,it=d.exports,st=$,ot=f.exports.Buffer,at=[1518500249,1859775393,-1894007588,-899497514],ut=new Array(80);function ct(){this.init(),this._w=ut,st.call(this,64,56)}function lt(t){return t<<5|t>>>27}function ht(t){return t<<30|t>>>2}function dt(t,e,n,r){return 0===t?e&n|~e&r:2===t?e&n|e&r|n&r:e^n^r}it(ct,st),ct.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},ct.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,s=0|this._c,o=0|this._d,a=0|this._e,u=0;u<16;++u)n[u]=t.readInt32BE(4*u);for(;u<80;++u)n[u]=(e=n[u-3]^n[u-8]^n[u-14]^n[u-16])<<1|e>>>31;for(var c=0;c<80;++c){var l=~~(c/20),h=lt(r)+dt(l,i,s,o)+a+n[c]+at[l]|0;a=o,o=s,s=ht(i),i=r,r=h}this._a=r+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0},ct.prototype._hash=function(){var t=ot.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var ft=ct,pt=d.exports,bt=$,yt=f.exports.Buffer,gt=[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],mt=new Array(64);function vt(){this.init(),this._w=mt,bt.call(this,64,56)}function wt(t,e,n){return n^t&(e^n)}function _t(t,e,n){return t&e|n&(t|e)}function St(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function Mt(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function Et(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function kt(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}pt(vt,bt),vt.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},vt.prototype._update=function(t){for(var e=this._w,n=0|this._a,r=0|this._b,i=0|this._c,s=0|this._d,o=0|this._e,a=0|this._f,u=0|this._g,c=0|this._h,l=0;l<16;++l)e[l]=t.readInt32BE(4*l);for(;l<64;++l)e[l]=kt(e[l-2])+e[l-7]+Et(e[l-15])+e[l-16]|0;for(var h=0;h<64;++h){var d=c+Mt(o)+wt(o,a,u)+gt[h]+e[h]|0,f=St(n)+_t(n,r,i)|0;c=u,u=a,a=o,o=s+d|0,s=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=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},vt.prototype._hash=function(){var t=yt.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var xt=vt,Ct=d.exports,It=xt,At=$,Nt=f.exports.Buffer,Rt=new Array(64);function Tt(){this.init(),this._w=Rt,At.call(this,64,56)}Ct(Tt,It),Tt.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},Tt.prototype._hash=function(){var t=Nt.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var jt=Tt,Ot=d.exports,Lt=$,Pt=f.exports.Buffer,Dt=[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],Bt=new Array(160);function Ft(){this.init(),this._w=Bt,Lt.call(this,128,112)}function Wt(t,e,n){return n^t&(e^n)}function Ut(t,e,n){return t&e|n&(t|e)}function Ht(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function Vt(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function zt(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function qt(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function Zt(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function Gt(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function $t(t,e){return t>>>0<e>>>0?1:0}Ot(Ft,Lt),Ft.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},Ft.prototype._update=function(t){for(var e=this._w,n=0|this._ah,r=0|this._bh,i=0|this._ch,s=0|this._dh,o=0|this._eh,a=0|this._fh,u=0|this._gh,c=0|this._hh,l=0|this._al,h=0|this._bl,d=0|this._cl,f=0|this._dl,p=0|this._el,b=0|this._fl,y=0|this._gl,g=0|this._hl,m=0;m<32;m+=2)e[m]=t.readInt32BE(4*m),e[m+1]=t.readInt32BE(4*m+4);for(;m<160;m+=2){var v=e[m-30],w=e[m-30+1],_=zt(v,w),S=qt(w,v),M=Zt(v=e[m-4],w=e[m-4+1]),E=Gt(w,v),k=e[m-14],x=e[m-14+1],C=e[m-32],I=e[m-32+1],A=S+x|0,N=_+k+$t(A,S)|0;N=(N=N+M+$t(A=A+E|0,E)|0)+C+$t(A=A+I|0,I)|0,e[m]=N,e[m+1]=A}for(var R=0;R<160;R+=2){N=e[R],A=e[R+1];var T=Ut(n,r,i),j=Ut(l,h,d),O=Ht(n,l),L=Ht(l,n),P=Vt(o,p),D=Vt(p,o),B=Dt[R],F=Dt[R+1],W=Wt(o,a,u),U=Wt(p,b,y),H=g+D|0,V=c+P+$t(H,g)|0;V=(V=(V=V+W+$t(H=H+U|0,U)|0)+B+$t(H=H+F|0,F)|0)+N+$t(H=H+A|0,A)|0;var z=L+j|0,q=O+T+$t(z,L)|0;c=u,g=y,u=a,y=b,a=o,b=p,o=s+V+$t(p=f+H|0,f)|0,s=i,f=d,i=r,d=h,r=n,h=l,n=V+q+$t(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+$t(this._al,l)|0,this._bh=this._bh+r+$t(this._bl,h)|0,this._ch=this._ch+i+$t(this._cl,d)|0,this._dh=this._dh+s+$t(this._dl,f)|0,this._eh=this._eh+o+$t(this._el,p)|0,this._fh=this._fh+a+$t(this._fl,b)|0,this._gh=this._gh+u+$t(this._gl,y)|0,this._hh=this._hh+c+$t(this._hl,g)|0},Ft.prototype._hash=function(){var t=Pt.allocUnsafe(64);function e(e,n,r){t.writeInt32BE(e,r),t.writeInt32BE(n,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var Qt=Ft,Yt=d.exports,Jt=Qt,Kt=$,Xt=f.exports.Buffer,te=new Array(160);function ee(){this.init(),this._w=te,Kt.call(this,128,112)}Yt(ee,Jt),ee.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},ee.prototype._hash=function(){var t=Xt.allocUnsafe(48);function e(e,n,r){t.writeInt32BE(e,r),t.writeInt32BE(n,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var ne=ee,re=q.exports=function(t){t=t.toLowerCase();var e=re[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};re.sha=rt,re.sha1=ft,re.sha224=jt,re.sha256=xt,re.sha384=ne,re.sha512=Qt;var ie,se={},oe="undefined"!=typeof Symbol&&Symbol,ae=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0},ue=Array.prototype.slice,ce=Object.prototype.toString,le=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==ce.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var n,r=ue.call(arguments,1),i=Math.max(0,e.length-r.length),s=[],o=0;o<i;o++)s.push("$"+o);if(n=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof n){var i=e.apply(this,r.concat(ue.call(arguments)));return Object(i)===i?i:this}return e.apply(t,r.concat(ue.call(arguments)))})),e.prototype){var a=function(){};a.prototype=e.prototype,n.prototype=new a,a.prototype=null}return n},he=Function.prototype.bind||le,de=he.call(Function.call,Object.prototype.hasOwnProperty),fe=SyntaxError,pe=Function,be=TypeError,ye=function(t){try{return pe('"use strict"; return ('+t+").constructor;")()}catch(t){}},ge=Object.getOwnPropertyDescriptor;if(ge)try{ge({},"")}catch(ah){ge=null}var me=function(){throw new be},ve=ge?function(){try{return me}catch(t){try{return ge(arguments,"callee").get}catch(t){return me}}}():me,we="function"==typeof oe&&"function"==typeof Symbol&&"symbol"==typeof oe("foo")&&"symbol"==typeof Symbol("bar")&&ae(),_e=Object.getPrototypeOf||function(t){return t.__proto__},Se={},Me="undefined"==typeof Uint8Array?ie:_e(Uint8Array),Ee={"%AggregateError%":"undefined"==typeof AggregateError?ie:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?ie:ArrayBuffer,"%ArrayIteratorPrototype%":we?_e([][Symbol.iterator]()):ie,"%AsyncFromSyncIteratorPrototype%":ie,"%AsyncFunction%":Se,"%AsyncGenerator%":Se,"%AsyncGeneratorFunction%":Se,"%AsyncIteratorPrototype%":Se,"%Atomics%":"undefined"==typeof Atomics?ie:Atomics,"%BigInt%":"undefined"==typeof BigInt?ie:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?ie:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?ie:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?ie:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?ie:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?ie:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?ie:FinalizationRegistry,"%Function%":pe,"%GeneratorFunction%":Se,"%Int8Array%":"undefined"==typeof Int8Array?ie:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?ie:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?ie:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":we?_e(_e([][Symbol.iterator]())):ie,"%JSON%":"object"==typeof JSON?JSON:ie,"%Map%":"undefined"==typeof Map?ie:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&we?_e((new Map)[Symbol.iterator]()):ie,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?ie:Promise,"%Proxy%":"undefined"==typeof Proxy?ie:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?ie:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?ie:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&we?_e((new Set)[Symbol.iterator]()):ie,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?ie:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":we?_e(""[Symbol.iterator]()):ie,"%Symbol%":we?Symbol:ie,"%SyntaxError%":fe,"%ThrowTypeError%":ve,"%TypedArray%":Me,"%TypeError%":be,"%Uint8Array%":"undefined"==typeof Uint8Array?ie:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?ie:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?ie:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?ie:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?ie:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?ie:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?ie:WeakSet};try{null.error}catch(ah){var ke=_e(_e(ah));Ee["%Error.prototype%"]=ke}var xe=function t(e){var n;if("%AsyncFunction%"===e)n=ye("async function () {}");else if("%GeneratorFunction%"===e)n=ye("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=ye("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(n=_e(i.prototype))}return Ee[e]=n,n},Ce={"%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"]},Ie=he,Ae=de,Ne=Ie.call(Function.call,Array.prototype.concat),Re=Ie.call(Function.apply,Array.prototype.splice),Te=Ie.call(Function.call,String.prototype.replace),je=Ie.call(Function.call,String.prototype.slice),Oe=Ie.call(Function.call,RegExp.prototype.exec),Le=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Pe=/\\(\\)?/g,De=function(t,e){var n,r=t;if(Ae(Ce,r)&&(r="%"+(n=Ce[r])[0]+"%"),Ae(Ee,r)){var i=Ee[r];if(i===Se&&(i=xe(r)),void 0===i&&!e)throw new be("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new fe("intrinsic "+t+" does not exist!")},Be=function(t,e){if("string"!=typeof t||0===t.length)throw new be("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new be('"allowMissing" argument must be a boolean');if(null===Oe(/^%?[^%]*%?$/,t))throw new fe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(t){var e=je(t,0,1),n=je(t,-1);if("%"===e&&"%"!==n)throw new fe("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new fe("invalid intrinsic syntax, expected opening `%`");var r=[];return Te(t,Le,(function(t,e,n,i){r[r.length]=n?Te(i,Pe,"$1"):e||t})),r}(t),r=n.length>0?n[0]:"",i=De("%"+r+"%",e),s=i.name,o=i.value,a=!1,u=i.alias;u&&(r=u[0],Re(n,Ne([0,1],u)));for(var c=1,l=!0;c<n.length;c+=1){var h=n[c],d=je(h,0,1),f=je(h,-1);if(('"'===d||"'"===d||"`"===d||'"'===f||"'"===f||"`"===f)&&d!==f)throw new fe("property names with quotes must have matching quotes");if("constructor"!==h&&l||(a=!0),Ae(Ee,s="%"+(r+="."+h)+"%"))o=Ee[s];else if(null!=o){if(!(h in o)){if(!e)throw new be("base intrinsic for "+t+" exists, but the property is not available.");return}if(ge&&c+1>=n.length){var p=ge(o,h);o=(l=!!p)&&"get"in p&&!("originalValue"in p.get)?p.get:o[h]}else l=Ae(o,h),o=o[h];l&&!a&&(Ee[s]=o)}}return o},Fe={exports:{}};!function(t){var e=he,n=Be,r=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),s=n("%Reflect.apply%",!0)||e.call(i,r),o=n("%Object.getOwnPropertyDescriptor%",!0),a=n("%Object.defineProperty%",!0),u=n("%Math.max%");if(a)try{a({},"a",{value:1})}catch(t){a=null}t.exports=function(t){var n=s(e,i,arguments);o&&a&&(o(n,"length").configurable&&a(n,"length",{value:1+u(0,t.length-(arguments.length-1))}));return n};var c=function(){return s(e,r,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c}(Fe);var We=Be,Ue=Fe.exports,He=Ue(We("String.prototype.indexOf")),Ve=m.inspect,ze="function"==typeof Map&&Map.prototype,qe=Object.getOwnPropertyDescriptor&&ze?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ze=ze&&qe&&"function"==typeof qe.get?qe.get:null,Ge=ze&&Map.prototype.forEach,$e="function"==typeof Set&&Set.prototype,Qe=Object.getOwnPropertyDescriptor&&$e?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ye=$e&&Qe&&"function"==typeof Qe.get?Qe.get:null,Je=$e&&Set.prototype.forEach,Ke="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,Xe="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,tn="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,en=Boolean.prototype.valueOf,nn=Object.prototype.toString,rn=Function.prototype.toString,sn=String.prototype.match,on=String.prototype.slice,an=String.prototype.replace,un=String.prototype.toUpperCase,cn=String.prototype.toLowerCase,ln=RegExp.prototype.test,hn=Array.prototype.concat,dn=Array.prototype.join,fn=Array.prototype.slice,pn=Math.floor,bn="function"==typeof BigInt?BigInt.prototype.valueOf:null,yn=Object.getOwnPropertySymbols,gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,mn="function"==typeof Symbol&&"object"==typeof Symbol.iterator,vn="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===mn||"symbol")?Symbol.toStringTag:null,wn=Object.prototype.propertyIsEnumerable,_n=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Sn(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||ln.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var r=t<0?-pn(-t):pn(t);if(r!==t){var i=String(r),s=on.call(e,i.length+1);return an.call(i,n,"$&_")+"."+an.call(an.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return an.call(e,n,"$&_")}var Mn=Ve,En=Mn.custom,kn=Nn(En)?En:null;function xn(t,e,n){var r="double"===(n.quoteStyle||e)?'"':"'";return r+t+r}function Cn(t){return an.call(String(t),/"/g,"&quot;")}function In(t){return!("[object Array]"!==jn(t)||vn&&"object"==typeof t&&vn in t)}function An(t){return!("[object RegExp]"!==jn(t)||vn&&"object"==typeof t&&vn in t)}function Nn(t){if(mn)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!gn)return!1;try{return gn.call(t),!0}catch(t){}return!1}var Rn=Object.prototype.hasOwnProperty||function(t){return t in this};function Tn(t,e){return Rn.call(t,e)}function jn(t){return nn.call(t)}function On(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function Ln(t,e){if(t.length>e.maxStringLength){var n=t.length-e.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Ln(on.call(t,0,e.maxStringLength),e)+r}return xn(an.call(an.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Pn),"single",e)}function Pn(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+un.call(e.toString(16))}function Dn(t){return"Object("+t+")"}function Bn(t){return t+" { ? }"}function Fn(t,e,n,r){return t+" ("+e+") {"+(r?Wn(n,r):dn.call(n,", "))+"}"}function Wn(t,e){if(0===t.length)return"";var n="\n"+e.prev+e.base;return n+dn.call(t,","+n)+"\n"+e.prev}function Un(t,e){var n=In(t),r=[];if(n){r.length=t.length;for(var i=0;i<t.length;i++)r[i]=Tn(t,i)?e(t[i],t):""}var s,o="function"==typeof yn?yn(t):[];if(mn){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var u in t)Tn(t,u)&&(n&&String(Number(u))===u&&u<t.length||mn&&s["$"+u]instanceof Symbol||(ln.call(/[^\w$]/,u)?r.push(e(u,t)+": "+e(t[u],t)):r.push(u+": "+e(t[u],t))));if("function"==typeof yn)for(var c=0;c<o.length;c++)wn.call(t,o[c])&&r.push("["+e(o[c])+"]: "+e(t[o[c]],t));return r}var Hn=Be,Vn=function(t,e){var n=We(t,!!e);return"function"==typeof n&&He(t,".prototype.")>-1?Ue(n):n},zn=function t(e,n,r,i){var s=n||{};if(Tn(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Tn(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=!Tn(s,"customInspect")||s.customInspect;if("boolean"!=typeof o&&"symbol"!==o)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Tn(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Tn(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return Ln(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var u=String(e);return a?Sn(e,u):u}if("bigint"==typeof e){var c=String(e)+"n";return a?Sn(e,c):c}var l=void 0===s.depth?5:s.depth;if(void 0===r&&(r=0),r>=l&&l>0&&"object"==typeof e)return In(e)?"[Array]":"[Object]";var h=function(t,e){var n;if("\t"===t.indent)n="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;n=dn.call(Array(t.indent+1)," ")}return{base:n,prev:dn.call(Array(e+1),n)}}(s,r);if(void 0===i)i=[];else if(On(i,e)>=0)return"[Circular]";function d(e,n,o){if(n&&(i=fn.call(i)).push(n),o){var a={depth:s.depth};return Tn(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,r+1,i)}return t(e,s,r+1,i)}if("function"==typeof e&&!An(e)){var f=function(t){if(t.name)return t.name;var e=sn.call(rn.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),p=Un(e,d);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+dn.call(p,", ")+" }":"")}if(Nn(e)){var b=mn?an.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):gn.call(e);return"object"!=typeof e||mn?b:Dn(b)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var y="<"+cn.call(String(e.nodeName)),g=e.attributes||[],m=0;m<g.length;m++)y+=" "+g[m].name+"="+xn(Cn(g[m].value),"double",s);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+cn.call(String(e.nodeName))+">"}if(In(e)){if(0===e.length)return"[]";var v=Un(e,d);return h&&!function(t){for(var e=0;e<t.length;e++)if(On(t[e],"\n")>=0)return!1;return!0}(v)?"["+Wn(v,h)+"]":"[ "+dn.call(v,", ")+" ]"}if(function(t){return!("[object Error]"!==jn(t)||vn&&"object"==typeof t&&vn in t)}(e)){var w=Un(e,d);return"cause"in Error.prototype||!("cause"in e)||wn.call(e,"cause")?0===w.length?"["+String(e)+"]":"{ ["+String(e)+"] "+dn.call(w,", ")+" }":"{ ["+String(e)+"] "+dn.call(hn.call("[cause]: "+d(e.cause),w),", ")+" }"}if("object"==typeof e&&o){if(kn&&"function"==typeof e[kn]&&Mn)return Mn(e,{depth:l-r});if("symbol"!==o&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!Ze||!t||"object"!=typeof t)return!1;try{Ze.call(t);try{Ye.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var _=[];return Ge&&Ge.call(e,(function(t,n){_.push(d(n,e,!0)+" => "+d(t,e))})),Fn("Map",Ze.call(e),_,h)}if(function(t){if(!Ye||!t||"object"!=typeof t)return!1;try{Ye.call(t);try{Ze.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var S=[];return Je&&Je.call(e,(function(t){S.push(d(t,e))})),Fn("Set",Ye.call(e),S,h)}if(function(t){if(!Ke||!t||"object"!=typeof t)return!1;try{Ke.call(t,Ke);try{Xe.call(t,Xe)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Bn("WeakMap");if(function(t){if(!Xe||!t||"object"!=typeof t)return!1;try{Xe.call(t,Xe);try{Ke.call(t,Ke)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Bn("WeakSet");if(function(t){if(!tn||!t||"object"!=typeof t)return!1;try{return tn.call(t),!0}catch(t){}return!1}(e))return Bn("WeakRef");if(function(t){return!("[object Number]"!==jn(t)||vn&&"object"==typeof t&&vn in t)}(e))return Dn(d(Number(e)));if(function(t){if(!t||"object"!=typeof t||!bn)return!1;try{return bn.call(t),!0}catch(t){}return!1}(e))return Dn(d(bn.call(e)));if(function(t){return!("[object Boolean]"!==jn(t)||vn&&"object"==typeof t&&vn in t)}(e))return Dn(en.call(e));if(function(t){return!("[object String]"!==jn(t)||vn&&"object"==typeof t&&vn in t)}(e))return Dn(d(String(e)));if(!function(t){return!("[object Date]"!==jn(t)||vn&&"object"==typeof t&&vn in t)}(e)&&!An(e)){var M=Un(e,d),E=_n?_n(e)===Object.prototype:e instanceof Object||e.constructor===Object,k=e instanceof Object?"":"null prototype",x=!E&&vn&&Object(e)===e&&vn in e?on.call(jn(e),8,-1):k?"Object":"",C=(E||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(x||k?"["+dn.call(hn.call([],x||[],k||[]),": ")+"] ":"");return 0===M.length?C+"{}":h?C+"{"+Wn(M,h)+"}":C+"{ "+dn.call(M,", ")+" }"}return String(e)},qn=Hn("%TypeError%"),Zn=Hn("%WeakMap%",!0),Gn=Hn("%Map%",!0),$n=Vn("WeakMap.prototype.get",!0),Qn=Vn("WeakMap.prototype.set",!0),Yn=Vn("WeakMap.prototype.has",!0),Jn=Vn("Map.prototype.get",!0),Kn=Vn("Map.prototype.set",!0),Xn=Vn("Map.prototype.has",!0),tr=function(t,e){for(var n,r=t;null!==(n=r.next);r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},er=String.prototype.replace,nr=/%20/g,rr="RFC3986",ir={default:rr,formatters:{RFC1738:function(t){return er.call(t,nr,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:rr},sr=ir,or=Object.prototype.hasOwnProperty,ar=Array.isArray,ur=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),cr=function(t,e){for(var n=e&&e.plainObjects?Object.create(null):{},r=0;r<t.length;++r)void 0!==t[r]&&(n[r]=t[r]);return n},lr={arrayToObject:cr,assign:function(t,e){return Object.keys(e).reduce((function(t,n){return t[n]=e[n],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],n=[],r=0;r<e.length;++r)for(var i=e[r],s=i.obj[i.prop],o=Object.keys(s),a=0;a<o.length;++a){var u=o[a],c=s[u];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(e.push({obj:s,prop:u}),n.push(c))}return function(t){for(;t.length>1;){var e=t.pop(),n=e.obj[e.prop];if(ar(n)){for(var r=[],i=0;i<n.length;++i)void 0!==n[i]&&r.push(n[i]);e.obj[e.prop]=r}}}(e),t},decode:function(t,e,n){var r=t.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(t){return r}},encode:function(t,e,n,r,i){if(0===t.length)return t;var s=t;if("symbol"==typeof t?s=Symbol.prototype.toString.call(t):"string"!=typeof t&&(s=String(t)),"iso-8859-1"===n)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var o="",a=0;a<s.length;++a){var u=s.charCodeAt(a);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===sr.RFC1738&&(40===u||41===u)?o+=s.charAt(a):u<128?o+=ur[u]:u<2048?o+=ur[192|u>>6]+ur[128|63&u]:u<55296||u>=57344?o+=ur[224|u>>12]+ur[128|u>>6&63]+ur[128|63&u]:(a+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(a)),o+=ur[240|u>>18]+ur[128|u>>12&63]+ur[128|u>>6&63]+ur[128|63&u])}return o},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(ar(t)){for(var n=[],r=0;r<t.length;r+=1)n.push(e(t[r]));return n}return e(t)},merge:function t(e,n,r){if(!n)return e;if("object"!=typeof n){if(ar(e))e.push(n);else{if(!e||"object"!=typeof e)return[e,n];(r&&(r.plainObjects||r.allowPrototypes)||!or.call(Object.prototype,n))&&(e[n]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(n);var i=e;return ar(e)&&!ar(n)&&(i=cr(e,r)),ar(e)&&ar(n)?(n.forEach((function(n,i){if(or.call(e,i)){var s=e[i];s&&"object"==typeof s&&n&&"object"==typeof n?e[i]=t(s,n,r):e.push(n)}else e[i]=n})),e):Object.keys(n).reduce((function(e,i){var s=n[i];return or.call(e,i)?e[i]=t(e[i],s,r):e[i]=s,e}),i)}},hr=function(){var t,e,n,r={assert:function(t){if(!r.has(t))throw new qn("Side channel does not contain "+zn(t))},get:function(r){if(Zn&&r&&("object"==typeof r||"function"==typeof r)){if(t)return $n(t,r)}else if(Gn){if(e)return Jn(e,r)}else if(n)return function(t,e){var n=tr(t,e);return n&&n.value}(n,r)},has:function(r){if(Zn&&r&&("object"==typeof r||"function"==typeof r)){if(t)return Yn(t,r)}else if(Gn){if(e)return Xn(e,r)}else if(n)return function(t,e){return!!tr(t,e)}(n,r);return!1},set:function(r,i){Zn&&r&&("object"==typeof r||"function"==typeof r)?(t||(t=new Zn),Qn(t,r,i)):Gn?(e||(e=new Gn),Kn(e,r,i)):(n||(n={key:{},next:null}),function(t,e,n){var r=tr(t,e);r?r.value=n:t.next={key:e,next:t.next,value:n}}(n,r,i))}};return r},dr=lr,fr=ir,pr=Object.prototype.hasOwnProperty,br={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},yr=Array.isArray,gr=Array.prototype.push,mr=function(t,e){gr.apply(t,yr(e)?e:[e])},vr=Date.prototype.toISOString,wr=fr.default,_r={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:dr.encode,encodeValuesOnly:!1,format:wr,formatter:fr.formatters[wr],indices:!1,serializeDate:function(t){return vr.call(t)},skipNulls:!1,strictNullHandling:!1},Sr={},Mr=function t(e,n,r,i,s,o,a,u,c,l,h,d,f,p,b,y){for(var g=e,m=y,v=0,w=!1;void 0!==(m=m.get(Sr))&&!w;){var _=m.get(e);if(v+=1,void 0!==_){if(_===v)throw new RangeError("Cyclic object value");w=!0}void 0===m.get(Sr)&&(v=0)}if("function"==typeof u?g=u(n,g):g instanceof Date?g=h(g):"comma"===r&&yr(g)&&(g=dr.maybeMap(g,(function(t){return t instanceof Date?h(t):t}))),null===g){if(s)return a&&!p?a(n,_r.encoder,b,"key",d):n;g=""}if(function(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||"symbol"==typeof t||"bigint"==typeof t}(g)||dr.isBuffer(g))return a?[f(p?n:a(n,_r.encoder,b,"key",d))+"="+f(a(g,_r.encoder,b,"value",d))]:[f(n)+"="+f(String(g))];var S,M=[];if(void 0===g)return M;if("comma"===r&&yr(g))p&&a&&(g=dr.maybeMap(g,a)),S=[{value:g.length>0?g.join(",")||null:void 0}];else if(yr(u))S=u;else{var E=Object.keys(g);S=c?E.sort(c):E}for(var k=i&&yr(g)&&1===g.length?n+"[]":n,x=0;x<S.length;++x){var C=S[x],I="object"==typeof C&&void 0!==C.value?C.value:g[C];if(!o||null!==I){var A=yr(g)?"function"==typeof r?r(k,C):k:k+(l?"."+C:"["+C+"]");y.set(e,v);var N=hr();N.set(Sr,y),mr(M,t(I,A,r,i,s,o,"comma"===r&&p&&yr(g)?null:a,u,c,l,h,d,f,p,b,N))}}return M},Er=lr,kr=Object.prototype.hasOwnProperty,xr=Array.isArray,Cr={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Er.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Ir=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},Ar=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Nr=function(t,e,n,r){if(t){var i=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/g,o=n.depth>0&&/(\[[^[\]]*])/.exec(i),a=o?i.slice(0,o.index):i,u=[];if(a){if(!n.plainObjects&&kr.call(Object.prototype,a)&&!n.allowPrototypes)return;u.push(a)}for(var c=0;n.depth>0&&null!==(o=s.exec(i))&&c<n.depth;){if(c+=1,!n.plainObjects&&kr.call(Object.prototype,o[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(o[1])}return o&&u.push("["+i.slice(o.index)+"]"),function(t,e,n,r){for(var i=r?e:Ar(e,n),s=t.length-1;s>=0;--s){var o,a=t[s];if("[]"===a&&n.parseArrays)o=[].concat(i);else{o=n.plainObjects?Object.create(null):{};var u="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(u,10);n.parseArrays||""!==u?!isNaN(c)&&a!==u&&String(c)===u&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(o=[])[c]=i:"__proto__"!==u&&(o[u]=i):o={0:i}}i=o}return i}(u,e,n,r)}},Rr=function(t,e){var n,r=t,i=function(t){if(!t)return _r;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||_r.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=fr.default;if(void 0!==t.format){if(!pr.call(fr.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var r=fr.formatters[n],i=_r.filter;return("function"==typeof t.filter||yr(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:_r.addQueryPrefix,allowDots:void 0===t.allowDots?_r.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:_r.charsetSentinel,delimiter:void 0===t.delimiter?_r.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:_r.encode,encoder:"function"==typeof t.encoder?t.encoder:_r.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:_r.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:_r.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:_r.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:_r.strictNullHandling}}(e);"function"==typeof i.filter?r=(0,i.filter)("",r):yr(i.filter)&&(n=i.filter);var s,o=[];if("object"!=typeof r||null===r)return"";s=e&&e.arrayFormat in br?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var a=br[s];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u="comma"===a&&e&&e.commaRoundTrip;n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var c=hr(),l=0;l<n.length;++l){var h=n[l];i.skipNulls&&null===r[h]||mr(o,Mr(r[h],h,a,u,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,c))}var d=o.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:""},Tr=function(t,e){var n=function(t){if(!t)return Cr;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?Cr.charset:t.charset;return{allowDots:void 0===t.allowDots?Cr.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:Cr.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:Cr.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:Cr.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Cr.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:Cr.comma,decoder:"function"==typeof t.decoder?t.decoder:Cr.decoder,delimiter:"string"==typeof t.delimiter||Er.isRegExp(t.delimiter)?t.delimiter:Cr.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:Cr.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:Cr.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:Cr.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:Cr.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Cr.strictNullHandling}}(e);if(""===t||null==t)return n.plainObjects?Object.create(null):{};for(var r="string"==typeof t?function(t,e){var n,r={},i=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,s=e.parameterLimit===1/0?void 0:e.parameterLimit,o=i.split(e.delimiter,s),a=-1,u=e.charset;if(e.charsetSentinel)for(n=0;n<o.length;++n)0===o[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===o[n]?u="utf-8":"utf8=%26%2310003%3B"===o[n]&&(u="iso-8859-1"),a=n,n=o.length);for(n=0;n<o.length;++n)if(n!==a){var c,l,h=o[n],d=h.indexOf("]="),f=-1===d?h.indexOf("="):d+1;-1===f?(c=e.decoder(h,Cr.decoder,u,"key"),l=e.strictNullHandling?null:""):(c=e.decoder(h.slice(0,f),Cr.decoder,u,"key"),l=Er.maybeMap(Ar(h.slice(f+1),e),(function(t){return e.decoder(t,Cr.decoder,u,"value")}))),l&&e.interpretNumericEntities&&"iso-8859-1"===u&&(l=Ir(l)),h.indexOf("[]=")>-1&&(l=xr(l)?[l]:l),kr.call(r,c)?r[c]=Er.combine(r[c],l):r[c]=l}return r}(t,n):t,i=n.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var a=s[o],u=Nr(a,r[a],n,"string"==typeof t);i=Er.merge(i,u,n)}return!0===n.allowSparse?i:Er.compact(i)},jr={formats:ir,parse:Tr,stringify:Rr},Or={};!function(t){function e(){return t=>t}var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0,t.OpaqueType=e,t.HexString=t=>t,t.AddressString=t=>t,t.BigIntString=t=>t,t.IntNumber=function(t){return Math.floor(t)},t.RegExpString=t=>t,(n=t.ProviderType||(t.ProviderType={})).CoinbaseWallet="CoinbaseWallet",n.MetaMask="MetaMask",n.Unselected=""}(Or);var Lr=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(se,"__esModule",{value:!0}),se.isInIFrame=se.createQrUrl=se.getFavicon=se.range=se.isBigNumber=se.ensureParsedJSONObject=se.ensureBN=se.ensureRegExpString=se.ensureIntNumber=se.ensureBuffer=se.ensureAddressString=se.ensureEvenLengthHexString=se.ensureHexString=se.isHexString=se.prepend0x=se.strip0x=se.has0xPrefix=se.hexStringFromIntNumber=se.intNumberFromHexString=se.bigIntStringFromBN=se.hexStringFromBuffer=se.hexStringToUint8Array=se.uint8ArrayToHex=se.randomBytesHex=void 0;const Pr=Lr(I.exports),Dr=jr,Br=Or,Fr=/^[0-9]*$/,Wr=/^[a-f0-9]*$/;function Ur(t){return[...t].map((t=>t.toString(16).padStart(2,"0"))).join("")}function Hr(t){return t.startsWith("0x")||t.startsWith("0X")}function Vr(t){return Hr(t)?t.slice(2):t}function zr(t){return Hr(t)?"0x"+t.slice(2):"0x"+t}function qr(t){if("string"!=typeof t)return!1;const e=Vr(t).toLowerCase();return Wr.test(e)}function Zr(t,e=!1){if("string"==typeof t){const n=Vr(t).toLowerCase();if(Wr.test(n))return(0,Br.HexString)(e?"0x"+n:n)}throw new Error(`"${String(t)}" is not a hexadecimal string`)}function Gr(t,e=!1){let n=Zr(t,!1);return n.length%2==1&&(n=(0,Br.HexString)("0"+n)),e?(0,Br.HexString)("0x"+n):n}function $r(t){if("number"==typeof t&&Number.isInteger(t))return(0,Br.IntNumber)(t);if("string"==typeof t){if(Fr.test(t))return(0,Br.IntNumber)(Number(t));if(qr(t))return(0,Br.IntNumber)(new Pr.default(Gr(t,!1),16).toNumber())}throw new Error(`Not an integer: ${String(t)}`)}function Qr(t){if(null==t||"function"!=typeof t.constructor)return!1;const{constructor:e}=t;return"function"==typeof e.config&&"number"==typeof e.EUCLID}se.randomBytesHex=function(t){return Ur(crypto.getRandomValues(new Uint8Array(t)))},se.uint8ArrayToHex=Ur,se.hexStringToUint8Array=function(t){return new Uint8Array(t.match(/.{1,2}/g).map((t=>parseInt(t,16))))},se.hexStringFromBuffer=function(t,e=!1){const n=t.toString("hex");return(0,Br.HexString)(e?"0x"+n:n)},se.bigIntStringFromBN=function(t){return(0,Br.BigIntString)(t.toString(10))},se.intNumberFromHexString=function(t){return(0,Br.IntNumber)(new Pr.default(Gr(t,!1),16).toNumber())},se.hexStringFromIntNumber=function(t){return(0,Br.HexString)("0x"+new Pr.default(t).toString(16))},se.has0xPrefix=Hr,se.strip0x=Vr,se.prepend0x=zr,se.isHexString=qr,se.ensureHexString=Zr,se.ensureEvenLengthHexString=Gr,se.ensureAddressString=function(t){if("string"==typeof t){const e=Vr(t).toLowerCase();if(qr(e)&&40===e.length)return(0,Br.AddressString)(zr(e))}throw new Error(`Invalid Ethereum address: ${String(t)}`)},se.ensureBuffer=function(t){if(Buffer.isBuffer(t))return t;if("string"==typeof t){if(qr(t)){const e=Gr(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw new Error(`Not binary data: ${String(t)}`)},se.ensureIntNumber=$r,se.ensureRegExpString=function(t){if(t instanceof RegExp)return(0,Br.RegExpString)(t.toString());throw new Error(`Not a RegExp: ${String(t)}`)},se.ensureBN=function(t){if(null!==t&&(Pr.default.isBN(t)||Qr(t)))return new Pr.default(t.toString(10),10);if("number"==typeof t)return new Pr.default($r(t));if("string"==typeof t){if(Fr.test(t))return new Pr.default(t,10);if(qr(t))return new Pr.default(Gr(t,!1),16)}throw new Error(`Not an integer: ${String(t)}`)},se.ensureParsedJSONObject=function(t){if("string"==typeof t)return JSON.parse(t);if("object"==typeof t)return t;throw new Error(`Not a JSON string or an object: ${String(t)}`)},se.isBigNumber=Qr,se.range=function(t,e){return Array.from({length:e-t},((e,n)=>t+n))},se.getFavicon=function(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:n}=document.location,r=t?t.getAttribute("href"):null;return!r||r.startsWith("javascript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?e+r:`${e}//${n}${r}`},se.createQrUrl=function(t,e,n,r,i,s){return`${n}/#/link?${(0,Dr.stringify)({[r?"parent-id":"id"]:t,secret:e,server:n,v:i,chainId:s})}`},se.isInIFrame=function(){try{return null!==window.frameElement}catch(t){return!1}},Object.defineProperty(z,"__esModule",{value:!0}),z.Session=void 0;const Yr=q.exports,Jr=se,Kr="session:id",Xr="session:secret",ti="session:linked";class ei{constructor(t,e,n,r){this._storage=t,this._id=e||(0,Jr.randomBytesHex)(16),this._secret=n||(0,Jr.randomBytesHex)(32),this._key=(new Yr.sha256).update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!r}static load(t){const e=t.getItem(Kr),n=t.getItem(ti),r=t.getItem(Xr);return e&&r?new ei(t,e,r,"1"===n):null}static hash(t){return(new Yr.sha256).update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Kr,this._id),this._storage.setItem(Xr,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(ti,this._linked?"1":"0")}}z.Session=ei;var ni={};Object.defineProperty(ni,"__esModule",{value:!0}),ni.WalletSDKRelayAbstract=ni.APP_VERSION_KEY=ni.LOCAL_STORAGE_ADDRESSES_KEY=ni.WALLET_USER_NAME_KEY=void 0;const ri=A;ni.WALLET_USER_NAME_KEY="walletUsername",ni.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",ni.APP_VERSION_KEY="AppVersion";ni.WalletSDKRelayAbstract=class{async makeEthereumJSONRPCRequest(t,e){if(!e)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(e,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then((t=>t.json())).then((t=>{if(!t)throw ri.ethErrors.rpc.parse({});const e=t,{error:n}=e;if(n)throw(0,ri.serializeError)(n);return e}))}};var ii,si,oi,ai,ui,ci={exports:{}},li={exports:{}};function hi(){return ii||(ii=1,li.exports=v),li.exports}function di(){if(oi)return si;function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach((function(t){n(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 n(t,e,n){return(e=i(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,i(r.key),r)}}function i(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}oi=1;var s=_.Buffer,o=m.inspect,a=o&&o.custom||"inspect";function u(t,e,n){s.prototype.copy.call(t,e,n)}return si=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var n,i,c;return n=t,i=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e=s.allocUnsafe(t>>>0),n=this.head,r=0;n;)u(n.data,e,r),r+=n.data.length,n=n.next;return e}},{key:"consume",value:function(t,e){var n;return t<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):n=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,n=1,r=e.data;for(t-=r.length;e=e.next;){var i=e.data,s=t>i.length?i.length:t;if(s===i.length?r+=i:r+=i.slice(0,t),0==(t-=s)){s===i.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(s));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),n=this.head,r=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var i=n.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=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,e}},{key:a,value:function(t,n){return o(this,e(e({},n),{},{depth:0,customInspect:!1}))}}],i&&r(n.prototype,i),c&&r(n,c),Object.defineProperty(n,"prototype",{writable:!1}),t}(),si}function fi(){if(ui)return ai;function t(t,r){n(t,r),e(t)}function e(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function n(t,e){t.emit("error",e)}return ui=1,ai={destroy:function(r,i){var s=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(i?i(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,r)):process.nextTick(n,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,(function(n){!i&&n?s._writableState?s._writableState.errorEmitted?process.nextTick(e,s):(s._writableState.errorEmitted=!0,process.nextTick(t,s,n)):process.nextTick(t,s,n):i?(process.nextTick(e,s),i(n)):process.nextTick(e,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var n=t._readableState,r=t._writableState;n&&n.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}},ai}var pi,bi,yi,gi,mi,vi,wi,_i={};function Si(){if(pi)return _i;pi=1;const t={};function e(e,n,r){r||(r=Error);class i extends r{constructor(t,e,r){super(function(t,e,r){return"string"==typeof n?n:n(t,e,r)}(t,e,r))}}i.prototype.name=r.name,i.prototype.code=e,t[e]=i}function n(t,e){if(Array.isArray(t)){const n=t.length;return t=t.map((t=>String(t))),n>2?`one of ${e} ${t.slice(0,n-1).join(", ")}, or `+t[n-1]:2===n?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}return`of ${e} ${String(t)}`}return e("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),e("ERR_INVALID_ARG_TYPE",(function(t,e,r){let i;var s,o;let a;if("string"==typeof e&&(s="not ",e.substr(!o||o<0?0:+o,s.length)===s)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))a=`The ${t} ${i} ${n(e,"type")}`;else{const r=function(t,e,n){return"number"!=typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";a=`The "${t}" ${r} ${i} ${n(e,"type")}`}return a+=". Received type "+typeof r,a}),TypeError),e("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),e("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),e("ERR_STREAM_PREMATURE_CLOSE","Premature close"),e("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),e("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),e("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),e("ERR_STREAM_WRITE_AFTER_END","write after end"),e("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),e("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),e("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),_i.codes=t,_i}function Mi(){if(yi)return bi;yi=1;var t=Si().codes.ERR_INVALID_OPT_VALUE;return bi={getHighWaterMark:function(e,n,r,i){var s=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(n,i,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new t(i?r:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}}function Ei(){if(mi)return gi;function t(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var e;mi=1,gi=k,k.WritableState=E;var n={deprecate:p()},r=hi(),i=_.Buffer,o=(void 0!==s?s:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a,u=fi(),c=Mi().getHighWaterMark,l=Si().codes,h=l.ERR_INVALID_ARG_TYPE,f=l.ERR_METHOD_NOT_IMPLEMENTED,b=l.ERR_MULTIPLE_CALLBACK,y=l.ERR_STREAM_CANNOT_PIPE,g=l.ERR_STREAM_DESTROYED,m=l.ERR_STREAM_NULL_VALUES,v=l.ERR_STREAM_WRITE_AFTER_END,w=l.ERR_UNKNOWN_ENCODING,S=u.errorOrDestroy;function M(){}function E(n,r,i){e=e||ki(),n=n||{},"boolean"!=typeof i&&(i=r instanceof e),this.objectMode=!!n.objectMode,i&&(this.objectMode=this.objectMode||!!n.writableObjectMode),this.highWaterMark=c(this,n,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===n.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new b;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,i){--e.pendingcb,n?(process.nextTick(i,r),process.nextTick(R,t,e),t._writableState.errorEmitted=!0,S(t,r)):(i(r),t._writableState.errorEmitted=!0,S(t,r),R(t,e))}(t,n,r,e,i);else{var s=A(n)||t.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||I(t,n),r?process.nextTick(C,t,n,s,i):C(t,n,s,i)}}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==n.emitClose,this.autoDestroy=!!n.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}function k(t){var n=this instanceof(e=e||ki());if(!n&&!a.call(k,this))return new k(t);this._writableState=new E(t,this,n),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),r.call(this)}function x(t,e,n,r,i,s,o){e.writelen=r,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new g("write")):n?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function C(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),R(t,e)}function I(e,n){n.bufferProcessing=!0;var r=n.bufferedRequest;if(e._writev&&r&&r.next){var i=n.bufferedRequestCount,s=new Array(i),o=n.corkedRequestsFree;o.entry=r;for(var a=0,u=!0;r;)s[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;s.allBuffers=u,x(e,n,!0,n.length,s,"",o.finish),n.pendingcb++,n.lastBufferedRequest=null,o.next?(n.corkedRequestsFree=o.next,o.next=null):n.corkedRequestsFree=new t(n),n.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,h=r.callback;if(x(e,n,!1,n.objectMode?1:c.length,c,l,h),r=r.next,n.bufferedRequestCount--,n.writing)break}null===r&&(n.lastBufferedRequest=null)}n.bufferedRequest=r,n.bufferProcessing=!1}function A(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function N(t,e){t._final((function(n){e.pendingcb--,n&&S(t,n),e.prefinished=!0,t.emit("prefinish"),R(t,e)}))}function R(t,e){var n=A(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(N,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var r=t._readableState;(!r||r.autoDestroy&&r.endEmitted)&&t.destroy()}return n}return d.exports(k,r),E.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(E.prototype,"buffer",{get:n.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(t){return!!a.call(this,t)||this===k&&(t&&t._writableState instanceof E)}})):a=function(t){return t instanceof this},k.prototype.pipe=function(){S(this,new y)},k.prototype.write=function(t,e,n){var r,s=this._writableState,a=!1,u=!s.objectMode&&(r=t,i.isBuffer(r)||r instanceof o);return u&&!i.isBuffer(t)&&(t=function(t){return i.from(t)}(t)),"function"==typeof e&&(n=e,e=null),u?e="buffer":e||(e=s.defaultEncoding),"function"!=typeof n&&(n=M),s.ending?function(t,e){var n=new v;S(t,n),process.nextTick(e,n)}(this,n):(u||function(t,e,n,r){var i;return null===n?i=new m:"string"==typeof n||e.objectMode||(i=new h("chunk",["string","Buffer"],n)),!i||(S(t,i),process.nextTick(r,i),!1)}(this,s,t,n))&&(s.pendingcb++,a=function(t,e,n,r,s,o){if(!n){var a=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=i.from(e,n));return e}(e,r,s);r!==a&&(n=!0,s="buffer",r=a)}var u=e.objectMode?1:r.length;e.length+=u;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:s,isBuf:n,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else x(t,e,!1,u,r,s,o);return c}(this,s,u,t,e,n)),a},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||I(this,t))},k.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,n){n(new f("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,e,n){var r=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||function(t,e,n){e.ending=!0,R(t,e),n&&(e.finished?process.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,r,n),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=u.destroy,k.prototype._undestroy=u.undestroy,k.prototype._destroy=function(t,e){e(t)},gi}function ki(){if(wi)return vi;wi=1;var t=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};vi=o;var e=Zi(),n=Ei();d.exports(o,e);for(var r=t(n.prototype),i=0;i<r.length;i++){var s=r[i];o.prototype[s]||(o.prototype[s]=n.prototype[s])}function o(t){if(!(this instanceof o))return new o(t);e.call(this,t),n.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",a)))}function a(){this._writableState.ended||process.nextTick(u,this)}function u(t){t.end()}return Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),vi}var xi,Ci,Ii,Ai,Ni,Ri,Ti,ji,Oi,Li,Pi,Di,Bi,Fi,Wi,Ui={};function Hi(){if(xi)return Ui;xi=1;var t=f.exports.Buffer,e=t.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(n){var r;switch(this.encoding=function(n){var r=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(n);if("string"!=typeof r&&(t.isEncoding===e||!e(n)))throw new Error("Unknown encoding: "+n);return r||n}(n),this.encoding){case"utf16le":this.text=s,this.end=o,r=4;break;case"utf8":this.fillLast=i,r=4;break;case"base64":this.text=a,this.end=u,r=3;break;default:return this.write=c,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(r)}function r(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function i(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function s(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function o(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function a(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function u(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function l(t){return t&&t.length?this.write(t):""}return Ui.StringDecoder=n,n.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},n.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},n.prototype.text=function(t,e){var n=function(t,e,n){var i=e.length-1;if(i<n)return 0;var s=r(e[i]);if(s>=0)return s>0&&(t.lastNeed=s-1),s;if(--i<n||-2===s)return 0;if(s=r(e[i]),s>=0)return s>0&&(t.lastNeed=s-2),s;if(--i<n||-2===s)return 0;if(s=r(e[i]),s>=0)return s>0&&(2===s?s=0:t.lastNeed=s-3),s;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length},Ui}function Vi(){if(Ii)return Ci;Ii=1;var t=Si().codes.ERR_STREAM_PREMATURE_CLOSE;function e(){}return Ci=function n(r,i,s){if("function"==typeof i)return n(r,null,i);i||(i={}),s=function(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}}}(s||e);var o=i.readable||!1!==i.readable&&r.readable,a=i.writable||!1!==i.writable&&r.writable,u=function(){r.writable||l()},c=r._writableState&&r._writableState.finished,l=function(){a=!1,c=!0,o||s.call(r)},h=r._readableState&&r._readableState.endEmitted,d=function(){o=!1,h=!0,a||s.call(r)},f=function(t){s.call(r,t)},p=function(){var e;return o&&!h?(r._readableState&&r._readableState.ended||(e=new t),s.call(r,e)):a&&!c?(r._writableState&&r._writableState.ended||(e=new t),s.call(r,e)):void 0},b=function(){r.req.on("finish",l)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(r)?a&&!r._writableState&&(r.on("end",u),r.on("close",u)):(r.on("complete",l),r.on("abort",p),r.req?b():r.on("request",b)),r.on("end",d),r.on("finish",l),!1!==i.error&&r.on("error",f),r.on("close",p),function(){r.removeListener("complete",l),r.removeListener("abort",p),r.removeListener("request",b),r.req&&r.req.removeListener("finish",l),r.removeListener("end",u),r.removeListener("close",u),r.removeListener("finish",l),r.removeListener("end",d),r.removeListener("error",f),r.removeListener("close",p)}},Ci}function zi(){if(Ni)return Ai;var t;function e(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Ni=1;var n=Vi(),r=Symbol("lastResolve"),i=Symbol("lastReject"),s=Symbol("error"),o=Symbol("ended"),a=Symbol("lastPromise"),u=Symbol("handlePromise"),c=Symbol("stream");function l(t,e){return{value:t,done:e}}function h(t){var e=t[r];if(null!==e){var n=t[c].read();null!==n&&(t[a]=null,t[r]=null,t[i]=null,e(l(n,!1)))}}function d(t){process.nextTick(h,t)}var f=Object.getPrototypeOf((function(){})),p=Object.setPrototypeOf((e(t={get stream(){return this[c]},next:function(){var t=this,e=this[s];if(null!==e)return Promise.reject(e);if(this[o])return Promise.resolve(l(void 0,!0));if(this[c].destroyed)return new Promise((function(e,n){process.nextTick((function(){t[s]?n(t[s]):e(l(void 0,!0))}))}));var n,r=this[a];if(r)n=new Promise(function(t,e){return function(n,r){t.then((function(){e[o]?n(l(void 0,!0)):e[u](n,r)}),r)}}(r,this));else{var i=this[c].read();if(null!==i)return Promise.resolve(l(i,!1));n=new Promise(this[u])}return this[a]=n,n}},Symbol.asyncIterator,(function(){return this})),e(t,"return",(function(){var t=this;return new Promise((function(e,n){t[c].destroy(null,(function(t){t?n(t):e(l(void 0,!0))}))}))})),t),f);return Ai=function(t){var h,f=Object.create(p,(e(h={},c,{value:t,writable:!0}),e(h,r,{value:null,writable:!0}),e(h,i,{value:null,writable:!0}),e(h,s,{value:null,writable:!0}),e(h,o,{value:t._readableState.endEmitted,writable:!0}),e(h,u,{value:function(t,e){var n=f[c].read();n?(f[a]=null,f[r]=null,f[i]=null,t(l(n,!1))):(f[r]=t,f[i]=e)},writable:!0}),h));return f[a]=null,n(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=f[i];return null!==e&&(f[a]=null,f[r]=null,f[i]=null,e(t)),void(f[s]=t)}var n=f[r];null!==n&&(f[a]=null,f[r]=null,f[i]=null,n(l(void 0,!0))),f[o]=!0})),t.on("readable",d.bind(null,f)),f},Ai}function qi(){if(Ti)return Ri;function t(t,e,n,r,i,s,o){try{var a=t[s](o),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Ti=1;var r=Si().codes.ERR_INVALID_ARG_TYPE;return Ri=function(i,s,o){var a;if(s&&"function"==typeof s.next)a=s;else if(s&&s[Symbol.asyncIterator])a=s[Symbol.asyncIterator]();else{if(!s||!s[Symbol.iterator])throw new r("iterable",["Iterable"],s);a=s[Symbol.iterator]()}var u=new i(function(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({objectMode:!0},o)),c=!1;function l(){return h.apply(this,arguments)}function h(){var e;return e=function*(){try{var t=yield a.next(),e=t.value;t.done?u.push(null):u.push(yield e)?l():c=!1}catch(t){u.destroy(t)}},h=function(){var n=this,r=arguments;return new Promise((function(i,s){var o=e.apply(n,r);function a(e){t(o,i,s,a,u,"next",e)}function u(e){t(o,i,s,a,u,"throw",e)}a(void 0)}))},h.apply(this,arguments)}return u._read=function(){c||(c=!0,l())},u},Ri}function Zi(){if(Oi)return ji;var t;Oi=1,ji=x,x.ReadableState=k,w.EventEmitter;var e=function(t,e){return t.listeners(e).length},n=hi(),r=_.Buffer,i=(void 0!==s?s:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var o,a=m;o=a&&a.debuglog?a.debuglog("stream"):function(){};var u,c,l,h=di(),f=fi(),p=Mi().getHighWaterMark,b=Si().codes,y=b.ERR_INVALID_ARG_TYPE,g=b.ERR_STREAM_PUSH_AFTER_EOF,v=b.ERR_METHOD_NOT_IMPLEMENTED,S=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;d.exports(x,n);var M=f.errorOrDestroy,E=["error","close","destroy","pause","resume"];function k(e,n,r){t=t||ki(),e=e||{},"boolean"!=typeof r&&(r=n instanceof t),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=p(this,e,"readableHighWaterMark",r),this.buffer=new h,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&&(u||(u=Hi().StringDecoder),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function x(e){if(t=t||ki(),!(this instanceof x))return new x(e);var r=this instanceof t;this._readableState=new k(e,this,r),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),n.call(this)}function C(t,e,n,s,a){o("readableAddChunk",e);var u,c=t._readableState;if(null===e)c.reading=!1,function(t,e){if(o("onEofChunk"),e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?R(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,T(t)))}(t,c);else if(a||(u=function(t,e){var n;s=e,r.isBuffer(s)||s instanceof i||"string"==typeof e||void 0===e||t.objectMode||(n=new y("chunk",["string","Buffer","Uint8Array"],e));var s;return n}(c,e)),u)M(t,u);else if(c.objectMode||e&&e.length>0)if("string"==typeof e||c.objectMode||Object.getPrototypeOf(e)===r.prototype||(e=function(t){return r.from(t)}(e)),s)c.endEmitted?M(t,new S):I(t,c,e,!0);else if(c.ended)M(t,new g);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!n?(e=c.decoder.write(e),c.objectMode||0!==e.length?I(t,c,e,!1):j(t,c)):I(t,c,e,!1)}else s||(c.reading=!1,j(t,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function I(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",n)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&R(t)),j(t,e)}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),x.prototype.destroy=f.destroy,x.prototype._undestroy=f.undestroy,x.prototype._destroy=function(t,e){e(t)},x.prototype.push=function(t,e){var n,i=this._readableState;return i.objectMode?n=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=r.from(t,e),e=""),n=!0),C(this,t,e,!1,n)},x.prototype.unshift=function(t){return C(this,t,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(t){u||(u=Hi().StringDecoder);var e=new u(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=e.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var A=1073741824;function N(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=A?t=A:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function R(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(T,t))}function T(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,B(t)}function j(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(O,t,e))}function O(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var n=e.length;if(o("maybeReadMore read 0"),t.read(0),n===e.length)break}e.readingMore=!1}function L(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function P(t){o("readable nexttick read 0"),t.read(0)}function D(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),B(t),e.flowing&&!e.reading&&t.read(0)}function B(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function W(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(U,e,t))}function U(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function H(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}return x.prototype.read=function(t){o("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?W(this):R(this),null;if(0===(t=N(t,e))&&e.ended)return 0===e.length&&W(this),null;var r,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&o("length less than watermark",i=!0),e.ended||e.reading?o("reading or ended",i=!1):i&&(o("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=N(n,e))),null===(r=t>0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&W(this)),null!==r&&this.emit("data",r),r},x.prototype._read=function(t){M(this,new v("_read()"))},x.prototype.pipe=function(t,n){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,o("pipe count=%d opts=%j",i.pipesCount,n);var s=(!n||!1!==n.end)&&t!==process.stdout&&t!==process.stderr?u:b;function a(e,n){o("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,o("cleanup"),t.removeListener("close",f),t.removeListener("finish",p),t.removeListener("drain",c),t.removeListener("error",d),t.removeListener("unpipe",a),r.removeListener("end",u),r.removeListener("end",b),r.removeListener("data",h),l=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}function u(){o("onend"),t.end()}i.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",a);var c=function(t){return function(){var n=t._readableState;o("pipeOnDrain",n.awaitDrain),n.awaitDrain&&n.awaitDrain--,0===n.awaitDrain&&e(t,"data")&&(n.flowing=!0,B(t))}}(r);t.on("drain",c);var l=!1;function h(e){o("ondata");var n=t.write(e);o("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==H(i.pipes,t))&&!l&&(o("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(n){o("onerror",n),b(),t.removeListener("error",d),0===e(t,"error")&&M(t,n)}function f(){t.removeListener("finish",p),b()}function p(){o("onfinish"),t.removeListener("close",f),b()}function b(){o("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",d),t.once("close",f),t.once("finish",p),t.emit("pipe",r),i.flowing||(o("pipe resume"),r.resume()),t},x.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<i;s++)r[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=H(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n)),this},x.prototype.on=function(t,e){var r=n.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,o("on readable",i.length,i.reading),i.length?R(this):i.reading||process.nextTick(P,this))),r},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(t,e){var r=n.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(L,this),r},x.prototype.removeAllListeners=function(t){var e=n.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(L,this),e},x.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(D,t,e))}(this,t)),t.paused=!1,this},x.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(o("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s<E.length;s++)t.on(E[s],this.emit.bind(this,E[s]));return this._read=function(e){o("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===c&&(c=zi()),c(this)}),Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),x._fromList=F,Object.defineProperty(x.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(x.from=function(t,e){return void 0===l&&(l=qi()),l(x,t,e)}),ji}function Gi(){if(Pi)return Li;Pi=1,Li=a;var t=Si().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,n=t.ERR_MULTIPLE_CALLBACK,r=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=t.ERR_TRANSFORM_WITH_LENGTH_0,s=ki();function o(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new n);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function a(t){if(!(this instanceof a))return new a(t);s.call(this,t),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",u)}function u(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?c(this,null,null):this._flush((function(e,n){c(t,e,n)}))}function c(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new i;if(t._transformState.transforming)throw new r;return t.push(null)}return d.exports(a,s),a.prototype.push=function(t,e){return this._transformState.needTransform=!1,s.prototype.push.call(this,t,e)},a.prototype._transform=function(t,n,r){r(new e("_transform()"))},a.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},a.prototype._destroy=function(t,e){s.prototype._destroy.call(this,t,(function(t){e(t)}))},Li}function $i(){if(Wi)return Fi;var t;Wi=1;var e=Si().codes,n=e.ERR_MISSING_ARGS,r=e.ERR_STREAM_DESTROYED;function i(t){if(t)throw t}function s(t){t()}function o(t,e){return t.pipe(e)}return Fi=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];var c,l=function(t){return t.length?"function"!=typeof t[t.length-1]?i:t.pop():i}(a);if(Array.isArray(a[0])&&(a=a[0]),a.length<2)throw new n("streams");var h=a.map((function(e,n){var i=n<a.length-1;return function(e,n,i,s){s=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(s);var o=!1;e.on("close",(function(){o=!0})),void 0===t&&(t=Vi()),t(e,{readable:n,writable:i},(function(t){if(t)return s(t);o=!0,s()}));var a=!1;return function(t){if(!o&&!a)return a=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new r("pipe"))}}(e,i,n>0,(function(t){c||(c=t),t&&h.forEach(s),i||(h.forEach(s),l(c))}))}));return a.reduce(o)},Fi}!function(t,e){var n=v;"disable"===process.env.READABLE_STREAM&&n?(t.exports=n.Readable,Object.assign(t.exports,n),t.exports.Stream=n):((e=t.exports=Zi()).Stream=n||e,e.Readable=e,e.Writable=Ei(),e.Duplex=ki(),e.Transform=Gi(),e.PassThrough=function(){if(Bi)return Di;Bi=1,Di=e;var t=Gi();function e(n){if(!(this instanceof e))return new e(n);t.call(this,n)}return d.exports(e,t),e.prototype._transform=function(t,e,n){n(null,t)},Di}(),e.finished=Vi(),e.pipeline=$i())}(ci,ci.exports);const{Transform:Qi}=ci.exports;const{Transform:Yi}=ci.exports;const Ji=t=>class e extends Qi{constructor(e,n,r,i,s){super(s),this._rate=e,this._capacity=n,this._delimitedSuffix=r,this._hashBitLength=i,this._options=s,this._state=new t,this._state.initialize(e,n),this._finalized=!1}_transform(t,e,n){let r=null;try{this.update(t,e)}catch(t){r=t}n(r)}_flush(t){let e=null;try{this.push(this.digest())}catch(t){e=t}t(e)}update(t,e){if(!Buffer.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(t)||(t=Buffer.from(t,e)),this._state.absorb(t),this}digest(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},Ki=t=>class e extends Yi{constructor(e,n,r,i){super(i),this._rate=e,this._capacity=n,this._delimitedSuffix=r,this._options=i,this._state=new t,this._state.initialize(e,n),this._finalized=!1}_transform(t,e,n){let r=null;try{this.update(t,e)}catch(t){r=t}n(r)}_flush(){}_read(t){this.push(this.squeeze(t))}update(t,e){if(!Buffer.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(t)||(t=Buffer.from(t,e)),this._state.absorb(t),this}squeeze(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let n=this._state.squeeze(t);return void 0!==e&&(n=n.toString(e)),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}};var Xi={};const ts=[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];Xi.p1600=function(t){for(let e=0;e<24;++e){const n=t[0]^t[10]^t[20]^t[30]^t[40],r=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],u=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49];let d=l^(i<<1|s>>>31),f=h^(s<<1|i>>>31);const p=t[0]^d,b=t[1]^f,y=t[10]^d,g=t[11]^f,m=t[20]^d,v=t[21]^f,w=t[30]^d,_=t[31]^f,S=t[40]^d,M=t[41]^f;d=n^(o<<1|a>>>31),f=r^(a<<1|o>>>31);const E=t[2]^d,k=t[3]^f,x=t[12]^d,C=t[13]^f,I=t[22]^d,A=t[23]^f,N=t[32]^d,R=t[33]^f,T=t[42]^d,j=t[43]^f;d=i^(u<<1|c>>>31),f=s^(c<<1|u>>>31);const O=t[4]^d,L=t[5]^f,P=t[14]^d,D=t[15]^f,B=t[24]^d,F=t[25]^f,W=t[34]^d,U=t[35]^f,H=t[44]^d,V=t[45]^f;d=o^(l<<1|h>>>31),f=a^(h<<1|l>>>31);const z=t[6]^d,q=t[7]^f,Z=t[16]^d,G=t[17]^f,$=t[26]^d,Q=t[27]^f,Y=t[36]^d,J=t[37]^f,K=t[46]^d,X=t[47]^f;d=u^(n<<1|r>>>31),f=c^(r<<1|n>>>31);const tt=t[8]^d,et=t[9]^f,nt=t[18]^d,rt=t[19]^f,it=t[28]^d,st=t[29]^f,ot=t[38]^d,at=t[39]^f,ut=t[48]^d,ct=t[49]^f,lt=p,ht=b,dt=g<<4|y>>>28,ft=y<<4|g>>>28,pt=m<<3|v>>>29,bt=v<<3|m>>>29,yt=_<<9|w>>>23,gt=w<<9|_>>>23,mt=S<<18|M>>>14,vt=M<<18|S>>>14,wt=E<<1|k>>>31,_t=k<<1|E>>>31,St=C<<12|x>>>20,Mt=x<<12|C>>>20,Et=I<<10|A>>>22,kt=A<<10|I>>>22,xt=R<<13|N>>>19,Ct=N<<13|R>>>19,It=T<<2|j>>>30,At=j<<2|T>>>30,Nt=L<<30|O>>>2,Rt=O<<30|L>>>2,Tt=P<<6|D>>>26,jt=D<<6|P>>>26,Ot=F<<11|B>>>21,Lt=B<<11|F>>>21,Pt=W<<15|U>>>17,Dt=U<<15|W>>>17,Bt=V<<29|H>>>3,Ft=H<<29|V>>>3,Wt=z<<28|q>>>4,Ut=q<<28|z>>>4,Ht=G<<23|Z>>>9,Vt=Z<<23|G>>>9,zt=$<<25|Q>>>7,qt=Q<<25|$>>>7,Zt=Y<<21|J>>>11,Gt=J<<21|Y>>>11,$t=X<<24|K>>>8,Qt=K<<24|X>>>8,Yt=tt<<27|et>>>5,Jt=et<<27|tt>>>5,Kt=nt<<20|rt>>>12,Xt=rt<<20|nt>>>12,te=st<<7|it>>>25,ee=it<<7|st>>>25,ne=ot<<8|at>>>24,re=at<<8|ot>>>24,ie=ut<<14|ct>>>18,se=ct<<14|ut>>>18;t[0]=lt^~St&Ot,t[1]=ht^~Mt&Lt,t[10]=Wt^~Kt&pt,t[11]=Ut^~Xt&bt,t[20]=wt^~Tt&zt,t[21]=_t^~jt&qt,t[30]=Yt^~dt&Et,t[31]=Jt^~ft&kt,t[40]=Nt^~Ht&te,t[41]=Rt^~Vt&ee,t[2]=St^~Ot&Zt,t[3]=Mt^~Lt&Gt,t[12]=Kt^~pt&xt,t[13]=Xt^~bt&Ct,t[22]=Tt^~zt&ne,t[23]=jt^~qt&re,t[32]=dt^~Et&Pt,t[33]=ft^~kt&Dt,t[42]=Ht^~te&yt,t[43]=Vt^~ee&gt,t[4]=Ot^~Zt&ie,t[5]=Lt^~Gt&se,t[14]=pt^~xt&Bt,t[15]=bt^~Ct&Ft,t[24]=zt^~ne&mt,t[25]=qt^~re&vt,t[34]=Et^~Pt&$t,t[35]=kt^~Dt&Qt,t[44]=te^~yt&It,t[45]=ee^~gt&At,t[6]=Zt^~ie&lt,t[7]=Gt^~se&ht,t[16]=xt^~Bt&Wt,t[17]=Ct^~Ft&Ut,t[26]=ne^~mt&wt,t[27]=re^~vt&_t,t[36]=Pt^~$t&Yt,t[37]=Dt^~Qt&Jt,t[46]=yt^~It&Nt,t[47]=gt^~At&Rt,t[8]=ie^~lt&St,t[9]=se^~ht&Mt,t[18]=Bt^~Wt&Kt,t[19]=Ft^~Ut&Xt,t[28]=mt^~wt&Tt,t[29]=vt^~_t&jt,t[38]=$t^~Yt&dt,t[39]=Qt^~Jt&ft,t[48]=It^~Nt&Ht,t[49]=At^~Rt&Vt,t[0]^=ts[2*e],t[1]^=ts[2*e+1]}};const es=Xi;function ns(){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}ns.prototype.initialize=function(t,e){for(let t=0;t<50;++t)this.state[t]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},ns.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(es.p1600(this.state),this.count=0)},ns.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<this.count%4*8,0!=(128&t)&&this.count===this.blockSize-1&&es.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,es.p1600(this.state),this.count=0,this.squeezing=!0},ns.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=Buffer.alloc(t);for(let n=0;n<t;++n)e[n]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(es.p1600(this.state),this.count=0);return e},ns.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var rs=function(t){const e=Ji(t),n=Ki(t);return function(t,r){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new e(1152,448,null,224,r);case"keccak256":return new e(1088,512,null,256,r);case"keccak384":return new e(832,768,null,384,r);case"keccak512":return new e(576,1024,null,512,r);case"sha3-224":return new e(1152,448,6,224,r);case"sha3-256":return new e(1088,512,6,256,r);case"sha3-384":return new e(832,768,6,384,r);case"sha3-512":return new e(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: "+t)}}}(ns);const is=rs,ss=I.exports;function os(t){return Buffer.allocUnsafe(t).fill(0)}function as(t,e,n){const r=os(e);return t=us(t),n?t.length<e?(t.copy(r),r):t.slice(0,e):t.length<e?(t.copy(r,e-t.length),r):t.slice(-e)}function us(t){if(!Buffer.isBuffer(t))if(Array.isArray(t))t=Buffer.from(t);else if("string"==typeof t)t=cs(t)?Buffer.from((e=ls(t)).length%2?"0"+e:e,"hex"):Buffer.from(t);else if("number"==typeof t)t=intToBuffer(t);else if(null==t)t=Buffer.allocUnsafe(0);else if(ss.isBN(t))t=t.toArrayLike(Buffer);else{if(!t.toArray)throw new Error("invalid type");t=Buffer.from(t.toArray())}var e;return t}function cs(t){return"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]*$/)}function ls(t){return"string"==typeof t&&t.startsWith("0x")?t.slice(2):t}var hs={zeros:os,setLength:as,setLengthRight:function(t,e){return as(t,e,!0)},isHexString:cs,stripHexPrefix:ls,toBuffer:us,bufferToHex:function(t){return"0x"+(t=us(t)).toString("hex")},keccak:function(t,e){return t=us(t),e||(e=256),is("keccak"+e).update(t).digest()}};const ds=hs,fs=I.exports;function ps(t){return t.startsWith("int[")?"int256"+t.slice(3):"int"===t?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):"uint"===t?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):"fixed"===t?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):"ufixed"===t?"ufixed128x128":t}function bs(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function ys(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function gs(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?""===e[2]?"dynamic":parseInt(e[2],10):null}function ms(t){var e=typeof t;if("string"===e)return ds.isHexString(t)?new fs(ds.stripHexPrefix(t),16):new fs(t,10);if("number"===e)return new fs(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function vs(t,e){var n,r,i,s;if("address"===t)return vs("uint160",ms(e));if("bool"===t)return vs("uint8",e?1:0);if("string"===t)return vs("bytes",new Buffer(e,"utf8"));if(function(t){return t.lastIndexOf("]")===t.length-1}(t)){if(void 0===e.length)throw new Error("Not an array?");if("dynamic"!==(n=gs(t))&&0!==n&&e.length>n)throw new Error("Elements exceed array size: "+n);for(s in i=[],t=t.slice(0,t.lastIndexOf("[")),"string"==typeof e&&(e=JSON.parse(e)),e)i.push(vs(t,e[s]));if("dynamic"===n){var o=vs("uint256",e.length);i.unshift(o)}return Buffer.concat(i)}if("bytes"===t)return e=new Buffer(e),i=Buffer.concat([vs("uint256",e.length),e]),e.length%32!=0&&(i=Buffer.concat([i,ds.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if((n=bs(t))<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return ds.setLengthRight(e,32)}if(t.startsWith("uint")){if((n=bs(t))%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if((r=ms(e)).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(t.startsWith("int")){if((n=bs(t))%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if((r=ms(e)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());return r.toTwos(256).toArrayLike(Buffer,"be",32)}if(t.startsWith("ufixed")){if(n=ys(t),(r=ms(e))<0)throw new Error("Supplied ufixed is negative");return vs("uint256",r.mul(new fs(2).pow(new fs(n[1]))))}if(t.startsWith("fixed"))return n=ys(t),vs("int256",ms(e).mul(new fs(2).pow(new fs(n[1]))));throw new Error("Unsupported or invalid type: "+t)}function ws(t){return"string"===t||"bytes"===t||"dynamic"===gs(t)}function _s(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var n,r,i=[],s=0;s<t.length;s++){var o=ps(t[s]),a=e[s];if("bytes"===o)i.push(a);else if("string"===o)i.push(new Buffer(a,"utf8"));else if("bool"===o)i.push(new Buffer(a?"01":"00","hex"));else if("address"===o)i.push(ds.setLength(a,20));else if(o.startsWith("bytes")){if((n=bs(o))<1||n>32)throw new Error("Invalid bytes<N> width: "+n);i.push(ds.setLengthRight(a,n))}else if(o.startsWith("uint")){if((n=bs(o))%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if((r=ms(a)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());i.push(r.toArrayLike(Buffer,"be",n/8))}else{if(!o.startsWith("int"))throw new Error("Unsupported or invalid type: "+o);if((n=bs(o))%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if((r=ms(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 Ss={rawEncode:function(t,e){var n=[],r=[],i=32*t.length;for(var s in t){var o=ps(t[s]),a=vs(o,e[s]);ws(o)?(n.push(vs("uint256",i)),r.push(a),i+=a.length):n.push(a)}return Buffer.concat(n.concat(r))},solidityPack:_s,soliditySHA3:function(t,e){return ds.keccak(_s(t,e))}};const Ms=hs,Es=Ss,ks={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"]},xs={encodeData(t,e,n,r=!0){const i=["bytes32"],s=[this.hashType(t,n)];if(r){const o=(t,e,i)=>{if(void 0!==n[e])return["bytes32",null==i?"0x0000000000000000000000000000000000000000000000000000000000000000":Ms.keccak(this.encodeData(e,i,n,r))];if(void 0===i)throw new Error(`missing value for field ${t} of type ${e}`);if("bytes"===e)return["bytes32",Ms.keccak(i)];if("string"===e)return"string"==typeof i&&(i=Buffer.from(i,"utf8")),["bytes32",Ms.keccak(i)];if(e.lastIndexOf("]")===e.length-1){const n=e.slice(0,e.lastIndexOf("[")),r=i.map((e=>o(t,n,e)));return["bytes32",Ms.keccak(Es.rawEncode(r.map((([t])=>t)),r.map((([,t])=>t))))]}return[e,i]};for(const r of n[t]){const[t,n]=o(r.name,r.type,e[r.name]);i.push(t),s.push(n)}}else for(const o of n[t]){let t=e[o.name];if(void 0!==t)if("bytes"===o.type)i.push("bytes32"),t=Ms.keccak(t),s.push(t);else if("string"===o.type)i.push("bytes32"),"string"==typeof t&&(t=Buffer.from(t,"utf8")),t=Ms.keccak(t),s.push(t);else if(void 0!==n[o.type])i.push("bytes32"),t=Ms.keccak(this.encodeData(o.type,t,n,r)),s.push(t);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(t)}}return Es.rawEncode(i,s)},encodeType(t,e){let n="",r=this.findTypeDependencies(t,e).filter((e=>e!==t));r=[t].concat(r.sort());for(const t of r){if(!e[t])throw new Error("No type definition specified: "+t);n+=t+"("+e[t].map((({name:t,type:e})=>e+" "+t)).join(",")+")"}return n},findTypeDependencies(t,e,n=[]){if(t=t.match(/^\w*/)[0],n.includes(t)||void 0===e[t])return n;n.push(t);for(const r of e[t])for(const t of this.findTypeDependencies(r.type,e,n))!n.includes(t)&&n.push(t);return n},hashStruct(t,e,n,r=!0){return Ms.keccak(this.encodeData(t,e,n,r))},hashType(t,e){return Ms.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const n in ks.properties)t[n]&&(e[n]=t[n]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const n=this.sanitizeData(t),r=[Buffer.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,e)),"EIP712Domain"!==n.primaryType&&r.push(this.hashStruct(n.primaryType,n.message,n.types,e)),Ms.keccak(Buffer.concat(r))}};var Cs={TYPED_MESSAGE_SCHEMA:ks,TypedDataUtils:xs,hashForSignTypedDataLegacy:function(t){return function(t){const e=new Error("Expect argument to be non-empty array");if("object"!=typeof t||!t.length)throw e;const n=t.map((function(t){return"bytes"===t.type?Ms.toBuffer(t.value):t.value})),r=t.map((function(t){return t.type})),i=t.map((function(t){if(!t.name)throw e;return t.type+" "+t.name}));return Es.soliditySHA3(["bytes32","bytes32"],[Es.soliditySHA3(new Array(t.length).fill("string"),i),Es.soliditySHA3(r,n)])}(t.data)},hashForSignTypedData_v3:function(t){return xs.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return xs.hash(t.data)}};var Is={};Object.defineProperty(Is,"__esModule",{value:!0}),Is.filterFromParam=Is.FilterPolyfill=void 0;const As=Or,Ns=se,Rs={jsonrpc:"2.0",id:0};function Ts(t){return{fromBlock:Os(t.fromBlock),toBlock:Os(t.toBlock),addresses:void 0===t.address?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}function js(t){const e={fromBlock:Ls(t.fromBlock),toBlock:Ls(t.toBlock),topics:t.topics};return null!==t.addresses&&(e.address=t.addresses),e}function Os(t){if(void 0===t||"latest"===t||"pending"===t)return"latest";if("earliest"===t)return(0,As.IntNumber)(0);if((0,Ns.isHexString)(t))return(0,Ns.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function Ls(t){return"latest"===t?t:(0,Ns.hexStringFromIntNumber)(t)}function Ps(){return Object.assign(Object.assign({},Rs),{error:{code:-32e3,message:"filter not found"}})}function Ds(){return Object.assign(Object.assign({},Rs),{result:[]})}Is.FilterPolyfill=class{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,As.IntNumber)(1),this.provider=t}async newFilter(t){const e=Ts(t),n=this.makeFilterId(),r=await this.setInitialCursorPosition(n,e.fromBlock);return console.log(`Installing new log filter(${n}):`,e,"initial cursor position:",r),this.logFilters.set(n,e),this.setFilterTimeout(n),(0,Ns.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),e=await this.setInitialCursorPosition(t,"latest");return console.log(`Installing new block filter (${t}) with initial cursor position:`,e),this.blockFilters.add(t),this.setFilterTimeout(t),(0,Ns.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),e=await this.setInitialCursorPosition(t,"latest");return console.log(`Installing new block filter (${t}) with initial cursor position:`,e),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,Ns.hexStringFromIntNumber)(t)}uninstallFilter(t){const e=(0,Ns.intNumberFromHexString)(t);return console.log(`Uninstalling filter (${e})`),this.deleteFilter(e),!0}getFilterChanges(t){const e=(0,Ns.intNumberFromHexString)(t);return this.timeouts.has(e)&&this.setFilterTimeout(e),this.logFilters.has(e)?this.getLogFilterChanges(e):this.blockFilters.has(e)?this.getBlockFilterChanges(e):this.pendingTransactionFilters.has(e)?this.getPendingTransactionFilterChanges(e):Promise.resolve(Ps())}async getFilterLogs(t){const e=(0,Ns.intNumberFromHexString)(t),n=this.logFilters.get(e);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Rs),{method:"eth_getLogs",params:[js(n)]})):Ps()}makeFilterId(){return(0,As.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise(((e,n)=>{this.provider.sendAsync(t,((t,r)=>t?n(t):Array.isArray(r)||null==r?n(new Error(`unexpected response received: ${JSON.stringify(r)}`)):void e(r)))}))}deleteFilter(t){console.log(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const e=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!e)return Ps();const r=await this.getCurrentBlockHeight(),i="latest"===e.toBlock?r:e.toBlock;if(n>r)return Ds();if(n>e.toBlock)return Ds();console.log(`Fetching logs from ${n} to ${i} for filter ${t}`);const s=await this.sendAsyncPromise(Object.assign(Object.assign({},Rs),{method:"eth_getLogs",params:[js(Object.assign(Object.assign({},e),{fromBlock:n,toBlock:i}))]}));if(Array.isArray(s.result)){const e=s.result.map((t=>(0,Ns.intNumberFromHexString)(t.blockNumber||"0x0"))),r=Math.max(...e);if(r&&r>n){const e=(0,As.IntNumber)(r+1);console.log(`Moving cursor position for filter (${t}) from ${n} to ${e}`),this.cursors.set(t,e)}}return s}async getBlockFilterChanges(t){const e=this.cursors.get(t);if(!e)return Ps();const n=await this.getCurrentBlockHeight();if(e>n)return Ds();console.log(`Fetching blocks from ${e} to ${n} for filter (${t})`);const r=(await Promise.all((0,Ns.range)(e,n+1).map((t=>this.getBlockHashByNumber((0,As.IntNumber)(t)))))).filter((t=>!!t)),i=(0,As.IntNumber)(e+r.length);return console.log(`Moving cursor position for filter (${t}) from ${e} to ${i}`),this.cursors.set(t,i),Object.assign(Object.assign({},Rs),{result:r})}async getPendingTransactionFilterChanges(t){return Promise.resolve(Ds())}async setInitialCursorPosition(t,e){const n=await this.getCurrentBlockHeight(),r="number"==typeof e&&e>n?e:n;return this.cursors.set(t,r),r}setFilterTimeout(t){const e=this.timeouts.get(t);e&&window.clearTimeout(e);const n=window.setTimeout((()=>{console.log(`Filter (${t}) timed out`),this.deleteFilter(t)}),3e5);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},Rs),{method:"eth_blockNumber",params:[]}));return(0,Ns.intNumberFromHexString)((0,Ns.ensureHexString)(t))}async getBlockHashByNumber(t){const e=await this.sendAsyncPromise(Object.assign(Object.assign({},Rs),{method:"eth_getBlockByNumber",params:[(0,Ns.hexStringFromIntNumber)(t),!1]}));return e.result&&"string"==typeof e.result.hash?(0,Ns.ensureHexString)(e.result.hash):null}},Is.filterFromParam=Ts;var Bs={};!function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,(e=t.JSONRPCMethod||(t.JSONRPCMethod={})).eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(Bs);var Fs={},Ws={},Us={},Hs={},Vs=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.BaseBlockTracker=void 0;const zs=Vs(c),qs=(t,e)=>t+e,Zs=["sync","latest"];class Gs extends zs.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||2e4,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){if(this._currentBlock)return this._currentBlock;return await new Promise((t=>this.once("latest",t)))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){Zs.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Zs.map((t=>this.listenerCount(t))).reduce(qs)}_newPotentialLatest(t){const e=this._currentBlock;e&&$s(t)<=$s(e)||this._setCurrentBlock(t)}_setCurrentBlock(t){const e=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:e,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}function $s(t){return Number.parseInt(t,16)}Hs.BaseBlockTracker=Gs;var Qs={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=S;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")}(Qs);var Ys=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Us,"__esModule",{value:!0}),Us.PollingBlockTracker=void 0;const Js=Ys(b),Ks=Ys(l),Xs=Hs,to=(0,Qs.createModuleLogger)(Qs.projectLogger,"polling-block-tracker"),eo=(0,Js.default)();class no extends Xs.BaseBlockTracker{constructor(t={}){var e;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:null!==(e=t.blockResetDuration)&&void 0!==e?e:t.pollingInterval}),this._provider=t.provider,this._pollingInterval=t.pollingInterval||2e4,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=void 0===t.keepEventLoopActive||t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const t=ro(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await t}catch(e){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${null!==(t=e.stack)&&void 0!==t?t:e}`);try{this.emit("error",n)}catch(t){console.error(n)}const r=ro(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:eo(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),to("Making request",t);const e=await(0,Ks.default)((e=>this._provider.sendAsync(t,e)))();if(to("Got response",e),e.error)throw new Error(`PollingBlockTracker - encountered error fetching block:\n${e.error.message}`);return e.result}}function ro(t,e){return new Promise((n=>{const r=setTimeout(n,t);r.unref&&e&&r.unref()}))}Us.PollingBlockTracker=no;var io={},so=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(io,"__esModule",{value:!0}),io.SubscribeBlockTracker=void 0;const oo=so(b),ao=Hs,uo=(0,oo.default)();class co extends ao.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(void 0===this._subscriptionId||null===this._subscriptionId)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(null!==this._subscriptionId&&void 0!==this._subscriptionId)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...e){return new Promise(((n,r)=>{this._provider.sendAsync({id:uo(),method:t,params:e,jsonrpc:"2.0"},((t,e)=>{t?r(t):n(e.result)}))}))}_handleSubData(t,e){var n;"eth_subscription"===e.method&&(null===(n=e.params)||void 0===n?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(e.params.result.number)}}io.SubscribeBlockTracker=co;var lo={};Object.defineProperty(lo,"__esModule",{value:!0}),function(t){var e=s&&s.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),n=s&&s.__exportStar||function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(Us,t),n(io,t),n(lo,t)}(Ws);const ho=(t,e,n,r)=>function(...i){return new(0,e.promiseModule)(((s,o)=>{e.multiArgs?i.push(((...t)=>{e.errorFirst?t[0]?o(t):(t.shift(),s(t)):s(t)})):e.errorFirst?i.push(((t,e)=>{t?o(t):s(e)})):i.push(s);const a=this===n?r:this;Reflect.apply(t,a,i)}))},fo=new WeakMap;const po=c.default;var bo=class extends po{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach((t=>this.emit("update",t)))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};const yo=bo;var go=class extends yo{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}},mo={minBlockRef:function(...t){return vo(t)[0]},maxBlockRef:function(...t){const e=vo(t);return e[e.length-1]},sortBlockRefs:vo,bnToHex:function(t){return"0x"+t.toString(16)},blockRefIsNumber:function(t){return t&&!["earliest","latest","pending"].includes(t)},hexToInt:wo,incrementHexInt:function(t){if(null==t)return t;return _o(wo(t)+1)},intToHex:_o,unsafeRandomBytes:function(t){let e="0x";for(let n=0;n<t;n++)e+=So(),e+=So();return e}};function vo(t){return t.sort(((t,e)=>"latest"===t||"earliest"===e?1:"latest"===e||"earliest"===t?-1:wo(t)-wo(e)))}function wo(t){return null==t?t:Number.parseInt(t,16)}function _o(t){if(null==t)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function So(){return Math.floor(16*Math.random()).toString(16)}const Mo=y(),Eo=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const n=typeof t;if(null===t||"object"!==n&&"function"!==n)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===t?"null":n}\``);const r=new WeakMap,i=new Proxy(t,{apply(t,n,s){const o=r.get(t);if(o)return Reflect.apply(o,n,s);const a=e.excludeMain?t:ho(t,e,i,t);return r.set(t,a),Reflect.apply(a,n,s)},get(t,n){const s=t[n];if(!((t,n)=>{let r=fo.get(t);if(r||(r={},fo.set(t,r)),n in r)return r[n];const i=t=>"string"==typeof t||"symbol"==typeof n?n===t:t.test(n),s=Reflect.getOwnPropertyDescriptor(t,n),o=void 0===s||s.writable||s.configurable,a=(e.include?e.include.some(i):!e.exclude.some(i))&&o;return r[n]=a,a})(t,n)||s===Function.prototype[n])return s;const o=r.get(s);if(o)return o;if("function"==typeof s){const n=ho(s,e,i,t);return r.set(s,n),n}return s}});return i},ko=go,{bnToHex:xo,hexToInt:Co,incrementHexInt:Io,minBlockRef:Ao,blockRefIsNumber:No}=mo;var Ro=class extends ko{constructor({provider:t,params:e}){super(),this.type="log",this.ethQuery=new Mo(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},e),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map((t=>t.toLowerCase())))}async initialize({currentBlock:t}){let e=this.params.fromBlock;["latest","pending"].includes(e)&&(e=t),"earliest"===e&&(e="0x0"),this.params.fromBlock=e;const n=Ao(this.params.toBlock,t),r=Object.assign({},this.params,{toBlock:n}),i=await this._fetchLogs(r);this.addInitialResults(i)}async update({oldBlock:t,newBlock:e}){const n=e;let r;r=t?Io(t):e;const i=Object.assign({},this.params,{fromBlock:r,toBlock:n}),s=(await this._fetchLogs(i)).filter((t=>this.matchLog(t)));this.addResults(s)}async _fetchLogs(t){return await Eo((e=>this.ethQuery.getLogs(t,e)))()}matchLog(t){if(Co(this.params.fromBlock)>=Co(t.blockNumber))return!1;if(No(this.params.toBlock)&&Co(this.params.toBlock)<=Co(t.blockNumber))return!1;const e=t.address&&t.address.toLowerCase();if(this.params.address&&e&&!this.params.address.includes(e))return!1;return this.params.topics.every(((e,n)=>{let r=t.topics[n];if(!r)return!1;r=r.toLowerCase();let i=Array.isArray(e)?e:[e];if(i.includes(null))return!0;i=i.map((t=>t.toLowerCase()));return i.includes(r)}))}},To=async function({provider:t,fromBlock:e,toBlock:n}){e||(e=n);const r=jo(e),i=jo(n),s=Array(i-r+1).fill().map(((t,e)=>r+e)).map(Oo);return await Promise.all(s.map((e=>async function(t,e,n){for(let r=0;r<3;r++)try{return await Lo(t,{id:1,jsonrpc:"2.0",method:e,params:n})}catch(t){console.error(`provider.sendAsync failed: ${t.stack||t.message||t}`)}throw new Error(`Block not found for params: ${JSON.stringify(n)}`)}(t,"eth_getBlockByNumber",[e,!1]))))};function jo(t){return null==t?t:Number.parseInt(t,16)}function Oo(t){if(null==t)return t;return"0x"+t.toString(16)}function Lo(t,e){return new Promise(((n,r)=>{t.sendAsync(e,((t,e)=>{t?r(t):e.error?r(e.error):e.result?n(e.result):r(new Error("Result was empty"))}))}))}const Po=bo,Do=To,{incrementHexInt:Bo}=mo;var Fo=class extends Po{constructor({provider:t,params:e}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:e}){const n=e,r=Bo(t),i=(await Do({provider:this.provider,fromBlock:r,toBlock:n})).map((t=>t.hash));this.addResults(i)}};const Wo=bo,Uo=To,{incrementHexInt:Ho}=mo;var Vo=class extends Wo{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const e=t,n=Ho(t),r=await Uo({provider:this.provider,fromBlock:n,toBlock:e}),i=[];for(const t of r)i.push(...t.transactions);this.addResults(i)}};const zo=g().Mutex,{createAsyncMiddleware:qo,createScaffoldMiddleware:Zo}=h,Go=Ro,$o=Fo,Qo=Vo,{intToHex:Yo,hexToInt:Jo}=mo;var Ko=function({blockTracker:t,provider:e}){let n=0,r={};const i=new zo,s=function({mutex:t}){return e=>async(n,r,i,s)=>{(await t.acquire())(),e(n,r,i,s)}}({mutex:i}),o=Zo({eth_newFilter:s(Xo(u)),eth_newBlockFilter:s(Xo(c)),eth_newPendingTransactionFilter:s(Xo(l)),eth_uninstallFilter:s(ta(f)),eth_getFilterChanges:s(ta(h)),eth_getFilterLogs:s(ta(d))}),a=async({oldBlock:t,newBlock:e})=>{if(0===r.length)return;const n=await i.acquire();try{await Promise.all(ea(r).map((async n=>{try{await n.update({oldBlock:t,newBlock:e})}catch(t){console.error(t)}})))}catch(t){console.error(t)}n()};return o.newLogFilter=u,o.newBlockFilter=c,o.newPendingTransactionFilter=l,o.uninstallFilter=f,o.getFilterChanges=h,o.getFilterLogs=d,o.destroy=()=>{!async function(){const t=ea(r).length;r={},b({prevFilterCount:t,newFilterCount:0})}()},o;async function u(t){const n=new Go({provider:e,params:t});return await p(n),n}async function c(){const t=new $o({provider:e});return await p(t),t}async function l(){const t=new Qo({provider:e});return await p(t),t}async function h(t){const e=Jo(t),n=r[e];if(!n)throw new Error(`No filter for index "${e}"`);return n.getChangesAndClear()}async function d(t){const e=Jo(t),n=r[e];if(!n)throw new Error(`No filter for index "${e}"`);let i=[];return"log"===n.type&&(i=n.getAllResults()),i}async function f(t){const e=Jo(t),n=r[e],i=Boolean(n);return i&&await async function(t){const e=ea(r).length;delete r[t];const n=ea(r).length;b({prevFilterCount:e,newFilterCount:n})}(e),i}async function p(e){const i=ea(r).length,s=await t.getLatestBlock();await e.initialize({currentBlock:s}),n++,r[n]=e,e.id=n,e.idHex=Yo(n);return b({prevFilterCount:i,newFilterCount:ea(r).length}),n}function b({prevFilterCount:e,newFilterCount:n}){0===e&&n>0?t.on("sync",a):e>0&&0===n&&t.removeListener("sync",a)}};function Xo(t){return ta((async(...e)=>{const n=await t(...e);return Yo(n.id)}))}function ta(t){return qo((async(e,n)=>{const r=await t.apply(null,e.params);n.result=r}))}function ea(t,e){const n=[];for(let e in t)n.push(t[e]);return n}const na=c.default,{createAsyncMiddleware:ra,createScaffoldMiddleware:ia}=h,sa=Ko,{unsafeRandomBytes:oa,incrementHexInt:aa}=mo,ua=To;var ca=function({blockTracker:t,provider:e}){const n={},r=sa({blockTracker:t,provider:e});let i=!1;const s=new na,o=ia({eth_subscribe:ra((async function(s,o){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const u=s.params[0],c=oa(16);let l;switch(u){case"newHeads":l=h({subId:c});break;case"logs":const t=s.params[1];l=d({subId:c,filter:await r.newLogFilter(t)});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${u}"`)}return n[c]=l,void(o.result=c);function h({subId:n}){const r={type:u,destroy:async()=>{t.removeListener("sync",r.update)},update:async({oldBlock:t,newBlock:r})=>{const i=r,s=aa(t);(await ua({provider:e,fromBlock:s,toBlock:i})).map(la).filter((t=>null!==t)).forEach((t=>{a(n,t)}))}};return t.on("sync",r.update),r}function d({subId:t,filter:e}){e.on("update",(e=>a(t,e)));return{type:u,destroy:async()=>await r.uninstallFilter(e.idHex)}}})),eth_unsubscribe:ra((async function(t,e){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const r=t.params[0],s=n[r];if(!s)return void(e.result=!1);delete n[r],await s.destroy(),e.result=!0}))});return o.destroy=function(){s.removeAllListeners();for(const t in n)n[t].destroy(),delete n[t];i=!0},{events:s,middleware:o};function a(t,e){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:t,result:e}})}};function la(t){return null==t?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.SubscriptionManager=void 0;const ha=Ws,da=ca,fa=()=>{};Fs.SubscriptionManager=class{constructor(t){const e=new ha.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:r}=da({blockTracker:e,provider:t});this.events=n,this.subscriptionMiddleware=r}async handleRequest(t){const e={};return await this.subscriptionMiddleware(t,e,fa,fa),e}destroy(){this.subscriptionMiddleware.destroy()}};var pa=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(C,"__esModule",{value:!0}),C.CoinbaseWalletProvider=void 0;const ba=pa(c),ya=pa(I.exports),ga=A,ma=V,va=z,wa=ni,_a=se,Sa=pa(Cs),Ma=Is,Ea=Bs,ka=Fs,xa="DefaultChainId",Ca="DefaultJsonRpcUrl";class Ia extends ba.default{constructor(t){var e,n;super(),this._filterPolyfill=new Ma.FilterPolyfill(this),this._subscriptionManager=new ka.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this._send=this.send.bind(this),this._sendAsync=this.sendAsync.bind(this),this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=null===(e=t.overrideIsCoinbaseWallet)||void 0===e||e,this.isCoinbaseBrowser=null!==(n=t.overrideIsCoinbaseBrowser)&&void 0!==n&&n,this.qrUrl=t.qrUrl,this.supportsAddressSwitching=t.supportsAddressSwitching,this.isLedger=t.isLedger;const r=this.getChainId(),i=(0,_a.prepend0x)(r.toString(16));this.emit("connect",{chainIdStr:i});const s=this._storage.getItem(wa.LOCAL_STORAGE_ADDRESSES_KEY);if(s){const t=s.split(" ");""!==t[0]&&(this._addresses=t.map((t=>(0,_a.ensureAddressString)(t))),this.emit("accountsChanged",t))}this._subscriptionManager.events.on("notification",(t=>{this.emit("message",{type:t.method,data:t.params})})),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",(t=>{var e;if(t.origin===location.origin&&t.source===window&&"walletLinkMessage"===t.data.type){if("defaultChainChanged"===t.data.data.action||"dappChainSwitched"===t.data.data.action){const n=t.data.data.chainId,r=null!==(e=t.data.data.jsonRpcUrl)&&void 0!==e?e:this.jsonRpcUrl;this.updateProviderInfo(r,Number(n))}"addressChanged"===t.data.data.action&&this._setAddresses([t.data.data.address])}}))}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,_a.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return null!==(t=this._storage.getItem(Ca))&&void 0!==t?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(Ca,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,e){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=e,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,e){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(xa,e.toString(10));!((0,_a.ensureIntNumber)(e)!==n)&&this.hasMadeFirstChainChangedEmission||(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,e,n,r,i,s){const o=await this.initializeRelay();return!!(await o.watchAsset(t,e,n,r,i,null==s?void 0:s.toString()).promise).result}async addEthereumChain(t,e,n,r,i,s){var o,a;if((0,_a.ensureIntNumber)(t)===this.getChainId())return!1;const u=await this.initializeRelay(),c=u.inlineAddEthereumChain(t.toString());this._isAuthorized()||c||await u.requestEthereumAccounts().promise;const l=await u.addEthereumChain(t.toString(),e,i,n,r,s).promise;return!0===(null===(o=l.result)||void 0===o?void 0:o.isApproved)&&this.updateProviderInfo(e[0],t),!0===(null===(a=l.result)||void 0===a?void 0:a.isApproved)}async switchEthereumChain(t){const e=await this.initializeRelay(),n=await e.switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if(n.errorCode)throw ga.ethErrors.provider.custom({code:n.errorCode});const r=n.result;r.isApproved&&r.rpcUrl.length>0&&this.updateProviderInfo(r.rpcUrl,t)}setAppInfo(t,e){this.initializeRelay().then((n=>n.setAppInfo(t,e)))}async enable(){var t;return null===(t=this.diagnostic)||void 0===t||t.log(ma.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?va.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this._send(Ea.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(t,e){if("string"==typeof t){const n={jsonrpc:"2.0",id:0,method:t,params:Array.isArray(e)?e:void 0!==e?[e]:[]};return this._sendRequestAsync(n).then((t=>t.result))}if("function"==typeof e){const n=t,r=e;return this._sendAsync(n,r)}if(Array.isArray(t)){return t.map((t=>this._sendRequest(t)))}const n=t;return this._sendRequest(n)}async sendAsync(t,e){if("function"!=typeof e)throw new Error("callback is required");if(Array.isArray(t)){const n=e;return void this._sendMultipleRequestsAsync(t).then((t=>n(null,t))).catch((t=>n(t,null)))}const n=e;return this._sendRequestAsync(t).then((t=>n(null,t))).catch((t=>n(t,null)))}async request(t){if(!t||"object"!=typeof t||Array.isArray(t))throw ga.ethErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:n}=t;if("string"!=typeof e||0===e.length)throw ga.ethErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(void 0!==n&&!Array.isArray(n)&&("object"!=typeof n||null===n))throw ga.ethErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const r=void 0===n?[]:n,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:e,params:r,jsonrpc:"2.0",id:i})).result}async scanQRCode(t){const e=await this.initializeRelay(),n=await e.scanQRCode((0,_a.ensureRegExpString)(t)).promise;if("string"!=typeof n.result)throw new Error("result was not a string");return n.result}async genericRequest(t,e){const n=await this.initializeRelay(),r=await n.genericRequest(t,e).promise;if("string"!=typeof r.result)throw new Error("result was not a string");return r.result}async selectProvider(t){const e=await this.initializeRelay(),n=await e.selectProvider(t).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(t){const e={jsonrpc:"2.0",id:t.id},{method:n}=t;if(e.result=this._handleSynchronousMethods(t),void 0===e.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 e}_setAddresses(t,e){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map((t=>(0,_a.ensureAddressString)(t)));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&!1===this.supportsAddressSwitching&&!e||(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(wa.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" "))))}_sendRequestAsync(t){return new Promise(((e,n)=>{try{const r=this._handleSynchronousMethods(t);if(void 0!==r)return e({jsonrpc:"2.0",id:t.id,result:r});const i=this._handleAsynchronousFilterMethods(t);if(void 0!==i)return void i.then((n=>e(Object.assign(Object.assign({},n),{id:t.id})))).catch((t=>n(t)));const s=this._handleSubscriptionMethods(t);if(void 0!==s)return void s.then((n=>e({jsonrpc:"2.0",id:t.id,result:n.result}))).catch((t=>n(t)))}catch(t){return n(t)}this._handleAsynchronousMethods(t).then((n=>n&&e(Object.assign(Object.assign({},n),{id:t.id})))).catch((t=>n(t)))}))}_sendMultipleRequestsAsync(t){return Promise.all(t.map((t=>this._sendRequestAsync(t))))}_handleSynchronousMethods(t){const{method:e}=t,n=t.params||[];switch(e){case Ea.JSONRPCMethod.eth_accounts:return this._eth_accounts();case Ea.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case Ea.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case Ea.JSONRPCMethod.net_version:return this._net_version();case Ea.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:e}=t,n=t.params||[];switch(e){case Ea.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case Ea.JSONRPCMethod.eth_sign:return this._eth_sign(n);case Ea.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case Ea.JSONRPCMethod.personal_sign:return this._personal_sign(n);case Ea.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case Ea.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case Ea.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case Ea.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case Ea.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case Ea.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case Ea.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case Ea.JSONRPCMethod.eth_signTypedData_v4:case Ea.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case Ea.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(n);case Ea.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(n);case Ea.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(n);case Ea.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(t){const{method:e}=t,n=t.params||[];switch(e){case Ea.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case Ea.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case Ea.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case Ea.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case Ea.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case Ea.JSONRPCMethod.eth_subscribe:case Ea.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const e=(0,_a.ensureAddressString)(t);return this._addresses.map((t=>(0,_a.ensureAddressString)(t))).includes(e)}catch(t){}return!1}_ensureKnownAddress(t){var e;if(!this._isKnownAddress(t))throw null===(e=this.diagnostic)||void 0===e||e.log(ma.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const e=t.from?(0,_a.ensureAddressString)(t.from):this.selectedAddress;if(!e)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(e);return{fromAddress:e,toAddress:t.to?(0,_a.ensureAddressString)(t.to):null,weiValue:null!=t.value?(0,_a.ensureBN)(t.value):new ya.default(0),data:t.data?(0,_a.ensureBuffer)(t.data):Buffer.alloc(0),nonce:null!=t.nonce?(0,_a.ensureIntNumber)(t.nonce):null,gasPriceInWei:null!=t.gasPrice?(0,_a.ensureBN)(t.gasPrice):null,maxFeePerGas:null!=t.maxFeePerGas?(0,_a.ensureBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:null!=t.maxPriorityFeePerGas?(0,_a.ensureBN)(t.maxPriorityFeePerGas):null,gasLimit:null!=t.gas?(0,_a.ensureBN)(t.gas):null,chainId:this.getChainId()}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw ga.ethErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw ga.ethErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,e,n,r){this._ensureKnownAddress(e);try{const i=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await i.signEthereumMessage(t,e,n,r).promise).result}}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw ga.ethErrors.provider.userRejectedRequest("User denied message signature");throw t}}async _ethereumAddressFromSignedMessage(t,e,n){const r=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await r.ethereumAddressFromSignedMessage(t,e,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,_a.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(xa);if(!t)return(0,_a.ensureIntNumber)(this._chainIdFromOpts);const e=parseInt(t,10);return(0,_a.ensureIntNumber)(e)}async _eth_requestAccounts(){var t;if(null===(t=this.diagnostic)||void 0===t||t.log(ma.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?va.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{const t=await this.initializeRelay();e=await t.requestEthereumAccounts().promise}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw ga.ethErrors.provider.userRejectedRequest("User denied account authorization");throw t}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const e=(0,_a.ensureAddressString)(t[0]),n=(0,_a.ensureBuffer)(t[1]);return this._signEthereumMessage(n,e,!1)}_eth_ecRecover(t){const e=(0,_a.ensureBuffer)(t[0]),n=(0,_a.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(e,n,!1)}_personal_sign(t){this._requireAuthorization();const e=(0,_a.ensureBuffer)(t[0]),n=(0,_a.ensureAddressString)(t[1]);return this._signEthereumMessage(e,n,!0)}_personal_ecRecover(t){const e=(0,_a.ensureBuffer)(t[0]),n=(0,_a.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(e,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const e=this._prepareTransactionParams(t[0]||{});try{const t=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await t.signEthereumTransaction(e).promise).result}}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw ga.ethErrors.provider.userRejectedRequest("User denied transaction signature");throw t}}async _eth_sendRawTransaction(t){const e=(0,_a.ensureBuffer)(t[0]),n=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await n.submitEthereumTransaction(e,this.getChainId()).promise).result}}async _eth_sendTransaction(t){this._requireAuthorization();const e=this._prepareTransactionParams(t[0]||{});try{const t=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await t.signAndSubmitEthereumTransaction(e).promise).result}}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw ga.ethErrors.provider.userRejectedRequest("User denied transaction signature");throw t}}async _eth_signTypedData_v1(t){this._requireAuthorization();const e=(0,_a.ensureParsedJSONObject)(t[0]),n=(0,_a.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const r=Sa.default.hashForSignTypedDataLegacy({data:e}),i=JSON.stringify(e,null,2);return this._signEthereumMessage(r,n,!1,i)}async _eth_signTypedData_v3(t){this._requireAuthorization();const e=(0,_a.ensureAddressString)(t[0]),n=(0,_a.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(e);const r=Sa.default.hashForSignTypedData_v3({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(r,e,!1,i)}async _eth_signTypedData_v4(t){this._requireAuthorization();const e=(0,_a.ensureAddressString)(t[0]),n=(0,_a.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(e);const r=Sa.default.hashForSignTypedData_v4({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(r,e,!1,i)}async _cbwallet_arbitrary(t){const e=t[0],n=t[1];if("string"!=typeof n)throw new Error("parameter must be a string");if("object"!=typeof e||null===e)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(e,n)}}async _wallet_addEthereumChain(t){var e,n,r,i;const s=t[0];if(0===(null===(e=s.rpcUrls)||void 0===e?void 0:e.length))return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!s.chainName||""===s.chainName.trim())throw ga.ethErrors.provider.custom({code:0,message:"chainName is a required field"});if(!s.nativeCurrency)throw ga.ethErrors.provider.custom({code:0,message:"nativeCurrency is a required field"});const o=parseInt(s.chainId,16);return await this.addEthereumChain(o,null!==(n=s.rpcUrls)&&void 0!==n?n:[],null!==(r=s.blockExplorerUrls)&&void 0!==r?r:[],s.chainName,null!==(i=s.iconUrls)&&void 0!==i?i:[],s.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const e=t[0];return await this.switchEthereumChain(parseInt(e.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const e=Array.isArray(t)?t[0]:t;if(!e.type)throw ga.ethErrors.rpc.invalidParams({message:"Type is required"});if("ERC20"!==(null==e?void 0:e.type))throw ga.ethErrors.rpc.invalidParams({message:`Asset of type '${e.type}' is not supported`});if(!(null==e?void 0:e.options))throw ga.ethErrors.rpc.invalidParams({message:"Options are required"});if(!(null==e?void 0:e.options.address))throw ga.ethErrors.rpc.invalidParams({message:"Address is required"});const n=this.getChainId(),{address:r,symbol:i,image:s,decimals:o}=e.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(e.type,r,i,o,s,n)}}_eth_uninstallFilter(t){const e=(0,_a.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(e)}async _eth_newFilter(t){const e=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(e)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const e=(0,_a.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(e)}_eth_getFilterLogs(t){const e=(0,_a.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(e)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then((t=>(t.setAccountsCallback(((t,e)=>this._setAddresses(t,e))),t.setChainCallback(((t,e)=>{this.updateProviderInfo(e,parseInt(t,10))})),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t)))}}C.CoinbaseWalletProvider=Ia;var Aa,Na,Ra,Ta,ja,Oa,La,Pa,Da,Ba={},Fa={},Wa={},Ua={},Ha=[],Va=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function za(t,e){for(var n in e)t[n]=e[n];return t}function qa(t){var e=t.parentNode;e&&e.removeChild(t)}function Za(t,e,n){var r,i,s,o={};for(s in e)"key"==s?r=e[s]:"ref"==s?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Aa.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return Ga(t,o,r,i,null)}function Ga(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Ra:i};return null==i&&null!=Na.vnode&&Na.vnode(s),s}function $a(t){return t.children}function Qa(t,e){this.props=t,this.context=e}function Ya(t,e){if(null==e)return t.__?Ya(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?Ya(t):null}function Ja(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return Ja(t)}}function Ka(t){(!t.__d&&(t.__d=!0)&&ja.push(t)&&!Xa.__r++||Oa!==Na.debounceRendering)&&((Oa=Na.debounceRendering)||La)(Xa)}function Xa(){var t,e,n,r,i,s,o,a;for(ja.sort(Pa);t=ja.shift();)t.__d&&(e=ja.length,r=void 0,i=void 0,o=(s=(n=t).__v).__e,(a=n.__P)&&(r=[],(i=za({},s)).__v=s.__v+1,uu(a,s,i,n.__n,void 0!==a.ownerSVGElement,null!=s.__h?[o]:null,r,null==o?Ya(s):o,s.__h),cu(r,s),s.__e!=o&&Ja(s)),ja.length>e&&ja.sort(Pa));Xa.__r=0}function tu(t,e,n,r,i,s,o,a,u,c){var l,h,d,f,p,b,y,g=r&&r.__k||Ha,m=g.length;for(n.__k=[],l=0;l<e.length;l++)if(null!=(f=n.__k[l]=null==(f=e[l])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Ga(null,f,null,null,f):Array.isArray(f)?Ga($a,{children:f},null,null,null):f.__b>0?Ga(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}uu(t,f,d=d||Ua,i,s,o,a,u,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(y||(y=[]),d.ref&&y.push(d.ref,null,f),y.push(h,f.__c||p,f)),null!=p?(null==b&&(b=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=u=eu(f,u,t):u=nu(t,f,d,g,p,u),"function"==typeof n.type&&(n.__d=u)):u&&d.__e==u&&u.parentNode!=t&&(u=Ya(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=ru(r).nextSibling),du(g[l],g[l]));if(y)for(l=0;l<y.length;l++)hu(y[l],y[++l],y[++l])}function eu(t,e,n){for(var r,i=t.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=t,e="function"==typeof r.type?eu(r,e,n):nu(n,r,r,i,r.__e,e));return e}function nu(t,e,n,r,i,s){var o,a,u;if(void 0!==e.__d)o=e.__d,e.__d=void 0;else if(null==n||i!=s||null==i.parentNode)t:if(null==s||s.parentNode!==t)t.appendChild(i),o=null;else{for(a=s,u=0;(a=a.nextSibling)&&u<r.length;u+=1)if(a==i)break t;t.insertBefore(i,s),o=s}return void 0!==o?o:i.nextSibling}function ru(t){var e,n,r;if(null==t.type||"string"==typeof t.type)return t.__e;if(t.__k)for(e=t.__k.length-1;e>=0;e--)if((n=t.__k[e])&&(r=ru(n)))return r;return null}function iu(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||Va.test(e)?n:n+"px"}function su(t,e,n,r,i){var s;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||iu(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||iu(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r||t.addEventListener(e,s?au:ou,s):t.removeEventListener(e,s?au:ou,s);else if("dangerouslySetInnerHTML"!==e){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function ou(t){return this.l[t.type+!1](Na.event?Na.event(t):t)}function au(t){return this.l[t.type+!0](Na.event?Na.event(t):t)}function uu(t,e,n,r,i,s,o,a,u){var c,l,h,d,f,p,b,y,g,m,v,w,_,S,M,E=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(u=n.__h,a=e.__e=n.__e,e.__h=null,s=[a]),(c=Na.__b)&&c(e);try{t:if("function"==typeof E){if(y=e.props,g=(c=E.contextType)&&r[c.__c],m=c?g?g.props.value:c.__:r,n.__c?b=(l=e.__c=n.__c).__=l.__E:("prototype"in E&&E.prototype.render?e.__c=l=new E(y,m):(e.__c=l=new Qa(y,m),l.constructor=E,l.render=fu),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!=E.getDerivedStateFromProps&&(l.__s==l.state&&(l.__s=za({},l.__s)),za(l.__s,E.getDerivedStateFromProps(y,l.__s))),d=l.props,f=l.state,l.__v=e,h)null==E.getDerivedStateFromProps&&null!=l.componentWillMount&&l.componentWillMount(),null!=l.componentDidMount&&l.__h.push(l.componentDidMount);else{if(null==E.getDerivedStateFromProps&&y!==d&&null!=l.componentWillReceiveProps&&l.componentWillReceiveProps(y,m),!l.__e&&null!=l.shouldComponentUpdate&&!1===l.shouldComponentUpdate(y,l.__s,m)||e.__v===n.__v){for(e.__v!==n.__v&&(l.props=y,l.state=l.__s,l.__d=!1),l.__e=!1,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),v=0;v<l._sb.length;v++)l.__h.push(l._sb[v]);l._sb=[],l.__h.length&&o.push(l);break t}null!=l.componentWillUpdate&&l.componentWillUpdate(y,l.__s,m),null!=l.componentDidUpdate&&l.__h.push((function(){l.componentDidUpdate(d,f,p)}))}if(l.context=m,l.props=y,l.__P=t,w=Na.__r,_=0,"prototype"in E&&E.prototype.render){for(l.state=l.__s,l.__d=!1,w&&w(e),c=l.render(l.props,l.state,l.context),S=0;S<l._sb.length;S++)l.__h.push(l._sb[S]);l._sb=[]}else do{l.__d=!1,w&&w(e),c=l.render(l.props,l.state,l.context),l.state=l.__s}while(l.__d&&++_<25);l.state=l.__s,null!=l.getChildContext&&(r=za(za({},r),l.getChildContext())),h||null==l.getSnapshotBeforeUpdate||(p=l.getSnapshotBeforeUpdate(d,f)),M=null!=c&&c.type===$a&&null==c.key?c.props.children:c,tu(t,Array.isArray(M)?M:[M],e,n,r,i,s,o,a,u),l.base=e.__e,e.__h=null,l.__h.length&&o.push(l),b&&(l.__E=l.__=null),l.__e=!1}else null==s&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=lu(n.__e,e,n,r,i,s,o,u);(c=Na.diffed)&&c(e)}catch(t){e.__v=null,(u||null!=s)&&(e.__e=a,e.__h=!!u,s[s.indexOf(a)]=null),Na.__e(t,e,n)}}function cu(t,e){Na.__c&&Na.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Na.__e(t,e.__v)}}))}function lu(t,e,n,r,i,s,o,a){var u,c,l,h=n.props,d=e.props,f=e.type,p=0;if("svg"===f&&(i=!0),null!=s)for(;p<s.length;p++)if((u=s[p])&&"setAttribute"in u==!!f&&(f?u.localName===f:3===u.nodeType)){t=u,s[p]=null;break}if(null==t){if(null===f)return document.createTextNode(d);t=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),s=null,a=!1}if(null===f)h===d||a&&t.data===d||(t.data=d);else{if(s=s&&Aa.call(t.childNodes),c=(h=n.props||Ua).dangerouslySetInnerHTML,l=d.dangerouslySetInnerHTML,!a){if(null!=s)for(h={},p=0;p<t.attributes.length;p++)h[t.attributes[p].name]=t.attributes[p].value;(l||c)&&(l&&(c&&l.__html==c.__html||l.__html===t.innerHTML)||(t.innerHTML=l&&l.__html||""))}if(function(t,e,n,r,i){var s;for(s in n)"children"===s||"key"===s||s in e||su(t,s,null,n[s],r);for(s in e)i&&"function"!=typeof e[s]||"children"===s||"key"===s||"value"===s||"checked"===s||n[s]===e[s]||su(t,s,e[s],n[s],r)}(t,d,h,i,a),l)e.__k=[];else if(p=e.props.children,tu(t,Array.isArray(p)?p:[p],e,n,r,i&&"foreignObject"!==f,s,o,s?s[0]:n.__k&&Ya(n,0),a),null!=s)for(p=s.length;p--;)null!=s[p]&&qa(s[p]);a||("value"in d&&void 0!==(p=d.value)&&(p!==t.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&su(t,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==t.checked&&su(t,"checked",p,h.checked,!1))}return t}function hu(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){Na.__e(t,n)}}function du(t,e,n){var r,i;if(Na.unmount&&Na.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||hu(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){Na.__e(t,e)}r.base=r.__P=null,t.__c=void 0}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&du(r[i],e,n||"function"!=typeof t.type);n||null==t.__e||qa(t.__e),t.__=t.__e=t.__d=void 0}function fu(t,e,n){return this.constructor(t,n)}function pu(t,e,n){var r,i,s;Na.__&&Na.__(t,e),i=(r="function"==typeof n)?null:n&&n.__k||e.__k,s=[],uu(e,t=(!r&&n||e).__k=Za($a,null,[t]),i||Ua,Ua,void 0!==e.ownerSVGElement,!r&&n?[n]:i?null:e.firstChild?Aa.call(e.childNodes):null,s,!r&&n?n:i?i.__e:e.firstChild,r),cu(s,t)}function bu(t){return"function"==typeof t}Aa=Ha.slice,Na={__e:function(t,e,n,r){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&null!=s.getDerivedStateFromError&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,r||{}),o=i.__d),o)return i.__E=i}catch(e){t=e}throw t}},Ra=0,Ta=function(t){return null!=t&&void 0===t.constructor},Qa.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=za({},this.state),"function"==typeof t&&(t=t(za({},n),this.props)),t&&za(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ka(this))},Qa.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ka(this))},Qa.prototype.render=$a,ja=[],La="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Pa=function(t,e){return t.__v.__b-e.__v.__b},Xa.__r=0,Da=0,Wa.Component=Qa,Wa.Fragment=$a,Wa.cloneElement=function(t,e,n){var r,i,s,o=za({},t.props);for(s in e)"key"==s?r=e[s]:"ref"==s?i=e[s]:o[s]=e[s];return arguments.length>2&&(o.children=arguments.length>3?Aa.call(arguments,2):n),Ga(t.type,o,r||t.key,i||t.ref,null)},Wa.createContext=function(t,e){var n={__c:e="__cC"+Da++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,r;return this.getChildContext||(n=[],(r={})[e]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,Ka(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n},Wa.createElement=Za,Wa.createRef=function(){return{current:null}},Wa.h=Za,Wa.hydrate=function t(e,n){pu(e,n,t)},Wa.isValidElement=Ta,Wa.options=Na,Wa.render=pu,Wa.toChildArray=function t(e,n){return n=n||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){t(e,n)})):n.push(e)),n};var yu=!1,gu={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;yu=t},get useDeprecatedSynchronousErrorHandling(){return yu}};function mu(t){setTimeout((function(){throw t}),0)}var vu={closed:!0,next:function(t){},error:function(t){if(gu.useDeprecatedSynchronousErrorHandling)throw t;mu(t)},complete:function(){}},wu=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}();function _u(t){return null!==t&&"object"==typeof t}var Su=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),Mu=Su,Eu=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this,r=n._parentOrParents,i=n._ctorUnsubscribe,s=n._unsubscribe,o=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof t)r.remove(this);else if(null!==r)for(var a=0;a<r.length;++a){r[a].remove(this)}if(bu(s)){i&&(this._unsubscribe=void 0);try{s.call(this)}catch(t){e=t instanceof Mu?ku(t.errors):[t]}}if(wu(o)){a=-1;for(var u=o.length;++a<u;){var c=o[a];if(_u(c))try{c.unsubscribe()}catch(t){e=e||[],t instanceof Mu?e=e.concat(ku(t.errors)):e.push(t)}}}if(e)throw new Mu(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=n._parentOrParents;if(null===i)n._parentOrParents=this;else if(i instanceof t){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}var s=this._subscriptions;return null===s?this._subscriptions=[n]:s.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function ku(t){return t.reduce((function(t,e){return t.concat(e instanceof Mu?e.errors:e)}),[])}var xu=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),Cu=function(e){function n(t,r,i){var s=e.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=vu;break;case 1:if(!t){s.destination=vu;break}if("object"==typeof t){t instanceof n?(s.syncErrorThrowable=t.syncErrorThrowable,s.destination=t,t.add(s)):(s.syncErrorThrowable=!0,s.destination=new Iu(s,t));break}default:s.syncErrorThrowable=!0,s.destination=new Iu(s,t,r,i)}return s}return t(n,e),n.prototype[xu]=function(){return this},n.create=function(t,e,r){var i=new n(t,e,r);return i.syncErrorThrowable=!1,i},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},n}(Eu),Iu=function(e){function n(t,n,r,i){var s,o=e.call(this)||this;o._parentSubscriber=t;var a=o;return bu(n)?s=n:n&&(s=n.next,r=n.error,i=n.complete,n!==vu&&(bu((a=Object.create(n)).unsubscribe)&&o.add(a.unsubscribe.bind(a)),a.unsubscribe=o.unsubscribe.bind(o))),o._context=a,o._next=s,o._error=r,o._complete=i,o}return t(n,e),n.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;gu.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},n.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=gu.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):mu(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;mu(t)}}},n.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};gu.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},n.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),gu.useDeprecatedSynchronousErrorHandling)throw t;mu(t)}},n.prototype.__tryOrSetError=function(t,e,n){if(!gu.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return gu.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(mu(e),!0)}return!1},n.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},n}(Cu);function Au(t){for(;t;){var e=t,n=e.closed,r=e.destination,i=e.isStopped;if(n||i)return!1;t=r&&r instanceof Cu?r:null}return!0}var Nu=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function Ru(t){return t}function Tu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ju(t)}function ju(t){return 0===t.length?Ru:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Ou=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,i=function(t,e,n){if(t){if(t instanceof Cu)return t;if(t[xu])return t[xu]()}return t||e||n?new Cu(t,e,n):new Cu(vu)}(t,e,n);if(r?i.add(r.call(i,this.source)):i.add(this.source||gu.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),gu.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){gu.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),Au(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=Lu(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),i&&i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[Nu]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:ju(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=Lu(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function Lu(t){if(t||(t=gu.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var Pu=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),Du=function(e){function n(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return t(n,e),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},n}(Eu),Bu=function(e){function n(t){var n=e.call(this,t)||this;return n.destination=t,n}return t(n,e),n}(Cu),Fu=function(e){function n(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t(n,e),n.prototype[xu]=function(){return new Bu(this)},n.prototype.lift=function(t){var e=new Wu(this,this);return e.operator=t,e},n.prototype.next=function(t){if(this.closed)throw new Pu;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].next(t)},n.prototype.error=function(t){if(this.closed)throw new Pu;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].error(t);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Pu;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;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(t){if(this.closed)throw new Pu;return e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(t){if(this.closed)throw new Pu;return this.hasError?(t.error(this.thrownError),Eu.EMPTY):this.isStopped?(t.complete(),Eu.EMPTY):(this.observers.push(t),new Du(this,t))},n.prototype.asObservable=function(){var t=new Ou;return t.source=this,t},n.create=function(t,e){return new Wu(t,e)},n}(Ou),Wu=function(e){function n(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t(n,e),n.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},n.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},n.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},n.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):Eu.EMPTY},n}(Fu);function Uu(){return function(t){return t.lift(new Hu(t))}}var Hu=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new Vu(t,n),i=e.subscribe(r);return r.closed||(r.connection=n.connect()),i},t}(),Vu=function(e){function n(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return t(n,e),n.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},n}(Cu),zu=function(e){function n(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return t(n,e),n.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},n.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},n.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new Eu).add(this.source.subscribe(new Zu(this.getSubject(),this))),t.closed&&(this._connection=null,t=Eu.EMPTY)),t},n.prototype.refCount=function(){return Uu()(this)},n}(Ou),qu=function(){var t=zu.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),Zu=function(e){function n(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return t(n,e),n.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},n.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},n.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},n}(Bu);var Gu=function(){function t(t,e,n,r){this.keySelector=t,this.elementSelector=e,this.durationSelector=n,this.subjectSelector=r}return t.prototype.call=function(t,e){return e.subscribe(new $u(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),$u=function(e){function n(t,n,r,i,s){var o=e.call(this,t)||this;return o.keySelector=n,o.elementSelector=r,o.durationSelector=i,o.subjectSelector=s,o.groups=null,o.attemptedToUnsubscribe=!1,o.count=0,o}return t(n,e),n.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},n.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups=new Map);var r,i=n.get(e);if(this.elementSelector)try{r=this.elementSelector(t)}catch(t){this.error(t)}else r=t;if(!i){i=this.subjectSelector?this.subjectSelector():new Fu,n.set(e,i);var s=new Yu(e,i,this);if(this.destination.next(s),this.durationSelector){var o=void 0;try{o=this.durationSelector(new Yu(e,i))}catch(t){return void this.error(t)}this.add(o.subscribe(new Qu(e,i,this)))}}i.closed||i.next(r)},n.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,n){e.error(t)})),e.clear()),this.destination.error(t)},n.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},n.prototype.removeGroup=function(t){this.groups.delete(t)},n.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},n}(Cu),Qu=function(e){function n(t,n,r){var i=e.call(this,n)||this;return i.key=t,i.group=n,i.parent=r,i}return t(n,e),n.prototype._next=function(t){this.complete()},n.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},n}(Cu),Yu=function(e){function n(t,n,r){var i=e.call(this)||this;return i.key=t,i.groupSubject=n,i.refCountSubscription=r,i}return t(n,e),n.prototype._subscribe=function(t){var e=new Eu,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&e.add(new Ju(n)),e.add(r.subscribe(t)),e},n}(Ou),Ju=function(e){function n(t){var n=e.call(this)||this;return n.parent=t,t.count++,n}return t(n,e),n.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},n}(Eu),Ku=function(e){function n(t){var n=e.call(this)||this;return n._value=t,n}return t(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Pu;return this._value},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(Fu),Xu=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return t(n,e),n.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},n.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},n.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},n.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},n.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},n}(function(e){function n(t,n){return e.call(this)||this}return t(n,e),n.prototype.schedule=function(t,e){return this},n}(Eu)),tc=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t(n,e),n.prototype.schedule=function(t,n){return void 0===n&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},n.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},n.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):t.flush(this)},n}(Xu),ec=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}(),nc=function(e){function n(t,r){void 0===r&&(r=ec.now);var i=e.call(this,t,(function(){return n.delegate&&n.delegate!==i?n.delegate.now():r()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return t(n,e),n.prototype.schedule=function(t,r,i){return void 0===r&&(r=0),n.delegate&&n.delegate!==this?n.delegate.schedule(t,r,i):e.prototype.schedule.call(this,t,r,i)},n.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},n}(ec),rc=new(function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n}(nc))(tc),ic=rc,sc=new Ou((function(t){return t.complete()}));function oc(t){return t?function(t){return new Ou((function(e){return t.schedule((function(){return e.complete()}))}))}(t):sc}function ac(t){return t&&"function"==typeof t.schedule}var uc,cc=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}};function lc(t,e){return new Ou((function(n){var r=new Eu,i=0;return r.add(e.schedule((function(){i!==t.length?(n.next(t[i++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}function hc(t,e){return e?lc(t,e):new Ou(cc(t))}function dc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return ac(n)?(t.pop(),lc(t,n)):hc(t)}function fc(t,e){return new Ou(e?function(n){return e.schedule(pc,0,{error:t,subscriber:n})}:function(e){return e.error(t)})}function pc(t){var e=t.error;t.subscriber.error(e)}uc||(uc={});var bc=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return dc(this.value);case"E":return fc(this.error);case"C":return oc()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();var yc=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new gc(t,this.scheduler,this.delay))},t}(),gc=function(e){function n(t,n,r){void 0===r&&(r=0);var i=e.call(this,t)||this;return i.scheduler=n,i.delay=r,i}return t(n,e),n.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},n.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(n.dispatch,this.delay,new mc(t,this.destination)))},n.prototype._next=function(t){this.scheduleMessage(bc.createNext(t))},n.prototype._error=function(t){this.scheduleMessage(bc.createError(t)),this.unsubscribe()},n.prototype._complete=function(){this.scheduleMessage(bc.createComplete()),this.unsubscribe()},n}(Cu),mc=function(){return function(t,e){this.notification=t,this.destination=e}}(),vc=function(e){function n(t,n,r){void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var i=e.call(this)||this;return i.scheduler=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=t<1?1:t,i._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return t(n,e),n.prototype.nextInfiniteTimeWindow=function(t){if(!this.isStopped){var n=this._events;n.push(t),n.length>this._bufferSize&&n.shift()}e.prototype.next.call(this,t)},n.prototype.nextTimeWindow=function(t){this.isStopped||(this._events.push(new wc(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},n.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,s=r.length;if(this.closed)throw new Pu;if(this.isStopped||this.hasError?e=Eu.EMPTY:(this.observers.push(t),e=new Du(this,t)),i&&t.add(t=new gc(t,i)),n)for(var o=0;o<s&&!t.closed;o++)t.next(r[o]);else for(o=0;o<s&&!t.closed;o++)t.next(r[o].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},n.prototype._getNow=function(){return(this.scheduler||ic).now()},n.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,s=0;s<i&&!(t-r[s].time<n);)s++;return i>e&&(s=Math.max(s,i-e)),s>0&&r.splice(0,s),r},n}(Fu),wc=function(){return function(t,e){this.time=t,this.value=e}}(),_c=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return t(n,e),n.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),Eu.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),Eu.EMPTY):e.prototype._subscribe.call(this,t)},n.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},n.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},n.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},n}(Fu),Sc=1,Mc=function(){return Promise.resolve()}(),Ec={};function kc(t){return t in Ec&&(delete Ec[t],!0)}var xc=function(t){var e=Sc++;return Ec[e]=!0,Mc.then((function(){return kc(e)&&t()})),e},Cc=function(t){kc(t)},Ic=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t(n,e),n.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=xc(t.flush.bind(t,null))))},n.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(Cc(n),t.scheduled=void 0)},n}(Xu),Ac=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<i&&(t=n.shift()));if(this.active=!1,e){for(;++r<i&&(t=n.shift());)t.unsubscribe();throw e}},n}(nc),Nc=new Ac(Ic),Rc=Nc,Tc=new nc(Xu),jc=Tc,Oc=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t(n,e),n.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame((function(){return t.flush(null)}))))},n.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(cancelAnimationFrame(n),t.scheduled=void 0)},n}(Xu),Lc=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<i&&(t=n.shift()));if(this.active=!1,e){for(;++r<i&&(t=n.shift());)t.unsubscribe();throw e}},n}(nc),Pc=new Lc(Oc),Dc=Pc,Bc=function(e){function n(t,n){void 0===t&&(t=Fc),void 0===n&&(n=Number.POSITIVE_INFINITY);var r=e.call(this,t,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return t(n,e),n.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},n.frameTimeFactor=10,n}(nc),Fc=function(e){function n(t,n,r){void 0===r&&(r=t.index+=1);var i=e.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.index=r,i.active=!0,i.index=t.index=r,i}return t(n,e),n.prototype.schedule=function(t,r){if(void 0===r&&(r=0),!this.id)return e.prototype.schedule.call(this,t,r);this.active=!1;var i=new n(this.scheduler,this.work);return this.add(i),i.schedule(t,r)},n.prototype.requestAsyncId=function(t,e,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(n.sortActions),!0},n.prototype.recycleAsyncId=function(t,e,n){},n.prototype._execute=function(t,n){if(!0===this.active)return e.prototype._execute.call(this,t,n)},n.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},n}(Xu);function Wc(){}var Uc=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),Hc=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),Vc=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}();function zc(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new qc(t,e))}}var qc=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Zc(t,this.project,this.thisArg))},t}(),Zc=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return t(n,e),n.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(Cu);function Gc(t){var e=this,n=t.args,r=t.subscriber,i=t.params,s=i.callbackFunc,o=i.context,a=i.scheduler,u=i.subject;if(!u){u=i.subject=new _c;try{s.apply(o,n.concat([function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.length<=1?t[0]:t;e.add(a.schedule($c,0,{value:r,subject:u}))}]))}catch(t){u.error(t)}}this.add(u.subscribe(r))}function $c(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function Qc(t){var e=this,n=t.params,r=t.subscriber,i=t.context,s=n.callbackFunc,o=n.args,a=n.scheduler,u=n.subject;if(!u){u=n.subject=new _c;try{s.apply(i,o.concat([function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.shift();if(r)e.add(a.schedule(Jc,0,{err:r,subject:u}));else{var i=t.length<=1?t[0]:t;e.add(a.schedule(Yc,0,{value:i,subject:u}))}}]))}catch(t){this.add(a.schedule(Jc,0,{err:t,subject:u}))}}this.add(u.subscribe(r))}function Yc(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function Jc(t){var e=t.err;t.subject.error(e)}var Kc=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},n.prototype.notifyError=function(t,e){this.destination.error(t)},n.prototype.notifyComplete=function(t){this.destination.complete()},n}(Cu),Xc=function(e){function n(t,n,r){var i=e.call(this)||this;return i.parent=t,i.outerValue=n,i.outerIndex=r,i.index=0,i}return t(n,e),n.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},n.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},n.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},n}(Cu);function tl(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var el=tl(),nl=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function rl(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var il=function(t){if(t&&"function"==typeof t[Nu])return r=t,function(t){var e=r[Nu]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(nl(t))return cc(t);if(rl(t))return n=t,function(t){return n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,mu),t};if(t&&"function"==typeof t[el])return e=t,function(t){for(var n=e[el]();;){var r=void 0;try{r=n.next()}catch(e){return t.error(e),t}if(r.done){t.complete();break}if(t.next(r.value),t.closed)break}return"function"==typeof n.return&&t.add((function(){n.return&&n.return()})),t};var e,n,r,i=_u(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+i+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function sl(t,e,n,r,i){if(void 0===i&&(i=new Xc(t,n,r)),!i.closed)return e instanceof Ou?e.subscribe(i):il(e)(i)}var ol={};var al=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new ul(t,this.resultSelector))},t}(),ul=function(e){function n(t,n){var r=e.call(this,t)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return t(n,e),n.prototype._next=function(t){this.values.push(ol),this.observables.push(t)},n.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(sl(this,r,void 0,n))}}},n.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},n.prototype.notifyNext=function(t,e,n){var r=this.values,i=r[n],s=this.toRespond?i===ol?--this.toRespond:this.toRespond:0;r[n]=e,0===s&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(r.slice()))},n.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(Kc);function cl(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[Nu]}(t))return function(t,e){return new Ou((function(n){var r=new Eu;return r.add(e.schedule((function(){var i=t[Nu]();r.add(i.subscribe({next:function(t){r.add(e.schedule((function(){return n.next(t)})))},error:function(t){r.add(e.schedule((function(){return n.error(t)})))},complete:function(){r.add(e.schedule((function(){return n.complete()})))}}))}))),r}))}(t,e);if(rl(t))return function(t,e){return new Ou((function(n){var r=new Eu;return r.add(e.schedule((function(){return t.then((function(t){r.add(e.schedule((function(){n.next(t),r.add(e.schedule((function(){return n.complete()})))})))}),(function(t){r.add(e.schedule((function(){return n.error(t)})))}))}))),r}))}(t,e);if(nl(t))return lc(t,e);if(function(t){return t&&"function"==typeof t[el]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new Ou((function(n){var r,i=new Eu;return i.add((function(){r&&"function"==typeof r.return&&r.return()})),i.add(e.schedule((function(){r=t[el](),i.add(e.schedule((function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}})))}))),i}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function ll(t,e){return e?cl(t,e):t instanceof Ou?t:new Ou(il(t))}var hl=function(e){function n(t){var n=e.call(this)||this;return n.parent=t,n}return t(n,e),n.prototype._next=function(t){this.parent.notifyNext(t)},n.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},n.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},n}(Cu),dl=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.notifyNext=function(t){this.destination.next(t)},n.prototype.notifyError=function(t){this.destination.error(t)},n.prototype.notifyComplete=function(){this.destination.complete()},n}(Cu);function fl(t,e){if(!e.closed){if(t instanceof Ou)return t.subscribe(e);var n;try{n=il(t)(e)}catch(t){e.error(t)}return n}}function pl(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe(pl((function(n,r){return ll(t(n,r)).pipe(zc((function(t,i){return e(n,t,r,i)})))}),n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new bl(t,n))})}var bl=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new yl(t,this.project,this.concurrent))},t}(),yl=function(e){function n(t,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=e.call(this,t)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return t(n,e),n.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},n.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},n.prototype._innerSub=function(t){var e=new hl(this),n=this.destination;n.add(e);var r=fl(t,e);r!==e&&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(t){this.destination.next(t)},n.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},n}(dl),gl=pl;function ml(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),pl(Ru,t)}function vl(){return ml(1)}function wl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return vl()(dc.apply(void 0,t))}function _l(t){return new Ou((function(e){var n;try{n=t()}catch(t){return void e.error(t)}return(n?ll(n):oc()).subscribe(e)}))}function Sl(t,e){return new Ou((function(n){var r=t.length;if(0!==r)for(var i=new Array(r),s=0,o=0,a=function(a){var u=ll(t[a]),c=!1;n.add(u.subscribe({next:function(t){c||(c=!0,o++),i[a]=t},error:function(t){return n.error(t)},complete:function(){++s!==r&&c||(o===r&&n.next(e?e.reduce((function(t,e,n){return t[e]=i[n],t}),{}):i),n.complete())}}))},u=0;u<r;u++)a(u);else n.complete()}))}function Ml(t,e,n,r,i){var s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){var o=t;t.addEventListener(e,n,i),s=function(){return o.removeEventListener(e,n,i)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){var a=t;t.on(e,n),s=function(){return a.off(e,n)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){var u=t;t.addListener(e,n),s=function(){return u.removeListener(e,n)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var c=0,l=t.length;c<l;c++)Ml(t[c],e,n,r,i)}r.add(s)}function El(t){var e=t.subscriber,n=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(t){return void e.error(t)}else t.needIterate=!0;if(n){var r=void 0;try{r=n(t.state)}catch(t){return void e.error(t)}if(!r)return void e.complete();if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(t){return void e.error(t)}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function kl(t){return!wu(t)&&t-parseFloat(t)+1>=0}function xl(t){var e=t.subscriber,n=t.counter,r=t.period;e.next(n),this.schedule({subscriber:e,counter:n+1,period:r},r)}function Cl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,r=null,i=t[t.length-1];return ac(i)?(r=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof i&&(n=t.pop()),null===r&&1===t.length&&t[0]instanceof Ou?t[0]:ml(n)(hc(t,r))}var Il=new Ou(Wc);function Al(t){var e=t.keys,n=t.index,r=t.subscriber,i=t.subscription,s=t.obj;if(!r.closed)if(n<e.length){var o=e[n];r.next([o,s[o]]),i.add(this.schedule({keys:e,index:n+1,subscriber:r,subscription:i,obj:s}))}else r.complete()}function Nl(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}function Rl(t,e){return function(n){return n.lift(new Tl(t,e))}}var Tl=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new jl(t,this.predicate,this.thisArg))},t}(),jl=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return t(n,e),n.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},n}(Cu);function Ol(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!wu(t[0]))return t[0];t=t[0]}return hc(t,void 0).lift(new Ll)}var Ll=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Pl(t))},t}(),Pl=function(e){function n(t){var n=e.call(this,t)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return t(n,e),n.prototype._next=function(t){this.observables.push(t)},n.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var n=0;n<e&&!this.hasFirst;n++){var r=sl(this,t[n],void 0,n);this.subscriptions&&this.subscriptions.push(r),this.add(r)}this.observables=null}},n.prototype.notifyNext=function(t,e,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(e)},n}(Kc);function Dl(t){var e=t.start,n=t.index,r=t.count,i=t.subscriber;n>=r?i.complete():(i.next(e),i.closed||(t.index=n+1,t.start=e+1,this.schedule(t)))}function Bl(t,e,n){void 0===t&&(t=0);var r=-1;return kl(e)?r=Number(e)<1?1:Number(e):ac(e)&&(n=e),ac(n)||(n=jc),new Ou((function(e){var i=kl(t)?t:+t-n.now();return n.schedule(Fl,i,{index:0,period:r,subscriber:e})}))}function Fl(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}function Wl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return"function"==typeof n&&t.pop(),hc(t,void 0).lift(new Ul(n))}var Ul=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Hl(t,this.resultSelector))},t}(),Hl=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.resultSelector=n,i.iterators=[],i.active=0,i.resultSelector="function"==typeof n?n:void 0,i}return t(n,e),n.prototype._next=function(t){var e=this.iterators;wu(t)?e.push(new zl(t)):"function"==typeof t[el]?e.push(new Vl(t[el]())):e.push(new ql(this.destination,this,t))},n.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var n=0;n<e;n++){var r=t[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 t=this.iterators,e=t.length,n=this.destination,r=0;r<e;r++){if("function"==typeof(o=t[r]).hasValue&&!o.hasValue())return}var i=!1,s=[];for(r=0;r<e;r++){var o,a=(o=t[r]).next();if(o.hasCompleted()&&(i=!0),a.done)return void n.complete();s.push(a.value)}this.resultSelector?this._tryresultSelector(s):n.next(s),i&&n.complete()},n.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(Cu),Vl=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},t}(),zl=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[el]=function(){return this},t.prototype.next=function(t){var e=this.index++,n=this.array;return e<this.length?{value:n[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),ql=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.parent=n,i.observable=r,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return t(n,e),n.prototype[el]=function(){return this},n.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.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(t){this.buffer.push(t),this.parent.checkIterators()},n.prototype.subscribe=function(){return fl(this.observable,new hl(this))},n}(dl),Zl=Object.freeze({__proto__:null,Observable:Ou,ConnectableObservable:zu,GroupedObservable:Yu,observable:Nu,Subject:Fu,BehaviorSubject:Ku,ReplaySubject:vc,AsyncSubject:_c,asap:Rc,asapScheduler:Nc,async:jc,asyncScheduler:Tc,queue:ic,queueScheduler:rc,animationFrame:Dc,animationFrameScheduler:Pc,VirtualTimeScheduler:Bc,VirtualAction:Fc,Scheduler:ec,Subscription:Eu,Subscriber:Cu,Notification:bc,get NotificationKind(){return uc},pipe:Tu,noop:Wc,identity:Ru,isObservable:function(t){return!!t&&(t instanceof Ou||"function"==typeof t.lift&&"function"==typeof t.subscribe)},ArgumentOutOfRangeError:Uc,EmptyError:Hc,ObjectUnsubscribedError:Pu,UnsubscriptionError:Mu,TimeoutError:Vc,bindCallback:function t(e,n,r){if(n){if(!ac(n))return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return t(e,r).apply(void 0,i).pipe(zc((function(t){return wu(t)?n.apply(void 0,t):n(t)})))};r=n}return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i,s=this,o={context:s,subject:i,callbackFunc:e,scheduler:r};return new Ou((function(n){if(r){var a={args:t,subscriber:n,params:o};return r.schedule(Gc,0,a)}if(!i){i=new _c;try{e.apply(s,t.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.next(t.length<=1?t[0]:t),i.complete()}]))}catch(t){Au(i)?i.error(t):console.warn(t)}}return i.subscribe(n)}))}},bindNodeCallback:function t(e,n,r){if(n){if(!ac(n))return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return t(e,r).apply(void 0,i).pipe(zc((function(t){return wu(t)?n.apply(void 0,t):n(t)})))};r=n}return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i={subject:void 0,args:t,callbackFunc:e,scheduler:r,context:this};return new Ou((function(n){var s=i.context,o=i.subject;if(r)return r.schedule(Qc,0,{params:i,subscriber:n,context:s});if(!o){o=i.subject=new _c;try{e.apply(s,t.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.shift();n?o.error(n):(o.next(t.length<=1?t[0]:t),o.complete())}]))}catch(t){Au(o)?o.error(t):console.warn(t)}}return o.subscribe(n)}))}},combineLatest:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=void 0,r=void 0;return ac(t[t.length-1])&&(r=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&wu(t[0])&&(t=t[0]),hc(t,r).lift(new al(n))},concat:wl,defer:_l,empty:oc,forkJoin:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){var n=t[0];if(wu(n))return Sl(n,null);if(_u(n)&&Object.getPrototypeOf(n)===Object.prototype){var r=Object.keys(n);return Sl(r.map((function(t){return n[t]})),r)}}if("function"==typeof t[t.length-1]){var i=t.pop();return Sl(t=1===t.length&&wu(t[0])?t[0]:t,null).pipe(zc((function(t){return i.apply(void 0,t)})))}return Sl(t,null)},from:ll,fromEvent:function t(e,n,r,i){return bu(r)&&(i=r,r=void 0),i?t(e,n,r).pipe(zc((function(t){return wu(t)?i.apply(void 0,t):i(t)}))):new Ou((function(t){Ml(e,n,(function(e){arguments.length>1?t.next(Array.prototype.slice.call(arguments)):t.next(e)}),t,r)}))},fromEventPattern:function t(e,n,r){return r?t(e,n).pipe(zc((function(t){return wu(t)?r.apply(void 0,t):r(t)}))):new Ou((function(t){var r,i=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1===e.length?e[0]:e)};try{r=e(i)}catch(e){return void t.error(e)}if(bu(n))return function(){return n(i,r)}}))},generate:function(t,e,n,r,i){var s,o;if(1==arguments.length){var a=t;o=a.initialState,e=a.condition,n=a.iterate,s=a.resultSelector||Ru,i=a.scheduler}else void 0===r||ac(r)?(o=t,s=Ru,i=r):(o=t,s=r);return new Ou((function(t){var r=o;if(i)return i.schedule(El,0,{subscriber:t,iterate:n,condition:e,resultSelector:s,state:r});for(;;){if(e){var a=void 0;try{a=e(r)}catch(e){return void t.error(e)}if(!a){t.complete();break}}var u=void 0;try{u=s(r)}catch(e){return void t.error(e)}if(t.next(u),t.closed)break;try{r=n(r)}catch(e){return void t.error(e)}}}))},iif:function(t,e,n){return void 0===e&&(e=sc),void 0===n&&(n=sc),_l((function(){return t()?e:n}))},interval:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=jc),(!kl(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=jc),new Ou((function(n){return n.add(e.schedule(xl,t,{subscriber:n,counter:0,period:t})),n}))},merge:Cl,never:function(){return Il},of:dc,onErrorResumeNext:function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)return sc;var r=e[0],i=e.slice(1);return 1===e.length&&wu(r)?t.apply(void 0,r):new Ou((function(e){var n=function(){return e.add(t.apply(void 0,i).subscribe(e))};return ll(r).subscribe({next:function(t){e.next(t)},error:n,complete:n})}))},pairs:function(t,e){return new Ou(e?function(n){var r=Object.keys(t),i=new Eu;return i.add(e.schedule(Al,0,{keys:r,index:0,subscriber:n,subscription:i,obj:t})),i}:function(e){for(var n=Object.keys(t),r=0;r<n.length&&!e.closed;r++){var i=n[r];t.hasOwnProperty(i)&&e.next([i,t[i]])}e.complete()})},partition:function(t,e,n){return[Rl(e,n)(new Ou(il(t))),Rl(Nl(e,n))(new Ou(il(t)))]},race:Ol,range:function(t,e,n){return void 0===t&&(t=0),new Ou((function(r){void 0===e&&(e=t,t=0);var i=0,s=t;if(n)return n.schedule(Dl,0,{index:i,count:e,start:t,subscriber:r});for(;;){if(i++>=e){r.complete();break}if(r.next(s++),r.closed)break}}))},throwError:fc,timer:Bl,using:function(t,e){return new Ou((function(n){var r,i;try{r=t()}catch(t){return void n.error(t)}try{i=e(r)}catch(t){return void n.error(t)}var s=(i?ll(i):sc).subscribe(n);return function(){s.unsubscribe(),r&&r.unsubscribe()}}))},zip:Wl,scheduled:cl,EMPTY:sc,NEVER:Il,config:gu}),Gl=o(Zl),$l={};function Ql(t){var e,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Ql(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Yl(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Ql(t))&&(r&&(r+=" "),r+=e);return r}var Jl,Kl,Xl,th,eh=o(Object.freeze({__proto__:null,clsx:Yl,default:Yl})),nh={},rh=Wa,ih=0,sh=[],oh=[],ah=rh.options.__b,uh=rh.options.__r,ch=rh.options.diffed,lh=rh.options.__c,hh=rh.options.unmount;function dh(t,e){rh.options.__h&&rh.options.__h(Kl,t,ih||e),ih=0;var n=Kl.__H||(Kl.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:oh}),n.__[t]}function fh(t){return ih=1,ph(Mh,t)}function ph(t,e,n){var r=dh(Jl++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):Mh(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],n=r.t(e,t);e!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Kl,!Kl.u)){var i=function(t,e,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter((function(t){return t.__c}));if(i.every((function(t){return!t.__N})))return!s||s.call(this,t,e,n);var o=!1;return i.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),!(!o&&r.__c.props===t)&&(!s||s.call(this,t,e,n))};Kl.u=!0;var s=Kl.shouldComponentUpdate,o=Kl.componentWillUpdate;Kl.componentWillUpdate=function(t,e,n){if(this.__e){var r=s;s=void 0,i(t,e,n),s=r}o&&o.call(this,t,e,n)},Kl.shouldComponentUpdate=i}return r.__N||r.__}function bh(t,e){var n=dh(Jl++,4);!rh.options.__s&&Sh(n.__H,e)&&(n.__=t,n.o=e,Kl.__h.push(n))}function yh(t,e){var n=dh(Jl++,7);return Sh(n.__H,e)?(n.__V=t(),n.o=e,n.__h=t,n.__V):n.__}function gh(){for(var t;t=sh.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(wh),t.__H.__h.forEach(_h),t.__H.__h=[]}catch(e){t.__H.__h=[],rh.options.__e(e,t.__v)}}rh.options.__b=function(t){Kl=null,ah&&ah(t)},rh.options.__r=function(t){uh&&uh(t),Jl=0;var e=(Kl=t.__c).__H;e&&(Xl===Kl?(e.__h=[],Kl.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=oh,t.__N=t.o=void 0}))):(e.__h.forEach(wh),e.__h.forEach(_h),e.__h=[])),Xl=Kl},rh.options.diffed=function(t){ch&&ch(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==sh.push(e)&&th===rh.options.requestAnimationFrame||((th=rh.options.requestAnimationFrame)||vh)(gh)),e.__H.__.forEach((function(t){t.o&&(t.__H=t.o),t.__V!==oh&&(t.__=t.__V),t.o=void 0,t.__V=oh}))),Xl=Kl=null},rh.options.__c=function(t,e){e.some((function(t){try{t.__h.forEach(wh),t.__h=t.__h.filter((function(t){return!t.__||_h(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],rh.options.__e(n,t.__v)}})),lh&&lh(t,e)},rh.options.unmount=function(t){hh&&hh(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{wh(t)}catch(t){e=t}})),n.__H=void 0,e&&rh.options.__e(e,n.__v))};var mh="function"==typeof requestAnimationFrame;function vh(t){var e,n=function(){clearTimeout(r),mh&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);mh&&(e=requestAnimationFrame(n))}function wh(t){var e=Kl,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Kl=e}function _h(t){var e=Kl;t.__c=t.__(),Kl=e}function Sh(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function Mh(t,e){return"function"==typeof e?e(t):e}nh.useCallback=function(t,e){return ih=8,yh((function(){return t}),e)},nh.useContext=function(t){var e=Kl.context[t.__c],n=dh(Jl++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(Kl)),e.props.value):t.__},nh.useDebugValue=function(t,e){rh.options.useDebugValue&&rh.options.useDebugValue(e?e(t):t)},nh.useEffect=function(t,e){var n=dh(Jl++,3);!rh.options.__s&&Sh(n.__H,e)&&(n.__=t,n.o=e,Kl.__H.__h.push(n))},nh.useErrorBoundary=function(t){var e=dh(Jl++,10),n=fh();return e.__=t,Kl.componentDidCatch||(Kl.componentDidCatch=function(t,r){e.__&&e.__(t,r),n[1](t)}),[n[0],function(){n[1](void 0)}]},nh.useId=function(){var t=dh(Jl++,11);if(!t.__){for(var e=Kl.__v;null!==e&&!e.__m&&null!==e.__;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__},nh.useImperativeHandle=function(t,e,n){ih=6,bh((function(){return"function"==typeof t?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0}),null==n?n:n.concat(t))},nh.useLayoutEffect=bh,nh.useMemo=yh,nh.useReducer=ph,nh.useRef=function(t){return ih=5,yh((function(){return{current:t}}),[])},nh.useState=fh;var Eh={},kh={};Object.defineProperty(kh,"__esModule",{value:!0}),kh.LIB_VERSION=void 0,kh.LIB_VERSION="3.6.6";var xh={};Object.defineProperty(xh,"__esModule",{value:!0}),xh.CloseIcon=void 0;const Ch=Wa;xh.CloseIcon=function(t){return(0,Ch.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ch.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 Ih={};Object.defineProperty(Ih,"__esModule",{value:!0}),Ih.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var Ah={};Object.defineProperty(Ah,"__esModule",{value:!0}),Ah.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var Nh={};Object.defineProperty(Nh,"__esModule",{value:!0}),Nh.QRCodeIcon=void 0;const Rh=Wa;Nh.QRCodeIcon=function(t){return(0,Rh.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Rh.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,Rh.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,Rh.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,Rh.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,Rh.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,Rh.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,Rh.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,Rh.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,Rh.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))};var Th={};Object.defineProperty(Th,"__esModule",{value:!0});Th.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 jh={};Object.defineProperty(jh,"__esModule",{value:!0}),jh.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 Oh={};Object.defineProperty(Oh,"__esModule",{value:!0}),Oh.StatusDotIcon=void 0;const Lh=Wa;Oh.StatusDotIcon=function(t){return(0,Lh.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Lh.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 Ph={};function Dh(t){this.mode=Fh.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,n=this.data.length;e<n;e++){var r=[],i=this.data.charCodeAt(e);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 Bh(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Dh.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,n=this.parsedData.length;e<n;e++)t.put(this.parsedData[e],8)}},Bh.prototype={addData:function(t){var e=new Dh(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var 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(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=Bh.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(var r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(this.modules[t+n][e+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 t=0,e=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=Kh.getLostPoint(this);(0==n||t>r)&&(t=r,e=n)}return e},createMovieClip:function(t,e,n){var r=t.createEmptyMovieClip(e,n);this.make();for(var i=0;i<this.modules.length;i++)for(var s=1*i,o=0;o<this.modules[i].length;o++){var a=1*o;this.modules[i][o]&&(r.beginFill(0,100),r.moveTo(a,s),r.lineTo(a+1,s),r.lineTo(a+1,s+1),r.lineTo(a,s+1),r.endFill())}return r},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)null==this.modules[t][6]&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)null==this.modules[6][e]&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=Kh.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var n=0;n<t.length;n++){var r=t[e],i=t[n];if(null==this.modules[r][i])for(var s=-2;s<=2;s++)for(var o=-2;o<=2;o++)this.modules[r+s][i+o]=-2==s||2==s||-2==o||2==o||0==s&&0==o}},setupTypeNumber:function(t){for(var e=Kh.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var r=!t&&1==(e>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(n=0;n<18;n++){r=!t&&1==(e>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},setupTypeInfo:function(t,e){for(var n=this.errorCorrectLevel<<3|e,r=Kh.getBCHTypeInfo(n),i=0;i<15;i++){var s=!t&&1==(r>>i&1);i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(i=0;i<15;i++){s=!t&&1==(r>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var n=-1,r=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(6==o&&o--;;){for(var a=0;a<2;a++)if(null==this.modules[r][o-a]){var u=!1;s<t.length&&(u=1==(t[s]>>>i&1)),Kh.getMask(e,r,o-a)&&(u=!u),this.modules[r][o-a]=u,-1==--i&&(s++,i=7)}if((r+=n)<0||this.moduleCount<=r){r-=n,n=-n;break}}}},Bh.PAD0=236,Bh.PAD1=17,Bh.createData=function(t,e,n){for(var r=nd.getRSBlocks(t,e),i=new rd,s=0;s<n.length;s++){var o=n[s];i.put(o.mode,4),i.put(o.getLength(),Kh.getLengthInBits(o.mode,t)),o.write(i)}var a=0;for(s=0;s<r.length;s++)a+=r[s].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(Bh.PAD0,8),i.getLengthInBits()>=8*a));)i.put(Bh.PAD1,8);return Bh.createBytes(i,r)},Bh.createBytes=function(t,e){for(var n=0,r=0,i=0,s=new Array(e.length),o=new Array(e.length),a=0;a<e.length;a++){var u=e[a].dataCount,c=e[a].totalCount-u;r=Math.max(r,u),i=Math.max(i,c),s[a]=new Array(u);for(var l=0;l<s[a].length;l++)s[a][l]=255&t.buffer[l+n];n+=u;var h=Kh.getErrorCorrectPolynomial(c),d=new ed(s[a],h.getLength()-1).mod(h);o[a]=new Array(h.getLength()-1);for(l=0;l<o[a].length;l++){var f=l+d.getLength()-o[a].length;o[a][l]=f>=0?d.get(f):0}}var p=0;for(l=0;l<e.length;l++)p+=e[l].totalCount;var b=new Array(p),y=0;for(l=0;l<r;l++)for(a=0;a<e.length;a++)l<s[a].length&&(b[y++]=s[a][l]);for(l=0;l<i;l++)for(a=0;a<e.length;a++)l<o[a].length&&(b[y++]=o[a][l]);return b};for(var Fh={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Wh=1,Uh=0,Hh=3,Vh=2,zh=0,qh=1,Zh=2,Gh=3,$h=4,Qh=5,Yh=6,Jh=7,Kh={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;Kh.getBCHDigit(e)-Kh.getBCHDigit(Kh.G15)>=0;)e^=Kh.G15<<Kh.getBCHDigit(e)-Kh.getBCHDigit(Kh.G15);return(t<<10|e)^Kh.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;Kh.getBCHDigit(e)-Kh.getBCHDigit(Kh.G18)>=0;)e^=Kh.G18<<Kh.getBCHDigit(e)-Kh.getBCHDigit(Kh.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;0!=t;)e++,t>>>=1;return e},getPatternPosition:function(t){return Kh.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,n){switch(t){case zh:return(e+n)%2==0;case qh:return e%2==0;case Zh:return n%3==0;case Gh:return(e+n)%3==0;case $h:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case Qh:return e*n%2+e*n%3==0;case Yh:return(e*n%2+e*n%3)%2==0;case Jh:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new ed([1],0),n=0;n<t;n++)e=e.multiply(new ed([1,Xh.gexp(n)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Fh.MODE_NUMBER:return 10;case Fh.MODE_ALPHA_NUM:return 9;case Fh.MODE_8BIT_BYTE:case Fh.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Fh.MODE_NUMBER:return 12;case Fh.MODE_ALPHA_NUM:return 11;case Fh.MODE_8BIT_BYTE:return 16;case Fh.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else{if(!(e<41))throw new Error("type:"+e);switch(t){case Fh.MODE_NUMBER:return 14;case Fh.MODE_ALPHA_NUM:return 13;case Fh.MODE_8BIT_BYTE:return 16;case Fh.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}}},getLostPoint:function(t){for(var e=t.getModuleCount(),n=0,r=0;r<e;r++)for(var i=0;i<e;i++){for(var s=0,o=t.isDark(r,i),a=-1;a<=1;a++)if(!(r+a<0||e<=r+a))for(var u=-1;u<=1;u++)i+u<0||e<=i+u||0==a&&0==u||o==t.isDark(r+a,i+u)&&s++;s>5&&(n+=3+s-5)}for(r=0;r<e-1;r++)for(i=0;i<e-1;i++){var c=0;t.isDark(r,i)&&c++,t.isDark(r+1,i)&&c++,t.isDark(r,i+1)&&c++,t.isDark(r+1,i+1)&&c++,0!=c&&4!=c||(n+=3)}for(r=0;r<e;r++)for(i=0;i<e-6;i++)t.isDark(r,i)&&!t.isDark(r,i+1)&&t.isDark(r,i+2)&&t.isDark(r,i+3)&&t.isDark(r,i+4)&&!t.isDark(r,i+5)&&t.isDark(r,i+6)&&(n+=40);for(i=0;i<e;i++)for(r=0;r<e-6;r++)t.isDark(r,i)&&!t.isDark(r+1,i)&&t.isDark(r+2,i)&&t.isDark(r+3,i)&&t.isDark(r+4,i)&&!t.isDark(r+5,i)&&t.isDark(r+6,i)&&(n+=40);var l=0;for(i=0;i<e;i++)for(r=0;r<e;r++)t.isDark(r,i)&&l++;return n+=10*(Math.abs(100*l/e/e-50)/5)}},Xh={glog:function(t){if(t<1)throw new Error("glog("+t+")");return Xh.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return Xh.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},td=0;td<8;td++)Xh.EXP_TABLE[td]=1<<td;for(td=8;td<256;td++)Xh.EXP_TABLE[td]=Xh.EXP_TABLE[td-4]^Xh.EXP_TABLE[td-5]^Xh.EXP_TABLE[td-6]^Xh.EXP_TABLE[td-8];for(td=0;td<255;td++)Xh.LOG_TABLE[Xh.EXP_TABLE[td]]=td;function ed(t,e){if(null==t.length)throw new Error(t.length+"/"+e);for(var n=0;n<t.length&&0==t[n];)n++;this.num=new Array(t.length-n+e);for(var r=0;r<t.length-n;r++)this.num[r]=t[r+n]}function nd(t,e){this.totalCount=t,this.dataCount=e}function rd(){this.buffer=[],this.length=0}ed.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),n=0;n<this.getLength();n++)for(var r=0;r<t.getLength();r++)e[n+r]^=Xh.gexp(Xh.glog(this.get(n))+Xh.glog(t.get(r)));return new ed(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=Xh.glog(this.get(0))-Xh.glog(t.get(0)),n=new Array(this.getLength()),r=0;r<this.getLength();r++)n[r]=this.get(r);for(r=0;r<t.getLength();r++)n[r]^=Xh.gexp(Xh.glog(t.get(r))+e);return new ed(n,0).mod(t)}},nd.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]],nd.getRSBlocks=function(t,e){var n=nd.getRsBlockTable(t,e);if(null==n)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var r=n.length/3,i=[],s=0;s<r;s++)for(var o=n[3*s+0],a=n[3*s+1],u=n[3*s+2],c=0;c<o;c++)i.push(new nd(a,u));return i},nd.getRsBlockTable=function(t,e){switch(e){case Wh:return nd.RS_BLOCK_TABLE[4*(t-1)+0];case Uh:return nd.RS_BLOCK_TABLE[4*(t-1)+1];case Hh:return nd.RS_BLOCK_TABLE[4*(t-1)+2];case Vh:return nd.RS_BLOCK_TABLE[4*(t-1)+3];default:return}},rd.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var n=0;n<e;n++)this.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var id=[[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 sd(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},"string"==typeof t&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if("string"!=typeof this.options.content)throw new Error("Expected 'content' as string!");if(0===this.options.content.length)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0&&this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");var n=this.options.content,r=function(t,e){for(var n=function(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=t?3:0)}(t),r=1,i=0,s=0,o=id.length;s<=o;s++){var a=id[s];if(!a)throw new Error("Content too long: expected "+i+" but got "+n);switch(e){case"L":i=a[0];break;case"M":i=a[1];break;case"Q":i=a[2];break;case"H":i=a[3];break;default:throw new Error("Unknwon error correction level: "+e)}if(n<=i)break;r++}if(r>id.length)throw new Error("Content too long");return r}(n,this.options.ecl),i=function(t){switch(t){case"L":return Wh;case"M":return Uh;case"Q":return Hh;case"H":return Vh;default:throw new Error("Unknwon error correction level: "+t)}}(this.options.ecl);this.qrcode=new Bh(r,i),this.qrcode.addData(n),this.qrcode.make()}sd.prototype.svg=function(t){var e=this.options||{},n=this.qrcode.modules;void 0===t&&(t={container:e.container||"svg"});for(var r=void 0===e.pretty||!!e.pretty,i=r?" ":"",s=r?"\r\n":"",o=e.width,a=e.height,u=n.length,c=o/(u+2*e.padding),l=a/(u+2*e.padding),h=void 0!==e.join&&!!e.join,d=void 0!==e.swap&&!!e.swap,f=void 0===e.xmlDeclaration||!!e.xmlDeclaration,p=void 0!==e.predefined&&!!e.predefined,b=p?i+'<defs><path id="qrmodule" d="M0 0 h'+l+" v"+c+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+s:"",y=i+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+s,g="",m="",v=0;v<u;v++)for(var w=0;w<u;w++){if(n[w][v]){var _=w*c+e.padding*c,S=v*l+e.padding*l;if(d){var M=_;_=S,S=M}if(h){var E=c+_,k=l+S;_=Number.isInteger(_)?Number(_):_.toFixed(2),S=Number.isInteger(S)?Number(S):S.toFixed(2),E=Number.isInteger(E)?Number(E):E.toFixed(2),m+="M"+_+","+S+" V"+(k=Number.isInteger(k)?Number(k):k.toFixed(2))+" H"+E+" V"+S+" H"+_+" Z "}else g+=p?i+'<use x="'+_.toString()+'" y="'+S.toString()+'" href="#qrmodule" />'+s:i+'<rect x="'+_.toString()+'" y="'+S.toString()+'" width="'+c+'" height="'+l+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+s}}h&&(g=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+m+'" />');let x="";if(void 0!==this.options.image&&this.options.image.svg){const t=o*this.options.image.width/100,e=a*this.options.image.height/100;x+=`<svg x="${o/2-t/2}" y="${a/2-e/2}" width="${t}" height="${e}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,x+=this.options.image.svg+s,x+="</svg>"}var C="";switch(t.container){case"svg":f&&(C+='<?xml version="1.0" standalone="yes"?>'+s),C+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+s,C+=b+y+g,C+=x,C+="</svg>";break;case"svg-viewbox":f&&(C+='<?xml version="1.0" standalone="yes"?>'+s),C+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+s,C+=b+y+g,C+=x,C+="</svg>";break;case"g":C+='<g width="'+o+'" height="'+a+'">'+s,C+=b+y+g,C+=x,C+="</g>";break;default:C+=(b+y+g+x).replace(/^\s+/,"")}return C};var od=sd,ad=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ph,"__esModule",{value:!0}),Ph.QRCode=void 0;const ud=Wa,cd=nh,ld=ad(od);Ph.QRCode=t=>{const[e,n]=(0,cd.useState)("");return(0,cd.useEffect)((()=>{var e,r;const i=new ld.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:null!==(e=t.width)&&void 0!==e?e:256,height:null!==(r=t.height)&&void 0!==r?r:256,padding:0,image:t.image}),s=Buffer.from(i.svg(),"utf8").toString("base64");n(`data:image/svg+xml;base64,${s}`)})),e?(0,ud.h)("img",{src:e,alt:"QR Code"}):null};var hd={},dd={};Object.defineProperty(dd,"__esModule",{value:!0}),dd.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 fd=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hd,"__esModule",{value:!0}),hd.Spinner=void 0;const pd=Wa,bd=fd(dd);hd.Spinner=t=>{var e;const n=null!==(e=t.size)&&void 0!==e?e:64,r=t.color||"#000";return(0,pd.h)("div",{class:"-cbwsdk-spinner"},(0,pd.h)("style",null,bd.default),(0,pd.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:n,height:n}},(0,pd.h)("circle",{style:{cx:50,cy:50,r:45,stroke:r}})))};var yd={};Object.defineProperty(yd,"__esModule",{value:!0}),yd.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 gd=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Eh,"__esModule",{value:!0}),Eh.CoinbaseAppSteps=Eh.CoinbaseWalletSteps=Eh.ConnectItem=Eh.ConnectContent=void 0;const md=gd(eh),vd=Wa,wd=nh,_d=se,Sd=kh,Md=xh,Ed=gd(Ih),kd=gd(Ah),xd=Nh,Cd=gd(Th),Id=gd(jh),Ad=Oh,Nd=Ph,Rd=hd,Td=gd(yd),jd={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:kd.default,steps:Pd},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:Ed.default,steps:Dd}},Od=t=>"light"===t?"#FFFFFF":"#0A0B0D";function Ld({title:t,description:e,icon:n,selected:r,theme:i,onClick:s}){return(0,vd.h)("div",{onClick:s,class:(0,md.default)("-cbwsdk-connect-item",i,{selected:r})},(0,vd.h)("div",null,(0,vd.h)("img",{src:n,alt:t})),(0,vd.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,vd.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,vd.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}function Pd({theme:t}){return(0,vd.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,vd.h)("li",{class:(0,md.default)("-cbwsdk-wallet-steps-item",t)},(0,vd.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,vd.h)("li",{class:(0,md.default)("-cbwsdk-wallet-steps-item",t)},(0,vd.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,vd.h)("span",null,"Tap ",(0,vd.h)("strong",null,"Scan")," "),(0,vd.h)("span",{class:(0,md.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,vd.h)(xd.QRCodeIcon,{fill:Od(t)})))))}function Dd({theme:t}){return(0,vd.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,vd.h)("li",{class:(0,md.default)("-cbwsdk-wallet-steps-item",t)},(0,vd.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,vd.h)("li",{class:(0,md.default)("-cbwsdk-wallet-steps-item",t)},(0,vd.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,vd.h)("span",null,"Tap ",(0,vd.h)("strong",null,"More")),(0,vd.h)("span",{class:(0,md.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,vd.h)(Ad.StatusDotIcon,{fill:Od(t)})),(0,vd.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,vd.h)("strong",null,"Scan")),(0,vd.h)("span",{class:(0,md.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,vd.h)(xd.QRCodeIcon,{fill:Od(t)})))))}Eh.ConnectContent=function(t){const{theme:e}=t,[n,r]=(0,wd.useState)("coinbase-wallet-app"),i=(0,wd.useCallback)((t=>{r(t)}),[]),s=(0,_d.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId);if(!n)return null;const o=jd[n].steps,a="coinbase-app"===n;return(0,vd.h)("div",{"data-testid":"connect-content",class:(0,md.default)("-cbwsdk-connect-content",e)},(0,vd.h)("style",null,Td.default),(0,vd.h)("div",{class:"-cbwsdk-connect-content-header"},(0,vd.h)("h2",{class:(0,md.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,vd.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,vd.h)(Md.CloseIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,vd.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,vd.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,vd.h)("div",null,Object.entries(jd).map((([t,r])=>(0,vd.h)(Ld,{key:t,title:r.title,description:r.description,icon:r.icon,selected:n===t,onClick:()=>i(t),theme:e})))),a&&(0,vd.h)("div",{class:(0,md.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,vd.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,vd.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,vd.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,vd.h)(Nd.QRCode,{content:s,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:(u=n,"coinbase-app"===u?Cd.default:Id.default),width:25,height:25}}),(0,vd.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Sd.LIB_VERSION}),(0,vd.h)("input",{type:"hidden",value:s})),(0,vd.h)(o,{theme:e}),!t.isConnected&&(0,vd.h)("div",{"data-testid":"connecting-spinner",class:(0,md.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,vd.h)(Rd.Spinner,{size:36,color:"dark"===e?"#FFF":"#000"}),(0,vd.h)("p",null,"Connecting...")))));var u},Eh.ConnectItem=Ld,Eh.CoinbaseWalletSteps=Pd,Eh.CoinbaseAppSteps=Dd;var Bd={},Fd={};Object.defineProperty(Fd,"__esModule",{value:!0}),Fd.ArrowLeftIcon=void 0;const Wd=Wa;Fd.ArrowLeftIcon=function(t){return(0,Wd.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,Wd.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 Ud={};Object.defineProperty(Ud,"__esModule",{value:!0}),Ud.LaptopIcon=void 0;const Hd=Wa;Ud.LaptopIcon=function(t){return(0,Hd.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Hd.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Hd.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 Vd={};Object.defineProperty(Vd,"__esModule",{value:!0}),Vd.SafeIcon=void 0;const zd=Wa;Vd.SafeIcon=function(t){return(0,zd.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,zd.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 qd={};Object.defineProperty(qd,"__esModule",{value:!0}),qd.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 Zd=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bd,"__esModule",{value:!0}),Bd.TryExtensionContent=void 0;const Gd=Zd(eh),$d=Wa,Qd=nh,Yd=Fd,Jd=Ud,Kd=Vd,Xd=Zd(qd);Bd.TryExtensionContent=function({theme:t}){const[e,n]=(0,Qd.useState)(!1),r=(0,Qd.useCallback)((()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")}),[]),i=(0,Qd.useCallback)((()=>{e?window.location.reload():(r(),n(!0))}),[r,e]);return(0,$d.h)("div",{class:(0,Gd.default)("-cbwsdk-try-extension",t)},(0,$d.h)("style",null,Xd.default),(0,$d.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,$d.h)("h3",{class:(0,Gd.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,$d.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,$d.h)("button",{class:(0,Gd.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,$d.h)("div",null,!e&&(0,$d.h)(Yd.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:"light"===t?"#0052FF":"#588AF5"})))),(0,$d.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,$d.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,$d.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,$d.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,$d.h)("span",{class:(0,Gd.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,$d.h)(Jd.LaptopIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,$d.h)("div",{class:(0,Gd.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,$d.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,$d.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,$d.h)("span",{class:(0,Gd.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,$d.h)(Kd.SafeIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,$d.h)("div",{class:(0,Gd.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))};var tf={};Object.defineProperty(tf,"__esModule",{value:!0}),tf.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 ef=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($l,"__esModule",{value:!0}),$l.ConnectDialog=void 0;const nf=ef(eh),rf=Wa,sf=nh,of=Eh,af=Bd,uf=ef(tf);$l.ConnectDialog=t=>{const{isOpen:e,darkMode:n}=t,[r,i]=(0,sf.useState)(!e),[s,o]=(0,sf.useState)(!e);(0,sf.useEffect)((()=>{const t=[window.setTimeout((()=>{o(!e)}),10)];return e?i(!1):t.push(window.setTimeout((()=>{i(!0)}),360)),()=>{t.forEach(window.clearTimeout)}}),[t.isOpen]);const a=n?"dark":"light";return(0,rf.h)("div",{class:(0,nf.default)("-cbwsdk-connect-dialog-container",r&&"-cbwsdk-connect-dialog-container-hidden")},(0,rf.h)("style",null,uf.default),(0,rf.h)("div",{class:(0,nf.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,rf.h)("div",{class:"-cbwsdk-connect-dialog"},(0,rf.h)("div",{class:(0,nf.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,rf.h)(of.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,rf.h)(af.TryExtensionContent,{theme:a}))))},Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.LinkFlow=void 0;const cf=Wa,lf=Gl,hf=$l;Fa.LinkFlow=class{constructor(t){this.extensionUI$=new lf.BehaviorSubject({}),this.subscriptions=new lf.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection,this.connected$=t.connected$,this.chainId$=t.chainId$}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe((t=>{this.isConnected!==t&&(this.isConnected=t,this.render())}))),this.subscriptions.add(this.chainId$.subscribe((t=>{this.chainId!==t&&(this.chainId=t,this.render())})))}detach(){var t;this.root&&(this.subscriptions.unsubscribe(),(0,cf.render)(null,this.root),null===(t=this.root.parentElement)||void 0===t||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const t=this.extensionUI$.subscribe((()=>{this.root&&(0,cf.render)((0,cf.h)(hf.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}));this.subscriptions.add(t)}};var df={},ff={};Object.defineProperty(ff,"__esModule",{value:!0}),ff.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 e=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const n=e(eh),r=Wa,i=nh,o=e(ff);function a(t){return"coinbase-app"===t?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}t.Snackbar=class{constructor(t){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=t.darkMode}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",t.appendChild(this.root),this.render()}presentItem(t){const e=this.nextItemKey++;return this.items.set(e,t),this.render(),()=>{this.items.delete(e),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,r.render)((0,r.h)("div",null,(0,r.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map((([e,n])=>(0,r.h)(t.SnackbarInstance,Object.assign({},n,{key:e})))))),this.root)}};t.SnackbarContainer=t=>(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-container")},(0,r.h)("style",null,o.default),(0,r.h)("div",{class:"-cbwsdk-snackbar"},t.children));t.SnackbarInstance=({autoExpand:t,message:e,menuItems:s,appSrc:o})=>{const[u,c]=(0,i.useState)(!0),[l,h]=(0,i.useState)(null!=t&&t);(0,i.useEffect)((()=>{const t=[window.setTimeout((()=>{c(!1)}),1),window.setTimeout((()=>{h(!0)}),1e4)];return()=>{t.forEach(window.clearTimeout)}}));return(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance",u&&"-cbwsdk-snackbar-instance-hidden",l&&"-cbwsdk-snackbar-instance-expanded")},(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{h(!l)}},(0,r.h)("img",{src:a(o),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),(0,r.h)("div",{class:"-gear-container"},!l&&(0,r.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,r.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),s&&s.length>0&&(0,r.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},s.map(((t,e)=>(0,r.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item",t.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:t.onClick,key:e},(0,r.h)("svg",{width:t.svgWidth,height:t.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("path",{"fill-rule":t.defaultFillRule,"clip-rule":t.defaultClipRule,d:t.path,fill:"#AAAAAA"})),(0,r.h)("span",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item-info",t.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},t.info))))))}}(df);var pf={},bf={};Object.defineProperty(bf,"__esModule",{value:!0}),bf.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 yf=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pf,"__esModule",{value:!0}),pf.injectCssReset=void 0;const gf=yf(bf);pf.injectCssReset=function(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(gf.default)),document.documentElement.appendChild(t)},Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.WalletSDKUI=void 0;const mf=Fa,vf=df,wf=pf;Ba.WalletSDKUI=class{constructor(t){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new vf.Snackbar({darkMode:t.darkMode}),this.linkFlow=new mf.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,connected$:t.connected$,chainId$:t.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,e=document.createElement("div");e.className="-cbwsdk-css-reset",t.appendChild(e),this.linkFlow.attach(e),this.snackbar.attach(e),this.attached=!0,(0,wf.injectCssReset)()}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(t){}watchAsset(t){}switchEthereumChain(t){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(t){}signEthereumTransaction(t){}submitEthereumTransaction(t){}ethereumAddressFromSignedMessage(t){}showConnecting(t){let e;return e=t.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:{message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(e)}setAppSrc(t){this.appSrc=t}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(t){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return null!==(t=this.standalone)&&void 0!==t&&t}};var _f,Sf={},Mf={};function Ef(t,e,n){if(!n||typeof n.value!==_f.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:_f.boolTrue,get:function(){var t=n.value.bind(this);return Object.defineProperty(this,e,{value:t,configurable:_f.boolTrue,writable:_f.boolTrue}),t}}}function kf(t){return function(e){return e.lift(new xf(t))}}Object.defineProperty(Mf,"__esModule",{value:!0}),function(t){t.typeOfFunction="function",t.boolTrue=!0}(_f||(_f={})),Mf.bind=Ef,Mf.default=Ef;var xf=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Cf(t,this.durationSelector))},t}(),Cf=function(e){function n(t,n){var r=e.call(this,t)||this;return r.durationSelector=n,r.hasValue=!1,r}return t(n,e),n.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var n=fl(e,new hl(this));!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},n.prototype.clearThrottle=function(){var t=this,e=t.value,n=t.hasValue,r=t.throttled;r&&(this.remove(r),this.throttled=void 0,r.unsubscribe()),n&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},n.prototype.notifyNext=function(){this.clearThrottle()},n.prototype.notifyComplete=function(){this.clearThrottle()},n}(dl);var If=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Af(t,this.closingNotifier))},t}(),Af=function(e){function n(t,n){var r=e.call(this,t)||this;return r.buffer=[],r.add(fl(n,new hl(r))),r}return t(n,e),n.prototype._next=function(t){this.buffer.push(t)},n.prototype.notifyNext=function(){var t=this.buffer;this.buffer=[],this.destination.next(t)},n}(dl);var Nf=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?Tf:Rf}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),Rf=function(e){function n(t,n){var r=e.call(this,t)||this;return r.bufferSize=n,r.buffer=[],r}return t(n,e),n.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},n.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},n}(Cu),Tf=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.bufferSize=n,i.startBufferEvery=r,i.buffers=[],i.count=0,i}return t(n,e),n.prototype._next=function(t){var e=this,n=e.bufferSize,r=e.startBufferEvery,i=e.buffers,s=e.count;this.count++,s%r==0&&i.push([]);for(var o=i.length;o--;){var a=i[o];a.push(t),a.length===n&&(i.splice(o,1),this.destination.next(a))}},n.prototype._complete=function(){for(var t=this.buffers,n=this.destination;t.length>0;){var r=t.shift();r.length>0&&n.next(r)}e.prototype._complete.call(this)},n}(Cu);var jf=function(){function t(t,e,n,r){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new Lf(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),Of=function(){return function(){this.buffer=[]}}(),Lf=function(e){function n(t,n,r,i,s){var o=e.call(this,t)||this;o.bufferTimeSpan=n,o.bufferCreationInterval=r,o.maxBufferSize=i,o.scheduler=s,o.contexts=[];var a=o.openContext();if(o.timespanOnly=null==r||r<0,o.timespanOnly){var u={subscriber:o,context:a,bufferTimeSpan:n};o.add(a.closeAction=s.schedule(Pf,n,u))}else{var c={subscriber:o,context:a},l={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:o,scheduler:s};o.add(a.closeAction=s.schedule(Bf,n,c)),o.add(s.schedule(Df,r,l))}return o}return t(n,e),n.prototype._next=function(t){for(var e,n=this.contexts,r=n.length,i=0;i<r;i++){var s=n[i],o=s.buffer;o.push(t),o.length==this.maxBufferSize&&(e=s)}e&&this.onBufferFull(e)},n.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},n.prototype._complete=function(){for(var t=this.contexts,n=this.destination;t.length>0;){var r=t.shift();n.next(r.buffer)}e.prototype._complete.call(this)},n.prototype._unsubscribe=function(){this.contexts=null},n.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:t,bufferTimeSpan:n};this.add(t.closeAction=this.scheduler.schedule(Pf,n,r))}},n.prototype.openContext=function(){var t=new Of;return this.contexts.push(t),t},n.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},n}(Cu);function Pf(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function Df(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,i=t.scheduler,s=r.openContext();r.closed||(r.add(s.closeAction=i.schedule(Bf,n,{subscriber:r,context:s})),this.schedule(t,e))}function Bf(t){var e=t.subscriber,n=t.context;e.closeContext(n)}var Ff=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Wf(t,this.openings,this.closingSelector))},t}(),Wf=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.closingSelector=r,i.contexts=[],i.add(sl(i,n)),i}return t(n,e),n.prototype._next=function(t){for(var e=this.contexts,n=e.length,r=0;r<n;r++)e[r].buffer.push(t)},n.prototype._error=function(t){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},n.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var n=t.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._complete.call(this)},n.prototype.notifyNext=function(t,e){t?this.closeBuffer(t):this.openBuffer(e)},n.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},n.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},n.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.buffer,r=t.subscription;this.destination.next(n),e.splice(e.indexOf(t),1),this.remove(r),r.unsubscribe()}},n.prototype.trySubscribe=function(t){var e=this.contexts,n=new Eu,r={buffer:[],subscription:n};e.push(r);var i=sl(this,t,r);!i||i.closed?this.closeBuffer(r):(i.context=r,this.add(i),n.add(i))},n}(Kc);var Uf=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Hf(t,this.closingSelector))},t}(),Hf=function(e){function n(t,n){var r=e.call(this,t)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return t(n,e),n.prototype._next=function(t){this.buffer.push(t)},n.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.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 t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new Eu,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(fl(e,new hl(this))),this.subscribing=!1},n}(dl);var Vf=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new zf(t,this.selector,this.caught))},t}(),zf=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.selector=n,i.caught=r,i}return t(n,e),n.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle();var r=new hl(this);this.add(r);var i=fl(n,r);i!==r&&this.add(i)}},n}(dl);function qf(t,e){return pl(t,e,1)}var Zf=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Gf(t,this.predicate,this.source))},t}(),Gf=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.source=r,i.count=0,i.index=0,i}return t(n,e),n.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},n.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},n.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},n}(Cu);var $f=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Qf(t,this.durationSelector))},t}(),Qf=function(e){function n(t,n){var r=e.call(this,t)||this;return r.durationSelector=n,r.hasValue=!1,r}return t(n,e),n.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},n.prototype._complete=function(){this.emitValue(),this.destination.complete()},n.prototype._tryNext=function(t,e){var n=this.durationSubscription;this.value=t,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=fl(e,new hl(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 t=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,t)}},n}(dl);var Yf=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Jf(t,this.dueTime,this.scheduler))},t}(),Jf=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return t(n,e),n.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Kf,this.dueTime,this))},n.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},n.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},n.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},n}(Cu);function Kf(t){t.debouncedNext()}function Xf(t){return void 0===t&&(t=null),function(e){return e.lift(new tp(t))}}var tp=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new ep(t,this.defaultValue))},t}(),ep=function(e){function n(t,n){var r=e.call(this,t)||this;return r.defaultValue=n,r.isEmpty=!0,r}return t(n,e),n.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},n.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},n}(Cu);function np(t){return t instanceof Date&&!isNaN(+t)}var rp=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new ip(t,this.delay,this.scheduler))},t}(),ip=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.delay=n,i.scheduler=r,i.queue=[],i.active=!1,i.errored=!1,i}return t(n,e),n.dispatch=function(t){for(var e=t.source,n=e.queue,r=t.scheduler,i=t.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){var s=Math.max(0,n[0].time-r.now());this.schedule(t,s)}else this.unsubscribe(),e.active=!1},n.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(n.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},n.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new sp(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},n.prototype._next=function(t){this.scheduleNotification(bc.createNext(t))},n.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},n.prototype._complete=function(){this.scheduleNotification(bc.createComplete()),this.unsubscribe()},n}(Cu),sp=function(){return function(t,e){this.time=t,this.notification=e}}();var op=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new ap(t,this.delayDurationSelector))},t}(),ap=function(e){function n(t,n){var r=e.call(this,t)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return t(n,e),n.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(t),this.removeSubscription(i),this.tryComplete()},n.prototype.notifyError=function(t,e){this._error(t)},n.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},n.prototype._next=function(t){var e=this.index++;try{var n=this.delayDurationSelector(t,e);n&&this.tryDelay(n,t)}catch(t){this.destination.error(t)}},n.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},n.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},n.prototype.tryDelay=function(t,e){var n=sl(this,t,e);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}(Kc),up=function(e){function n(t,n){var r=e.call(this)||this;return r.source=t,r.subscriptionDelay=n,r}return t(n,e),n.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new cp(t,this.source))},n}(Ou),cp=function(e){function n(t,n){var r=e.call(this)||this;return r.parent=t,r.source=n,r.sourceSubscribed=!1,r}return t(n,e),n.prototype._next=function(t){this.subscribeToSource()},n.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},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}(Cu);var lp=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new hp(t))},t}(),hp=function(e){function n(t){return e.call(this,t)||this}return t(n,e),n.prototype._next=function(t){t.observe(this.destination)},n}(Cu);var dp=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new fp(t,this.keySelector,this.flushes))},t}(),fp=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.keySelector=n,i.values=new Set,r&&i.add(fl(r,new hl(i))),i}return t(n,e),n.prototype.notifyNext=function(){this.values.clear()},n.prototype.notifyError=function(t){this._error(t)},n.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},n.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(t){return void n.error(t)}this._finalizeNext(e,t)},n.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},n}(dl);function pp(t,e){return function(n){return n.lift(new bp(t,e))}}var bp=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new yp(t,this.compare,this.keySelector))},t}(),yp=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return t(n,e),n.prototype.compare=function(t,e){return t===e},n.prototype._next=function(t){var e;try{var n=this.keySelector;e=n?n(t):t}catch(t){return this.destination.error(t)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;r||(this.key=e,this.destination.next(t))},n}(Cu);function gp(t){return void 0===t&&(t=wp),function(e){return e.lift(new mp(t))}}var mp=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,e){return e.subscribe(new vp(t,this.errorFactory))},t}(),vp=function(e){function n(t,n){var r=e.call(this,t)||this;return r.errorFactory=n,r.hasValue=!1,r}return t(n,e),n.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},n.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)},n}(Cu);function wp(){return new Hc}function _p(t){return function(e){return 0===t?oc():e.lift(new Sp(t))}}var Sp=function(){function t(t){if(this.total=t,this.total<0)throw new Uc}return t.prototype.call=function(t,e){return e.subscribe(new Mp(t,this.total))},t}(),Mp=function(e){function n(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return t(n,e),n.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},n}(Cu);var Ep=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new kp(t,this.predicate,this.thisArg,this.source))},t}(),kp=function(e){function n(t,n,r,i){var s=e.call(this,t)||this;return s.predicate=n,s.thisArg=r,s.source=i,s.index=0,s.thisArg=r||s,s}return t(n,e),n.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},n.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},n.prototype._complete=function(){this.notifyComplete(!0)},n}(Cu);var xp=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Cp(t))},t}(),Cp=function(e){function n(t){var n=e.call(this,t)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return t(n,e),n.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(fl(t,new hl(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}(dl);var Ip=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Ap(t,this.project))},t}(),Ap=function(e){function n(t,n){var r=e.call(this,t)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return t(n,e),n.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},n.prototype.tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e)},n.prototype._innerSub=function(t){var e=new hl(this),n=this.destination;n.add(e);var r=fl(t,e);r!==e&&n.add(r)},n.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},n.prototype.notifyNext=function(t){this.destination.next(t)},n.prototype.notifyError=function(t){this.destination.error(t)},n.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},n}(dl);var Np=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new Rp(t,this.project,this.concurrent,this.scheduler))},t}(),Rp=function(e){function n(t,n,r,i){var s=e.call(this,t)||this;return s.project=n,s.concurrent=r,s.scheduler=i,s.index=0,s.active=0,s.hasCompleted=!1,r<Number.POSITIVE_INFINITY&&(s.buffer=[]),s}return t(n,e),n.dispatch=function(t){var e=t.subscriber,n=t.result,r=t.value,i=t.index;e.subscribeToProjection(n,r,i)},n.prototype._next=function(t){var e=this.destination;if(e.closed)this._complete();else{var r=this.index++;if(this.active<this.concurrent){e.next(t);try{var i=(0,this.project)(t,r);if(this.scheduler){var s={subscriber:this,result:i,value:t,index:r};this.destination.add(this.scheduler.schedule(n.dispatch,0,s))}else this.subscribeToProjection(i,t,r)}catch(t){e.error(t)}}else this.buffer.push(t)}},n.prototype.subscribeToProjection=function(t,e,n){this.active++,this.destination.add(fl(t,new hl(this)))},n.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},n.prototype.notifyNext=function(t){this._next(t)},n.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t&&t.length>0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},n}(dl);var Tp=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new jp(t,this.callback))},t}(),jp=function(e){function n(t,n){var r=e.call(this,t)||this;return r.add(new Eu(n)),r}return t(n,e),n}(Cu);var Op=function(){function t(t,e,n,r){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=r}return t.prototype.call=function(t,e){return e.subscribe(new Lp(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),Lp=function(e){function n(t,n,r,i,s){var o=e.call(this,t)||this;return o.predicate=n,o.source=r,o.yieldIndex=i,o.thisArg=s,o.index=0,o}return t(n,e),n.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},n.prototype._next=function(t){var e=this.predicate,n=this.thisArg,r=this.index++;try{e.call(n||this,t,r,this.source)&&this.notifyComplete(this.yieldIndex?r:t)}catch(t){this.destination.error(t)}},n.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},n}(Cu);var Pp=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Dp(t))},t}(),Dp=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype._next=function(t){},n}(Cu);var Bp=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Fp(t))},t}(),Fp=function(e){function n(t){return e.call(this,t)||this}return t(n,e),n.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},n.prototype._next=function(t){this.notifyComplete(!1)},n.prototype._complete=function(){this.notifyComplete(!0)},n}(Cu);function Wp(t){return function(e){return 0===t?oc():e.lift(new Up(t))}}var Up=function(){function t(t){if(this.total=t,this.total<0)throw new Uc}return t.prototype.call=function(t,e){return e.subscribe(new Hp(t,this.total))},t}(),Hp=function(e){function n(t,n){var r=e.call(this,t)||this;return r.total=n,r.ring=new Array,r.count=0,r}return t(n,e),n.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t},n.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i<n;i++){var s=e++%n;t.next(r[s])}t.complete()},n}(Cu);var Vp=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new zp(t,this.value))},t}(),zp=function(e){function n(t,n){var r=e.call(this,t)||this;return r.value=n,r}return t(n,e),n.prototype._next=function(t){this.destination.next(this.value)},n}(Cu);var qp=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Zp(t))},t}(),Zp=function(e){function n(t){return e.call(this,t)||this}return t(n,e),n.prototype._next=function(t){this.destination.next(bc.createNext(t))},n.prototype._error=function(t){var e=this.destination;e.next(bc.createError(t)),e.complete()},n.prototype._complete=function(){var t=this.destination;t.next(bc.createComplete()),t.complete()},n}(Cu);function Gp(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new $p(t,e,n))}}var $p=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new Qp(t,this.accumulator,this.seed,this.hasSeed))},t}(),Qp=function(e){function n(t,n,r,i){var s=e.call(this,t)||this;return s.accumulator=n,s._seed=r,s.hasSeed=i,s.index=0,s}return t(n,e),Object.defineProperty(n.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),n.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},n.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},n}(Cu);function Yp(t,e){return arguments.length>=2?function(n){return Tu(Gp(t,e),Wp(1),Xf(e))(n)}:function(e){return Tu(Gp((function(e,n,r){return t(e,n,r+1)})),Wp(1))(e)}}var Jp=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new Kp(t,this.accumulator,this.seed,this.concurrent))},t}(),Kp=function(e){function n(t,n,r,i){var s=e.call(this,t)||this;return s.accumulator=n,s.acc=r,s.concurrent=i,s.hasValue=!1,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return t(n,e),n.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,n=this.destination,r=void 0;try{r=(0,this.accumulator)(this.acc,t,e)}catch(t){return n.error(t)}this.active++,this._innerSub(r)}else this.buffer.push(t)},n.prototype._innerSub=function(t){var e=new hl(this),n=this.destination;n.add(e);var r=fl(t,e);r!==e&&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(t){var e=this.destination;this.acc=t,this.hasValue=!0,e.next(t)},n.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},n}(dl);function Xp(t,e){return function(n){var r;if(r="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new tb(r,e));var i=Object.create(n,qu);return i.source=n,i.subjectFactory=r,i}}var tb=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(t);return i.add(e.subscribe(r)),i},t}();var eb=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new nb(t,this.nextSources))},t}(),nb=function(e){function n(t,n){var r=e.call(this,t)||this;return r.destination=t,r.nextSources=n,r}return t(n,e),n.prototype.notifyError=function(){this.subscribeToNextSource()},n.prototype.notifyComplete=function(){this.subscribeToNextSource()},n.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},n.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},n.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new hl(this),n=this.destination;n.add(e);var r=fl(t,e);r!==e&&n.add(r)}else this.destination.complete()},n}(dl);var rb=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ib(t))},t}(),ib=function(e){function n(t){var n=e.call(this,t)||this;return n.hasPrev=!1,n}return t(n,e),n.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},n}(Cu);var sb=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new ob(t,this.count,this.source))},t}(),ob=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.count=n,i.source=r,i}return t(n,e),n.prototype.complete=function(){if(!this.isStopped){var t=this.source,n=this.count;if(0===n)return e.prototype.complete.call(this);n>-1&&(this.count=n-1),t.subscribe(this._unsubscribeAndRecycle())}},n}(Cu);var ab=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new ub(t,this.notifier,e))},t}(),ub=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.notifier=n,i.source=r,i.sourceIsBeingSubscribedTo=!0,i}return t(n,e),n.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},n.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return e.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 e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},n.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},n.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},n.prototype.subscribeToRetries=function(){var t;this.notifications=new Fu;try{t=(0,this.notifier)(this.notifications)}catch(t){return e.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=fl(t,new hl(this))},n}(dl);var cb=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new lb(t,this.count,this.source))},t}(),lb=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.count=n,i.source=r,i}return t(n,e),n.prototype.error=function(t){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return e.prototype.error.call(this,t);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},n}(Cu);var hb=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new db(t,this.notifier,this.source))},t}(),db=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.notifier=n,i.source=r,i}return t(n,e),n.prototype.error=function(t){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 Fu;try{r=(0,this.notifier)(n)}catch(t){return e.prototype.error.call(this,t)}i=fl(r,new hl(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=i,n.next(t)}},n.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},n.prototype.notifyNext=function(){var t=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=t,this.source.subscribe(this)},n}(dl);var fb=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new pb(t),r=e.subscribe(n);return r.add(fl(this.notifier,new hl(n))),r},t}(),pb=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasValue=!1,t}return t(n,e),n.prototype._next=function(t){this.value=t,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}(dl);var bb=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new yb(t,this.period,this.scheduler))},t}(),yb=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.period=n,i.scheduler=r,i.hasValue=!1,i.add(r.schedule(gb,n,{subscriber:i,period:n})),i}return t(n,e),n.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},n.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},n}(Cu);function gb(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}var mb=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new vb(t,this.compareTo,this.comparator))},t}(),vb=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.compareTo=n,i.comparator=r,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(n.subscribe(new wb(t,i))),i}return t(n,e),n.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),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 t=this,e=t._a,n=t._b,r=t.comparator;e.length>0&&n.length>0;){var i=e.shift(),s=n.shift(),o=!1;try{o=r?r(i,s):i===s}catch(t){this.destination.error(t)}o||this.emit(!1)}},n.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},n.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},n.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},n}(Cu),wb=function(e){function n(t,n){var r=e.call(this,t)||this;return r.parent=n,r}return t(n,e),n.prototype._next=function(t){this.parent.nextB(t)},n.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},n.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},n}(Cu);function _b(){return new Fu}var Sb=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Mb(t,this.predicate,this.source))},t}(),Mb=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.source=r,i.seenValue=!1,i.index=0,i}return t(n,e),n.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},n.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},n.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},n.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new Hc)},n}(Cu);var Eb=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new kb(t,this.total))},t}(),kb=function(e){function n(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return t(n,e),n.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},n}(Cu);var xb=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new Uc}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new Cu(t)):e.subscribe(new Cb(t,this._skipCount))},t}(),Cb=function(e){function n(t,n){var r=e.call(this,t)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return t(n,e),n.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n<e)this._ring[n]=t;else{var r=n%e,i=this._ring,s=i[r];i[r]=t,this.destination.next(s)}},n}(Cu);var Ib=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Ab(t,this.notifier))},t}(),Ab=function(e){function n(t,n){var r=e.call(this,t)||this;r.hasValue=!1;var i=new hl(r);r.add(i),r.innerSubscription=i;var s=fl(n,i);return s!==i&&(r.add(s),r.innerSubscription=s),r}return t(n,e),n.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},n.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},n.prototype.notifyComplete=function(){},n}(dl);var Nb=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new Rb(t,this.predicate))},t}(),Rb=function(e){function n(t,n){var r=e.call(this,t)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return t(n,e),n.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},n.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},n}(Cu);var Tb=function(e){function n(t,n,r){void 0===n&&(n=0),void 0===r&&(r=Rc);var i=e.call(this)||this;return i.source=t,i.delayTime=n,i.scheduler=r,(!kl(n)||n<0)&&(i.delayTime=0),r&&"function"==typeof r.schedule||(i.scheduler=Rc),i}return t(n,e),n.create=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=Rc),new n(t,e,r)},n.dispatch=function(t){var e=t.source,n=t.subscriber;return this.add(e.subscribe(n))},n.prototype._subscribe=function(t){var e=this.delayTime,r=this.source;return this.scheduler.schedule(n.dispatch,e,{source:r,subscriber:t})},n}(Ou);var jb=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new Tb(e,this.delay,this.scheduler).subscribe(t)},t}();function Ob(t,e){return"function"==typeof e?function(n){return n.pipe(Ob((function(n,r){return ll(t(n,r)).pipe(zc((function(t,i){return e(n,t,r,i)})))})))}:function(e){return e.lift(new Lb(t))}}var Lb=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Pb(t,this.project))},t}(),Pb=function(e){function n(t,n){var r=e.call(this,t)||this;return r.project=n,r.index=0,r}return t(n,e),n.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e)},n.prototype._innerSub=function(t){var e=this.innerSubscription;e&&e.unsubscribe();var n=new hl(this),r=this.destination;r.add(n),this.innerSubscription=fl(t,n),this.innerSubscription!==n&&r.add(this.innerSubscription)},n.prototype._complete=function(){var t=this.innerSubscription;t&&!t.closed||e.prototype._complete.call(this),this.unsubscribe()},n.prototype._unsubscribe=function(){this.innerSubscription=void 0},n.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},n.prototype.notifyNext=function(t){this.destination.next(t)},n}(dl);var Db=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new Bb(t),r=fl(this.notifier,new hl(n));return r&&!n.seenValue?(n.add(r),e.subscribe(n)):n},t}(),Bb=function(e){function n(t){var n=e.call(this,t)||this;return n.seenValue=!1,n}return t(n,e),n.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},n.prototype.notifyComplete=function(){},n}(dl);var Fb=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new Wb(t,this.predicate,this.inclusive))},t}(),Wb=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.inclusive=r,i.index=0,i}return t(n,e),n.prototype._next=function(t){var e,n=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void n.error(t)}this.nextOrComplete(t,e)},n.prototype.nextOrComplete=function(t,e){var n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())},n}(Cu);var Ub=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new Hb(t,this.nextOrObserver,this.error,this.complete))},t}(),Hb=function(e){function n(t,n,r,i){var s=e.call(this,t)||this;return s._tapNext=Wc,s._tapError=Wc,s._tapComplete=Wc,s._tapError=r||Wc,s._tapComplete=i||Wc,bu(n)?(s._context=s,s._tapNext=n):n&&(s._context=n,s._tapNext=n.next||Wc,s._tapError=n.error||Wc,s._tapComplete=n.complete||Wc),s}return t(n,e),n.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},n.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},n.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},n}(Cu),Vb={leading:!0,trailing:!1};var zb=function(){function t(t,e,n){this.durationSelector=t,this.leading=e,this.trailing=n}return t.prototype.call=function(t,e){return e.subscribe(new qb(t,this.durationSelector,this.leading,this.trailing))},t}(),qb=function(e){function n(t,n,r,i){var s=e.call(this,t)||this;return s.destination=t,s.durationSelector=n,s._leading=r,s._trailing=i,s._hasValue=!1,s}return t(n,e),n.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},n.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=void 0},n.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=fl(e,new hl(this)))},n.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},n.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=void 0,e&&this.send()},n.prototype.notifyNext=function(){this.throttlingDone()},n.prototype.notifyComplete=function(){this.throttlingDone()},n}(dl);var Zb=function(){function t(t,e,n,r){this.duration=t,this.scheduler=e,this.leading=n,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new Gb(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),Gb=function(e){function n(t,n,r,i,s){var o=e.call(this,t)||this;return o.duration=n,o.scheduler=r,o.leading=i,o.trailing=s,o._hasTrailingValue=!1,o._trailingValue=null,o}return t(n,e),n.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule($b,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,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 t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},n}(Cu);function $b(t){t.subscriber.clearThrottle()}var Qb=function(){return function(t,e){this.value=t,this.interval=e}}();function Yb(t,e,n){return void 0===n&&(n=jc),function(r){var i=np(t),s=i?+t-n.now():Math.abs(t);return r.lift(new Jb(s,i,e,n))}}var Jb=function(){function t(t,e,n,r){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new Kb(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),Kb=function(e){function n(t,n,r,i,s){var o=e.call(this,t)||this;return o.absoluteTimeout=n,o.waitFor=r,o.withObservable=i,o.scheduler=s,o.scheduleTimeout(),o}return t(n,e),n.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add(fl(e,new hl(t)))},n.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(n.dispatchTimeout,this.waitFor,this))},n.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},n.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},n}(dl);var Xb=function(){return function(t,e){this.value=t,this.timestamp=e}}();function ty(t,e,n){return 0===n?[e]:(t.push(e),t)}var ey=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var n=new ny(t),r=e.subscribe(n);return r.closed||n.add(fl(this.windowBoundaries,new hl(n))),r},t}(),ny=function(e){function n(t){var n=e.call(this,t)||this;return n.window=new Fu,t.next(n.window),n}return t(n,e),n.prototype.notifyNext=function(){this.openWindow()},n.prototype.notifyError=function(t){this._error(t)},n.prototype.notifyComplete=function(){this._complete()},n.prototype._next=function(t){this.window.next(t)},n.prototype._error=function(t){this.window.error(t),this.destination.error(t)},n.prototype._complete=function(){this.window.complete(),this.destination.complete()},n.prototype._unsubscribe=function(){this.window=null},n.prototype.openWindow=function(){var t=this.window;t&&t.complete();var e=this.destination,n=this.window=new Fu;e.next(n)},n}(dl);var ry=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new iy(t,this.windowSize,this.startWindowEvery))},t}(),iy=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.destination=t,i.windowSize=n,i.startWindowEvery=r,i.windows=[new Fu],i.count=0,t.next(i.windows[0]),i}return t(n,e),n.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,i=this.windows,s=i.length,o=0;o<s&&!this.closed;o++)i[o].next(t);var a=this.count-r+1;if(a>=0&&a%e==0&&!this.closed&&i.shift().complete(),++this.count%e==0&&!this.closed){var u=new Fu;i.push(u),n.next(u)}},n.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},n.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},n.prototype._unsubscribe=function(){this.count=0,this.windows=null},n}(Cu);var sy=function(){function t(t,e,n,r){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new ay(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),oy=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._numberOfNextedValues=0,t}return t(n,e),n.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(n.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),n}(Fu),ay=function(e){function n(t,n,r,i,s){var o=e.call(this,t)||this;o.destination=t,o.windowTimeSpan=n,o.windowCreationInterval=r,o.maxWindowSize=i,o.scheduler=s,o.windows=[];var a=o.openWindow();if(null!==r&&r>=0){var u={subscriber:o,window:a,context:null},c={windowTimeSpan:n,windowCreationInterval:r,subscriber:o,scheduler:s};o.add(s.schedule(ly,n,u)),o.add(s.schedule(cy,r,c))}else{var l={subscriber:o,window:a,windowTimeSpan:n};o.add(s.schedule(uy,n,l))}return o}return t(n,e),n.prototype._next=function(t){for(var e=this.windows,n=e.length,r=0;r<n;r++){var i=e[r];i.closed||(i.next(t),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},n.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},n.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},n.prototype.openWindow=function(){var t=new oy;return this.windows.push(t),this.destination.next(t),t},n.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},n}(Cu);function uy(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function cy(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,i=t.windowCreationInterval,s=n.openWindow(),o=this,a={action:o,subscription:null},u={subscriber:n,window:s,context:a};a.subscription=r.schedule(ly,e,u),o.add(a.subscription),o.schedule(t,i)}function ly(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}var hy=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new dy(t,this.openings,this.closingSelector))},t}(),dy=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(i.openSubscription=sl(i,n,n)),i}return t(n,e),n.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,r=0;r<n;r++)e[r].window.next(t)},n.prototype._error=function(t){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var s=n[i];s.window.error(t),s.subscription.unsubscribe()}e.prototype._error.call(this,t)},n.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var n=t.length,r=-1;++r<n;){var i=t[r];i.window.complete(),i.subscription.unsubscribe()}e.prototype._complete.call(this)},n.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,n=-1;++n<e;){var r=t[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},n.prototype.notifyNext=function(t,e,n,r,i){if(t===this.openings){var s=void 0;try{s=(0,this.closingSelector)(e)}catch(t){return this.error(t)}var o=new Fu,a=new Eu,u={window:o,subscription:a};this.contexts.push(u);var c=sl(this,s,u);c.closed?this.closeWindow(this.contexts.length-1):(c.context=u,a.add(c)),this.destination.next(o)}else this.closeWindow(this.contexts.indexOf(t))},n.prototype.notifyError=function(t){this.error(t)},n.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},n.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,n=e[t],r=n.window,i=n.subscription;e.splice(t,1),r.complete(),i.unsubscribe()}},n}(Kc);var fy=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new py(t,this.closingSelector))},t}(),py=function(e){function n(t,n){var r=e.call(this,t)||this;return r.destination=t,r.closingSelector=n,r.openWindow(),r}return t(n,e),n.prototype.notifyNext=function(t,e,n,r,i){this.openWindow(i)},n.prototype.notifyError=function(t){this._error(t)},n.prototype.notifyComplete=function(t){this.openWindow(t)},n.prototype._next=function(t){this.window.next(t)},n.prototype._error=function(t){this.window.error(t),this.destination.error(t),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(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var e=this.window;e&&e.complete();var n,r=this.window=new Fu;this.destination.next(r);try{n=(0,this.closingSelector)()}catch(t){return this.destination.error(t),void this.window.error(t)}this.add(this.closingNotification=sl(this,n))},n}(Kc);var by=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new yy(t,this.observables,this.project))},t}(),yy=function(e){function n(t,n,r){var i=e.call(this,t)||this;i.observables=n,i.project=r,i.toRespond=[];var s=n.length;i.values=new Array(s);for(var o=0;o<s;o++)i.toRespond.push(o);for(o=0;o<s;o++){var a=n[o];i.add(sl(i,a,void 0,o))}return i}return t(n,e),n.prototype.notifyNext=function(t,e,n){this.values[n]=e;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(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},n.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(Kc);var gy=Object.freeze({__proto__:null,audit:kf,auditTime:function(t,e){return void 0===e&&(e=jc),kf((function(){return Bl(t,e)}))},buffer:function(t){return function(e){return e.lift(new If(t))}},bufferCount:function(t,e){return void 0===e&&(e=null),function(n){return n.lift(new Nf(t,e))}},bufferTime:function(t){var e=arguments.length,n=jc;ac(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(e){return e.lift(new jf(t,r,i,n))}},bufferToggle:function(t,e){return function(n){return n.lift(new Ff(t,e))}},bufferWhen:function(t){return function(e){return e.lift(new Uf(t))}},catchError:function(t){return function(e){var n=new Vf(t),r=e.lift(n);return n.caught=r}},combineAll:function(t){return function(e){return e.lift(new al(t))}},combineLatest:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null;return"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&wu(t[0])&&(t=t[0].slice()),function(e){return e.lift.call(ll([e].concat(t)),new al(n))}},concat:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(wl.apply(void 0,[e].concat(t)))}},concatAll:vl,concatMap:qf,concatMapTo:function(t,e){return qf((function(){return t}),e)},count:function(t){return function(e){return e.lift(new Zf(t,e))}},debounce:function(t){return function(e){return e.lift(new $f(t))}},debounceTime:function(t,e){return void 0===e&&(e=jc),function(n){return n.lift(new Yf(t,e))}},defaultIfEmpty:Xf,delay:function(t,e){void 0===e&&(e=jc);var n=np(t)?+t-e.now():Math.abs(t);return function(t){return t.lift(new rp(n,e))}},delayWhen:function(t,e){return e?function(n){return new up(n,e).lift(new op(t))}:function(e){return e.lift(new op(t))}},dematerialize:function(){return function(t){return t.lift(new lp)}},distinct:function(t,e){return function(n){return n.lift(new dp(t,e))}},distinctUntilChanged:pp,distinctUntilKeyChanged:function(t,e){return pp((function(n,r){return e?e(n[t],r[t]):n[t]===r[t]}))},elementAt:function(t,e){if(t<0)throw new Uc;var n=arguments.length>=2;return function(r){return r.pipe(Rl((function(e,n){return n===t})),_p(1),n?Xf(e):gp((function(){return new Uc})))}},endWith:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return wl(e,dc.apply(void 0,t))}},every:function(t,e){return function(n){return n.lift(new Ep(t,e,n))}},exhaust:function(){return function(t){return t.lift(new xp)}},exhaustMap:function t(e,n){return n?function(r){return r.pipe(t((function(t,r){return ll(e(t,r)).pipe(zc((function(e,i){return n(t,e,r,i)})))})))}:function(t){return t.lift(new Ip(e))}},expand:function(t,e,n){return void 0===e&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(r){return r.lift(new Np(t,e,n))}},filter:Rl,finalize:function(t){return function(e){return e.lift(new Tp(t))}},find:function(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(n){return n.lift(new Op(t,n,!1,e))}},findIndex:function(t,e){return function(n){return n.lift(new Op(t,n,!0,e))}},first:function(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Rl((function(e,n){return t(e,n,r)})):Ru,_p(1),n?Xf(e):gp((function(){return new Hc})))}},groupBy:function(t,e,n,r){return function(i){return i.lift(new Gu(t,e,n,r))}},ignoreElements:function(){return function(t){return t.lift(new Pp)}},isEmpty:function(){return function(t){return t.lift(new Bp)}},last:function(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Rl((function(e,n){return t(e,n,r)})):Ru,Wp(1),n?Xf(e):gp((function(){return new Hc})))}},map:zc,mapTo:function(t){return function(e){return e.lift(new Vp(t))}},materialize:function(){return function(t){return t.lift(new qp)}},max:function(t){var e="function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e};return Yp(e)},merge:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Cl.apply(void 0,[e].concat(t)))}},mergeAll:ml,mergeMap:pl,flatMap:gl,mergeMapTo:function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?pl((function(){return t}),e,n):("number"==typeof e&&(n=e),pl((function(){return t}),n))},mergeScan:function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new Jp(t,e,n))}},min:function(t){var e="function"==typeof t?function(e,n){return t(e,n)<0?e:n}:function(t,e){return t<e?t:e};return Yp(e)},multicast:Xp,observeOn:function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new yc(t,e))}},onErrorResumeNext:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&wu(t[0])&&(t=t[0]),function(e){return e.lift(new eb(t))}},pairwise:function(){return function(t){return t.lift(new rb)}},partition:function(t,e){return function(n){return[Rl(t,e)(n),Rl(Nl(t,e))(n)]}},pluck:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(0===n)throw new Error("list of properties cannot be empty.");return function(e){return zc(function(t,e){var n=function(n){for(var r=n,i=0;i<e;i++){var s=null!=r?r[t[i]]:void 0;if(void 0===s)return;r=s}return r};return n}(t,n))(e)}},publish:function(t){return t?Xp((function(){return new Fu}),t):Xp(new Fu)},publishBehavior:function(t){return function(e){return Xp(new Ku(t))(e)}},publishLast:function(){return function(t){return Xp(new _c)(t)}},publishReplay:function(t,e,n,r){n&&"function"!=typeof n&&(r=n);var i="function"==typeof n?n:void 0,s=new vc(t,e,r);return function(t){return Xp((function(){return s}),i)(t)}},race:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return 1===t.length&&wu(t[0])&&(t=t[0]),e.lift.call(Ol.apply(void 0,[e].concat(t)))}},reduce:Yp,repeat:function(t){return void 0===t&&(t=-1),function(e){return 0===t?oc():t<0?e.lift(new sb(-1,e)):e.lift(new sb(t-1,e))}},repeatWhen:function(t){return function(e){return e.lift(new ab(t))}},retry:function(t){return void 0===t&&(t=-1),function(e){return e.lift(new cb(t,e))}},retryWhen:function(t){return function(e){return e.lift(new hb(t,e))}},refCount:Uu,sample:function(t){return function(e){return e.lift(new fb(t))}},sampleTime:function(t,e){return void 0===e&&(e=jc),function(n){return n.lift(new bb(t,e))}},scan:Gp,sequenceEqual:function(t,e){return function(n){return n.lift(new mb(t,e))}},share:function(){return function(t){return Uu()(Xp(_b)(t))}},shareReplay:function(t,e,n){var r;return r=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(t){return t.lift(function(t){var e,n,r=t.bufferSize,i=void 0===r?Number.POSITIVE_INFINITY:r,s=t.windowTime,o=void 0===s?Number.POSITIVE_INFINITY:s,a=t.refCount,u=t.scheduler,c=0,l=!1,h=!1;return function(t){var r;c++,!e||l?(l=!1,e=new vc(i,o,u),r=e.subscribe(this),n=t.subscribe({next:function(t){e.next(t)},error:function(t){l=!0,e.error(t)},complete:function(){h=!0,n=void 0,e.complete()}}),h&&(n=void 0)):r=e.subscribe(this),this.add((function(){c--,r.unsubscribe(),r=void 0,n&&!h&&a&&0===c&&(n.unsubscribe(),n=void 0,e=void 0)}))}}(r))}},single:function(t){return function(e){return e.lift(new Sb(t,e))}},skip:function(t){return function(e){return e.lift(new Eb(t))}},skipLast:function(t){return function(e){return e.lift(new xb(t))}},skipUntil:function(t){return function(e){return e.lift(new Ib(t))}},skipWhile:function(t){return function(e){return e.lift(new Nb(t))}},startWith:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return ac(n)?(t.pop(),function(e){return wl(t,e,n)}):function(e){return wl(t,e)}},subscribeOn:function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new jb(t,e))}},switchAll:function(){return Ob(Ru)},switchMap:Ob,switchMapTo:function(t,e){return e?Ob((function(){return t}),e):Ob((function(){return t}))},take:_p,takeLast:Wp,takeUntil:function(t){return function(e){return e.lift(new Db(t))}},takeWhile:function(t,e){return void 0===e&&(e=!1),function(n){return n.lift(new Fb(t,e))}},tap:function(t,e,n){return function(r){return r.lift(new Ub(t,e,n))}},throttle:function(t,e){return void 0===e&&(e=Vb),function(n){return n.lift(new zb(t,!!e.leading,!!e.trailing))}},throttleTime:function(t,e,n){return void 0===e&&(e=jc),void 0===n&&(n=Vb),function(r){return r.lift(new Zb(t,e,n.leading,n.trailing))}},throwIfEmpty:gp,timeInterval:function(t){return void 0===t&&(t=jc),function(e){return _l((function(){return e.pipe(Gp((function(e,n){var r=e.current;return{value:n,current:t.now(),last:r}}),{current:t.now(),value:void 0,last:void 0}),zc((function(t){var e=t.current,n=t.last,r=t.value;return new Qb(r,e-n)})))}))}},timeout:function(t,e){return void 0===e&&(e=jc),Yb(t,fc(new Vc),e)},timeoutWith:Yb,timestamp:function(t){return void 0===t&&(t=jc),zc((function(e){return new Xb(e,t.now())}))},toArray:function(){return Yp(ty,[])},window:function(t){return function(e){return e.lift(new ey(t))}},windowCount:function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new ry(t,e))}},windowTime:function(t){var e=jc,n=null,r=Number.POSITIVE_INFINITY;return ac(arguments[3])&&(e=arguments[3]),ac(arguments[2])?e=arguments[2]:kl(arguments[2])&&(r=Number(arguments[2])),ac(arguments[1])?e=arguments[1]:kl(arguments[1])&&(n=Number(arguments[1])),function(i){return i.lift(new sy(t,n,r,e))}},windowToggle:function(t,e){return function(n){return n.lift(new hy(t,e))}},windowWhen:function(t){return function(e){return e.lift(new fy(t))}},withLatestFrom:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n;"function"==typeof t[t.length-1]&&(n=t.pop());var r=t;return e.lift(new by(r,n))}},zip:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Wl.apply(void 0,[e].concat(t)))}},zipAll:function(t){return function(e){return e.lift(new Ul(t))}}}),my=o(gy),vy={},wy={};Object.defineProperty(wy,"__esModule",{value:!0}),wy.ClientMessagePublishEvent=wy.ClientMessageSetSessionConfig=wy.ClientMessageGetSessionConfig=wy.ClientMessageIsLinked=wy.ClientMessageHostSession=void 0,wy.ClientMessageHostSession=function(t){return Object.assign({type:"HostSession"},t)},wy.ClientMessageIsLinked=function(t){return Object.assign({type:"IsLinked"},t)},wy.ClientMessageGetSessionConfig=function(t){return Object.assign({type:"GetSessionConfig"},t)},wy.ClientMessageSetSessionConfig=function(t){return Object.assign({type:"SetSessionConfig"},t)},wy.ClientMessagePublishEvent=function(t){return Object.assign({type:"PublishEvent"},t)};var _y={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;const e=Gl,n=my;var r;!function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"}(r=t.ConnectionState||(t.ConnectionState={}));t.RxWebSocket=class{constructor(t,n=WebSocket){this.WebSocketClass=n,this.webSocket=null,this.connectionStateSubject=new e.BehaviorSubject(r.DISCONNECTED),this.incomingDataSubject=new e.Subject,this.url=t.replace(/^http/,"ws")}connect(){return this.webSocket?(0,e.throwError)(new Error("webSocket object is not null")):new e.Observable((t=>{let e;try{this.webSocket=e=new this.WebSocketClass(this.url)}catch(e){return void t.error(e)}this.connectionStateSubject.next(r.CONNECTING),e.onclose=e=>{this.clearWebSocket(),t.error(new Error(`websocket error ${e.code}: ${e.reason}`)),this.connectionStateSubject.next(r.DISCONNECTED)},e.onopen=e=>{t.next(),t.complete(),this.connectionStateSubject.next(r.CONNECTED)},e.onmessage=t=>{this.incomingDataSubject.next(t.data)}})).pipe((0,n.take)(1))}disconnect(){const{webSocket:t}=this;if(t){this.clearWebSocket(),this.connectionStateSubject.next(r.DISCONNECTED);try{t.close()}catch(t){}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,n.flatMap)((t=>{let n;try{n=JSON.parse(t)}catch(t){return(0,e.empty)()}return(0,e.of)(n)})))}sendData(t){const{webSocket:e}=this;if(!e)throw new Error("websocket is not connected");e.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}}(_y);var Sy={};Object.defineProperty(Sy,"__esModule",{value:!0}),Sy.isServerMessageFail=void 0,Sy.isServerMessageFail=function(t){return t&&"Fail"===t.type&&"number"==typeof t.id&&"string"==typeof t.sessionId&&"string"==typeof t.error},Object.defineProperty(vy,"__esModule",{value:!0}),vy.WalletSDKConnection=void 0;const My=Gl,Ey=my,ky=z,xy=Or,Cy=wy,Iy=V,Ay=_y,Ny=Sy;vy.WalletSDKConnection=class{constructor(t,e,n,r,i=WebSocket){this.sessionId=t,this.sessionKey=e,this.diagnostic=r,this.subscriptions=new My.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,xy.IntNumber)(1),this.connectedSubject=new My.BehaviorSubject(!1),this.linkedSubject=new My.BehaviorSubject(!1),this.sessionConfigSubject=new My.ReplaySubject(1);const s=new Ay.RxWebSocket(n+"/rpc",i);this.ws=s,this.subscriptions.add(s.connectionState$.pipe((0,Ey.tap)((e=>{var n;return null===(n=this.diagnostic)||void 0===n?void 0:n.log(Iy.EVENTS.CONNECTED_STATE_CHANGE,{state:e,sessionIdHash:ky.Session.hash(t)})})),(0,Ey.skip)(1),(0,Ey.filter)((t=>t===Ay.ConnectionState.DISCONNECTED&&!this.destroyed)),(0,Ey.delay)(5e3),(0,Ey.filter)((t=>!this.destroyed)),(0,Ey.flatMap)((t=>s.connect())),(0,Ey.retry)()).subscribe()),this.subscriptions.add(s.connectionState$.pipe((0,Ey.skip)(2),(0,Ey.switchMap)((t=>(0,My.iif)((()=>t===Ay.ConnectionState.CONNECTED),this.authenticate().pipe((0,Ey.tap)((t=>this.sendIsLinked())),(0,Ey.tap)((t=>this.sendGetSessionConfig())),(0,Ey.map)((t=>!0))),(0,My.of)(!1)))),(0,Ey.distinctUntilChanged)(),(0,Ey.catchError)((t=>(0,My.of)(!1)))).subscribe((t=>this.connectedSubject.next(t)))),this.subscriptions.add(s.connectionState$.pipe((0,Ey.skip)(1),(0,Ey.switchMap)((t=>(0,My.iif)((()=>t===Ay.ConnectionState.CONNECTED),(0,My.timer)(0,1e4))))).subscribe((t=>0===t?this.updateLastHeartbeat():this.heartbeat()))),this.subscriptions.add(s.incomingData$.pipe((0,Ey.filter)((t=>"h"===t))).subscribe((t=>this.updateLastHeartbeat()))),this.subscriptions.add(s.incomingJSONData$.pipe((0,Ey.filter)((t=>["IsLinkedOK","Linked"].includes(t.type)))).subscribe((e=>{var n;const r=e;null===(n=this.diagnostic)||void 0===n||n.log(Iy.EVENTS.LINKED,{sessionIdHash:ky.Session.hash(t),linked:r.linked,type:e.type,onlineGuests:r.onlineGuests}),this.linkedSubject.next(r.linked||r.onlineGuests>0)}))),this.subscriptions.add(s.incomingJSONData$.pipe((0,Ey.filter)((t=>["GetSessionConfigOK","SessionConfigUpdated"].includes(t.type)))).subscribe((e=>{var n;const r=e;null===(n=this.diagnostic)||void 0===n||n.log(Iy.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:ky.Session.hash(t),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 t;if(this.destroyed)throw new Error("instance is destroyed");null===(t=this.diagnostic)||void 0===t||t.log(Iy.EVENTS.STARTED_CONNECTING,{sessionIdHash:ky.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var t;this.subscriptions.unsubscribe(),this.ws.disconnect(),null===(t=this.diagnostic)||void 0===t||t.log(Iy.EVENTS.DISCONNECTED,{sessionIdHash:ky.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,Ey.filter)((t=>t)),(0,Ey.take)(1),(0,Ey.map)((()=>{})))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,Ey.filter)((t=>t)),(0,Ey.take)(1),(0,Ey.map)((()=>{})))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,Ey.filter)((t=>{if("Event"!==t.type)return!1;const e=t;return"string"==typeof e.sessionId&&"string"==typeof e.eventId&&"string"==typeof e.event&&"string"==typeof e.data})),(0,Ey.map)((t=>t)))}setSessionMetadata(t,e){const n=(0,Cy.ClientMessageSetSessionConfig)({id:(0,xy.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[t]:e}});return this.onceConnected$.pipe((0,Ey.flatMap)((t=>this.makeRequest(n))),(0,Ey.map)((t=>{if((0,Ny.isServerMessageFail)(t))throw new Error(t.error||"failed to set session metadata")})))}publishEvent(t,e,n=!1){const r=(0,Cy.ClientMessagePublishEvent)({id:(0,xy.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:t,data:e,callWebhook:n});return this.onceLinked$.pipe((0,Ey.flatMap)((t=>this.makeRequest(r))),(0,Ey.map)((t=>{if((0,Ny.isServerMessageFail)(t))throw new Error(t.error||"failed to publish event");return t.eventId})))}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(t){}}makeRequest(t,e=6e4){const n=t.id;try{this.sendData(t)}catch(t){return(0,My.throwError)(t)}return this.ws.incomingJSONData$.pipe((0,Ey.timeoutWith)(e,(0,My.throwError)(new Error(`request ${n} timed out`))),(0,Ey.filter)((t=>t.id===n)),(0,Ey.take)(1))}authenticate(){const t=(0,Cy.ClientMessageHostSession)({id:(0,xy.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(t).pipe((0,Ey.map)((t=>{if((0,Ny.isServerMessageFail)(t))throw new Error(t.error||"failed to authentcate")})))}sendIsLinked(){const t=(0,Cy.ClientMessageIsLinked)({id:(0,xy.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}sendGetSessionConfig(){const t=(0,Cy.ClientMessageGetSessionConfig)({id:(0,xy.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}};var Ry={};Object.defineProperty(Ry,"__esModule",{value:!0}),Ry.WalletUIError=void 0;class Ty extends Error{constructor(t,e){super(t),this.message=t,this.errorCode=e}}Ry.WalletUIError=Ty,Ty.UserRejectedRequest=new Ty("User rejected request"),Ty.SwitchEthereumChainUnsupportedChainId=new Ty("Unsupported chainId",4902);var jy={};Object.defineProperty(jy,"__esModule",{value:!0}),jy.decrypt=jy.encrypt=void 0;const Oy=se;jy.encrypt=async function(t,e){if(64!==e.length)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.importKey("raw",(0,Oy.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},r,i.encode(t)),o=s.slice(s.byteLength-16),a=s.slice(0,s.byteLength-16),u=new Uint8Array(o),c=new Uint8Array(a),l=new Uint8Array([...n,...u,...c]);return(0,Oy.uint8ArrayToHex)(l)},jy.decrypt=function(t,e){if(64!==e.length)throw Error("secret must be 256 bits");return new Promise(((n,r)=>{!async function(){const i=await crypto.subtle.importKey("raw",(0,Oy.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,Oy.hexStringToUint8Array)(t),o=s.slice(0,12),a=s.slice(12,28),u=s.slice(28),c=new Uint8Array([...u,...a]),l={name:"AES-GCM",iv:new Uint8Array(o)};try{const t=await window.crypto.subtle.decrypt(l,i,c),e=new TextDecoder;n(e.decode(t))}catch(t){r(t)}}()}))};var Ly={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(t){t.requestEthereumAccounts="requestEthereumAccounts",t.signEthereumMessage="signEthereumMessage",t.signEthereumTransaction="signEthereumTransaction",t.submitEthereumTransaction="submitEthereumTransaction",t.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",t.scanQRCode="scanQRCode",t.generic="generic",t.childRequestEthereumAccounts="childRequestEthereumAccounts",t.addEthereumChain="addEthereumChain",t.switchEthereumChain="switchEthereumChain",t.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",t.watchAsset="watchAsset",t.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))}(Ly);var Py={},Dy={};!function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,(e=t.RelayMessageType||(t.RelayMessageType={})).SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(Dy),Object.defineProperty(Py,"__esModule",{value:!0}),Py.Web3RequestCanceledMessage=void 0;const By=Dy;Py.Web3RequestCanceledMessage=function(t){return{type:By.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}};var Fy={};Object.defineProperty(Fy,"__esModule",{value:!0}),Fy.Web3RequestMessage=void 0;const Wy=Dy;Fy.Web3RequestMessage=function(t){return Object.assign({type:Wy.RelayMessageType.WEB3_REQUEST},t)};var Uy={};Object.defineProperty(Uy,"__esModule",{value:!0}),Uy.EthereumAddressFromSignedMessageResponse=Uy.SubmitEthereumTransactionResponse=Uy.SignEthereumTransactionResponse=Uy.SignEthereumMessageResponse=Uy.isRequestEthereumAccountsResponse=Uy.SelectProviderResponse=Uy.WatchAssetReponse=Uy.RequestEthereumAccountsResponse=Uy.SwitchEthereumChainResponse=Uy.AddEthereumChainResponse=Uy.ErrorResponse=void 0;const Hy=Ly;Uy.ErrorResponse=function(t,e,n){return{method:t,errorMessage:e,errorCode:n}},Uy.AddEthereumChainResponse=function(t){return{method:Hy.Web3Method.addEthereumChain,result:t}},Uy.SwitchEthereumChainResponse=function(t){return{method:Hy.Web3Method.switchEthereumChain,result:t}},Uy.RequestEthereumAccountsResponse=function(t){return{method:Hy.Web3Method.requestEthereumAccounts,result:t}},Uy.WatchAssetReponse=function(t){return{method:Hy.Web3Method.watchAsset,result:t}},Uy.SelectProviderResponse=function(t){return{method:Hy.Web3Method.selectProvider,result:t}},Uy.isRequestEthereumAccountsResponse=function(t){return t&&t.method===Hy.Web3Method.requestEthereumAccounts},Uy.SignEthereumMessageResponse=function(t){return{method:Hy.Web3Method.signEthereumMessage,result:t}},Uy.SignEthereumTransactionResponse=function(t){return{method:Hy.Web3Method.signEthereumTransaction,result:t}},Uy.SubmitEthereumTransactionResponse=function(t){return{method:Hy.Web3Method.submitEthereumTransaction,result:t}},Uy.EthereumAddressFromSignedMessageResponse=function(t){return{method:Hy.Web3Method.ethereumAddressFromSignedMessage,result:t}};var Vy={};Object.defineProperty(Vy,"__esModule",{value:!0}),Vy.isWeb3ResponseMessage=Vy.Web3ResponseMessage=void 0;const zy=Dy;Vy.Web3ResponseMessage=function(t){return Object.assign({type:zy.RelayMessageType.WEB3_RESPONSE},t)},Vy.isWeb3ResponseMessage=function(t){return t&&t.type===zy.RelayMessageType.WEB3_RESPONSE};var qy=s&&s.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),Zy=s&&s.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Gy=s&&s.__decorate||function(t,e,n,r){var i,s=arguments.length,o=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s<3?i(o):s>3?i(e,n,o):i(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},$y=s&&s.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&qy(e,t,n);return Zy(e,t),e},Qy=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Sf,"__esModule",{value:!0}),Sf.WalletSDKRelay=void 0;const Yy=Qy(Mf),Jy=A,Ky=Gl,Xy=my,tg=V,eg=vy,ng=Ry,rg=Or,ig=se,sg=$y(jy),og=z,ag=ni,ug=Ly,cg=Py,lg=Fy,hg=Uy,dg=Vy;class fg extends ag.WalletSDKRelayAbstract{constructor(t){var e;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new Ky.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new Ky.Subscription,this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:r,connection:i}=this.subscribe();if(this._session=n,this.connection=i,this.relayEventManager=t.relayEventManager,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this.diagnostic={log:t.eventListener.onEvent}:this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=null===(e=t.reloadOnDisconnect)||void 0===e||e,this.ui=r}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe((t=>{this.dappDefaultChain!==t&&(this.dappDefaultChain=t)})));const t=og.Session.load(this.storage)||new og.Session(this.storage).save(),e=new eg.WalletSDKConnection(t.id,t.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(e.sessionConfig$.subscribe({next:t=>{this.onSessionConfigChanged(t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(tg.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(e.incomingEvent$.pipe((0,Xy.filter)((t=>"Web3Response"===t.event))).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(e.linked$.pipe((0,Xy.skip)(1),(0,Xy.tap)((t=>{var e;this.isLinked=t;const n=this.storage.getItem(ag.LOCAL_STORAGE_ADDRESSES_KEY);if(t&&(this.session.linked=t),this.isUnlinkedErrorState=!1,n){const r=n.split(" "),i="true"===this.storage.getItem("IsStandaloneSigning");if(""!==r[0]&&!t&&this.session.linked&&!i){this.isUnlinkedErrorState=!0;const t=this.getSessionIdHash();null===(e=this.diagnostic)||void 0===e||e.log(tg.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:t})}}}))).subscribe()),this.subscriptions.add(e.sessionConfig$.pipe((0,Xy.filter)((t=>!!t.metadata&&"1"===t.metadata.__destroyed))).subscribe((()=>{var t;const n=e.isDestroyed;return null===(t=this.diagnostic)||void 0===t||t.log(tg.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:n,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()}))),this.subscriptions.add(e.sessionConfig$.pipe((0,Xy.filter)((t=>t.metadata&&void 0!==t.metadata.WalletUsername))).pipe((0,Xy.mergeMap)((e=>sg.decrypt(e.metadata.WalletUsername,t.secret)))).subscribe({next:t=>{this.storage.setItem(ag.WALLET_USER_NAME_KEY,t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(tg.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Xy.filter)((t=>t.metadata&&void 0!==t.metadata.AppVersion))).pipe((0,Xy.mergeMap)((e=>sg.decrypt(e.metadata.AppVersion,t.secret)))).subscribe({next:t=>{this.storage.setItem(ag.APP_VERSION_KEY,t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(tg.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Xy.filter)((t=>t.metadata&&void 0!==t.metadata.ChainId&&void 0!==t.metadata.JsonRpcUrl))).pipe((0,Xy.mergeMap)((e=>(0,Ky.zip)(sg.decrypt(e.metadata.ChainId,t.secret),sg.decrypt(e.metadata.JsonRpcUrl,t.secret))))).pipe((0,Xy.distinctUntilChanged)()).subscribe({next:([t,e])=>{this.chainCallback&&this.chainCallback(t,e)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(tg.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Xy.filter)((t=>t.metadata&&void 0!==t.metadata.EthereumAddress))).pipe((0,Xy.mergeMap)((e=>sg.decrypt(e.metadata.EthereumAddress,t.secret)))).subscribe({next:t=>{this.accountsCallback&&this.accountsCallback([t]),fg.accountRequestCallbackIds.size>0&&(Array.from(fg.accountRequestCallbackIds.values()).forEach((e=>{const n=(0,dg.Web3ResponseMessage)({id:e,response:(0,hg.RequestEthereumAccountsResponse)([t])});this.invokeCallback(Object.assign(Object.assign({},n),{id:e}))})),fg.accountRequestCallbackIds.clear())},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(tg.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Xy.filter)((t=>t.metadata&&void 0!==t.metadata.AppSrc))).pipe((0,Xy.mergeMap)((e=>sg.decrypt(e.metadata.AppSrc,t.secret)))).subscribe({next:t=>{this.ui.setAppSrc(t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(tg.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:t,connected$:e.connected$,chainId$:this.dappDefaultChainSubject});return e.connect(),{session:t,ui:n,connection:e}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,Xy.timeout)(1e3),(0,Xy.catchError)((t=>(0,Ky.of)(null)))).subscribe((t=>{var e,n,r;const i=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch(t){null===(e=this.diagnostic)||void 0===e||e.log(tg.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}null===(n=this.diagnostic)||void 0===n||n.log(tg.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const s=og.Session.load(this.storage);if((null==s?void 0:s.id)===this._session.id?this.storage.clear():s&&(null===(r=this.diagnostic)||void 0===r||r.log(tg.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:og.Session.hash(s.id)})),this._reloadOnDisconnect)return void this.ui.reloadUI();this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new Ky.Subscription;const{session:o,ui:a,connection:u}=this.subscribe();this._session=o,this.connection=u,this.ui=a,i&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()}),(t=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(tg.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})}))}setAppInfo(t,e){this.appName=t,this.appLogoUrl=e}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,e){this.storage.setItem(t,e)}signEthereumMessage(t,e,n,r){return this.sendRequest({method:ug.Web3Method.signEthereumMessage,params:{message:(0,ig.hexStringFromBuffer)(t,!0),address:e,addPrefix:n,typedDataJson:r||null}})}ethereumAddressFromSignedMessage(t,e,n){return this.sendRequest({method:ug.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,ig.hexStringFromBuffer)(t,!0),signature:(0,ig.hexStringFromBuffer)(e,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:ug.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,ig.bigIntStringFromBN)(t.weiValue),data:(0,ig.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,ig.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,ig.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,ig.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,ig.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:ug.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,ig.bigIntStringFromBN)(t.weiValue),data:(0,ig.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,ig.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,ig.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,ig.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,ig.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,e){return this.sendRequest({method:ug.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,ig.hexStringFromBuffer)(t,!0),chainId:e}})}scanQRCode(t){return this.sendRequest({method:ug.Web3Method.scanQRCode,params:{regExp:t}})}getQRCodeUrl(){return(0,ig.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,e){return this.sendRequest({method:ug.Web3Method.generic,params:{action:e,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let e=null;const n=(0,ig.randomBytesHex)(8),r=r=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,r),null==e||e()};return{promise:new Promise(((i,s)=>{this.ui.isStandalone()||(e=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:r,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,(t=>{if(null==e||e(),t.errorMessage)return s(new Error(t.errorMessage));i(t)})),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)})),cancel:r}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChainSubject.next(t)}publishWeb3RequestEvent(t,e){var n;const r=(0,lg.Web3RequestMessage)({id:t,request:e}),i=og.Session.load(this.storage);null===(n=this.diagnostic)||void 0===n||n.log(tg.EVENTS.WEB3_REQUEST,{eventId:r.id,method:`relay::${r.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?og.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:t=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(tg.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:r.id,method:`relay::${r.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?og.Session.hash(i.id):"",isSessionMismatched:((null==i?void 0:i.id)!==this._session.id).toString()})},error:t=>{this.handleWeb3ResponseMessage((0,dg.Web3ResponseMessage)({id:r.id,response:{method:r.request.method,errorMessage:t.message}}))}}))}publishWeb3RequestCanceledEvent(t){const e=(0,cg.Web3RequestCanceledMessage)(t);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",e,!1).subscribe())}publishEvent(t,e,n){const r=this.session.secret;return new Ky.Observable((t=>{sg.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{origin:location.origin})),r).then((e=>{t.next(e),t.complete()}))})).pipe((0,Xy.mergeMap)((e=>this.connection.publishEvent(t,e,n))))}handleIncomingEvent(t){try{this.subscriptions.add((0,Ky.from)(sg.decrypt(t.data,this.session.secret)).pipe((0,Xy.map)((t=>JSON.parse(t)))).subscribe({next:t=>{const e=(0,dg.isWeb3ResponseMessage)(t)?t:null;e&&this.handleWeb3ResponseMessage(e)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(tg.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch(t){return}}handleWeb3ResponseMessage(t){var e;const{response:n}=t;if(null===(e=this.diagnostic)||void 0===e||e.log(tg.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,hg.isRequestEthereumAccountsResponse)(n))return fg.accountRequestCallbackIds.forEach((e=>this.invokeCallback(Object.assign(Object.assign({},t),{id:e})))),void fg.accountRequestCallbackIds.clear();this.invokeCallback(t)}handleErrorResponse(t,e,n,r){this.handleWeb3ResponseMessage((0,dg.Web3ResponseMessage)({id:t,response:(0,hg.ErrorResponse)(e,(null!=n?n:ng.WalletUIError.UserRejectedRequest).message,r)}))}invokeCallback(t){const e=this.relayEventManager.callbacks.get(t.id);e&&(e(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:ug.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},e=(0,ig.randomBytesHex)(8),n=n=>{this.publishWeb3RequestCanceledEvent(e),this.handleErrorResponse(e,t.method,n)};return{promise:new Promise(((r,i)=>{var s;this.relayEventManager.callbacks.set(e,(t=>{if(this.ui.hideRequestEthereumAccounts(),t.errorMessage)return i(new Error(t.errorMessage));r(t)}));const o=(null===(s=null===window||void 0===window?void 0:window.navigator)||void 0===s?void 0:s.userAgent)||null;if(o&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(o)){let t;try{t=(0,ig.isInIFrame)()&&window.top?window.top.location:window.location}catch(e){t=window.location}t.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(t.href)}`}else{if(this.ui.inlineAccountsResponse()){const t=t=>{this.handleWeb3ResponseMessage((0,dg.Web3ResponseMessage)({id:e,response:(0,hg.RequestEthereumAccountsResponse)(t)}))};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:t})}else{const t=Jy.ethErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(t)})}fg.accountRequestCallbackIds.add(e),this.ui.inlineAccountsResponse()||this.ui.isStandalone()||this.publishWeb3RequestEvent(e,t)}})),cancel:n}}selectProvider(t){const e={method:ug.Web3Method.selectProvider,params:{providerOptions:t}},n=(0,ig.randomBytesHex)(8);return{cancel:t=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,t)},promise:new Promise(((e,r)=>{this.relayEventManager.callbacks.set(n,(t=>{if(t.errorMessage)return r(new Error(t.errorMessage));e(t)}));this.ui.selectProvider&&this.ui.selectProvider({onApprove:t=>{this.handleWeb3ResponseMessage((0,dg.Web3ResponseMessage)({id:n,response:(0,hg.SelectProviderResponse)(t)}))},onCancel:t=>{this.handleWeb3ResponseMessage((0,dg.Web3ResponseMessage)({id:n,response:(0,hg.SelectProviderResponse)(rg.ProviderType.Unselected)}))},providerOptions:t})}))}}watchAsset(t,e,n,r,i,s){const o={method:ug.Web3Method.watchAsset,params:{type:t,options:{address:e,symbol:n,decimals:r,image:i},chainId:s}};let a=null;const u=(0,ig.randomBytesHex)(8),c=t=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,o.method,t),null==a||a()};this.ui.inlineWatchAsset()||(a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:c,onResetConnection:this.resetAndReload}));return{cancel:c,promise:new Promise(((c,l)=>{this.relayEventManager.callbacks.set(u,(t=>{if(null==a||a(),t.errorMessage)return l(new Error(t.errorMessage));c(t)}));const h=t=>{this.handleWeb3ResponseMessage((0,dg.Web3ResponseMessage)({id:u,response:(0,hg.WatchAssetReponse)(!1)}))},d=()=>{this.handleWeb3ResponseMessage((0,dg.Web3ResponseMessage)({id:u,response:(0,hg.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:d,onCancel:h,type:t,address:e,symbol:n,decimals:r,image:i,chainId:s}),this.ui.inlineWatchAsset()||this.ui.isStandalone()||this.publishWeb3RequestEvent(u,o)}))}}addEthereumChain(t,e,n,r,i,s){const o={method:ug.Web3Method.addEthereumChain,params:{chainId:t,rpcUrls:e,blockExplorerUrls:r,chainName:i,iconUrls:n,nativeCurrency:s}};let a=null;const u=(0,ig.randomBytesHex)(8),c=t=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,o.method,t),null==a||a()};this.ui.inlineAddEthereumChain(t)||(a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:c,onResetConnection:this.resetAndReload}));return{promise:new Promise(((e,n)=>{this.relayEventManager.callbacks.set(u,(t=>{if(null==a||a(),t.errorMessage)return n(new Error(t.errorMessage));e(t)}));const r=t=>{this.handleWeb3ResponseMessage((0,dg.Web3ResponseMessage)({id:u,response:(0,hg.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},i=t=>{this.handleWeb3ResponseMessage((0,dg.Web3ResponseMessage)({id:u,response:(0,hg.AddEthereumChainResponse)({isApproved:!0,rpcUrl:t})}))};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:r,onApprove:i,chainId:o.params.chainId,rpcUrls:o.params.rpcUrls,blockExplorerUrls:o.params.blockExplorerUrls,chainName:o.params.chainName,iconUrls:o.params.iconUrls,nativeCurrency:o.params.nativeCurrency}),this.ui.inlineAddEthereumChain(t)||this.ui.isStandalone()||this.publishWeb3RequestEvent(u,o)})),cancel:c}}switchEthereumChain(t,e){const n={method:ug.Web3Method.switchEthereumChain,params:Object.assign({chainId:t},{address:e})},r=(0,ig.randomBytesHex)(8);return{promise:new Promise(((t,e)=>{this.relayEventManager.callbacks.set(r,(n=>n.errorMessage&&n.errorCode?e(Jy.ethErrors.provider.custom({code:n.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):n.errorMessage?e(new Error(n.errorMessage)):void t(n)));this.ui.switchEthereumChain({onCancel:t=>{if("number"==typeof t){const e=t;this.handleWeb3ResponseMessage((0,dg.Web3ResponseMessage)({id:r,response:(0,hg.ErrorResponse)(ug.Web3Method.switchEthereumChain,ng.WalletUIError.SwitchEthereumChainUnsupportedChainId.message,e)}))}else t instanceof ng.WalletUIError?this.handleErrorResponse(r,ug.Web3Method.switchEthereumChain,t,t.errorCode):this.handleWeb3ResponseMessage((0,dg.Web3ResponseMessage)({id:r,response:(0,hg.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:t=>{this.handleWeb3ResponseMessage((0,dg.Web3ResponseMessage)({id:r,response:(0,hg.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:t})}))},chainId:n.params.chainId,address:n.params.address}),this.ui.inlineSwitchEthereumChain()||this.ui.isStandalone()||this.publishWeb3RequestEvent(r,n)})),cancel:t=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,n.method,t)}}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return og.Session.hash(this._session.id)}sendRequestStandalone(t,e){const n=n=>{this.handleErrorResponse(t,e.method,n)},r=e=>{this.handleWeb3ResponseMessage((0,dg.Web3ResponseMessage)({id:t,response:e}))};switch(e.method){case ug.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:e,onSuccess:r,onCancel:n});break;case ug.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:e,onSuccess:r,onCancel:n});break;case ug.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:e,onSuccess:r,onCancel:n});break;case ug.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:e,onSuccess:r});break;default:n()}}onSessionConfigChanged(t){}}fg.accountRequestCallbackIds=new Set,Gy([Yy.default],fg.prototype,"resetAndReload",null),Gy([Yy.default],fg.prototype,"handleIncomingEvent",null),Sf.WalletSDKRelay=fg;var pg={};Object.defineProperty(pg,"__esModule",{value:!0}),pg.WalletSDKRelayEventManager=void 0;const bg=se;pg.WalletSDKRelayEventManager=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,e=(0,bg.prepend0x)(t.toString(16));return this.callbacks.get(e)&&this.callbacks.delete(e),t}};var yg="3.6.6";Object.defineProperty(E,"__esModule",{value:!0}),E.CoinbaseWalletSDK=void 0;const gg=k,mg=x,vg=C,wg=Ba,_g=Sf,Sg=pg,Mg=se,Eg=process.env.LINK_API_URL||"https://www.walletlink.org",kg=process.env.SDK_VERSION||yg||"unknown";class xg{constructor(t){var e,n,r;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const i=t.linkAPIUrl||Eg;let s;if(s=t.uiConstructor?t.uiConstructor:t=>new wg.WalletSDKUI(t),void 0===t.overrideIsMetaMask?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=null===(e=t.overrideIsCoinbaseWallet)||void 0===e||e,this._overrideIsCoinbaseBrowser=null!==(n=t.overrideIsCoinbaseBrowser)&&void 0!==n&&n,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this._diagnosticLogger={log:t.eventListener.onEvent}:this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=null===(r=t.reloadOnDisconnect)||void 0===r||r;const o=new URL(i),a=`${o.protocol}//${o.host}`;this._storage=new mg.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",xg.VERSION),this.walletExtension||this.coinbaseBrowser||(this._relayEventManager=new Sg.WalletSDKRelayEventManager,this._relay=new _g.WalletSDKRelay({linkAPIUrl:i,version:kg,darkMode:!!t.darkMode,uiConstructor:s,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(t.appName,t.appLogoUrl),t.headlessMode||this._relay.attachUI())}makeWeb3Provider(t="",e=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,e),!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 t||i.setConnectDisabled(!0),new vg.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(i),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:e,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,e){var n;this._appName=t||"DApp",this._appLogoUrl=e||(0,Mg.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 t;const e=this.walletExtension;e?e.close():null===(t=this._relay)||void 0===t||t.resetAndReload()}getQrUrl(){var t,e;return null!==(e=null===(t=this._relay)||void 0===t?void 0:t.getQRCodeUrl())&&void 0!==e?e:null}getCoinbaseWalletLogo(t,e=240){return(0,gg.walletLogo)(t,e)}get walletExtension(){var t;return null!==(t=window.coinbaseWalletExtension)&&void 0!==t?t:window.walletLinkExtension}get coinbaseBrowser(){var t,e;try{const n=null!==(t=window.ethereum)&&void 0!==t?t:null===(e=window.top)||void 0===e?void 0:e.ethereum;if(!n)return;return"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch(t){return}}isCipherProvider(t){return"boolean"==typeof t.isCipher&&t.isCipher}}E.CoinbaseWalletSDK=xg,xg.VERSION=kg,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=E,n=C;var r=E;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return r.CoinbaseWalletSDK}});var i=C;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,"undefined"!=typeof window&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=n.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=n.CoinbaseWalletProvider)}(M);var Cg=a(M);function Ig(t,s){var o=t.chainId,a=t.rpcUrl,u=t.appName,c=t.appLogoUrl,l=t.darkMode;return e(this,void 0,void 0,(function(){var t,e;return n(this,(function(n){switch(n.label){case 0:if(window.ethereum&&(window.ethereum.isWalletLink||window.ethereum.isToshi))return[2,i(window.ethereum,s)];if(!u)throw new Error("walletLink need appName");return t=new Cg({appName:u,appLogoUrl:c,darkMode:l}),[4,(e=t.makeWeb3Provider(a,o)).enable()];case 1:return n.sent(),e.on("connect",s.connect),e.on("disconnect",s.disconnect),e.on("accountsChanged",s.accountsChanged),e.on("chainChanged",s.chainChanged),e.on("message",s.message),[2,r(e)]}}))}))}export{Ig as default};